After opening a dialog window from my main window, I call a function to connect confirmSavePathButton and confirmLoadPathButton to their individual file-writing and reading functions separately. The function called by the main window to open the dialog with a button works and remains connected, but the connections in the called function do not work.
Camera_Control_GUI class contains mainwindow ui, VideoSettings class contains dialog window uiDlg. Both classes were generated by Qt.
I've tried changing the syntax used in the connect lines to pre-5.0 Qt, using SIGNALS and SLOTS. None of the connections on the dialog seem to be working.
Camera_Control_GUI.cpp:
void Camera_Control_GUI::launchConfigOptions() {
QDialog* configOptions = new QDialog(0, 0);
Ui::VideoSettings uiDlg;
VideoSettings vidObj;
vidObj.videoSettingsConnector();
uiDlg.setupUi(configOptions);
configOptions->exec();
}
VideoSettings.cpp:
void VideoSettings::videoSettingsConnector() {
connect(uiDlg->confirmSavePushButton, &QPushButton::clicked, this, &VideoSettings::pathWrite);
connect(uiDlg->confirmLoadPushButton, &QPushButton::clicked, this, VideoSettings::pathRead);
QMessageBox::about(this, "Verification Box", "This function is called");
}
Opening the dialog window using launchConfigOptions() shows the QMessageBox indicating the function has run. However, when attempting to click on either confirmSavePushButton or confirmLoadPushButton, neither run (also checked by replacing both functions with having a QMessageBox open).