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. Stylesheet problem with Qt > 5.12.2

Stylesheet problem with Qt > 5.12.2

Scheduled Pinned Locked Moved Unsolved General and Desktop
15 Posts 3 Posters 1.9k Views
  • 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.
  • R Offline
    R Offline
    Rumen GB
    wrote on last edited by
    #1

    Hi everybody,
    I am facing an issue with the stylesheets, The app worked perfectly until version 5.12.2 and since 5.12.3 there is an issue with the stylesheet setting:
    Here is a sreenshot with Qt 5.12.2:
    icp_exposure.png
    and a the same thing with Qt 5:13:
    icp_broken.png

    See the bottom right frame: "Start Exposure"
    So I have no idea how to fix it. Here is the code that produces this mess:

    void QIndigoProperty::update_property_view() {
    switch (m_property->state) {
    case INDIGO_IDLE_STATE:
    m_led->setPixmap(QPixmap(":resource/led-grey.png"));
    this->setStyleSheet(
    "#INDIGO_property { background-color: #202020 }"
    "QLineEdit#INDIGO_property { background-color: #202020}"
    "QPushButton#INDIGO_property { background-color: #222222 }"
    "QPushButton#INDIGO_property:focus { background-color: #272727 }"
    );
    break;
    case INDIGO_BUSY_STATE:
    if (conf.use_state_icons)
    m_led->setPixmap(QPixmap(":resource/led-orange-cb.png"));
    else
    m_led->setPixmap(QPixmap(":resource/led-orange.png"));
    this->setStyleSheet(
    "#INDIGO_property { background-color: #353520; border: 0px}"
    "QLineEdit#INDIGO_property { background-color: #252520}"
    "QPushButton#INDIGO_property { background-color: #454522 }"
    "QPushButton#INDIGO_property:focus { background-color: #505022 }"
    );
    break;
    case INDIGO_ALERT_STATE:
    if (conf.use_state_icons)
    m_led->setPixmap(QPixmap(":resource/led-red-cb.png"));
    else
    m_led->setPixmap(QPixmap(":resource/led-red.png"));
    this->setStyleSheet(
    "#INDIGO_property { background-color: #352222; border: 0px}"
    "QLineEdit#INDIGO_property { background-color: #252222}"
    "QPushButton#INDIGO_property { background-color: #452222 }"
    "QPushButton#INDIGO_property:focus { background-color: #502222 }"
    );
    break;
    case INDIGO_OK_STATE:
    if (conf.use_state_icons)
    m_led->setPixmap(QPixmap(":resource/led-green-cb.png"));
    else
    m_led->setPixmap(QPixmap(":resource/led-green.png"));
    this->setStyleSheet(
    "#INDIGO_property { background-color: #203220; border: 0px}"
    "QLineEdit#INDIGO_property { background-color: #202520}"
    "QPushButton#INDIGO_property { background-color: #224322 }"
    "QPushButton#INDIGO_property:focus { background-color: #225022 }"
    );
    break;
    }
    m_led->update();

    Any Idea? is that a QT bug?

    regards
    Rumen

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Rumen-GB said in Stylesheet problem with Qt > 5.12.2:

      See the bottom right frame: "Start Exposure"

      Can you be a little bit more precise? Don't see any major difference.
      Also it would be nice to get a testcase so we can reproduce it here - your code is too big (and does not compile).

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • R Offline
        R Offline
        Rumen GB
        wrote on last edited by
        #3

        Hi,
        it is a bit tough to reproduce at home as you need indigo framework:
        http://indigo-astronomy.org/ in order to use it.

        But the code is here:
        https://github.com/indigo-astronomy/indigo_control_panel
        file: qindigoproperty.cpp line: 64

        The issue is that the child widgets do not get properly decorated when compiled with Qt version > 5.12.2 (see the screenshots in my previous post) It should be all yellow in "Set Exposure" frame but on the bottom screenshot QLabel, QPushButton etc do not change their color and remain green only the frame color changed. While with Qt <= 5.12.2 it is as shown on the first screenshot!
        Basically the ide is: it is all green, you hit "Set" button and whie exposure is in progress it should be all yellow which it is when build against Qt <=5.12.2 and is not if newer.

        I think the trouble code is here:
        this->setStyleSheet(
        "#INDIGO_property { background-color: #353520; border: 0px}"
        "QLineEdit#INDIGO_property { background-color: #252520}"
        "QPushButton#INDIGO_property { background-color: #454522 }"
        "QPushButton#INDIGO_property:focus { background-color: #505022 }"
        );

        all widgets are named as they should be:
        QLabel* device_label = new QLabel(device_string);
        device_label->setObjectName("INDIGO_property");

        regards
        Rrumen

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          I think this should also be reproducible with a small testcase - please file a bug report at https://bugreports.qt.io and attach the testcase.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          1
          • R Offline
            R Offline
            Rumen GB
            wrote on last edited by
            #5

            Sorry I do not have time to make a simpler test. I will file the bug and describe it. will that be ok?

            mrjjM 1 Reply Last reply
            0
            • R Rumen GB

              Sorry I do not have time to make a simpler test. I will file the bug and describe it. will that be ok?

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Rumen-GB
              Hi
              While a bug description does help. without a sample to clearly show
              the issue / regression, it might not get much love as in many cases its an
              application bug and not directly Qt issues.

              I can see you use Widget Names as selector.
              Is the issue you experience like it does ignore the
              name and affect another widget even it has other name or what is
              the actual thesis about what is broken between the versions ?

              R Christian EhrlicherC 2 Replies Last reply
              0
              • mrjjM mrjj

                @Rumen-GB
                Hi
                While a bug description does help. without a sample to clearly show
                the issue / regression, it might not get much love as in many cases its an
                application bug and not directly Qt issues.

                I can see you use Widget Names as selector.
                Is the issue you experience like it does ignore the
                name and affect another widget even it has other name or what is
                the actual thesis about what is broken between the versions ?

                R Offline
                R Offline
                Rumen GB
                wrote on last edited by
                #7

                @mrjj the issue is that the stylesheet does not affect the child widgets. It did till qt 5.12.2 and stopped at 5.12.3. It is clearly seen on the screen shots. The frame by default is green. It should change to yellow during the exposure and back to green when done. Both screenshots are during the exposure. Note how buttons and labels keep its green background with 5.13 and are all yellow with 5.12.2. I played a bit and figured that this regression is introduced in 5.12.3

                Rumen

                1 Reply Last reply
                0
                • mrjjM mrjj

                  @Rumen-GB
                  Hi
                  While a bug description does help. without a sample to clearly show
                  the issue / regression, it might not get much love as in many cases its an
                  application bug and not directly Qt issues.

                  I can see you use Widget Names as selector.
                  Is the issue you experience like it does ignore the
                  name and affect another widget even it has other name or what is
                  the actual thesis about what is broken between the versions ?

                  Christian EhrlicherC Offline
                  Christian EhrlicherC Offline
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @mrjj said in Stylesheet problem with Qt > 5.12.2:

                  it might not get much love as in many cases its an
                  application bug and not directly Qt issues.

                  That's the reason why I want a small reproducer - to see if it's really a Qt bug or not.

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  R 1 Reply Last reply
                  0
                  • Christian EhrlicherC Christian Ehrlicher

                    @mrjj said in Stylesheet problem with Qt > 5.12.2:

                    it might not get much love as in many cases its an
                    application bug and not directly Qt issues.

                    That's the reason why I want a small reproducer - to see if it's really a Qt bug or not.

                    R Offline
                    R Offline
                    Rumen GB
                    wrote on last edited by
                    #9

                    @Christian-Ehrlicher I agree but if this worked before 5.12.3 and now it stopped... I would assume it is a regression :)

                    1 Reply Last reply
                    0
                    • Christian EhrlicherC Offline
                      Christian EhrlicherC Offline
                      Christian Ehrlicher
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @Rumen-GB said in Stylesheet problem with Qt > 5.12.2:

                      I would assume it is a regression :)

                      No matter what you think - if we can not reproduce it with a simple testcase, noone will be able to fix it.

                      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                      Visit the Qt Academy at https://academy.qt.io/catalog

                      1 Reply Last reply
                      1
                      • R Offline
                        R Offline
                        Rumen GB
                        wrote on last edited by
                        #11

                        Now I can prove it :) I created a test program to illustrate it.
                        it is all here:
                        https://bugreports.qt.io/browse/QTBUG-79545

                        Christian EhrlicherC 1 Reply Last reply
                        0
                        • R Rumen GB

                          Now I can prove it :) I created a test program to illustrate it.
                          it is all here:
                          https://bugreports.qt.io/browse/QTBUG-79545

                          Christian EhrlicherC Offline
                          Christian EhrlicherC Offline
                          Christian Ehrlicher
                          Lifetime Qt Champion
                          wrote on last edited by Christian Ehrlicher
                          #12

                          @Rumen-GB: thx, I cleaned it up a little bit and can reproduce it.

                          /edit: and found the solution - is already fixed in 5.12.6

                          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                          Visit the Qt Academy at https://academy.qt.io/catalog

                          1 Reply Last reply
                          1
                          • R Offline
                            R Offline
                            Rumen GB
                            wrote on last edited by
                            #13

                            Hi, thanks can this be backported to 5.12.x?

                            Christian EhrlicherC 1 Reply Last reply
                            0
                            • R Rumen GB

                              Hi, thanks can this be backported to 5.12.x?

                              Christian EhrlicherC Offline
                              Christian EhrlicherC Offline
                              Christian Ehrlicher
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              @Rumen-GB said in Stylesheet problem with Qt > 5.12.2:

                              Hi, thanks can this be backported to 5.12.x?

                              Please read my last post.

                              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                              Visit the Qt Academy at https://academy.qt.io/catalog

                              R 1 Reply Last reply
                              0
                              • Christian EhrlicherC Christian Ehrlicher

                                @Rumen-GB said in Stylesheet problem with Qt > 5.12.2:

                                Hi, thanks can this be backported to 5.12.x?

                                Please read my last post.

                                R Offline
                                R Offline
                                Rumen GB
                                wrote on last edited by
                                #15

                                @Christian-Ehrlicher thank you!

                                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