Yeah, sizing via CSS is great. I use Python for structure only, all
look-related things go via CSS, including min, max, fixed sizes. Keeps a
clean separation, and resembles HTML with CSS if your familiar with that,
and facilitates having multiple themes too!

In fact I was going to put up a new thread about SCSS, to make CSS more
manageable and pretty. I recommend having a look.


On 6 June 2014 14:17, Justin Israel <[email protected]> wrote:

> Glad it was helpful to solve something! There are so many facets to Qt
> that it is hard to know them all. I haven't actually sized widgets much
> through CSS so I will keep that in mind. I use CSS for all the other look
> related stuff.
>  On Jun 7, 2014 12:50 AM, "Marcus Ottosson" <[email protected]>
> wrote:
>
>> Unrelated to the problem at hand, but related to eventFilter, I did
>> already find a good use for them.
>>
>> When sizing things via CSS, widgets aren't resized immediately but are
>> delayed towards the point where the widget is about to be shown. So asking
>> a widget for it's size when running the application would yield incorrect
>> results.
>>
>> The way I dealt with it previously was to run QWidget.ensurePolished(),
>> but that only worked on a per-widget occasion, meaning I'd have to cascade
>> the call to each child widget for accurate results.
>>
>> Now, instead of calling upon the method querying the sizes directly, I
>> posted an event, picked up in an eventFilter during QEvent.Show and fired a
>> call from there to the method making the queries, and the sizes are correct.
>>
>> I've been missing out. :)
>>
>> Thanks for the tip Justin, I've had such a hard time with this particular
>> issue for a long time.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOB1oMtPyRAbcWSUb-PJ0TGwHDZ%2BpJPMoDvaNZTdqXDf-A%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOB1oMtPyRAbcWSUb-PJ0TGwHDZ%2BpJPMoDvaNZTdqXDf-A%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2_W7Ai79wJ9_NXqj-ypz3CJ%3DFb7MdcbvxAG84JFQumJg%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2_W7Ai79wJ9_NXqj-ypz3CJ%3DFb7MdcbvxAG84JFQumJg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Marcus Ottosson*
[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAkwM7GD_W9278Dae-5EDh4Nb-_VNnpHu8oACo1ESGpZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to