January 27, 2011

jdarnold jdarnold
Lab Rat
37 posts

“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?

7 replies

January 27, 2011

Zlatomir Zlatomir
Dinosaur Breeder
326 posts

You can have a bool store it in some file (some custom made settings file for your application) or use the QSettings [doc.qt.nokia.com] class to store it (and any other settings for application)

January 27, 2011

Volker Volker
Robot Herder
5428 posts

QErrorMessage [doc.trolltech.com] might be what you want, although the “dont’t show again” info is not saved permanently (by means of QSettings).

January 28, 2011

jdarnold jdarnold
Lab Rat
37 posts

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 ?

January 28, 2011

Volker Volker
Robot Herder
5428 posts

You can use QStyle::standardIcon() [doc.trolltech.com]

with one of these values for the StandardPixmap standardIcon parameter:

  1. QStyle::SP_MessageBoxInformation
  2. QStyle::SP_MessageBoxWarning
  3. QStyle::SP_MessageBoxCritical
  4. QStyle::SP_MessageBoxQuestion

January 28, 2011

jdarnold jdarnold
Lab Rat
37 posts

Perfect!

  1. ui->dlgIconButton->setIcon(style()->standardIcon(QStyle::SP_MessageBoxInformation));

January 28, 2011

Volker Volker
Robot Herder
5428 posts

BTW – it’s always worth to have a look into the sources of Qt itself, that’s the place where I found this :-)

January 31, 2011

js_dev js_dev
Lab Rat
13 posts

To save the settings you could have a look at QSettings [doc.qt.nokia.com] for platform-independent application settings.

 Signature 

Don’t be afraid of perfection, you will never reach it.
(Salvator Dali)

 
  ‹‹ Hide All function?      QLineEdit with Custom QComboBox ››

You must log in to post a reply. Not a member yet? Register here!