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. Qt.WindowTransparentForInput flag with TapHandler/MouseArea

Qt.WindowTransparentForInput flag with TapHandler/MouseArea

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 239 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.
  • N Offline
    N Offline
    necko1
    wrote on last edited by
    #1
    Is it possible to combine Qt.WindowTransparentForInput and TapHandler/MouseArea?

    I want to make it so that the user can interact with something behind the window and also so that the window can see when the user has pressed the mouse button.
    I know that Qt.WindowTransparentForInput literally disables this feature, but perhaps there is some other way around?

    my code that I tried to implement:

    import QtQuick
    import QtQuick.Window
    
    Window {
        visible: true
    
        width: Screen.desktopAvailableWidth
        height: Screen.desktopAvailableHeight
        flags: Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint | Qt.Window | Qt.WindowTransparentForInput
        color: "transparent"
    
        Component.onCompleted: {
            showFullScreen()
        }
    
        TapHandler {
            onTapped: close()
        }
    }
    

    It will work if I remove the "Transparent for input" flag, but this way I won't be able to interact with anything behind the window. (for the first click)

    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