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. Weird QComboBox navigation arrows
Forum Updated to NodeBB v4.3 + New Features

Weird QComboBox navigation arrows

Scheduled Pinned Locked Moved General and Desktop
9 Posts 2 Posters 3.9k 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.
  • K Offline
    K Offline
    kegon
    wrote on last edited by
    #1

    Hi, I am using Qt 5.2.0 on a Mac.

    Sometimes when I click on a QComboBox it shows only a single item, with a thick frame including scroll arrows in the centre top and bottom. If you click on the scroll arrows you can navigate to the other options but this looks very strange on a Mac (I have never seen it in other software). When I say scroll arrows I don't mean QComboBox::drop-down.

    I guess that this feature is meant for very large QComboBoxes that wouldn't fit on the screen, but this happens even when there are only 2 or 3 options. I want to disable this feature because it hides the other options.

    Thanks in advance for any suggestions.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kegon
      wrote on last edited by
      #2

      Here are some images of a QComboBox with 3 items:

      http://imgur.com/lP0AeRL

      There are 2 images at this URL. You can see the normal state; then if I click on the widget I get the arrows.

      Edit: the second image showing the unclicked widget is here http://imgur.com/7fFYwO0

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

        Hi,

        Can you provide a minimal code example that shows the behavior ?

        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
        • K Offline
          K Offline
          kegon
          wrote on last edited by
          #4

          I'm not using this widget in any special way, it's just a regular QComboBox. The only customisation is CSS, I removed the colour information:

          @
          QComboBox {
          font-size: 11px;
          margin: 0px;
          padding: 0px 6px 0px 6px;
          border: 1px solid #000;
          border-radius: 4px;
          }
          QComboBox::drop-down {
          subcontrol-origin: padding;
          subcontrol-position: top right;
          width: 20px;
          border: 0px
          }
          QComboBox::on {
          border: 1px solid #000;
          border-radius: 4px;
          }
          QComboBox::checked {
          border: 0px;
          }
          QComboBox::down-arrow {
          image: url(:/Icons/combo-updown-arrow.png);
          }
          QComboBox::down-arrow:disabled {
          image: url(:/Icons/combo-updown-arrow-disabled.png);
          }
          QComboBox QAbstractItemView {
          border: 2px solid gray;
          border-radius: 4px;
          margin: 0px;
          padding: 1px;
          outline: none;
          }
          QComboBox QAbstractItemView::item {
          border: 0px;
          }
          QComboBox QAbstractItemView::item:selected {
          border: 0px;
          }
          @

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

            All in all, it's a pretty big CSS that changes a lot of things.

            It's not the same style that is used to paint the combo box which could explain the look and feel difference.

            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
            • K Offline
              K Offline
              kegon
              wrote on last edited by
              #6

              bq. which could explain the look and feel difference.

              I've never seen arrows like that on any other Mac application or with Qt.

              I never encountered them when I was using Qt 4.x or Qt 3.x

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

                Using this style sheet ?

                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
                • K Offline
                  K Offline
                  kegon
                  wrote on last edited by
                  #8

                  Using this style sheet on 4.x and I believe using 5.0.x.

                  At some stage of Qt 5's development I noticed that these arrows would appear.

                  Actually, sometimes they don't, even with Qt 5.2.0. When I was trying to make the screenshot at the top of the post they stopped appearing. I hadn't changed the window size.

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

                    Can you provide a minimal sample code ? Even it's only a standard QComboBox with some data in, that will ensure that everybody is testing with the same base

                    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