Unsolved Controls Events
-
In Visual Studio I place a button on a form and double click it - it creates MyButton_onClick event. How do I do it in Qt?
-
@jenya7 said in Controls Events:
How do I do it in Qt?
In Qt Creator you mean?
Right click->Go to slot->clicked()
-
OK. Created
void MainWindow::on_ButtonOpenParamFile_clicked() { QMessageBox msgBox; msgBox.setText("Button Pressed"); }
But nothing happens on click.
Sorry. Have to add msgBox.exec();
-
I failed to find Select File Dialog - is it exists?
-
@jenya7
I don't think Qt Creator (I don't use it) provides a drag-and-drop interface to creating one, but yes Qt provides a https://doc.qt.io/qt-5/qfiledialog.html. From code you call one of its methods, you may be able to get away with the https://doc.qt.io/qt-5/qfiledialog.html#static-public-members ones for simplest purposes. -
@JonB said in Controls Events:
@jenya7
I don't think Qt Creator (I don't use it) provides a drag-and-drop interface to creating one, but yes Qt provides a https://doc.qt.io/qt-5/qfiledialog.html. From code you call one of its methods, you may be able to get away with the https://doc.qt.io/qt-5/qfiledialog.html#static-public-members ones for simplest purposes.Thank you.