February 8, 2013

mbreier mbreier
Lab Rat
31 posts

Dynamically resizing of QML scenes

 

Hello,

for industrial automation and SCADA I have developed an application mixed of Qt widgets and QML using QML 1.0 and QtDeclarative. The QML scenes have a lot of QML items inside like pipes, pumps, valves and tanks. These components have a specific position and size each connected to the other.

You can see a picture here [imb-web.de].

The problem is now, that this application needs to run on different resolutions, starting from 1024×768 until full hd resolution.
My question is if there is a technique to resize a complex QML scene so that the items are also resized proportional and also there positions are moved proportional.
I know of property binding but for a complex scene with hundreds of QML items it is not really a solution to calculate all the positions and width and height from the parent size so that it fits at the end.
Also the scaling is not really a solution because the rendering of a scaled scene is rather bad, and especially text is not longer readable.

Best regards

Michael

6 replies

February 8, 2013

Mostafa Alizadeh Mostafa Alizadeh
Ant Farmer
126 posts

I had a similar issue and for resolving that i’ve sent resolution of screen from qt to qml so the resolution of qml scene was calculated from resolution of screen. for other components i have no idea except your idea which mentioned above!! i know that’s a big deal.
However in the link that you provided, there is graph. Did you use it in your qml scene?! if so, then how did you do that? i’ve been seeking for it!

February 8, 2013

mbreier mbreier
Lab Rat
31 posts

Thanks for your reply.
The graph is not QML it is normal Qt using QWT.

I also need to make software in C# .NET using WPF and there is a possibility to set the Brush of a border to a VisualBrush which contains another XAML scene. This XAML will be interpreted as a picture and can be resized without problems. Even animation is still possible. I thought there would be a similar comfortable solution in QML.

Regards
Michael

February 8, 2013

Mostafa Alizadeh Mostafa Alizadeh
Ant Farmer
126 posts

But the performance of WPF or C# maybe suffer you later! be careful!

February 8, 2013

selectedOne selectedOne
Lab Rat
8 posts

I have the same resizing problem and would be happy if we find a solution… :)

February 8, 2013

Mostafa Alizadeh Mostafa Alizadeh
Ant Farmer
126 posts

you have to set scale for all of objects or set width and height of objects as percent of their parents, i haven’t any better idea!

February 13, 2013

ansifpi ansifpi
Robot Herder
188 posts

Hi mbrier,

Did you tried QQuickView::setResizeMode(QQuickView::SizeRootObjectToView) in your main program.
It takes care of the resolution in a better way.

Regards
Ansif

 Signature 

Software programmer

 
  ‹‹ [Cosed/Duplicate] QtWebView + D3 Javascript Visualization Library      [SOLVED] QtQuick-Plugin - get QmlViewer object ››

You must log in to post a reply. Not a member yet? Register here!