I've changed the code and now it works!
NewButton->setText("Button");
actionsObj *ao= new actionsObj;
connect(NewButton, SIGNAL(clicked()),ao, SLOT(ButtonClicked()));
NewButton->setGeometry(50, 40, 300, 200);
NewButton->show();
//ui->setupUi(this);
QPushButton *NewButton= new QPushButton(this);
NewButton->setText("Button");
actionsObj *ao= new actionsObj;
connect(NewButton, SIGNAL(clicked()),ao, SLOT(ButtonClicked()));
NewButton->setGeometry(50, 40, 300, 200);
NewButton->show();
//ui->setupUi(this);
To copy to clipboard, switch view to plain text mode
the only problem now is that if I uncomment the last row the button isn't clickable anymore. What could be the problem?
Bookmarks