Re: Adding slots in Designer
Quote:
Originally Posted by jamos
At the moment I am puzzled as to how to add slots to my window class. Designer does not seem to have any facility to add slots to a class (am I missing something?) So I have to add them by hand.
Yes, you have to add them by hand.
Quote:
Originally Posted by jamos
- If I manually add slots to my class (QtTest, derived from QMainWindow), the slots do not show up in Designer, so I can't use Designer's signal/slot facilities.
True, you would have to create a custom widget plugin for the designer.
Quote:
Originally Posted by jamos
- If I were to add the slots to ui_QtTestClass, then they will be overwritten the next time I edit the form in Designer - am I correct?
Correct. You are not supposed to modify headers generated by uic.
Re: Adding slots in Designer
A general approach for Qt4 is to design your user interfaces in Qt Designer and then either inherit or incorporate them in a regular C++ class derived from one of QWidget descendants and use the designed UI by calling setupUi().
Code:
class MyMainWindow
: public QMainWindow,
private Ui
::MyMainWindow {//...
};
or
Code:
//...
private:
Ui::MyMainWindow ui;
//...
};
Re: Adding slots in Designer
Wow. This essentially makes Designer worthless except as a layout tool.
OK. I'll swim with that. Thanks.
Re: Adding slots in Designer
It is strictly a layout tool (of course you can manage signals and slot connections there too) and not an IDE.
Re: Adding slots in Designer
Indeed, QtDesigner simply integrates into Visual Studio 2005, and piggy-backs off of Microsoft's debugger, compiler, etc. Visual Studio 2005 is still your IDE. :cool: