Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Style a QFrame with CSS depending on the frameShape in Qt 6
QtWS25 Last Chance

Style a QFrame with CSS depending on the frameShape in Qt 6

Scheduled Pinned Locked Moved Unsolved Qt 6
3 Posts 2 Posters 448 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.
  • l3u_L Offline
    l3u_L Offline
    l3u_
    wrote on last edited by
    #1

    Using the Fusion style, both a QFrame with a HLine and VLine frameShape set are displayed as a 1px black line. Up to Qt 5.15, the appearance could be changed with style sheets. E.g. this made such a QFrame a gray line:

    QApplication application(argc, argv);
    application.setStyleSheet(QStringLiteral(
        // This prevents HLine and VLine QFrames to be a black line
        "QFrame[frameShape=\"4\"],"
        "QFrame[frameShape=\"5\"] { "
            "color: palette(Mid); "
        "}"));
    

    Using Qt 6, this setting seems to be ignored. I also tried to use some literal color like color: red or border: 1px solid red to see it's about the palette value, but the setting is still not applied. Leaving out the [frameShape=...] selector makes all QFrames being styled like the respective setting, so apparently, this is about the [frameShape=...] selector.

    I tried to use e.g. frameShape=\"0x0004\" and also e.g. frameShape=\"QFrame::HLine\". This also didn't work.

    According to the docs, the QFrame::Shape enum remains unchanged. Is this not implemented yet (I tried it with Qt 6.2.3), or does one have to access this in another way in Qt 6?

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

      Hi,

      Looks like you can reproduce that pretty easily.

      I would recommend checking the bug report system to see if it's something known and if not, please open a new report providing a minimal compilable example.

      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
      • l3u_L Offline
        l3u_L Offline
        l3u_
        wrote on last edited by l3u_
        #3

        Okay, so maybe, this is actually a bug or not implemented yet. I'll create a minimal compatible example (which is quite easy) and file a bug report.

        Thanks for the feedback!

        Edit: Here you are: https://bugreports.qt.io/browse/QTBUG-101877

        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