Qt-jambi-interest Archive, July 2007
promoting a widget in QtJambi
Message 1 in thread
Hi People,
I have a little Problem,
i wrote a little application in QtJambi using the Eclipse-plugin.
For this App to work i needed some custom Drag & Drop functionality
which i implemented
like it is shown in the Qt-Docs. (of course i adapted the code to work
in java).
Well, as i need a subclass of QListWidget for this, i decided to write
one with this custom
D&D implementation.
However, as i tried to promote the QListwidget - List on the mainform to
my new class, nothing changed.
the .jui - file still shows "QListWidget" as Type and according to the
behavior at runtime, my custom implementation is not used at all.
after a look in the Ui_Mainform.java i noticed that the sist still had
type "QListWidget", not my promoted type.
Well...
Am i doing something wrong?
If I manually edit the UI_Mainform.java to use my subclass of
QListWidget, everything works as it should.
But only until the next change to the ui - file.
I'm getting tired if manually correcting this every time i try to build
the Program.
Is this a known issue? Or is the mechanism of promoting widgets not
supposed to work for Jambi and there is an other way?
pls let me know if there is a more elegant way to handle this than
manually fiddling with those files.
greetings,
Ge0rgy
Message 2 in thread
Hi, Christoph.
Christoph Schmid wrote:
> Well, as i need a subclass of QListWidget for this, i decided to write
> one with this custom
> D&D implementation.
> However, as i tried to promote the QListwidget - List on the mainform
> to my new class, nothing changed.
I can reproduce this bug, and I've registered it in our task tracker.
A different way of doing custom widgets in the Eclipse integration is to
right click on your project, selecting properties, then the "Qt Designer
Plugins" page. On this page, all your widgets should be listed, and you
should be able to tick off your QListWidget subclass to enable it as a
custom widget. Once you have done this and accepted the dialog box, the
widget will appear in the widget box together with the default ones.
-- Eskil