Hi,
- I created a project(LayoutDesign) in QT4.4.3,it created LayoutDesign.ui ,LayoutDesign.h,LayoutDesign.cpp and main.cpp file
- I opened the ui file using QTDesigner and i added 3 widgets(LineEdit1,Pushbutton,LineEdit2) on to it.
- my intention is when i click Pushbutton it should take the input from LineEdit1 and make some calculations and displayed in LineEdit2.
- Using signal and slot mechanism i connected the widgets in below manner in ui_LayoutDesign.h file
QObject::connect(PushButton,
SIGNAL(clicked
()), LayoutDesign,
SLOT(Convert
()));
QObject::connect(LineEdit1,
SIGNAL(activated
(int)), LayoutDesign,
SLOT(Convert
()));
QObject::connect(LineEdit2,
SIGNAL(activated
(int)), LayoutDesign,
SLOT(Convert
()));
QObject::connect(PushButton, SIGNAL(clicked()), LayoutDesign, SLOT(Convert()));
QObject::connect(LineEdit1, SIGNAL(activated(int)), LayoutDesign, SLOT(Convert()));
QObject::connect(LineEdit2, SIGNAL(activated(int)), LayoutDesign, SLOT(Convert()));
To copy to clipboard, switch view to plain text mode
The Convert() slot specified in the connect function is newly added slot(it means it is not predefined).
Here My question is where to define the Convert() slot in my code.
Bookmarks