相关资料:
https://blog.csdn.net/qq_40194498/article/details/79849807 怎么创建一个QML工程
https://blog.csdn.net/robertkun/article/details/42007901 QML设置背景图片
https://www.cnblogs.com/surfsky/p/4275346.html 毛玻璃原文章
https://download.csdn.net/download/zhujianqiangqq/13092324 代码包下载
PS:使用C++语法的IsCompositionEnabled函数实现的都是利用系统函数实现的,IsCompositionEnabled中对系统版本做了判断,开启条件必须是WIN8以下系统。具体可查看QT自代实例“Music Player”。
.pro
1 QT += quick 2 3 CONFIG += c++11 4 5 # The following define makes your compiler emit warnings if you use 6 # any Qt feature that has been marked deprecated (the exact warnings 7 # depend on your compiler). Refer to the documentation for the 8 # deprecated API to know how to port your code away from it. 9 DEFINES += QT_DEPRECATED_WARNINGS 10 11 # You can also make your code fail to compile if it uses deprecated APIs. 12 # In order to do so, uncomment the following line. 13 # You can also select to disable deprecated APIs only up to a certain version of Qt. 14 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 15 16 SOURCES += \ 17 main.cpp 18 19 RESOURCES += qml.qrc 20 21 # Additional import path used to resolve QML modules in Qt Creator's code model 22 QML_IMPORT_PATH = 23 24 # Additional import path used to resolve QML modules just for Qt Quick Designer 25 QML_DESIGNER_IMPORT_PATH = 26 27 # Default rules for deployment. 28 qnx: target.path = /tmp/$${TARGET}/bin 29 else: unix:!android: target.path = /opt/$${TARGET}/bin 30 !isEmpty(target.path): INSTALLS += target