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. QComboBox Disable drop-down / popup ? (Drag-n-Drop)

QComboBox Disable drop-down / popup ? (Drag-n-Drop)

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 10.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
    Sam
    wrote on last edited by
    #1

    Is there anyway that I can disable the drop-down for QComboBox and enable it again. The requirement is like I want to disable the dropdown list while using drag events i.e startDrag(),dragMoveEvent() etc and enable it after the events/functionalities have been executed successfully.

    TIA

    1 Reply Last reply
    0
    • U Offline
      U Offline
      utcenter
      wrote on last edited by
      #2

      Setting enabled for the entire combo box to false doesn't do the trick?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sam
        wrote on last edited by
        #3

        [quote author="utcenter" date="1360560873"]Setting enabled for the entire combo box to false doesn't do the trick?[/quote]

        No, if I setEnabled(false) then I am not able to use drag-n-drop for the currentItem in the combo.Secondly the display/view of the combobox changes, i want to maintain the same efftect/display of the view and just want to disable the dropdown.

        PS :

        Found something like showPopup() and hidePopup() will check if this works.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Sam
          wrote on last edited by
          #4

          Okay one more question ,

          When i am trying to drag the combobox then the drag cursor changes like
          !http://img94.imageshack.us/img94/3415/mainwindow2013021111114.jpg(combo )!

          but for a QWidget the drag cursor looks like

          !http://img688.imageshack.us/img688/4761/gpsyd.jpg(widget cursor)!

          I did not explicitly change the dragCursor, then why do I get different outputs ? How to get the above dragCursor for comboBox?

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Sam
            wrote on last edited by
            #5

            Solved the above problem , I just forgot to use drag->setPixmap()

            :)

            1 Reply Last reply
            0
            • T Offline
              T Offline
              tzander
              wrote on last edited by
              #6

              I'm maybe over thinking this, and got a bit confused about your usecase. THe only way for a combobox to 'open' is to click on top of the combobox. You explicitly have to do your mouse-down inside the area of the combobox. This means that it should not open at all while dragging...

              What am I missing?

              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