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. How to add a scrollbar to a Qcombobox
Qt 6.11 is out! See what's new in the release blog

How to add a scrollbar to a Qcombobox

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 2.8k 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.
  • S Offline
    S Offline
    semi
    wrote on last edited by
    #1

    i use python, and qt5, and qt designer. I want to add a scroll bar to the combo box. Any way to add a scrollbar using stylesheet? Other ways are also good. This is the stylesheet currently used in the combo box.
    QComboBox {
    combobox-popup: 0;
    }
    I use this because I want to show the drop down list in 10 order. There seems to be no more data below because there are no scrollbars at this time. If you know how, please help me. thanks!

    jsulmJ 1 Reply Last reply
    0
    • S semi

      i use python, and qt5, and qt designer. I want to add a scroll bar to the combo box. Any way to add a scrollbar using stylesheet? Other ways are also good. This is the stylesheet currently used in the combo box.
      QComboBox {
      combobox-popup: 0;
      }
      I use this because I want to show the drop down list in 10 order. There seems to be no more data below because there are no scrollbars at this time. If you know how, please help me. thanks!

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @semi Doesn't QComboBox add scroll bar automatically?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      VineelaV 1 Reply Last reply
      2
      • jsulmJ jsulm

        @semi Doesn't QComboBox add scroll bar automatically?

        VineelaV Offline
        VineelaV Offline
        Vineela
        wrote on last edited by
        #3

        @jsulm it has arrow at the top and end unless we click that arrow it scrolls but how to get scroll bar?????

        jsulmJ 1 Reply Last reply
        0
        • VineelaV Vineela

          @jsulm it has arrow at the top and end unless we click that arrow it scrolls but how to get scroll bar?????

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Vineela I don't understand the problem: if there are too many items in the combo box to show them all at the same time then the combo box adds a scroll bar automatically.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          2
          • K Offline
            K Offline
            Kogotoro
            wrote on last edited by
            #5

            Qt 5.11.1 (MSVC 2015, 32 bit)

            loading diffrent css
            with
            QComboBox { combobox-popup: 1 }
            and
            QComboBox { combobox-popup: 0 }
            one after another
            results crush when on form present editable combobox
            for not editable it work fine

            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