I want to write my custom input dialog. I wrote following lines to handle click on OK/Cancel:
connect(buttonBox, &QDialogButtonBox::accepted,this, &MyCustomDialog::accept);
I got this error on compile:
/usr/include/qt4/QtGui/qdialogbuttonbox.h:147:10: error: 'void QDialogButtonBox::accepted()' is protected
void accepted();
There isn't any public signal in QDialogButtonBox.
This is not about
QDialogButtonBox. It is about yourQtversion. You are usingQt5syntax for singal-slot while you haveQt4. Use this:acceptedis aQ_SIGNALSwhich isprotectedinQt4, so you can't use that syntax.