Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Use QAction (c++) in QML Menu
Forum Updated to NodeBB v4.3 + New Features

Use QAction (c++) in QML Menu

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.4k 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.
  • L Offline
    L Offline
    lasmr
    wrote on last edited by
    #1

    Hi,

    I am adding a new view based in QML to an existing Qt(c++) project. In the original project I am using a list of QAction for adding a context menu to some QWidgets.

    Is there a way for using the existing actions in a Menu object in QML? Basically I don't want to redo all the existing work in QML.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      AFAIK, you need to use "QML action":http://qt-project.org/doc/qt-5/qml-qtquick-controls-action.html element. There was a plan to move QAction into QtGui in Qt 5, but it was not implemented in time, so now it has to wait for Qt 6.

      (Z(:^

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lasmr
        wrote on last edited by
        #3

        Thanks for the answer, I wanted to be sure that there is no other way :)

        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