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. [SOLVED]QSS for changing the width of the drop-down button
QtWS25 Last Chance

[SOLVED]QSS for changing the width of the drop-down button

Scheduled Pinned Locked Moved General and Desktop
qssqdateeditdrop-downpopupwidget
9 Posts 3 Posters 7.9k 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.
  • A Offline
    A Offline
    Aaron Hou
    wrote on 3 Aug 2015, 03:22 last edited by Aaron Hou 8 May 2015, 06:23
    #1

    Hello everyone, I want to know that how to change the width of the ComboBox ArrowButton with qss, when I set the QDateEdit's property "calendarPopup" checked? Just like the pic:
    link text
    Thank you!

    V 1 Reply Last reply 3 Aug 2015, 05:05
    0
    • A Aaron Hou
      3 Aug 2015, 03:22

      Hello everyone, I want to know that how to change the width of the ComboBox ArrowButton with qss, when I set the QDateEdit's property "calendarPopup" checked? Just like the pic:
      link text
      Thank you!

      V Offline
      V Offline
      Vitek
      wrote on 3 Aug 2015, 05:05 last edited by Vitek 8 Mar 2015, 05:06
      #2

      @arrowhou There is no picture in your message.

      A 1 Reply Last reply 3 Aug 2015, 05:36
      0
      • V Vitek
        3 Aug 2015, 05:05

        @arrowhou There is no picture in your message.

        A Offline
        A Offline
        Aaron Hou
        wrote on 3 Aug 2015, 05:36 last edited by
        #3

        @Vitek I don't know how to attatch a picture, but you can click the link and see the picture.
        Thank you!

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on 3 Aug 2015, 06:31 last edited by Chris Kawa 8 Mar 2015, 06:32
          #4

          You can style the drop down button with QComboBox::drop-down sub-control and the arrow inside it with QComboBox::down-arrow. Here's an example: Customizing QComboBox.

          A 1 Reply Last reply 3 Aug 2015, 09:52
          1
          • C Chris Kawa
            3 Aug 2015, 06:31

            You can style the drop down button with QComboBox::drop-down sub-control and the arrow inside it with QComboBox::down-arrow. Here's an example: Customizing QComboBox.

            A Offline
            A Offline
            Aaron Hou
            wrote on 3 Aug 2015, 09:52 last edited by
            #5

            @Chris-Kawa Yes, it can affect the common QComboBox, but it can not change the display of the drop-down button in the QDateEdit.

            1 Reply Last reply
            0
            • C Offline
              C Offline
              Chris Kawa
              Lifetime Qt Champion
              wrote on 3 Aug 2015, 10:57 last edited by
              #6

              Ah yes, sorry. It seems QDateEdit::drop-down respects some of the properties but not width :/
              If you're changing the background color or borders too then you might get away with adjusting margins, at least for a visual effect.
              But in general this seems to be a bug so I'd consider reporting it on the bug-tracker.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                Aaron Hou
                wrote on 5 Aug 2015, 06:20 last edited by
                #7

                Thank you very much!
                I have accomplished it with qss myself!

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  Chris Kawa
                  Lifetime Qt Champion
                  wrote on 5 Aug 2015, 06:25 last edited by
                  #8

                  Great. Can you share how?

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    Aaron Hou
                    wrote on 6 Aug 2015, 05:28 last edited by SGaist 8 Jun 2015, 21:32
                    #9

                    Certainly, but I don't know how to insert code. They are just like this:

                    QDateEdit{
                            border-radius: 5px;
                            padding: 1px 10px 1px 5px;
                            border: 1px solid #5CACEE;
                            min-height: 30px;
                    }
                    
                    QDateEdit::drop-down {
                    	subcontrol-origin: padding;
                    	subcontrol-position: top right;
                    	**width: 35px; **
                    	border-left-width: 1px;
                    	border-left-style: solid;
                    	border-top-right-radius: 3px;
                    	border-bottom-right-radius: 3px;
                    	border-left-color: #5CACEE;
                    }
                    
                    QDateEdit::down-arrow {
                      border-image: url(:/Resources/array_down.png);
                    	height:30px;
                    	width:30px;
                    }
                    

                    [edit: added missing coding tags ``` SGaist]

                    1 Reply Last reply
                    0

                    9/9

                    6 Aug 2015, 05:28

                    • Login

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