Of course it doesn't. You never make a connection in the slot that it is supposed to call.
edit:
void example::on_pushButton_clicked()
{
connect(ui->pushButton, SIGNAL(clicked()), hi, SLOT(gamatos->show()));
}
void example::on_pushButton_clicked()
{
QDialog *gamatos = new QDialog;
connect(ui->pushButton, SIGNAL(clicked()), hi, SLOT(gamatos->show()));
}
To copy to clipboard, switch view to plain text mode
should be something along the lines of
yourClass::yourConstructor(...) : yourParent() {
...
connect(ui->pushButton, SIGNAL(clicked()), hi, SLOT(on_pushButton_clicked());
...
}
void example::on_pushButton_clicked()
{
...
gamatos->exec();
}
yourClass::yourConstructor(...) : yourParent() {
...
connect(ui->pushButton, SIGNAL(clicked()), hi, SLOT(on_pushButton_clicked());
...
}
void example::on_pushButton_clicked()
{
QDialog *gamatos = new QDialog;
...
gamatos->exec();
}
To copy to clipboard, switch view to plain text mode
You *really* need to read and re-read the signals and slots documentation very carefully until you understand it. A slot isn't a statement, it's a function name, and the connection must be established outside of the slot otherwise the slot *cannot* be called!
Bookmarks