import QtQuick import QtQuick.Controls Window { id: mainWindow visible: true width: 800 height: 600 title: qsTr("Minimal Example") // Bottom bar Rectangle { id: controlBar anchors.left: parent.left anchors.right: parent.right anchors.bottom: parent.bottom height: 50 color: "#312f2f" Row { anchors.centerIn: parent spacing: 20 Button { id: toggleOnTopButton text: "Toggle Always on Top" onClicked: { // Check if we're currently "always on top" if (mainWindow.flags & Qt.WindowStaysOnTopHint) { // Remove the "always on top" flag mainWindow.flags = mainWindow.flags & ~Qt.WindowStaysOnTopHint } else { // Add the "always on top" flag mainWindow.flags = mainWindow.flags | Qt.WindowStaysOnTopHint } } } } } }