Martin wrote: >> Can you explain why you do not want to use ImplicitSizeItem? Artur wrote: > From my point of view, one of the main problems is the need to > load a c++ library just because of it :P Which means it doesn't > work with qmlviewer "out of the box", etc..
I assume you mean "using qmlviewer out of the box with a set of QML files without also compiling or installing a c++ library". This is only a minor issue for me. Let's see if I can put words to my gut feelings... (below lower-case "component" means Qt Components UI element that we implement using QML, and upper-case "Component" means the QML element encapsulates a QML component definition) To style a component (as implemented on our "custom" branch) you need to define a Component that draws part of the visual appearance of the component. The root element of these can be an Item in almost all cases, but sometimes the implicit size of the style element should be used to set the overall implicit size of the component. We would then have to explain to the person re-styling the component that they have to use an ImplicitSizeItem instead of an Item for this particular style Component, and then that they have to include a special plugin that is used almost exclusively for this purpose, and when they ask why we'll have to tell them it's a work- around for lack of support in QML. We then have to use the same ImplicitSizeItem for the root element of our components just for propagating the implicit size from the style item(s), which in effect un-does the read-onlyness of the Item's implicit size properties that we all prefer. Martin wrote: >> Another option may be to have something like >> Component.implicitWidth/height attached properties to set the >> implicit size of the root item of the Component. Do you only >> want to set the size of the root of the Component? Yes, I think that's an excellent idea! It would prevent people from overriding the implicit size on instances of elements when there are several in the same file, but still let you set or override it if your defining your own (perhaps derived) Component. Brilliant! :) Can you knock up a version of this quickly so I can try it on our Qt Components? Cheers Mathias ------------------------------------------------------------ Mathias Malmqvist UX Prototype Lead 10 Great Pulteney Street, London, W1F 9NB, UK Got no reply? Try giving me a call: Mobile: +44 (0)77 6522 2738 http://www.nokia.com ________________________________________ From: ext Artur Souza (MoRpHeUz) [artur.so...@openbossa.org] Sent: Friday, January 14, 2011 11:40 AM To: Jones Martin (Nokia-MS-Qt/Brisbane) Cc: Malmqvist Mathias (Nokia-MS/London); qt-components@qt.nokia.com; Kennedy Aaron (Nokia-MS-Qt/Brisbane) Subject: Re: [Qt-components] (QTBUG-14957) Only core QML elements can have implicit size On Thu, Jan 13, 2011 at 8:28 PM, <martin.jo...@nokia.com> wrote: > Can you explain why you do not want to use ImplicitSizeItem? >From my point of view, one of the main problems is the need to load a c++ library just because of it :P Which means it doesn't work with qmlviewer "out of the box", etc.. There is also the feeling (my feeling at least) that this is something "basic" and that when you're developing widgets for other people to use you certainly need them (it's a use case a little bit different from the case where you're developing your own widgets to use in your own application - in the latter you can "predict" how it's being used and set "sane" sizes for example). I understand the point of Martin that want a clear use case before adding API to avoid regretting it latter. But it seems that we have a clear use case, at least for us :) Cheers! -- ------------------------------------------------------- Artur Duque de Souza openBossa INdT - Instituto Nokia de Tecnologia ------------------------------------------------------- Blog: http://blog.morpheuz.cc PGP: 0xDBEEAAC3 @ wwwkeys.pgp.net ------------------------------------------------------- _______________________________________________ Qt-components mailing list Qt-components@qt.nokia.com http://lists.qt.nokia.com/mailman/listinfo/qt-components