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

QQuickWidget does not show together with another widget in layout

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Done
    • Affects Version/s: 5.3.2
    • Fix Version/s: 5.4.0 RC
    • Component/s: Quick: Widget
    • Labels:
      None
    • Environment:
      Windows 7 64bit ( Qt 5.3.2 MSVC2013 32bit )

      Description

      When trying to group QQuickWidget with another widget in layout warning show up and QQuickWidget is not shown.

      It depends what is in QML file ( Rectangle alone is OK, Item is not )

      Output is:

       
      QOpenGLFramebufferObject: Framebuffer incomplete attachment.
      QOpenGLFramebufferObject: Framebuffer incomplete attachment.
      QOpenGLFramebufferObject: Framebuffer incomplete attachment.
      QOpenGLFramebufferObject: Framebuffer incomplete attachment.
      QOpenGLFramebufferObject: Framebuffer incomplete, missing attachment.
      

      Example program

      #include <QtGui>
      #include <QtWidgets>
      #include <QDebug>
      #include <QQuickWidget>
      
      class View : public QMainWindow
      {
          Q_OBJECT
      public:
          View() {
              QQuickWidget *quickWidget = new QQuickWidget(this);
              quickWidget->setSource(QUrl(QStringLiteral("qrc:/main.qml")));
      
              QVBoxLayout *vbox = new QVBoxLayout;
              QTableView *tableView = new QTableView(this);
      
              vbox->addWidget(quickWidget);
              // When adding new widget -> quickWidget shows warning and does not show up
              // When alone in vbox -> OK
              vbox->addWidget(tableView);
      
              QWidget *centralWidget = new QWidget(this);
              centralWidget->setLayout(vbox);
      
              setCentralWidget(centralWidget);
          }
      };
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          View view;
          view.show();
          return a.exec();
      }
      
      #include "main.moc"
      

      Example QML ( must contain Item element, rectangle alone is working )

      import QtQuick 2.3
      
      Item {
          Rectangle {
              width: 100
              height: 62
              color: "red"
          }
      }
      

        Attachments

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

          Activity

            People

            Assignee:
            lagocs Laszlo Agocs
            Reporter:
            fbucek fbucek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes