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. Dynamically resizing of QML scenes
QtWS25 Last Chance

Dynamically resizing of QML scenes

Scheduled Pinned Locked Moved QML and Qt Quick
7 Posts 4 Posters 4.2k 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.
  • M Offline
    M Offline
    mbreier
    wrote on last edited by
    #1

    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":http://www.imb-web.de/index.php/fuelcontrolmenu.

    The problem is now, that this application needs to run on different resolutions, starting from 1024x768 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

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alizadeh91
      wrote on last edited by
      #2

      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!

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mbreier
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • A Offline
          A Offline
          alizadeh91
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • S Offline
            S Offline
            selectedOne
            wrote on last edited by
            #5

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

            1 Reply Last reply
            0
            • A Offline
              A Offline
              alizadeh91
              wrote on last edited by
              #6

              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!

              1 Reply Last reply
              0
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

                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

                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