Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Custom full-screen QDialog with QQuickWidget inside, the latter won't scale properly (Android)
Forum Updated to NodeBB v4.3 + New Features

Custom full-screen QDialog with QQuickWidget inside, the latter won't scale properly (Android)

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 416 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.
  • V Offline
    V Offline
    Vega4
    wrote on last edited by
    #1

    Description: The aim is to show a custom dialog-box (no borders, no default buttons, content is to be provided by QML), transparency is desired and the dialog box with the embedded QML should show full-screen. The content of the QML rendered within the dialog-box should scale properly to full-screen.

    Implementation (constructor) of a custom Dialog:

    CIdentityBox::CIdentityBox(QWidget *parent): QDialog(parent)
    {
       setAttribute(Qt::WA_TranslucentBackground);
           QQuickWidget* content = new QQuickWidget();
           content->setParent(this);
            content->rootContext()->setContextProperty(QStringLiteral("applicationData"), this);
             content->setResizeMode(QQuickWidget::SizeRootObjectToView);
            content->setSource(QStringLiteral("qrc:/dialog.qml"));
           content->setClearColor(Qt::transparent);
    
    }
    

    The QML file:

    Item {
        //objectName: "topographySeries"
        height: 750
       width:360
    //other stuff
    }
    

    I show the dialog with a call to dialog->showFullScreen();

    Current State: Now, the dialog shows, the space occupied by the QDialog is full-screen indeed (if I turn off WA_TranslucentBackground the entire screen is white), BUT the inner(?) QQuickWidget is not scaled at all. Even though SizeRootObjectToView is set.

    Ideas? In QML if I change the default(?) height/width or set anchors.fill = parent, the QQuickWidget is not rendered at all. Ideas?

    Any hacky way to accomplish this? Does not need to be clean one, I've spent too much time on this already.

    Question is: how to make the inner QQuickWidget occupy the entire space of QDialog. Other approaches are welcome.

    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