Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. how to add qaction to the menu in qtoolbar
Forum Updated to NodeBB v4.3 + New Features

how to add qaction to the menu in qtoolbar

Scheduled Pinned Locked Moved Unsolved Qt for Python
17 Posts 5 Posters 3.9k 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.
  • M Offline
    M Offline
    Mikeeeeee
    wrote on last edited by
    #6

    How can I get this menu from the toolBar and add QAction to it?

    JonBJ 1 Reply Last reply
    -1
    • M Mikeeeeee

      How can I get this menu from the toolBar and add QAction to it?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #7

      @Mikeeeeee
      Is that not exactly what the stackoverflow post I pointed you to addresses?

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

        @JonB said in how to add qaction to the menu in qtoolbar:

        Is that not exactly what the stackoverflow post I pointed you to addresses?

        That's not it. I already have a menu in the toolbar. The menu is created automatically. How can I get a pointer to a menu and add qaction to it?

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

          Hi,

          What do you have currently in that drop down menu ?
          How are your initialization that toolbar ?
          What exactly is your goal with these additional actions ?

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

          1 Reply Last reply
          0
          • M Offline
            M Offline
            Mikeeeeee
            wrote on last edited by
            #10

            Now the menu has change the visibility of the toolbar and dockwidget. I want to add the visibility of other dockwidgets.

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

              Then add the the other dock widgets toggle actions to it.

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

              1 Reply Last reply
              0
              • M Offline
                M Offline
                Mikeeeeee
                wrote on last edited by
                #12

                How can I do this?

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

                  The same way you did for the other dock widget.

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

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    Mikeeeeee
                    wrote on last edited by
                    #14

                    It's impossible. What else can you do??

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

                      Well, something different.

                      Seriously, how do you except to get an answer when you do not show your code, do not explain what you tried, in fact just nothing ?

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

                      1 Reply Last reply
                      1
                      • M Offline
                        M Offline
                        Mikeeeeee
                        wrote on last edited by
                        #16

                        I don't show my code because my code isn't there. I put widgets in the designer and the menu appeared automatically. Now I need to get a pointer to this menu.

                        JonBJ 1 Reply Last reply
                        0
                        • M Mikeeeeee

                          I don't show my code because my code isn't there. I put widgets in the designer and the menu appeared automatically. Now I need to get a pointer to this menu.

                          JonBJ Offline
                          JonBJ Offline
                          JonB
                          wrote on last edited by JonB
                          #17

                          @Mikeeeeee said in how to add qaction to the menu in qtoolbar:

                          the menu appeared automatically

                          This is not magic. You can learn an awful lot by looking at the code generated into the ui....h file (in the debug output folder) from uic. Hopefully you will see how this menu is generated, and how you might access it.

                          1 Reply Last reply
                          1

                          • Login

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