大家好:
最近我们在使用qt5+x11系统,通过yocto编译
yocto imx-3.10.53-1.1.2_patch
MACHINE=imx6qsabresd source fsl-setup-release.sh -b build-x11 -e x11
bitbake fsl-image-qt5
我们使用编译的文件系统,测试透明度功能,代码如下:
// -----------------------------------------
#include <QApplication>
#include <QScreen>
#include <QPushButton>
#include <QWidget>
#include <QSurfaceFormat>
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QSurfaceFormat format;
format.setSamples(4);
QWidget w;
w.setGeometry(200,200,500,400);
w.setWindowOpacity(0.35);
QPushButton bt("PushButton1", &w);
bt.setGeometry(0,0,100,50);
bt.show();
QPushButton bt2("PushButton2", &w);
bt2.setGeometry(400,350,100,50);
bt2.show();
w.show();
return app.exec();
}
// -----------------------------------------
编译后,执行程序出现一下警告:
Qt Warning: Could not find a location of the system's Compose files. Consider setting the QTCOMPOSE environment variable.
Qt Warning: Could not find a location of the system's Compose files. Consider setting the QTCOMPOSE environment variable.
Warning: EGL suggested using X Visual ID 33 (RGB888) for EGL config 1 (RGB444), but this is incompatable
Unable to find an X11 visual which matches EGL config 1
程序正常运行,但是没有透明度功能,请问yocto的qt5+X11如何支持透明度功能,目前对这个问题没有头绪,希望得到帮助!
谢谢。
|