On Samstag, 5. März 2016 08:34:27 CEST, Frederik Schwarzer wrote:
Since in my use case, some of the values in the dialog are calculated
and (to my understanding) cannot be handled correctly by Kcfg, I want
to get rif of the "Restore Defaults" button. So I add this line:
dialog->setStandardButtons(QDialogButtonBox::Ok |
QDialogButtonBox::Cancel | QDialogButtonBox::Help);
but then the Help button does not open the Help browser anymore.
::setStandardButtons simply forwards the call to the internal button box which
nukes all button objects (incl. their slot connections) and recreates them w/
the new item list.
The most straight forward solution is likely to hide or delete
button(QDialogButtonBox::RestoreDefaults)
Otherwise you'll have to grep through to the buttonbox and remove it
"correctly" or rebind the help button to the showHelp() slot.
It though looks like you'd destroy more bindings by resetting the
standardButtons (which you all need to restore)
I'm not sure the HIG team would like to remove the defaults button, though.
:-P
Rather replace the restore defaults button, resp. re-link it to your own
calculation slot.
Cheers,
Thomas