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 give vertical scroll bar for combobox.
Forum Updated to NodeBB v4.3 + New Features

How to give vertical scroll bar for combobox.

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 4 Posters 2.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.
  • VineelaV Offline
    VineelaV Offline
    Vineela
    wrote on last edited by
    #1

    I've added number of days to my comboBox.addItems but how can i give or add vertical scroll bar so that it can easy to scroll for me.
    It is almost like this image shown below link please check for it .

    https://stackoverflow.com/questions/50789605/how-to-add-a-scrollbar-to-a-qcombobox

    VRoninV 1 Reply Last reply
    0
    • VineelaV Vineela

      I've added number of days to my comboBox.addItems but how can i give or add vertical scroll bar so that it can easy to scroll for me.
      It is almost like this image shown below link please check for it .

      https://stackoverflow.com/questions/50789605/how-to-add-a-scrollbar-to-a-qcombobox

      VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      @Vineela said in How to give vertical scroll bar for combobox.:

      It is almost like this image shown below link please check for it .

      The solution in your link should be correct

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      VineelaV 1 Reply Last reply
      1
      • VRoninV VRonin

        @Vineela said in How to give vertical scroll bar for combobox.:

        It is almost like this image shown below link please check for it .

        The solution in your link should be correct

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

        @VRonin clever one but this was my code when i added that
        ui->comboBox_13->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
        but it didn't work for me is there anything wrong in that.

        M 1 Reply Last reply
        0
        • VineelaV Vineela

          @VRonin clever one but this was my code when i added that
          ui->comboBox_13->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
          but it didn't work for me is there anything wrong in that.

          M Offline
          M Offline
          mvuori
          wrote on last edited by
          #4

          (Note that your question seems to have nothing particular to do with mobile or embedded devices, so it is on a wrong forum)

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

            Hi,

            Can you show how you populate your combobox ?

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

            VineelaV 1 Reply Last reply
            0
            • SGaistS SGaist

              Hi,

              Can you show how you populate your combobox ?

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

              @SGaist

              ui->comboBox_5->clear();
                ui->comboBox_5->addItems({ "mm" , "01", "02", "03", "04" , "05" , "06" , "07" , "08" , "09" , "10" ,"11" , "12" });
              
              

              just this.

              1 Reply Last reply
              0
              • VineelaV Offline
                VineelaV Offline
                Vineela
                wrote on last edited by
                #7

                well this one worked ...,

                QScroller::grabGesture(ui->comboBox_5->view()->viewport(),QScroller::LeftMouseButtonGesture);
                

                it didn't show scroll bar ,but i got the action like scroll when i touch it.

                By the way @VRonin ,@mvuori ,@SGaist thanks for your kind reply.

                1 Reply Last reply
                2

                • Login

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