[Kde-perl] QtDesigner, PerlQt and Slots
Peter Daum
gator_ml at yahoo.de
Tue Jun 7 10:50:17 CEST 2005
I played around a little with Qtdesigner and the Perl plugin,
and tried the "Quick Start" example from the Qtdesigner documentation.
What I can't figure out, is how the collaboration between the different
source code modules is supposed to work:
I have a single main form with name "ConversionForm" stored in the
file "conversionform.ui" and the main program, "main.pl". The actual
code would be mostly in a slot named "convert()".
PerlQt puts the perl code for creating the form in "ConversionForm.pl"
(including statements to connect the signals/slots) but the implementation
for the slots ends up in "conversionform.ui.h" without any reference
to them. When the program is started, it emits a bunch of error messages
"QObject::connect: No such slot".
I can connect the pieces by hand by putting a "require conversionform.ui.pm"
in main.pl and fix up "conversionform.ui.pm" a little (put it in the right
package, add a ": SLOT()" behind the "sub convert" statement and put a "1;" at
the end. This way the resulting program works correctly, but as soon as i load
the project in the designer the next time, it does not know the slot "convert()"
any more and the Perl plugin is obviosly confused by the ":SLOT()".
Is there any way to put the pieces together in a way that the result actually works
and the project can still be handled by Qtdesigner, preferably in a way that keeps
GUI and program logic / automatically generated code and handmade stuff separate?
Regards,
Peter Daum
More information about the Kde-perl
mailing list