Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-3040

QPalette.ColorRole.Base incorrect on Gtk based Linux machines

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 6.8.2
    • PySide
    • None
    • Linux/X11

    Description

      Updated 20250318:

      Solved via help from Friedemann Kleint (s. comments). Use 

      qmake6 -v

      to determine the system Qt version (6.4.2 in my case). Then use 

      python3 -m pip install PySide6==6.4.2

       to match it.

      Updated 20250214 to include pointers in the comments:

      A disabled QTextEdit on a GTK based Linux machine lacks a visual cue to indicate the disabled state. Please compare the following apps running on a Mac (Mac.png) and a Linux machine (GTK Linux.png). The code is in both cases GUI.py. On the linux machine, only the text color indicates the dis- or enabled state, but the color of the QTextEdit field is grayish in both cases. I believe it should look like on the Mac.

      Looking further into the issue, I found that the QPalette.ColorRole.Base is incorrect and made the attached test (qt_base_tester.py). The output is 

      Gtk: (True, color=Gdk.RGBA(red=1.000000, green=1.000000, blue=1.000000, alpha=1.000000))
      Qt: (0.9803921580314636, 0.9764705896377563, 0.9725490212440491, 1.0)

      i.e. the GTK palette is correct but something is lost in translation to Qt. It was suggested that this is a Qt and not a PySide bug and has to be tested via C code. I attached this code as well (qt_base_tester.c). The output is correct:

      Gtk: (1, 1, 1, 1)
      Qt: (1, 1, 1, 1)

      therefore, it is not a general Qt bug. Then, it was suggested that the code is linked against different libraries that can be tested via QT_DEBUG_PLUGINS. This is indeed the case, but I do not see a way around that. Forcing my little testing app the load the same library fails due to a version conflict. Also, I cannot install via `apt install`, to my best knowledge, PySide can only be installed via `pip`. I tested on Ubuntu 22.04, which is an officially supported Qt platform. We also tested many more systems and the bug appears on all GTK based systems. 

      Where/How should I report this bug? Building PySide6 by myself even on a supported system to get to a state without the bug seems rather involved. 

       

      Attachments

        1. GTK Linux.png
          GTK Linux.png
          6 kB
        2. GUI.py
          0.7 kB
        3. Mac.png
          Mac.png
          61 kB
        4. qt_base_tester.c
          1 kB
        5. qt_base_tester.py
          0.4 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              crmaurei Cristian Maureira-Fredes
              andythomas Andy Thomas
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes