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. What are the rules for ordering pseudo-states?
Forum Update on Monday, May 27th 2025

What are the rules for ordering pseudo-states?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 174 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.
  • E Offline
    E Offline
    Esor
    wrote on last edited by
    #1

    I was surprised to find that the two snippets below gave different results, I thought order shouldn't matter, does it? I can't find docs on the order rules or understand why the second snippet is wrong, all I did was move :horizontal to be the first pseudo-state instead of second.

    a5a8516c-20e1-4065-8ede-5d9d2cb35626-image.png

    QScrollBar:horizontal {
        border: 2px solid grey;
        background: #32CC99;
        height: 15px;
        margin: 0px 20px 0 20px;
    }
    QScrollBar::handle:horizontal {
        background: white;
        min-width: 20px;
    }
    QScrollBar::add-line:horizontal {
        border: 2px solid grey;
        background: #32CC99;
        width: 20px;
        subcontrol-position: right;
        subcontrol-origin: margin;
    }
    
    QScrollBar::sub-line:horizontal {
        border: 2px solid grey;
        background: #32CC99;
        width: 20px;
        subcontrol-position: left;
        subcontrol-origin: margin;
    }
    

    0c178a12-10cf-4401-8509-e3ff295786b9-image.png

    QScrollBar:horizontal {
        border: 2px solid grey;
        background: #32CC99;
        height: 15px;
        margin: 0px 20px 0 20px;
    }
    QScrollBar:horizontal::handle {
        background: white;
        min-width: 20px;
    }
    QScrollBar:horizontal::add-line {
        border: 2px solid grey;
        background: #32CC99;
        width: 20px;
        subcontrol-position: right;
        subcontrol-origin: margin;
    }
    
    QScrollBar:horizontal::sub-line {
        border: 2px solid grey;
        background: #32CC99;
        width: 20px;
        subcontrol-position: left;
        subcontrol-origin: margin;
    }
    
    1 Reply Last reply
    0
    • B Offline
      B Offline
      Bonnie
      wrote on last edited by Bonnie
      #2

      This is a sub-control: ::handle.
      This is a pseudo-state: :horizontal.

      According to the documentation

      Pseudo-states appear at the end of the selector

      1 Reply Last reply
      4

      • Login

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