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. Replicating double borders with QSS
QtWS25 Last Chance

Replicating double borders with QSS

Scheduled Pinned Locked Moved Solved General and Desktop
qssstylesheet
5 Posts 3 Posters 1.3k 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.
  • Q Offline
    Q Offline
    QueTeeHelper
    wrote on last edited by QueTeeHelper
    #1

    While messing around with stylesheets I came across an image of one which appears to be using double borders around some of the widgets.
    My curiosity got the better of me and now I must know what kind of magic this is!

    Take a close look at the QComboBox and QPushButton and you can see a dark grey border with an inner light grey border.

    I'm aware of the "outline" property, but that doesn't seem to work for anything but QPushButton; even then it's inconsistent.
    I've looked through all the QSS documentation, checked the git repo for this QSS, searched everywhere I could think of and I can't, for the life of me, figure out how this is achieved.

    My hunch is, this is more than just QSS:
    A) Subclassed widgets with custom paint implementation that paints the inner border.
    B) A widget inside a widget with no margins. (CustomCtrlFrame {border: 1px solid black;} CustomCtrlFrame QComboBox {border: 1px solid grey})
    C) Maybe it's a platform-specific style? But then how is it retaining the style with the QSS border applied?

    Suggestions?

    alt text
    https://github.com/Jorgen-VikingGod/Qt-Frameless-Window-DarkStyle

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      QueTeeHelper
      wrote on last edited by
      #2

      Never mind, looks like this hunch was correct.

      C) Maybe it's a platform-specific style? But then how is it retaining the style with the QSS border applied?

      Fusion style handles both borders and applying any sort of QSS will remove the styling entirely.
      The styling for these widgets appear to be handled entirely by style and palette.

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

        Hi,

        Currently, the style applying the style sheet replaces the application style completely for the concerned widget(s) so you have to do all the styling yourself in that case.

        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
        • D Offline
          D Offline
          Dariusz
          wrote on last edited by
          #4

          Re: Replicating double borders with QSS

          Is there any place where we can read fusion style/etc what/how does it do what so we can reproduce it in style?
          Its a bit of a pain now, when we want to keep 90% of the style of fusion and just change a background color or something.
          Ideas?

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

            You can read the class sources.

            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

            • Login

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