Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QQuickWindow : Center contentItem
Forum Updated to NodeBB v4.3 + New Features

QQuickWindow : Center contentItem

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 550 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.
  • D Offline
    D Offline
    dvdk
    wrote on last edited by
    #1

    I am trying to fit the contentItem() in a QQuickWindow, like the fitInView function from QGraphicsView.

    Scaling the contentItem()->childrenRect() to QQuickWindow::width() and height() is no problem, but centering the content in the QQuickWindow seems more difficult.

    I fail to understand how to convert QQuickWindow coordinates to scene coordinates (mapToView equivalent)
    Basically if I can determine the center of the QQuickWindow in scene coordinates, I can re-position the contentItem to be centered in the window.

    What is the best way to center the contentItem in a QQuickWindow ?

    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