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. Styling of QComboBox Arrow
Forum Updated to NodeBB v4.3 + New Features

Styling of QComboBox Arrow

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 6.2k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    sp3x
    wrote on last edited by sp3x
    #1

    Hello at all,

    is it possible to change the size of the Dropdown-Arrow image inside of the element? It will always expand to the complete size of the element. With padding it wont work as expected.

    QComboBox::down-arrow {
        image: url(://img/icons/white/arrow-down-circle.svg);
        width: 36px;
        height: 36px;
        background-color: red;
    }
    

    Thats how it looks like with the above spectified code:
    bf103f6a-636e-43a2-8d3f-2e55c4252350-image.png

    And thats how it should look like:
    ecfae73a-1e88-46d0-9ef2-a57eab5242f5-image.png

    With QComboBox::drop-down:button its working but I need to style the disabled state also and QComboBox::drop-down:button:disabled wont work.

    Thanks for your replys. Kind regards

    S 2 Replies Last reply
    0
    • S sp3x

      Hello at all,

      is it possible to change the size of the Dropdown-Arrow image inside of the element? It will always expand to the complete size of the element. With padding it wont work as expected.

      QComboBox::down-arrow {
          image: url(://img/icons/white/arrow-down-circle.svg);
          width: 36px;
          height: 36px;
          background-color: red;
      }
      

      Thats how it looks like with the above spectified code:
      bf103f6a-636e-43a2-8d3f-2e55c4252350-image.png

      And thats how it should look like:
      ecfae73a-1e88-46d0-9ef2-a57eab5242f5-image.png

      With QComboBox::drop-down:button its working but I need to style the disabled state also and QComboBox::drop-down:button:disabled wont work.

      Thanks for your replys. Kind regards

      S Offline
      S Offline
      sp3x
      wrote on last edited by sp3x
      #3

      @sp3x

      QComboBox::drop-down:button{
      	background-color: red;
      	width: 36px;
      }
      
      QComboBox::down-arrow {
          image: url(://img/icons/white/arrow-down-circle.svg);
          width: 26px;
          height: 24px;
      	background-color: red;
      	padding: 5px;
      }
      
      QComboBox::down-arrow:disabled {
      	background-color: #CCC;
      }
      

      Thats working. Styling :button flattens the button. And then settings the height and width with matching padding, resizes the down-arrow field over the button field.

      1 Reply Last reply
      0
      • S sp3x

        Hello at all,

        is it possible to change the size of the Dropdown-Arrow image inside of the element? It will always expand to the complete size of the element. With padding it wont work as expected.

        QComboBox::down-arrow {
            image: url(://img/icons/white/arrow-down-circle.svg);
            width: 36px;
            height: 36px;
            background-color: red;
        }
        

        Thats how it looks like with the above spectified code:
        bf103f6a-636e-43a2-8d3f-2e55c4252350-image.png

        And thats how it should look like:
        ecfae73a-1e88-46d0-9ef2-a57eab5242f5-image.png

        With QComboBox::drop-down:button its working but I need to style the disabled state also and QComboBox::drop-down:button:disabled wont work.

        Thanks for your replys. Kind regards

        S Offline
        S Offline
        sp3x
        wrote on last edited by
        #2

        @sp3x Another question I want to ask is, where are all the possible css options documented in the Qt Docs related to their widgets?

        I.e. where can I get further infos about QComboBox::drop-down:button?

        Pl45m4P 1 Reply Last reply
        0
        • S sp3x

          Hello at all,

          is it possible to change the size of the Dropdown-Arrow image inside of the element? It will always expand to the complete size of the element. With padding it wont work as expected.

          QComboBox::down-arrow {
              image: url(://img/icons/white/arrow-down-circle.svg);
              width: 36px;
              height: 36px;
              background-color: red;
          }
          

          Thats how it looks like with the above spectified code:
          bf103f6a-636e-43a2-8d3f-2e55c4252350-image.png

          And thats how it should look like:
          ecfae73a-1e88-46d0-9ef2-a57eab5242f5-image.png

          With QComboBox::drop-down:button its working but I need to style the disabled state also and QComboBox::drop-down:button:disabled wont work.

          Thanks for your replys. Kind regards

          S Offline
          S Offline
          sp3x
          wrote on last edited by sp3x
          #3

          @sp3x

          QComboBox::drop-down:button{
          	background-color: red;
          	width: 36px;
          }
          
          QComboBox::down-arrow {
              image: url(://img/icons/white/arrow-down-circle.svg);
              width: 26px;
              height: 24px;
          	background-color: red;
          	padding: 5px;
          }
          
          QComboBox::down-arrow:disabled {
          	background-color: #CCC;
          }
          

          Thats working. Styling :button flattens the button. And then settings the height and width with matching padding, resizes the down-arrow field over the button field.

          1 Reply Last reply
          0
          • S sp3x has marked this topic as solved on
          • S sp3x

            @sp3x Another question I want to ask is, where are all the possible css options documented in the Qt Docs related to their widgets?

            I.e. where can I get further infos about QComboBox::drop-down:button?

            Pl45m4P Offline
            Pl45m4P Offline
            Pl45m4
            wrote on last edited by
            #4

            @sp3x said in Styling of QComboBox Arrow:

            where can I get further infos about QComboBox::drop-down:button?

            Here

            • https://doc.qt.io/qt-6/stylesheet-examples.html#customizing-qcombobox

            In general, the standard CSS syntax is used (for colors, keywords like background and so on).


            If debugging is the process of removing software bugs, then programming must be the process of putting them in.

            ~E. W. Dijkstra

            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