[Kde-java] QAccel problem
Emond Papegaaij
kde-java@kde.org
Sat, 9 Feb 2002 01:50:41 +0100
Hi,
I'm currently trying out qtjava for qt2, we (our project group) will be using
it, if it turns out ok. To gain some experience, I decided to convert all 14
tutorials. I can send you the code, if you want it. During the conversion, I
noticed a few problems with qtjava:
1: The constructors with the default arguments are missing. This is not a big
problem, you can find the default arguments in the qt-source, but it is a
problem in our project group. Not everyone understands c++. But it's also
annoying to have to write
quit.setFont(new QFont("Times", 18, QFont.Bold, false));
in stead of
quit.setFont(new QFont("Times", 18, QFont.Bold));
or
QGridLayout grid = new QGridLayout(this, 2, 2, 10, -1, null);
in stead of
QGridLayout grid = new QGridLayout(this, 2, 2, 10);
2: This problem is somewhat more complex than the first one. Somehow I can't
connect a QAccel key to a slot in my custom class:
QObject::connect: No such slot QWidget::fire()
QObject::connect: (sender name: 'unnamed')
QObject::connect: (receiver name: 'gameboard')
This shows up in the last example. However, I can connect a key to a default
slot, like quit() in qApp().
The problem seems to be solved in the qtjava bindings for qt3. What causes
this problem, and is it possible to backport the fix to qtjava for qt2?
3: I tried to convert the canvas example, but this example uses
QCanvasItemLists everywhere. This class is declared in qcanvas.h:
class QCanvasItemList : public QValueList<QCanvasItem*>
QCanvasItemList is not declared as a java class, what would the java
equivalent for this class be? Or is is impossible to convert such a
construction to java? QCanvasItemList is commented out throughout the qtjava
java code.
Thanks,
Emond Papegaaij