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. How to sub stylesheet ?
QtWS25 Last Chance

How to sub stylesheet ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qcomboboxqlistviewqcheckboxqstylestylesheet
5 Posts 2 Posters 2.6k 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.
  • _ Offline
    _ Offline
    _compiler
    wrote on last edited by _compiler
    #1
    QComboBox QListView::item {
        min-height: 24px;
    }
    

    working.

    QComboBox QListView QCheckBox::indicator {
        width: 14px;
        height: 14px;
        border : 1px solid rgb(200,200,200);
    } 
    

    not working .

    image

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by Chris Kawa
      #2

      Checkable items of a QListView are not derived from QCheckBox widget class. To style them use QListView::indicator instead of QListView QCheckBox::indicator.

      1 Reply Last reply
      0
      • _ Offline
        _ Offline
        _compiler
        wrote on last edited by _compiler
        #3

        @_compiler said:

        QListView QCheckBox::indicator {
        width: 14px;
        height: 14px;
        border : 1px solid rgb(200,200,200);
        }

        not working.

        All stylesheet

        QComboBox {
        border : 1px solid rgb(204,204,204);
        border-top : 3px solid;
        border-top-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(204, 204, 204, 255), stop:0.339795 rgba(204, 204, 204, 255), stop:0.339799 rgba(244, 244, 244, 255), stop:0.662444 rgba(244, 244, 244, 255), stop:0.662469 rgba(249, 249, 249, 255), stop:1 rgba(249, 249, 249, 255));
        border-left : 2px solid;
        border-left-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(204, 204, 204, 255), stop:0.495 rgba(204, 204, 204, 255), stop:0.505 rgba(249, 249, 249, 255), stop:1 rgba(249, 249, 249, 255));
        min-width: 7em;
        color: rgb(40, 40, 40);
        }
        
        QComboBox:!editable, QComboBox::drop-down:editable {
            
        	background-color: rgb(255, 255, 255);
        }
        
        QComboBox:!editable::hover
        {	
        border : 1px solid rgb(116,116,116);
        border-top : 3px solid;
        border-top-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(116,116,116, 255), stop:0.339795 rgba(116,116,116, 255), stop:0.339799 rgba(239, 239, 239, 255), stop:0.662444 rgba(239, 239, 239, 255), stop:0.662469 rgba(247, 247, 247, 255), stop:1 rgba(247, 247, 247, 255));
        border-left : 2px solid;
        	border-left-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(116,116,116, 255), stop:0.495 rgba(116,116,116, 255), stop:0.505 rgba(247, 247, 247, 255), stop:1 rgba(247, 247, 247, 255));
        }
        
        QComboBox:!editable::focus
        {	
        border : 1px solid rgb(77,144,254);
        border-top : 3px solid;
        border-top-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(77,144,254, 255), stop:0.339795 rgba(77,144,254, 255), stop:0.339799 rgba(239, 239, 239, 255), stop:0.662444 rgba(239, 239, 239, 255), stop:0.662469 rgba(247, 247, 247, 255), stop:1 rgba(247, 247, 247, 255));
        border-left : 2px solid;
        	border-left-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(77,144,254, 255), stop:0.495 rgba(77,144,254, 255), stop:0.505 rgba(247, 247, 247, 255), stop:1 rgba(247, 247, 247, 255));
        }
        
        QComboBox:!editable:on, QComboBox::drop-down:editable:on {
            
        	border : 1px solid rgb(77,144,254);
        border-top : 3px solid;
        border-top-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(77,144,254, 255), stop:0.339795 rgba(77,144,254, 255), stop:0.339799 rgba(239, 239, 239, 255), stop:0.662444 rgba(239, 239, 239, 255), stop:0.662469 rgba(247, 247, 247, 255), stop:1 rgba(247, 247, 247, 255));
        border-left : 2px solid;
        	border-left-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(77,144,254, 255), stop:0.495 rgba(77,144,254, 255), stop:0.505 rgba(247, 247, 247, 255), stop:1 rgba(247, 247, 247, 255));
        }
        
        QComboBox::drop-down {
            border: none;
        }
        
        QComboBox::down-arrow {
        image: url(:/down.png);
        }
        
        QComboBox::down-arrow:on {
        	image: url(:/active_down.png);
        }
        QComboBox QListView::item {
            min-height: 24px;
        }
        QListView::item:selected {
         color: black;
        	background-color: rgb(231, 231, 231);
        }
        QComboBox QAbstractItemView {outline: none;}
        
        QListView QCheckBox::indicator {
            width: 14px;
            height: 14px;
            border : 1px solid rgb(200,200,200);
        } 
        
        
        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          not working.

          Yes, and it won't. As I said: use QListView::indicator instead of QListView QCheckBox::indicator. Checkable items on a list are not QCheckBox.

          _ 1 Reply Last reply
          1
          • Chris KawaC Chris Kawa

            not working.

            Yes, and it won't. As I said: use QListView::indicator instead of QListView QCheckBox::indicator. Checkable items on a list are not QCheckBox.

            _ Offline
            _ Offline
            _compiler
            wrote on last edited by _compiler
            #5

            @_compiler said:

            thanks.

            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