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. Converting Middle Click to Left Click
Forum Updated to NodeBB v4.3 + New Features

Converting Middle Click to Left Click

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 318 Views
  • 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.
  • J Offline
    J Offline
    Jhorns2
    wrote on last edited by Jhorns2
    #1

    My application is desktop, not mobile. This kind of behavior is possible with widgets and the QGraphicsScene but I was really hoping to use QML for this.

    From my search of these forums, I'm seeing this may be an open issue that is long standing but I'm hoping someone has an elegant solution using only QML. I have a lot of experience with C++/QML interop but I was really hoping to avoid anything but pure QML to achieve this.

    I am using a flickable surface. I want to be able to place items on this surface and to move them around. It's going to be a large area (much of it will be off screen at any one time) that can be flicked through by pressing and holding the middle mouse button and flicking, zoomed in and out (two dimensions), and used to select and manipulate items (drag them around).

    Flickable takes mouse press events and responds to them. I can only think of a few ways to achieve what I want. I can try to subclass Flickable and override the event handlers, but I wanted to avoid it.

    The way that I would prefer to do it, even though it seems hackish to me as well, would be to put a mouseArea over the flickable, detect a middle press and translate that to a left press (Flickable seems only to "flick" on left press).

    The ideal way would be to have a handler defined in QML that detected presses and be able to translate the event right there. That seems like a pipe dream, though.

    Can anyone make a suggestion? Thanks.

    binitafelicityB 1 Reply Last reply
    0
    • J Jhorns2

      My application is desktop, not mobile. This kind of behavior is possible with widgets and the QGraphicsScene but I was really hoping to use QML for this.

      From my search of these forums, I'm seeing this may be an open issue that is long standing but I'm hoping someone has an elegant solution using only QML. I have a lot of experience with C++/QML interop but I was really hoping to avoid anything but pure QML to achieve this.

      I am using a flickable surface. I want to be able to place items on this surface and to move them around. It's going to be a large area (much of it will be off screen at any one time) that can be flicked through by pressing and holding the middle mouse button and flicking, zoomed in and out (two dimensions), and used to select and manipulate items (drag them around).

      Flickable takes mouse press events and responds to them. I can only think of a few ways to achieve what I want. I can try to subclass Flickable and override the event handlers, but I wanted to avoid it.

      The way that I would prefer to do it, even though it seems hackish to me as well, would be to put a mouseArea over the flickable, detect a middle press and translate that to a left press (Flickable seems only to "flick" on left press).

      The ideal way would be to have a handler defined in QML that detected presses and be able to translate the event right there. That seems like a pipe dream, though.

      Can anyone make a suggestion? Thanks.

      binitafelicityB Offline
      binitafelicityB Offline
      binitafelicity
      Banned
      wrote on last edited by
      #2
      This post is deleted!
      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