Edit Slot ???

Laurent Cortier laurent.cortier at chello.be
Tue Mar 20 21:17:18 GMT 2001


> I am fluent in C++ (VC++) and in DELPHI, however, so far I've gained little
> success in Qt-designer:
Then it's only a matter to fix a few things, and you'll be ok, coz Qt is
really quite logical...

> The problem is that I could not find a good tutorial/textbook.
> I wonder if you find time to give me a hint on how can I link the
> source-code to the slot, e.g., suppose we have two lineedit widgets, one
> pushbutton and one label. 
I can try :)

> The "task" would be to add the two numbers from
> lineedits by clicking the pushbutton. The result will be shown on label.
> Qt-designer produces *.ui files. Is there any tool inside the qt-designer
> to create also *.cpp files, say, like in DELPHI, by double-clicking on the
> widget, or whatsoever?
Well. Hmm. A few things :
when you're using Qt Designer and save your work, it appears indeed as
a .ui file in your project. All you have to do to use that interface, is 
derive from it. How can you derive from a .ui ? Easy : KDevelop uses the 
command line tool uic (ui compiler or something) to generate the .h and .cpp 
from the .ui file. All this is done at compile time automatically.

So. Just take as granted that the name of the class created from the .ui file 
is the name you gave to the Widget (the window or dialog box) in QT Designer.

Once you've created your widget with Qt Designer, go in KDevelop 1.4, 
right-click on your file tree or class tree and choose "New class..." in the 
popup menu. In the following dialog, enter the name of your widget as 
baseclass, and chose a name for your class. Don't forget to check "generate a 
QWidget-Childclass". Then click Ok.
The class he created is the class you can use. You can use your widgets from 
it, by calling this->LineEditFirstInput->text for example.

Now for the slots and signals, I understood them by reading the tutorial 
found at this page :
http://women.kde.org/projects/coding/tutorials.html
and more specifically this one :
http://women.kde.org/projects/coding/tut_kdevelop/creating.html#STARTINGPROJECT

Everything is in it, that's how I learned everything I know about Qt. At 
least that was a sufficient start to understand the big picture.
Sorry, but I cannot be clearer than them (I even hope you understood anything 
I said coz my explanations never look clear to me ;), and it's on at least 
4-5 pages.

Hope this helps,

    Laurent Cortier.
Consultant in a free world
http://www.dsimprove.be



-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list