Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. QQuickWidget as viewport for QMdiArea
Forum Updated to NodeBB v4.3 + New Features

QQuickWidget as viewport for QMdiArea

Scheduled Pinned Locked Moved Unsolved Qt 6
1 Posts 1 Posters 151 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    ObiWanKennedy
    wrote on last edited by ObiWanKennedy
    #1

    I would like to use a QQuickWidget to show a 3D scene (QtQuick3D) as the background of a QMdiArea.

    I tried to create a QQuickWidget and set it as the viewport of the QMdiArea but it didn't work at all. I got few error message such as Unrecognized OpenGL Version, and QQuickWidget: Failed to make context current.

    I have other part of my software where I used QQuickWidget to show some QML items and they are working fine.

    // in the constructor of my QMdiArea subclass.
        auto p= new QQuickWidget(); 
    
         auto engine= p->engine();
         connect(engine, &QQmlEngine::warnings, this, [](const QList<QQmlError>& warnings) {
             for(const auto& warn : warnings)
             {// never called
                 qDebug() << "engine error:" << warn.description() << warn.messageType();
             }
         });
         connect(p, &QQuickWidget::statusChanged, this, [p](QQuickWidget::Status st) {
             if(st == QQuickWidget::Error)
             {// never called
                 auto errors= p->errors();
                 for(const auto& warn : errors)
                 {
                     qDebug() << "quickwidget error:" << warn.description() << warn.messageType();
                 }
             }
         });
         p->setSource(QUrl("qrc:/qml/views/DiceField.qml"));
    
         setViewport(p); // tried with or without hoping to have a second window or anything.
         p->show(); // tried with or without
    

    Any clue ?
    Regards.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved