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 combobox into menubar
Forum Updated to NodeBB v4.3 + New Features

How to add combobox into menubar

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

    Hi
    I have desktop application and i also want to add combox into menubar for search items pleace anyone have solution pleace help me to solve that problem.

    Short idea ->Add combobox into menubar for implement serch item(items are fixed)

    thanks
    Diluka

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      Hi,

      you can use QMenuBar::addAction with QWidgetAction.

      Good Luck

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      0
      • H Offline
        H Offline
        Himanshu Rohilla
        wrote on last edited by
        #3

        Create search items as QAction and set them in QMenubar. After that, you can set true or false the Checkable property of QAction .

        HImanshu Rohilla

        1 Reply Last reply
        0
        • H Offline
          H Offline
          Himanshu Rohilla
          wrote on last edited by
          #4

          As mcosta has already said, you can use QWidgetAction.

          for example:-

          QComboBox *comboBox = new QComboBox(menu);
          QWidgetAction *checkableAction = new QWidgetAction(menu);
          checkableAction->setDefaultWidget(comboBox);
          menu->addAction(checkableAction);

          HImanshu Rohilla

          1 Reply Last reply
          0
          • D Offline
            D Offline
            Diluka
            wrote on last edited by
            #5

            Hi
            Thanks all of you,But any body can tell me if there any steps to do that use in QT Designer because i am use in VS 2008 .I try several ways but still not achieved that.(I use in QT Designer in VS 2008 for develop my application)

            Thanks

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mcosta
              wrote on last edited by
              #6

              Hi,
              at the moment you can't do this at design mode (QtDesigner) but I think you have to write code.

              Once your problem is solved don't forget to:

              • Mark the thread as SOLVED using the Topic Tool menu
              • Vote up the answer(s) that helped you to solve the issue

              You can embed images using (http://imgur.com/) or (http://postimage.org/)

              1 Reply Last reply
              0
              • D Offline
                D Offline
                Diluka
                wrote on last edited by
                #7

                Hi
                Thanks for reply .

                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