I have a QDialogButtonBox with All Standard Button and Non Standard Buttons (QPushbutton added to create Non-Standard Buttons).
I can implement SignalMapper saperately f
QSignalMapper can map a QObject and a integer. So you can map your non-standardButton with its role and create a slot that takes in parameter a role:
For example:
void Widget::initMap() {
QPushButton* buttonReset = new QPushButton( "Reset" );
signalMapper = new QSignalMapper(this);
connect(buttonReset, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(button, QDialogButtonBox::ResetRole);
connect(signalMapper, SIGNAL(mapped(int)), this, SLOT(slot(int)));
}
void Widget::slot( int role) {
if ( role == QDialogButtonBox::ResetRole ) {
reset();
} else if ( QDialogButtonBox::Apply ) {
apply();
}
}