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. Button in MenuBar

Button in MenuBar

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 753 Views 2 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.
  • P Offline
    P Offline
    PavloPonomarov
    wrote on last edited by PavloPonomarov
    #1

    Hello,
    In the app I develop I have a usual MenuBar with such dropdowns as File, Edit, etc. I need to place active button near those dropdowns on the highest level. I can't use Action as it is not supported in MenuBar component. I found out that MenuBarItem has onTriggered event and it works great for me, but there is one little problem - after click event focus stays in MenuBar. In this case if I move my mouse left and right other menu items will be selected and their submenus shown. Tried to solve it with code setting focus to false, but it didn't solve the problem.
    Could you help me to find a way how to unfocus clicked MenuBarItem or maybe there is any other MenuBar component that can be used as a Button?

    Pl45m4P 1 Reply Last reply
    0
    • P PavloPonomarov

      Hello,
      In the app I develop I have a usual MenuBar with such dropdowns as File, Edit, etc. I need to place active button near those dropdowns on the highest level. I can't use Action as it is not supported in MenuBar component. I found out that MenuBarItem has onTriggered event and it works great for me, but there is one little problem - after click event focus stays in MenuBar. In this case if I move my mouse left and right other menu items will be selected and their submenus shown. Tried to solve it with code setting focus to false, but it didn't solve the problem.
      Could you help me to find a way how to unfocus clicked MenuBarItem or maybe there is any other MenuBar component that can be used as a Button?

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @PavloPonomarov said in Button in MenuBar:

      I can't use Action as it is not supported in MenuBar component

      Why not? (https://doc.qt.io/qt-5/qmenubar.html#addAction)


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      1
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi
        MenuBarItem ?
        Is it QML ?

        P 1 Reply Last reply
        2
        • mrjjM mrjj

          Hi
          MenuBarItem ?
          Is it QML ?

          P Offline
          P Offline
          PavloPonomarov
          wrote on last edited by
          #4

          @mrjj
          Yes!
          Sorry, should have wrote about it

          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