Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QQuickWidget inside QDockWidget: resize() not working
Forum Updated to NodeBB v4.3 + New Features

QQuickWidget inside QDockWidget: resize() not working

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 403 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.
  • F Offline
    F Offline
    Fheanor
    wrote on last edited by
    #1

    I use a QML with a C++ model.

    My QML is set in a QQuickWidget that I put in a QDockWidget.

    I need sometimes to resize my QDockWidget. However, when I call resize() function, nothing is happening.

    What am I doing wrong ?

    Code example:

    MainWindow::MainWindow() {    
        QQuickWidget *view = new QQuickWidget;
        QQmlContext *ctxt = view->rootContext();
    
        ctxt->setContextProperty("myModel", m_model);
    
        view->setSource(QUrl::fromLocalFile(QML_FILE_DEFINITION));
        view->setGeometry(0, 200, 200, 400);
        view->setResizeMode(QQuickWidget::SizeRootObjectToView);
        view->setMinimumSize(QSize(200,200));
      
        m_dock->setWidget(view); //QDockWidget
        addDockWidget(Qt::LeftDockWidgetArea, m_dock);
    
        m_dock->resize(500,200); //This is not working
        view->resize(500,200); //Not either    
    }
    
    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