I am not sure what your intention with the connect is, other than it obviously being wrong in syntax.
The action is already connected to that very slot.
Just create an instance of your password change dialog and show it (this will open multiple dialogs if the action is triggered multiple times)
void MainWindow::on_actionChange_password_triggered()
{
// assumes PasswordChangeDialog deletes itself when being closed
PasswordChangeDialog *dialog = new PasswordChangeDialog(this);
dialog->show();
}
void MainWindow::on_actionChange_password_triggered()
{
// assumes PasswordChangeDialog deletes itself when being closed
PasswordChangeDialog *dialog = new PasswordChangeDialog(this);
dialog->show();
}
To copy to clipboard, switch view to plain text mode
Keep the instance if you only want one.
void MainWindow::on_actionChange_password_triggered()
{
if (m_passwordChangeDialog == 0) {
m_passwordChangeDialog = new PasswordChangeDialog(this);
}
m_passwordChangeDialog->show();
m_passwordChangeDialog->raise();
m_passwordChangeDialog->activateWindow();
}
void MainWindow::on_actionChange_password_triggered()
{
if (m_passwordChangeDialog == 0) {
m_passwordChangeDialog = new PasswordChangeDialog(this);
}
m_passwordChangeDialog->show();
m_passwordChangeDialog->raise();
m_passwordChangeDialog->activateWindow();
}
To copy to clipboard, switch view to plain text mode
Use exec() if it should be modal.
void MainWindow::on_actionChange_password_triggered()
{
PasswordChangeDialog dialog(this);
dialog.exec();
}
void MainWindow::on_actionChange_password_triggered()
{
PasswordChangeDialog dialog(this);
dialog.exec();
}
To copy to clipboard, switch view to plain text mode
Whether you use designer for password change dialog or code it manually is really irrelevant to its usage. Manually coding it is way more work of course.
Cheers,
_
Bookmarks