Unsolved QButtonBox problem with the button how do I know which one has been clicked
-
So I just have the default OK and Cancel
void Dialog::on_buttonBox_clicked(QAbstractButton *button) { QString myen; myen = ui->lineEdit->text(); entry = myen.toUtf8().constData(); }
I want the entry to be changed with OK and close the dialog with Cancel
-
@AI_Messiah said in QButtonBox problem with the button how do I know which one has been clicked:
how do I know which one has been clicked
Your slot has a
QAbstractButton *button
parameter that points to the button that was clicked.QButtonBox
There is no class called "QButtonBox". Do you mean QButtonGroup or QDialogButtonBox?
I want the entry to be changed with OK and close the dialog with Cancel
If you meant QDialogButtonBox, it emits the
accepted()
signal when you click "OK", and emits therejected()
signal when you click "Cancel".