Transparent effect is not working in Qt5
-
An application I wrote with C++, Qt4, works fine on ARM board of Linux operating system. But when I try to run it in Qt5( after modification and re-compilation of course ), the parts where there are transparent effects is not working.
The pixmap used in a drag-drop, has a transparent part. But during a draging, the pixmap's transparent part is black, instead of transparent.
I want to set a widget's transparency in paintEvent with painter.fillRect( QRect( 0, 0, 800, 480 ), QColor( 0, 0, 0, 40 ) ). But it shows black regardless of my setting.
Has anyone dealt with this before? Or anyone has any ideas, please let me know. I will appreciate that. Thanks a lot. -
Hi and welcome to devnet,
Which plugin are you using ? And which version of Qt 5 ?
-
@SGaist Thank you very much. Uh, the plugin is tslib? Does that count? And it's Qt5.2.1.
There is another thing though, when it comes to QML, only the QtQuick 1.x can work properly, QtQuick 2.x will only show a black area. Just so you know. I don't know if this is relevant.
Thanks again. -
-
tslib is the input plugin for touchscreen handling.
Are you using linuxfb ? eglfs ?
-
Ok, then there's your problem: linuxfb is not enough for QtQuick2. You should use the eglfs plugin for Qt Quick 2 since OpenGL is a hard requirement for this module.
-
@SGaist So that's the problem, thanks a lot. To solve this, I have to re-transplant Qt with elgfs platform, right?
But the transparent thing I talked about, the code I used is pure C++, no qml at all. It still has something to do with elgfs platform? -
Recompile ? Yes
So transparency on a pure QWidget project ?