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. Qt ComboBox in Menu View Question
QtWS25 Last Chance

Qt ComboBox in Menu View Question

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 4.2k 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.
  • N Offline
    N Offline
    needhelp_gh
    wrote on last edited by
    #1

    Hi,

    I was wondering if it is possible to create a qcombobox with a menu view?

    Please see image of what I mean:

    !http://doc.qt.nokia.com/4.7-snapshot/images/menus-example.png(menu)!

    I want a combobox with sublevels like the Edit menu.

    Please let me know if this is unclear. Thanks in advanced!!


    http://abstrusegoose.com/432

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DerManu
      wrote on last edited by
      #2

      Do you mean a real QComboBox as widget inside a QAction or just a submenu?
      The submenu can be created easily with QMenu::addMenu(), see docs

      1 Reply Last reply
      0
      • N Offline
        N Offline
        needhelp_gh
        wrote on last edited by
        #3

        I wanted to have a hierarchical QComboBox with sub levels

        ex:

        combobox has items:

        test1
        test1.1
        test1.2
        test1.3
        test2
        test3

        I tried to setView to a tree view, but it wasn't exactly what I wanted...I want more of a menu style.


        http://abstrusegoose.com/432

        1 Reply Last reply
        0
        • D Offline
          D Offline
          DerManu
          wrote on last edited by
          #4

          Ahh okay, now I understand... But I'm afraid I can't help much. Of course there's always the possibility to just hack (subclass) QComboBox (or a QLineEdit) to just show a popup menu aligned with the widget so the impression to a regular combobox is similar.

          1 Reply Last reply
          0
          • N Offline
            N Offline
            needhelp_gh
            wrote on last edited by
            #5

            By popup menu,

            do you mean something like this:

            !http://images.ntwind.com/winsnap3/vlc-menu.png(popup)!


            http://abstrusegoose.com/432

            1 Reply Last reply
            0
            • D Offline
              D Offline
              DerManu
              wrote on last edited by
              #6

              yes, exactly.

              1 Reply Last reply
              0
              • N Offline
                N Offline
                needhelp_gh
                wrote on last edited by
                #7

                That sounds good if there are no other solutions.

                Thanks for your help, DerManu!


                http://abstrusegoose.com/432

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  Mammamia
                  wrote on last edited by
                  #8

                  Does any one implemented this feature for the QComboBox... Currently i am looking for the same solution.

                  "My Post":http://qt-project.org/forums/viewthread/41627/#172610

                  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