如何使光标"True Transparent"窗口,最好是在纯QML上?(Qt 5.7)
How to make a "True Transparent" window to cursor, preferably on a pure QML? (Qt 5.7)
" true透明度"解释(图像,76kb)。
在该图像上 applicationWindow 具有视觉透明层。但是实际上,光标不会转到 applicationWindow 后面的窗口(在这种情况下 - QT创建者)。
如果添加(uncommunt)" qt.windowtransparentforinput"标志,则可以实现" true透明度",但是按钮不再可用(很明显,我知道)。
我尝试了具有相似含义的各种标志(来自文档),但没有找到工作组合 - 当它位于窗口的边界内时,光标一直处于"默认"状态(必须在"文本"状态中,因为那是下面的文本)。
有人面对类似问题吗?您是否找到了解决方案?谢谢!
图像中的代码,其他项目文件保持未触及(QT快速控制2应用程序):
import QtQuick 2.7
import QtQuick.Controls 1.5
ApplicationWindow {
visible: true
width: 320
height: 240
x: 400
y: 210
color: "transparent"
flags: Qt.Widget | Qt.FramelessWindowHint //| Qt.WindowTransparentForInput
//| Qt.WA_TranslucentBackground //| Qt.WA_NoSystemBackground
//| Qt.WA_NoBackground //| Qt.WA_MouseNoMask
Button {
x: ApplicationWindow.width - width
text: "Right Top Window Corner"
}
Button {
y: ApplicationWindow.height - height
text: "Left Bottom Window Corner"
}
}
一种解决方案是创建一个3窗口,一个用于透明区域,一个用于每个按钮。
import QtQuick 2.4
import QtQuick.Controls 1.5
import QtQuick.Window 2.0
ApplicationWindow {
id: app
visible: true
width: 320
height: 240
x: 400
y: 210
color: "transparent"
flags: Qt.Widget | Qt.FramelessWindowHint | Qt.WindowTransparentForInput | Qt.WindowStaysOnTopHint
Window {
visible: true
flags: Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint
x: app.width - width
height: rightButton.implicitHeight
Button {
id: rightButton
text: "Right Top Window Corner"
}
}
Window {
visible: true
flags: Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint
y: app.height - height
height: leftButton.implicitHeight
Button {
id: leftButton
text: "Left Bottom Window Corner"
}
}
}
相关文章:
- QT通过C++添加映射QML项目
- Qt Quick-如何仅从c++代码与qml属性交互
- Qt QML桌面应用程序自动化测试
- Qt QML相机在部署后显示白屏
- 如何注册Qt C++对象以在QML中使用它
- 控制带有信号/插槽的Qt QML滑动视图
- Qt - 为什么Visual Studio 2019在qml资源中添加10Mb文件后无法再编译我的项目?
- Qt QML for Android bugs
- Qt Quick - 如何在 qml 接口中使用继承自 QQuickPaintedItem 的 c++ 类?
- Qt 5.9中的QML崩溃-帮助读取堆栈跟踪
- 如何替换QML(QT)文件上的图像中的图像中没有资源中的图像
- QML/QT 无法将 C++ 中的 QList<QVariantMap> 转换为 JavaScript 中的对象数组
- 如何在QML(Qt)中离线运行OpenStreetMap
- 将图像拆分为单元格 QML/QT
- 如何从新线程 QML QT c++ 更改文本字段
- 从QML(Qt Quick应用程序)调用C++方法
- 如何使用命令行 qmake 创建 Qt GUI 或 QML/Qt 快速项目
- Integrate C++ and QML. Qt 5.4
- Qml/Qt/C++:小部件中的QQuickView,无法获得正确的位置
- 如何在Repeater内部的UI QML (QT)中显示列表中的值