Results 1 to 2 of 2

Thread: Detect Clicks outside QML Window

  1. #1
    Join Date
    Jun 2012
    Posts
    58
    Thanks
    13
    Qt products
    Qt4

    Default Detect Clicks outside QML Window

    How do i detect clicks outside Window {} in QML ?

    Qt Code:
    1. Rectangle {
    2. id: topLevel
    3.  
    4. height: 400; width: 400
    5.  
    6. Window {
    7. id: windowObj
    8.  
    9. color: "blue"
    10. height: 200; width: 200
    11. onActiveChanged { console.trace() }
    12. }
    13.  
    14. Component.onCompleted: windowObj.visible = true
    15. }
    To copy to clipboard, switch view to plain text mode 

    Suppose I click on some part of topLevel outside windowObj.
    onActiveChanged works on Windows but not on MAC.


    {Using: QtQuick 2.1, QtQuick.Window 2.1, QML/Qt 5.2.0}

  2. #2
    Join Date
    Jan 2011
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Detect Clicks outside QML Window

    Hi,
    maybe i m wrong but in C++ you can grab mouse event, and catch them even if mouse is outside window. Maybe a similary think in QtQuick is possible. And you just test after if coordonate are outside the window.
    Sincerely

Similar Threads

  1. Detect if window is bigger than screen
    By qt_developer in forum Qt Programming
    Replies: 1
    Last Post: 5th June 2014, 17:36
  2. how to detect window resize event ?
    By phenoboy in forum Qt Programming
    Replies: 5
    Last Post: 17th June 2013, 04:04
  3. Replies: 2
    Last Post: 20th December 2010, 17:51
  4. Replies: 3
    Last Post: 12th May 2010, 13:11
  5. QMdiArea window needs two clicks to close
    By epsilon in forum Qt Programming
    Replies: 2
    Last Post: 2nd March 2010, 06:08

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.