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. Pop up menu QT
Forum Updated to NodeBB v4.3 + New Features

Pop up menu QT

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 478 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.
  • H Offline
    H Offline
    HenkCoder
    wrote on last edited by
    #1

    Hey everyone, I'm currently trying to make a notepad in Qt. I want to put a pop up menu to my button like this:
    7b865ad2-c494-449f-aa6a-af69cebdb000-image.png
    Sorry if it's in italian.
    How can I do this in my Qt project?

    raven-worxR 1 Reply Last reply
    0
    • H HenkCoder

      Hey everyone, I'm currently trying to make a notepad in Qt. I want to put a pop up menu to my button like this:
      7b865ad2-c494-449f-aa6a-af69cebdb000-image.png
      Sorry if it's in italian.
      How can I do this in my Qt project?

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #5

      @HenkCoder
      Alternative:

      QWidget* popup = new QWidget( button, Qt::Popup );
      // position popup in screen coordinates
      QPoint popupTopLeft = button->mapToGlobal(rect.bottomLeft());
      popup->setGeometry(QRect(popupTopLeft , QSize(300,100)));
      popup->show();
      

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Use a QToolButton and add the actions your want.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        H 1 Reply Last reply
        1
        • Christian EhrlicherC Christian Ehrlicher

          Use a QToolButton and add the actions your want.

          H Offline
          H Offline
          HenkCoder
          wrote on last edited by
          #3

          @Christian-Ehrlicher
          And how do I do that?

          1 Reply Last reply
          0
          • Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #4

            @HenkCoder said in Pop up menu QT:

            And how do I do that?

            What exactly? What did you try? Create a QToolBar, add a QToolButton and to this button add the actions you want.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            0
            • H HenkCoder

              Hey everyone, I'm currently trying to make a notepad in Qt. I want to put a pop up menu to my button like this:
              7b865ad2-c494-449f-aa6a-af69cebdb000-image.png
              Sorry if it's in italian.
              How can I do this in my Qt project?

              raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #5

              @HenkCoder
              Alternative:

              QWidget* popup = new QWidget( button, Qt::Popup );
              // position popup in screen coordinates
              QPoint popupTopLeft = button->mapToGlobal(rect.bottomLeft());
              popup->setGeometry(QRect(popupTopLeft , QSize(300,100)));
              popup->show();
              

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              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