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. Adjust QWidget size to QDeclarativeView

Adjust QWidget size to QDeclarativeView

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 2.5k Views 1 Watching
  • 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.
  • I Offline
    I Offline
    ixSci
    wrote on last edited by
    #1

    Hi there.

    I want my top QWidget auto resize in according to the QML item size change. Now it doesn't change at all so I have to resize my top widget manually,
    Here is the ctor code to show what I have:
    @
    m_pView = new QDeclarativeView(this);
    ...
    m_pView->setSource(QmlFileName);
    ...
    QVBoxLayout* pLayout = new QVBoxLayout(this);
    pLayout->addWidget(m_pView);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);@
    So it has the right size at the start but doesn't change it dynamically while the QML component actually does.

    Thanks!

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      -Have you tried setting "QDeclarativeView::resizeMode":http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeview.html#resizeMode-prop to SizeViewToRootObject?- Should be default.

      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