hi! I am new to qt and now I have a little problem((
int main(int argc, char *argv[])
{
wnd.resize(200, 100);
wnd.setWindowTitle("w3.cpp");
wnd.show();
QObject::connect(btn,
SIGNAL(clicked
()), btn,
SLOT(setText
("hi!")));
btn->move(50, 40);
btn->show();
return app.exec();
}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QWidget wnd;
wnd.resize(200, 100);
wnd.setWindowTitle("w3.cpp");
wnd.show();
QPushButton *btn = new QPushButton("Press Me", &wnd);
QObject::connect(btn, SIGNAL(clicked()), btn, SLOT(setText("hi!")));
btn->move(50, 40);
btn->show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
i just want to do such thing - after clicking button its text changes to "hi"))
where is my mistake??? help please((
Bookmarks