Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-103349

QSpinBox Palette

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P3: Somewhat important
    • None
    • 5.15.2
    • None
    • Windows 10
      AMD Ryzen 5 2600
      16 GB RAM

      Qt Creator 4.15.1
      Qt 5.15.2 (MSVC 2019, 64 bit)
    • Windows

    Description

      QSpinBox when changing palette color.

      On focus on QWidget palette remain default (gray background, black text)

      When focus is lost QSpinBox takes palette setting.

      Not sure if its just my implementation which is wrong

       

          QPalette errorPalette, acceptPalette;
          errorPalette.setColor(QPalette::Base,Qt::red);
          errorPalette.setColor(QPalette::Text,Qt::black);
      
          acceptPalette.setColor(QPalette::Base,Qt::white);
          acceptPalette.setColor(QPalette::Text,Qt::black);
      
          edtTitle.setPalette(acceptPalette);
          edtDirector.setPalette(acceptPalette);
          spnLength.setPalette(acceptPalette);
      
      try {
      
              if (title == "") {
                  edtTitle.setPalette(errorPalette);
                  throw 0;
              }
                  else if (director == "") {
                      edtDirector.setPalette(errorPalette);
                      throw 0;
              }
                  else if (length == 0) {
                      spnLength.setPalette(errorPalette);
                      throw 0;
              }
      

       

      Attachments

        1. Focused.PNG
          Focused.PNG
          5 kB
        2. main.cpp
          0.9 kB
        3. Unfocused.PNG
          Unfocused.PNG
          6 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            shadow_walker Bradley du Buy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes