Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
6.2.0 Beta1
-
-
e71a5d5cc3c0337e7dbd5d571ecee5668baf8b63 (qt/qtbase/dev) cdec9d739d35e336e2bd18a2d2c5863c1002c569 (qt/qtbase/6.2) 78ca39fbb06dc87dbfd87952e4cc67e3c5141297 (qt/tqtc-qtbase/5.15) e8d39c670ee9ee5f097fcab27c8070103a3c4b68 (qt/qtbase/6.1)
Description
There is a bug when using Qt::Tool | Qt::FramelessWindowHint and Qt::WA_TranslucentBackground on a QFrame and drawing something on top of that QFrame with Qt 6.2.0 on macOS.
With Qt 5.15.5 the background is translucent as set via the setAttribute() function, but in Qt 6.2.0 this background is gray as shown in the screenshots.
Qt 5.15.5 | Qt 6.2.0 |
---|---|
This works without problems under Windows and Linux with Qt 5.15.5 as well as with 6.2.0.
#include <QtWidgets> #include <QHBoxLayout> int main(int argc, char *argv[]) { QApplication app(argc, argv); QWidget *window = new QWidget(); window->resize(320, 240); window->show(); window->setWindowTitle("Hello World"); QLabel *label = new QLabel(); label->setText("This should be visible!"); label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); QHBoxLayout *windowLayout = new QHBoxLayout(window); windowLayout->addWidget(label); QFrame *frame = new QFrame(window); frame->setWindowOpacity(1); frame->setWindowFlags(Qt::Tool | Qt::FramelessWindowHint); frame->setAttribute(Qt::WA_NoSystemBackground); frame->setAttribute(Qt::WA_TranslucentBackground); frame->setGeometry(window->frameGeometry()); frame->setVisible(true); QLabel *topLabel = new QLabel(frame); topLabel->setText("Top Label"); QHBoxLayout *frameLayout = new QHBoxLayout(frame); frameLayout->addWidget(topLabel); return app.exec(); }
This mechanism is used in QtDesignStudio to implement the docking overlay within the "AdvancedDockingSystem" - with that bug it is unusable.
Attachments
Issue Links
- is duplicated by
-
QTBUG-95428 macOS: Top Level Transparent Window Regression Since 5.15 onwards - QML
- Closed
-
QTBUG-97781 Translucency in Qt::Popup / Qt::ToolTip windows on macOS.
- Closed
- resulted in
-
QDS-4656 Dock widgets not working
- Closed
For Gerrit Dashboard: QTBUG-95042 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
358827,2 | macOS: Don't make frameless tool windows miniaturizable | dev | qt/qtbase | Status: MERGED | +2 | 0 |
359292,2 | macOS: Don't make frameless tool windows miniaturizable | 6.1 | qt/qtbase | Status: MERGED | +2 | 0 |
359293,2 | macOS: Don't make frameless tool windows miniaturizable | 6.2 | qt/qtbase | Status: MERGED | +2 | 0 |
359297,2 | macOS: Don't make frameless tool windows miniaturizable | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
370957,2 | macOS: Compute NSWindow background color without checking styleMask | dev | qt/qtbase | Status: MERGED | +2 | 0 |
371125,2 | macOS: Compute NSWindow background color without checking styleMask | 6.2 | qt/qtbase | Status: MERGED | +2 | 0 |
372513,2 | macOS: Compute NSWindow background color without checking styleMask | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
379307,4 | macOS: Compute NSWindow background color without checking styleMask | 5.12 | qt/qtbase | Status: MERGED | +2 | 0 |