I'd probably approach this by creating an implicit Rectangle item that is bound to the viewport dimensions. Then code the scrips to refer to a mysterious "parent" for height and width.
When the viewport changes, the property bindings should automatically re-evaluate, and anything not hard coded should respond accordingly. I've not cone any C++/QML interop, but I think you'd have to take the QMLViewer class and embed a root rect, then override the resize() method which would then resize the implicit rect (call it _root or something?) Then I am not sure how you woudl trigger the update to all the sub items. One would think that it would happen naturally on the next paint(). I'd be interested in how this turns out. ________________________________ From: "Robinson, David" <[email protected]> To: [email protected] Sent: Thu, July 29, 2010 9:25:54 AM Subject: [Qt4-preview-feedback] Dynamic resizing of QML component & display window I appreciate that QML applications are designed primarily for mobile environments with a fixed screen size but we are told that QML applications are intended to work just as well inside a resizable QDeclarativeView widget. However I find that setResizeMode has behaviour that seems to work on component creation but cannot know when the root item has been changed size from within the QML declaration. For example I can make a button in the QML component change the width & size of the root item but this has no affect on the size of the display window either in Qmlviewer or a QDeclarativeView widget.even when the SizeViewToRootObject property is set. To change the size the property must be set prior to creation. Is it possible to write a QML interface that can adjust its size dynamically to suit a user selectable settings within the QML component? Regards David Robinsion Please refer to www.anite.com for individual Anite company details. The contents of this e-mail and any attachments are for the intended recipient only. If you are not the intended recipient, you are not authorised to and must not disclose, copy, distribute, or retain this message or any part of it. It may contain information which is confidential and/or covered by legal professional or other privilege. Contracts cannot be concluded with us nor legal service effected by email. Anite plc Registered in England No.1798114 Registered Office: 353 Buckingham Avenue Slough Berks SL1 4PF United Kingdom VAT Registration No. GB 787 418187 Scanned for viruses by Mimecast.
_______________________________________________ Qt4-preview-feedback mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback
