[SOLVED] QPushButton. I click on the button, but nothing not happend.
-
wrote on 18 Jul 2012, 08:28 last edited by
[quote author="goblincoding" date="1342530066"]Your problem is this:
@
void MainWindow::on_actionOther_triggered()
{
Ui::setRefreshSpeed something;
QDialog *d = new QDialog;
something.setupUi(d);
d->show();
}
@You're creating QDialog object, not a refreshSpeed object and QDialog does not have a slot1() (as your compiler rightfully pointed out). You also do not need to explicitly create or setup the UI (that's kind of the whole point with Qt Designer Form classes :) ). This is what you want:
@
void MainWindow::on_actionOther_triggered()
{
//Ui::setRefreshSpeed something;
setRefreshSpeed *d = new setRefreshSpeed;
d->setAttribute( Qt::WA_DeleteOnClose );
//something.setupUi(d);
d->show();
}
@[/quote]Thanks, goblincoding! :D
I rewrote, and works perfectly.
@void MainWindow::on_actionOther_triggered()
{
short x = freq;
setRefreshSpeed *d = new setRefreshSpeed;
d->setAttribute(Qt::WA_DeleteOnClose);
d->exec();if (freq != x){ timer->start(freq); ui->action1s->setChecked(false); ui->action2s->setChecked(false); ui->action3s->setChecked(false); ui->actionOther->setChecked(true); }
}@
-
wrote on 18 Jul 2012, 08:34 last edited by
So, the topic is solved. Not? :)
This problem is resolved. I'll write the next. :D -
wrote on 18 Jul 2012, 08:42 last edited by
Glad that you got the code working. Kindly Edit your title and add Solved to it.
Happy Coding!!!!
-
wrote on 18 Jul 2012, 10:28 last edited by
Happy to finally be of some service here :D
21/24