Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ Qt Quick2窗口可以';没有空气动力学,你就不能透明_C++_Qt_Qml - Fatal编程技术网

C++ Qt Quick2窗口可以';没有空气动力学,你就不能透明

C++ Qt Quick2窗口可以';没有空气动力学,你就不能透明,c++,qt,qml,C++,Qt,Qml,我在Windows7上使用Qt5.7 我可以使我的QWindow不透明度,但它不能是透明的 // window1.qml Window { width: 640 height: 480 color: "transparent" } // no transparent, black background // window2.qml Window { width: 640 height: 480 color: "transparent"

我在Windows7上使用Qt5.7

我可以使我的QWindow不透明度,但它不能是透明的

// window1.qml
Window {
    width: 640
    height: 480
    color: "transparent"
} // no transparent, black background


// window2.qml
Window {
    width: 640
    height: 480
    color: "transparent"
    opacity: 0.5
} // black but 50% opacity background
但如果我启用aero,那么它将是透明的,没有任何问题

我读了很多关于它的文章。但我找不到正确的答案

-设置曲面格式

这个答案对我不适用


如何解决它?

我用
Qt5.8
尝试了这段代码:

Window {
  width: 200
  height: 200
  visible: true

  color: "transparent"
  opacity: 0.9

  Button {
    anchors.centerIn: parent
    text: "Click Me!"
  }
}
我得到了这个结果:
我建议您使用
qt5.8

目前还没有解决方案。如果没有空气动力学,透明性是不可能的。这是我在QT5.8中遇到的类似问题。我无法让它工作。但我看到一些使用openGL开发的UI元素在win7上是透明的,没有aero(不是QT)。因此,从技术上讲,可能需要做一些变通。