I am using qt quick controls 2 SplitView
and it seems like any MouseArea
inside the SplitView
's item takes mouse events away from the SplitView
handle. This means that dragging the handle is not possible when the handle is over a component that has a MouseArea
, e.g. Button
, inside the SplitView
's item.
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.13
Window {
width: 640
height: 480
visible: true
title: qsTr("Hello World")
SplitView {
id: splitView
anchors.fill: parent
handle: Rectangle {
id: handle
implicitWidth: 20
color: "red"
}
Page {
id: firstPage
Button {
id: button
implicitWidth: 100
implicitHeight: 50
text: "button"
}
}
Page {
id: secondPage
}
}
}
Normal behaviour:
Button blocks mouse events from handle:
I tried setting the z value of splitView
and handle
greater than the z value of firstPage
and button
but that didn't work.
You have to active clip on page. I tested on a empty projet it work.:D I suppose the right side of loaded button under handle bar is still active. (if someone know precisely why leave a comment)