Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-29625

cannot use Qt::AA_NativeWindows and Qt::WA_TranslucentBackground together (was regression: QDeclarativeView won't show as subwindow)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.0.1
    • GUI: Painting
    • None
    • Linux i5 3.7.6-1-ARCH #1 SMP PREEMPT Mon Feb 4 09:15:13 CET 2013 x86_64 GNU/Linux

    Description

      The following code does not work under Qt5, but it does work under Qt4:

      #include <QApplication>
      #include <QWidget>
      
      #include <QtDeclarative/QDeclarativeView>
      
      //////////////////////////////////////////////////////////////////////////////
      int main(int argc, char* argv[])
      {
        QApplication app(argc, argv);
      
        QApplication::setAttribute(Qt::AA_NativeWindows);
      
        QWidget widget(0, Qt::FramelessWindowHint);
      
        widget.setStyleSheet("background:\"red\"");
      
        QWidget* subWidget(new QDeclarativeView(&widget));
      
        subWidget->setWindowFlags(Qt::FramelessWindowHint | Qt::Dialog);
      
        subWidget->setAttribute(Qt::WA_TranslucentBackground);
      
        subWidget->setStyleSheet("background:\"green\"");
      
        widget.show();
      
        subWidget->show();
      
        subWidget->setGeometry(QRect(widget.pos(), widget.size()));
      
        subWidget->setAutoFillBackground(true);
      
        return app.exec();
      }
      

      The errors are:

      QXcbConnection: XCB error: 8 (BadMatch), sequence: 366, resource id: 81788949, major code: 130 (Unknown), minor code: 3
      QXcbConnection: XCB error: 8 (BadMatch), sequence: 373, resource id: 81788949, major code: 130 (Unknown), minor code: 3
      QXcbConnection: XCB error: 8 (BadMatch), sequence: 380, resource id: 81788949, major code: 130 (Unknown), minor code: 3
      QXcbConnection: XCB error: 8 (BadMatch), sequence: 400, resource id: 81788956, major code: 130 (Unknown), minor code: 3
      QXcbConnection: XCB error: 8 (BadMatch), sequence: 413, resource id: 81788956, major code: 130 (Unknown), minor code: 3
      QXcbConnection: XCB error: 8 (BadMatch), sequence: 423, resource id: 81788956, major code: 130 (Unknown), minor code: 3
      

      Attachments

        1. qtbug29625_simple.zip
          2 kB
        2. QTBUG-29625.tgz
          0.6 kB
        3. qtbug29625.zip
          2 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              paeglis Gatis Paeglis
              janezzabc Janez Žemva
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes