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. Differences between QQmlEngine window compiled and started from Qt Creator and from VS2010
Forum Updated to NodeBB v4.3 + New Features

Differences between QQmlEngine window compiled and started from Qt Creator and from VS2010

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

    Hi,
    There are a huge differences between view of QML window, which compiled and started from Qt Creator and from VS2010. I have the following code in main.cpp:

    QQmlEngine engine;
    QQmlComponent *component = new QQmlComponent(&engine);
    component->loadUrl(QUrl("../../dashboard/main.qml"));
    
    QObject *topLevel = component->create();
    QQuickWindow *window = qobject_cast<QQuickWindow *>(topLevel);
    QSurfaceFormat surfaceFormat = window->requestedFormat();
    window->setFormat(surfaceFormat);
    window->show();
    

    And some QML file with ApplicationWindow and several simple components (layouts, rectangles, splitviews, etc).
    When I execute this from Qt Creator, I have a window with right view (all components, positions, anchors, sizes are as expected). SplitView working correctly (split moving, sizes of parts change).
    When I try to execute the same code from VS2010, I have absolutely wrong object positions. All of them groupped at the top of window, some of them are above other. The SplitView doesn't work correctly (it doesn't fill window, the partition is moved but sizes of parts are not changed). It's looked really weird.
    Is anyone faced with the same behavior? I've just tried many options and cannot find the reason.
    Thank you!

    1 Reply Last reply
    0
    • D Offline
      D Offline
      devel
      wrote on last edited by
      #2

      Probably you should implement what the QQuickView class does. It has resizeMode property that accepts QQuickView::SizeRootObjectToView value and does the right thing.

      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