Solved Cannot create transparent pixmap for QDrag
-
@SGaist No. On my dev machine I use open source qt that I installed either via
apt-get install
or by downloading the package and installing it. Can't remember which of the two but I certainly didn't build it manually. And on the board I use buildroot as mentioned already. Obviously, for the board build buildroot downloads and builds it. But I have not applied any patches on that so far either. -
Sorry for the downvote on your previous post btw but the answer to one of your questions is already mentioned in my original question (i.e. qt version 4.8.6).
-
@Boofish said in Cannot create transparent pixmap for QDrag:
Sorry for the downvote on your previous post btw but the answer to one of your questions is already mentioned in my original question (i.e. qt version 4.8.6).
While I did miss you wrote the Qt version, the OS you are using is still legitimate, especially if you are using different flavours of Linux.
Note that you are not even using the latest version of the Qt 4 series and also it has reached end of life a long time ago now.
-
@SGaist Retracted the downvote. But anyway I would still like to fix the issue on this qt version preferably, for the reason I mentioned. I mean I'd like to identify the actual problem so if anyone knows what the bug is if it is indeed a bug, I can surely patch it. Also when you say "it has reached end of life a long time ago now" do you mean Qt4.8.6 or Qt4 in general?
-
Qt 4. There won't be any new bug fixes release unless there's a highly critical security issue. See here.
One thing you can still try is Qt 4.8.7 if you can't update to a recent supported version of Qt.
-
Thanks for the responses. I'll try upping the version. I'll also dig into the code a bit more because the drag n drop robot example... works. Which is suspicious. And that is also using a pixmap in a QDrag from what I see.
-
I'm going to leave this open in case I do find a solution, be it upping the version or whatever else (a quick google search shows that I'm not the only one that has had this issue or similar issues). I'll post it if I do maybe it will be helpful to someone else.
-
One thing that could help is to provide a minimal compilable example that reproduces that. So other people may have a look at it more easily.
-
I've found the solution. I had to patch qt source code to get this working. Here is the patch for anyone else struggling with this:
--- qt.old/src/gui/kernel/qdnd_qws.cpp 2019-07-04 02:22:03.051763167 +0300 +++ qt/src/gui/kernel/qdnd_qws.cpp 2019-07-04 02:22:36.895605031 +0300 @@ -97,6 +97,7 @@ // setAttribute() should be done unconditionally! if (QApplication::type() == QApplication::GuiServer) setAttribute(Qt::WA_TransparentForMouseEvents); + setAttribute(Qt::WA_TranslucentBackground); } void setPixmap(QPixmap pm) --- qt.old/src/gui/kernel/qdnd_x11.cpp 2019-07-04 02:22:54.539523527 +0300 +++ qt/src/gui/kernel/qdnd_x11.cpp 2019-07-04 02:22:12.647718085 +0300 @@ -286,6 +286,7 @@ | Qt::BypassGraphicsProxyWidget) { setAttribute(Qt::WA_X11NetWmWindowTypeDND); + setAttribute(Qt::WA_TranslucentBackground); } void setPixmap(const QPixmap &pm)
-
@boofish If this is really a Qt issue and you have a patch you should contribute it to Qt, so it gets integrated.
-
@jsulm Hi jsulm, this is on qt 4.8. I don't think this file even exists in the latest qt version.