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. MouseArea and WebEngine: Qt6 Bug?
Forum Updated to NodeBB v4.3 + New Features

MouseArea and WebEngine: Qt6 Bug?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmlwebenginemousearea
1 Posts 1 Posters 326 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.
  • W Offline
    W Offline
    Wikkie
    wrote on last edited by
    #1

    I have some QML code that is supposed to track whether the mouse is over a WebEngineView, with a similar intent as mentioned here.

    Except, my code is arranged the other way around: MouseArea wraps the WebEngineView, rather than having the WebEngineView wrap the MouseArea:

     MouseArea {
            anchors.fill: parent
            hoverEnabled: true
    
            onEntered: {
                main.title = "onEntered";
                console.log("##### onEntered");
            }
    
            onExited: {
                main.title = "onExited";
                console.log("##### onExited");
            }
    
            WebEngineView {
    
                x: 30
                y: 30
                width: parent.width-(x*2)
                height: parent.height-(x*2)
    
                url : "http://www.example.com"
    
            }
        }
    

    Now in Qt5 this works as expected: when you enter the MouseArea and keep moving across the MouseArea / WebEngineView, the only code that ever gets called here is onEnter.

    With Qt6 this is different: onEnter is called when the MouseArea is entered but here is the difference: as soon as the mouse moves over the WebEngineView, onExit gets called (and onEnter is called again when moving the mouse from the WebEngineView object over the MouseArea).

    It seems to me that the more correcter approach would be having the MouseArea inside the WebEngineView object, but then there is the still valid issue that all MouseArea events appear to be consumed as already mentioned in the other question.

    So here are two questions:

    • Is this a Qt 6 bug? If so, will it be fixed?
    • Isn't it more correct to rearrange the Obejcts that the MouseArea is inside the WebEngineView (in which case there should be a way to pass events through to the WebEngineView)?
    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