"Don't Show This Again"
-
Is there a standard or even a 3rd party way of displaying a simple dialog that has a check box that says "Don't Show This Again", and saves it off to check later?
-
You can have a bool store it in some file (some custom made settings file for your application) or use the "QSettings":http://doc.qt.nokia.com/stable/qsettings.html class to store it (and any other settings for application)
-
"QErrorMessage":http://doc.trolltech.com/4.7/qerrormessage.html might be what you want, although the "dont't show again" info is not saved permanently (by means of QSettings).
-
I've decided to go with my own custom dialog box, but is there an easy and/or standard way of displaying the default system message box icons for warning/information/error ?
-
You can use "QStyle::standardIcon() ":http://doc.trolltech.com/4.7/qstyle.html#standardIcon
with one of these values for the StandardPixmap standardIcon parameter:
@
QStyle::SP_MessageBoxInformation
QStyle::SP_MessageBoxWarning
QStyle::SP_MessageBoxCritical
QStyle::SP_MessageBoxQuestion
@ -
Perfect!
@
ui->dlgIconButton->setIcon(style()->standardIcon(QStyle::SP_MessageBoxInformation));
@ -
BTW - it's always worth to have a look into the sources of Qt itself, that's the place where I found this :-)
-
To save the settings you could have a look at "QSettings":http://doc.qt.nokia.com/4.7/qsettings.html for platform-independent application settings.