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. Qt 6.3: stylesheets with QLineEdit makes the placeholder color same as text

Qt 6.3: stylesheets with QLineEdit makes the placeholder color same as text

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 2 Posters 1.7k 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.
  • MitsuriouM Offline
    MitsuriouM Offline
    Mitsuriou
    wrote on last edited by
    #1

    Hello,
    I am migrating my app from Qt 5.15.2 to Qt 6.3.0.
    If this seems to be working pretty good so far, I just noticed that using stylesheets makes my QLineEdits' placeholder color the same as the text color, which is very frustrating, because you cannot see which QLineEdit is empty or filled.

    • Qt 5.15.2 with default OS theme :
      5.15 native.jpg
    • Qt 5.15.2 with stylesheet :
      5.15 stylesheet.jpg
    • Qt 6.3.0 with default OS theme :
      6.3.0 native.jpg
    • Qt 6.3.0 with stylesheet :
      6.3.0 stylesheet.jpg

    Do you have any clue of what could have been modified in Qt 6 when it comes to stylesheets?
    Also, I've tried tried using the stylesheet code from https://forum.qt.io/topic/90176/change-qlineedit-placeholder-text-color/8 but it changes both the text color and the placeholder color.

    1 Reply Last reply
    0
    • MitsuriouM Offline
      MitsuriouM Offline
      Mitsuriou
      wrote on last edited by
      #11

      For those of you who would find this post and are looking for a solution, I used this workaround, on Qt 6.3.1 :
      https://bugreports.qt.io/browse/QTBUG-95297

      1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        That looks like a possible bug.

        Can you provide a minimal compilable example that shows this behaviour ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        MitsuriouM 2 Replies Last reply
        0
        • SGaistS SGaist

          Hi,

          That looks like a possible bug.

          Can you provide a minimal compilable example that shows this behaviour ?

          MitsuriouM Offline
          MitsuriouM Offline
          Mitsuriou
          wrote on last edited by Mitsuriou
          #3

          @SGaist Hello, here is a minimal example, made with QtCreator: Google Drive link.

          1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            That looks like a possible bug.

            Can you provide a minimal compilable example that shows this behaviour ?

            MitsuriouM Offline
            MitsuriouM Offline
            Mitsuriou
            wrote on last edited by
            #4

            @SGaist said in Qt 6.3: stylesheets with QLineEdit makes the placeholder color same as text:

            Hi,

            That looks like a possible bug.

            Can you provide a minimal compilable example that shows this behaviour ?

            Hello again. Sorry for the double post, but have you had time to check my example project yet?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #5

              Not yet, will do ASAP

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #6

                I can confirm the behaviour change between Qt 5 and Qt 6 on Linux.

                You should check the bug report system to see if it's something known. If not, please consider opening a new report providing your example.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                MitsuriouM 1 Reply Last reply
                1
                • SGaistS SGaist

                  I can confirm the behaviour change between Qt 5 and Qt 6 on Linux.

                  You should check the bug report system to see if it's something known. If not, please consider opening a new report providing your example.

                  MitsuriouM Offline
                  MitsuriouM Offline
                  Mitsuriou
                  wrote on last edited by
                  #7

                  @SGaist Hello,
                  Thanks for the confirmation!

                  I just checked on the bug report system, and it seems that is is a known bug since the early development of Qt 6 :/
                  There are already 4 or 5 tickets talking about this issue or related things (QSS / QPalette).
                  All the tickets are in low priority, I'm a little bit sad about that, but I guess I will just have to wait more to use Qt 6, and stick with 5.15.2 for a while ^^

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #8

                    Can you link what you found ?
                    Is there any of these that related to your issue ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • MitsuriouM Offline
                      MitsuriouM Offline
                      Mitsuriou
                      wrote on last edited by
                      #9

                      Hello,
                      I've managed to find the tickets through this request:
                      https://bugreports.qt.io/browse/QTBUG-92199?jql=text ~ "placeholder stylesheet"

                      1 Reply Last reply
                      2
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #10

                        Thanks !

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • MitsuriouM Offline
                          MitsuriouM Offline
                          Mitsuriou
                          wrote on last edited by
                          #11

                          For those of you who would find this post and are looking for a solution, I used this workaround, on Qt 6.3.1 :
                          https://bugreports.qt.io/browse/QTBUG-95297

                          1 Reply Last reply
                          1

                          • Login

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