You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Friday, November 7th 2008, 10:40pm

Autoconnect Objects

Hello,

it is my first time using the qt designer within the qt creator (version 0.9). I realized a small application with a button, a lineEdit and a label. For the button i createtd a slot to put the text from lineEdit into the textbox.

My Problem is, that i have to declare and connect the lineEdit and label by myself:

mainWindow.h:

Source code

1
2
3
private:
QLabel *ui_label;
QLineEdit *ui_lineEdit;


mainWindow.cpp

Source code

1
2
3
4
5
6
MainWindow::MainWindow(QWidget *parent, Qt::WFlags flags)     : QMainWindow(parent, flags)
{
ui.setupUi(this);
ui_lineEdit = qFindChild<QLineEdit*>(this, "lineEdit");
ui_label = qFindChild<QLabel*>(this, "label");
}


Is there a option to create these declarations automatically?

Thanks for helping.

2

Tuesday, November 11th 2008, 10:08am

when you open the designer , in left side you get the buttons..just drag n drop which buttons you want to you frame. In the right side u will get a property window. u can change the widget's property thru here. Once you are done with it, just right click the form and go to "new connection". here you can define the slots.

Thanks
Techsavy