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. QSpinBox arrow buttons blank
QtWS25 Last Chance

QSpinBox arrow buttons blank

Scheduled Pinned Locked Moved General and Desktop
qspinbox
2 Posts 2 Posters 3.2k 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.
  • M Offline
    M Offline
    Moschops
    wrote on 17 Jul 2015, 16:05 last edited by Moschops
    #1

    I have a delegate, derived from a QAbstractItemDelegate, that provides a QSpinBox.

    When that QSpinBox is displayed, the up/down buttons are there, but they are blank. On the windows version, they have little arrow heads on them, so I'm guessing this is some kind of preference gathered from my Linux desktop.

    I really want the arrow heads to be there. I tried QSpinBox::setButtonSymbols, but it made no difference. How can I make the arrow heads appear on the buttons?

    I found a way to do it with style sheets, but it seems I can only apply one style at a time. By which I mean, if I do this:

    editor->setStyleSheet("QSpinBox::up-arrow {  width: 7px;  height: 7px; }");
    editor->setStyleSheet("QSpinBox::down-arrow {  width: 10px;  height: 7px; }");
    

    I get just the down arrow

    If I do this:

    editor->setStyleSheet("QSpinBox::down-arrow {  width: 10px;  height: 7px; }");
    editor->setStyleSheet("QSpinBox::up-arrow {  width: 7px;  height: 7px; }");
    

    I get just the up arrow.

    I want the up arrow AND the down arrow, but I can't find in the documentation how to apply both at the same time. What's the stylesheet string format to put the QSpinBox::down-arrow and the QSpinBox::up-arrow in at the same time?

    I'm also trying to use the stylesheet to set the size of the QSpinBox, but I'll be happy for the moment with just both arrows visible at the same time.

    V 1 Reply Last reply 17 Jul 2015, 17:27
    0
    • M Moschops
      17 Jul 2015, 16:05

      I have a delegate, derived from a QAbstractItemDelegate, that provides a QSpinBox.

      When that QSpinBox is displayed, the up/down buttons are there, but they are blank. On the windows version, they have little arrow heads on them, so I'm guessing this is some kind of preference gathered from my Linux desktop.

      I really want the arrow heads to be there. I tried QSpinBox::setButtonSymbols, but it made no difference. How can I make the arrow heads appear on the buttons?

      I found a way to do it with style sheets, but it seems I can only apply one style at a time. By which I mean, if I do this:

      editor->setStyleSheet("QSpinBox::up-arrow {  width: 7px;  height: 7px; }");
      editor->setStyleSheet("QSpinBox::down-arrow {  width: 10px;  height: 7px; }");
      

      I get just the down arrow

      If I do this:

      editor->setStyleSheet("QSpinBox::down-arrow {  width: 10px;  height: 7px; }");
      editor->setStyleSheet("QSpinBox::up-arrow {  width: 7px;  height: 7px; }");
      

      I get just the up arrow.

      I want the up arrow AND the down arrow, but I can't find in the documentation how to apply both at the same time. What's the stylesheet string format to put the QSpinBox::down-arrow and the QSpinBox::up-arrow in at the same time?

      I'm also trying to use the stylesheet to set the size of the QSpinBox, but I'll be happy for the moment with just both arrows visible at the same time.

      V Offline
      V Offline
      Vitek
      wrote on 17 Jul 2015, 17:27 last edited by Vitek
      #2

      @Moschops
      Try it together

      spinBox->setStyleSheet("QSpinBox::up-arrow {  width: 7px;  height: 7px; }"
                           "QSpinBox::down-arrow {  width: 10px;  height: 7px; }");
      
      1 Reply Last reply
      0

      1/2

      17 Jul 2015, 16:05

      • Login

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