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. Timer to know how much time is the mouse not moving

Timer to know how much time is the mouse not moving

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

    Hi,

    I am working in a project where I need to move Rectangles, and drag them over other rectangles. Once they are overlapped, the rectangle that is not beeing dragged has to change its opacity.
    For the moment, I know how to drag a Rectangle and detect when it is over an other and change the opacity of the second one.
    The problem is that I would like to user to hold the draged rectangle a second over the other rectangle before it becomes transparent.
    Is there a way to put a timer on how much time is the mouse over the target rectangle (the one to become transparent) and trigger the opacity change after a second?

    Thank you :)

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      Have you already taken a look at the "Timer":http://qt-project.org/doc/qt-5.0/qtqml/qml-qtquick2-timer.html element? It can be used as a single-shot timer as well, activated once the Rectangles overlap and triggered after a second, reducing the opacity of the Rectangle.

      1 Reply Last reply
      0
      • E Offline
        E Offline
        excalibur1491
        wrote on last edited by
        #3

        Hi!
        First, thank you for the quick answer ^^
        Timer is just what I was looking for ;) I did what I wanted and I event put a little animation :)
        Thanks a lot.

        I have just a quick question about another thing, if you don't mind:
        How should I comment my QML files if I use doxygen documentation? I mean, what syntax should I use in order to make doxygen recognise it?

        thank you again ;)

        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