hello, i am new to QT and i am trying to learn QT and its features.But as a C guy i am facing a bit difficult in understanding signals and slots except this feature the Docs provided by QT is more than enough for me
i use code blocks along with QT libraries to do the magic with C and it works great!.
i need help from you guys.can you please tell me how to create a new slots and how to manipulate data with it.i have some very small basic knowledge on c++ so i can understand little bit.
for example is this correct?
int main(int argc, char* argv[])
{
clickme.resize(75, 30);
QObject::connect(&clickme,
SIGNAL(clicked
()),
&app,
SLOT(updatenewvalues
()));
clickme.show();
return app.exec();
}
void updatenewvalues()
{
/* some code here */
}
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
QPushButton clickme("ClickeME");
clickme.resize(75, 30);
clickme.setFont(QFont("Times", 18, QFont::Bold));
QObject::connect(&clickme, SIGNAL(clicked()), &app, SLOT(updatenewvalues()));
clickme.show();
return app.exec();
}
void updatenewvalues()
{
/* some code here */
}
To copy to clipboard, switch view to plain text mode
what i want this program to do is initially the value in clickme is "clickme" no when i press clickme i want the value of "clickme" to change to "dontclickme"
i have read the Docs from here
http://doc.trolltech.com/4.7/signalsandslots.html
but no help!
Bookmarks