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. QQuickView with frameless window hint - fails if QQuickView::setSource is called
Forum Updated to NodeBB v4.3 + New Features

QQuickView with frameless window hint - fails if QQuickView::setSource is called

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.6k Views 2 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.
  • V Offline
    V Offline
    VRHans
    wrote on last edited by
    #1

    I have a Qt Qml application based in a QQuickView window. It works great on OSX/Linux/Windows.

    On Windows 10 (but I've not tried on other operating systems yet), if I add a frameless window hint to the QQuickView window's flag, I get exactly the window I desired (as expected.)

    If I do the same thing and then call setSource( "myqml.qml" ) on that QQuickView, the window will fail to display although the taskbar will show that the application window (the QQuickView.) Note that the setSource call happens after the ::show() call (I tried hiding it, then calling setSource, then unhiding in case there was some window reconstruction issue - but no luck.)

    When this happens, the console output shows: "QSGThreadedRenderLoop: expose event received for window QQuickView(0xc6eb8fef68) with invalid geometry: QRect(-1357,226 0x0) on QScreen(0x277c048c960, name=\.\DISPLAY3)"

    This is the same display that shows successfully if I don't call setSource.

    If the QML file is completely empty or only contains import statements - the window shows properly.
    If I add just the following:

    Rectangle {
    color: "red"
    }

    The window fails to show.

    Interestingly if I give the rectangle a specific size like this:

    Rectangle {
    width: 100
    height: 100
    color: "red"
    border.color: "black"
    border.width: 5
    radius: 10
    }

    Then I do not get the window without a title bar, I get a window exactly the size of the rect and because I gave the corners a radius, I see a white background where the corners would normally be (indicating to me that the window size has shrunk to the size of the rect.)

    Anybody know how to fix this?

    I would expect the same behavior as when there is a titlebar... Is that wrong?

    Thanks!

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VRHans
      wrote on last edited by
      #2

      Ahhh, I think that because the base rect in my qml code doesn't define a size (which gives it parent fill properties) and the frameless window doesn't have a parent (which was presumably previously the window frame itself.)

      Strange because I tried defining a minimum size for the QQuickView and then loading the qml and that didn't work.

      Anyhow, not sure if this is a bug or expected behavior (by the implementors) - I suspect the latter.

      I can easily work around by giving the qml base rect a size.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jagh
        wrote on last edited by
        #3

        I think(but i might be wrong) that it's true with regards to almost all QML visual items - by default, their size is 0x0. With an exception of Image which gets its default size from the picture it shows, and perhaps some others?. Anyway, that's what makes defining proper height/width and/or anchors of all visible Items mandatory.

        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