Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Width of arrows for ComboBox dropdown list
Forum Updated to NodeBB v4.3 + New Features

Width of arrows for ComboBox dropdown list

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 2 Posters 4.1k 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.
  • G Offline
    G Offline
    GregWilsonLindberg
    wrote on last edited by
    #1

    I'm working with a program running on a BeagleBone Black using QT4.8.4 and QtCreator 2.7.1. The system has a 5.7" touch screen on it and I'm needing to make all of my widgets larger so that they work on the touch screen.
    I've figured out how to increase the size of the arrow to the right in the ComboBox, but I don't know how to increase the size of the arrows in the drop down list when you click on the ComboBox.

    Here is the Style Sheet fragment for the Combo Box:
    @
    QComboBox {
    border: 1px solid gray;
    border-radius: 6px;
    }

    QComboBox::drop-down {
    width: 50;
    }
    @

    This gets me a wide down arrow for the unselected ComboBox. When I touch the element in the ComboBox, the list pops up below the ComboBox with three narrow arrows on the right side, I would like to make those arrows 50 pixels wide also.

    Anybody know what the magic incantation is the will allow me to widen the drop down list arrows?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      If I'm not mistaken you need to style QScrollBar for your QComboBox.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • G Offline
        G Offline
        GregWilsonLindberg
        wrote on last edited by
        #3

        Hi SGaist,
        You are right, it is the QScrollBar that needs customizing, min-width, & margin.

        Now do you know how to get the pop list to be longer? I only get a list with 2 elements in it, about the height that I have the ComboBox set to. I've got 17 elements in the Combo Box and there is much more room on the display for the popup to get longer. The "Style Sheet Example":http://qt-project.org/doc/qt-4.8/stylesheet-examples.html#customizing-qcombobox says that the popup is an QAbstractItemView, but there isn't really anything on what can be customized.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Try playing with setMaxVisibleItems

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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