Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

QQuickView custom resize to behave in a PreserveAspectRatio - mode

$
0
0
I am wondering if there is a simple way of implementing (or maybe there is already there, and only waits to be used) a resize mechanism which behaves like PreserveAspectRatio does for Image qml-component. In my application the entire UI is developed using QtQuick, and the main qml will be loaded inside one QQuickView. UI is implemented in a static way. Every component and item has a fix position, and images which are used are also fixed. I know that as a best practice, I should use anchors in qml, and I should create the entire UI like in web technologies (everything is relative to parent’s properties). Than when the resize mode is set to SizeRootObjectToView, it will work. viewer.setResizeMode(QQuickView::SizeRootObjectToView); But changing my entire UI will be time consuming, and I am thinking to leave it like it is now, and only the find a strategy to resize QQuickView in a PreserveAspectRatio way. Any sugestions from where I should start?

Viewing all articles
Browse latest Browse all 4972

Trending Articles