Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. "Don't Show This Again"
Qt 6.11 is out! See what's new in the release blog

"Don't Show This Again"

Scheduled Pinned Locked Moved General and Desktop
8 Posts 4 Posters 6.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jdarnold
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • ZlatomirZ Offline
      ZlatomirZ Offline
      Zlatomir
      wrote on last edited by
      #2

      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)

      https://forum.qt.io/category/41/romanian

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #3

        "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).

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • J Offline
          J Offline
          jdarnold
          wrote on last edited by
          #4

          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 ?

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #5

            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
            @

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0
            • J Offline
              J Offline
              jdarnold
              wrote on last edited by
              #6

              Perfect!

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

              1 Reply Last reply
              0
              • G Offline
                G Offline
                goetz
                wrote on last edited by
                #7

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

                http://www.catb.org/~esr/faqs/smart-questions.html

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  js_dev
                  wrote on last edited by
                  #8

                  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.

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

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved