How to force a style sheet recalculation
-
Hi Chetankjain,
I have read that part of the manual, and I understand that "One way to achieve this" is to set the style sheet (emphasis on the one way). I guess what I was asking is, is there another way that's less expensive...
From my web search and from the replies here it would seem that a better line in the docs would be "The ONLY way to do this..."
Anyway, I'm happy enough with the multiple style sheet solution so I guess it's problem solved.
Regards,
Steve -
[quote author="SteveKing" date="1287412881"]Andre: I think the property emits a signal, but I'll have a look at that and see if adding the signal makes any difference. I guess it wouldn't.[/quote]
I fear so too, but you'd say that in an ideal world, it should. Also, I think it would be perfectly possible to do. If the rendering of a widget depends on a property, then a change of that property should, IMHO, cause a trigger to see if a re-render is needed. Just like hovering, getting focus etc. do. As long as there is a signal for the property change, this should be possible. Having to re-set the style sheet is a hackish workaround, IMHO. -
I created a bugreport suggesting that property changes should trigger an update of the styling automatically: "http://bugreports.qt.nokia.com/browse/QTBUG-14601":http://bugreports.qt.nokia.com/browse/QTBUG-14601
[edit: fixed link / chetankjain]
-
genjix, for hovering or clicking on a button there are pseudo-states in stylesheets.
-
Just for reference:
"http://developer.qt.nokia.com/faq/answer/how_can_my_stylesheet_account_for_custom_properties":http://developer.qt.nokia.com/faq/answer/how_can_my_stylesheet_account_for_custom_properties.Here it is indicated that using a unpolish()/polish() pair of calls would be the fastest way to force the update.
-
When first being classified as "a sensible idea" and asking for more info, the JIRA ticket has now been closed as "Out of scope" because Qt is "more focussed on QML than in widgets" now.
I read in that: f*ck everybody who invested hundreds or thousands of developer hours into widget based applications; everybody who is not immediately jumping onto the immature Quick bandwagon is screwed.
I am really disapointed by this. While I see Quick as a very interesting technology for creating flashy touch UI's, conventional widgets have a huge invested base and do have their advantages. At least it is proven technology. I would have expected to see them live on side by side for quite a while, as there are use cases for both stacks. It seems I was wrong. :-(