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. How to show Context menu in Desktop QML
Forum Updated to NodeBB v4.3 + New Features

How to show Context menu in Desktop QML

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 3.7k 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.
  • P Offline
    P Offline
    psbhardwaj09gmail.com
    wrote on last edited by
    #1

    Hi,

    I am following Christophe Dumez("http://cdumez.blogspot.in/2010/11/how-to-use-c-list-model-in-qml.html") in my application.
    Now i want to display context menu in my QML. And item in context menu will be condition based e.g. if i click left button then there is only one item("One Item") & if i click right button then there will be two items("One Item ", Two Item). So can you please suggest me how to make context menu in my QML.(Provide me any example link)

    Pardeep Sharma

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alizadeh91
      wrote on last edited by
      #2

      Hi,
      That's not so hard to implement it. Write your own custom context menu (an item with some buttons put them in column and also you can implement mouse hover for buttons) then in mouse area of qml, implement right and left click to show your desired context menu.

      1 Reply Last reply
      0
      • P Offline
        P Offline
        psbhardwaj09gmail.com
        wrote on last edited by
        #3

        Hi,
        I am able to display context menu, but my question is that how to show context menu condition based as i wrote in first post?

        Pardeep Sharma

        1 Reply Last reply
        0
        • A Offline
          A Offline
          alizadeh91
          wrote on last edited by
          #4

          in mouse area base on which mouse button clicks (left or right click)you can emit a signal or change a property, after that you can bind this property to show your favorite context menu. That's so easy , am i clear?

          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