Hello. I'm trying to draw a QWidget over another QWidget that is drawn by the SFML API.
Everything works fine, I have my main widget be Qt-controlled, I have additional widgets around the sides, and the center widget is a QScrollArea with the SFML QWidget owned by the QScrollArea.
Events work fine, drawing works fine.
However, when I give the SFML-drawn QWidget a layout and a child widget, despite everything I do, I can't see the SFML-drawn widget through the background of the child widget.
It looks like this:
blackbar.jpg
The one on the left is behaving properly (it's outside the SFML widget), but the one on the right (a child of the SFML widget) with it's transparent background shows black instead of the background drawn by SFML.
All my SFML drawing happens within the QPaint of the SFML QWidget.
I've tried tons of different methods to try and get the background to be transparent.
I've tried:
rightTabBar.
setBrush(QPalette::Window, Qt
::transparent);
rightTabBar->setPalette(p);
QPalette p = rightTabBar->palette();
rightTabBar.setBrush(QPalette::Window, Qt::transparent);
rightTabBar->setPalette(p);
To copy to clipboard, switch view to plain text mode
rightTabBar->setObjectName("MyVerticalTabBar");
rightTabBar->setStyleSheet("#MyVerticalTabBar { background-color: transparent; }");
rightTabBar->setObjectName("MyVerticalTabBar");
rightTabBar->setStyleSheet("#MyVerticalTabBar { background-color: transparent; }");
To copy to clipboard, switch view to plain text mode
rightTabBar->setAutoFillBackground(false);
rightTabBar->setAutoFillBackground(false);
To copy to clipboard, switch view to plain text mode
rightTabBar->setAttribute(Qt::WA_TranslucentBackground);
rightTabBar->setAttribute(Qt::WA_TranslucentBackground);
To copy to clipboard, switch view to plain text mode
And:
rightTabBar->setAttribute(Qt::WA_NoSystemBackground);
rightTabBar->setAttribute(Qt::WA_NoSystemBackground);
To copy to clipboard, switch view to plain text mode
I'm under the sneaking suspicion that the background is properly transparent, but that the parent's background (the SFML-drawn widget) is somehow being propagated to the child before the SFML widget gets drawn, and that the child then draws the propagated blank background over the now-drawn background.
Or else, maybe the child gets drawn first, and some kind of clip-rect gets set to the SFML-drawn window, keeping those pixels under the child from getting drawn (Despite Qt::WA_PaintUnclipped being set on the parent).
Bookmarks