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

[Reg] Qt 6 ignores the "frameShape" selector when styling a QFrame with CSS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.2.3, 6.5.0, 6.6.2
    • Widgets: Style Sheets
    • None
    • Linux/X11

    Description

      When using the Fusion style, a QFrame with QFrame::HLine or QFrame::VLine set as the frameShape is displayed as a 1 px solid black line both for Qt 5.15 and Qt 6.2.

      Up to Qt 5.15, it was possible to style the appearance of such a QFrame with CSS, e.g. via 

      QApplication app(argc, argv);
      app.setStyleSheet(QStringLiteral(
          "QFrame[frameShape=\"4\"],"
          "QFrame[frameShape=\"5\"] { "
              "color: palette(Mid); "
          "}"));

      which e.g. lead to the QFrame being painted as a gray line in this case.

      Qt 6 (I tested this with Qt 6.2.3) seems to ignore the frameShape selector. Nothing changes, no matter if the style sheet is set or not: in both cases the QFrame appears as a 1px solid black line.

      QFrame's Shape enum seems to be unchanged since Qt 5.15. I also tried to use other representations of the set value in the selector like frameShape=\"0x0004\" or frameShape=\"QFrame::HLine\", but none worked.

      See the attached minimal example and the result screenshots.

      Attachments

        1. CMakeLists_qt5.txt
          0.2 kB
        2. CMakeLists_qt6.txt
          0.2 kB
        3. main.cpp
          0.4 kB
        4. MainWindow.cpp
          0.7 kB
        5. MainWindow.h
          0.2 kB
        6. Qt-5.15_no_css.png
          Qt-5.15_no_css.png
          6 kB
        7. Qt-5.15_with_css.png
          Qt-5.15_with_css.png
          6 kB
        8. Qt-6.2_no_css.png
          Qt-6.2_no_css.png
          6 kB
        9. Qt-6.2_with_css.png
          Qt-6.2_with_css.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
            l3u Tobias Leupold
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes