Qt Eclipse basic question
-
Hi again, I'm new with Qt. using the Qt Eclipse integration, I want to build a really simple program.
First, if I want a box that user can enter values, but it has to be integers. How do I limit that? eg. if I use line edit, it takes any characters?Second, in the Main.cpp, how do I make multiple widgets go on the same window. Right now, I have a couple of buttons/labels, but each one show a different window.
eg.@
QLabel *msg= new QLabel ("Welcome!");
msg->show();
QPushButton *close=new QPushButton("close");
QObject::connect (close, SIGNAL(clicked()),&a, SLOT(quit()));
equal->show();
@Sorry, I'm really a beginner to Qt. Thanks in advance
[EDIT: code formatting, please wrap in @-tags; Volker]
-
I think what You are looking for is a SpinBox. And really why do You need to use Eclipse isn't QtCreator an option? In my mind, making someone use Eclipse is a very harsh form of punishment.
"C++-GUI-Programming-with-Qt-4-1st-ed.":http://www.qtrac.eu/C++-GUI-Programming-with-Qt-4-1st-ed.zip