An update on this, heading over to using MVC as opposed to dancing around
with deep object hierarchies solved the main issue giving birth to QtPath.
The other issue was solved by QEvent and it's glory.

Thanks guys for your input, my code is sparkly clean now. :)

QtPath is a now solution looking for a problem, so if you can think of any,
let me know. :)


On 7 June 2014 11:06, Justin Israel <[email protected]> wrote:

> I will save my reply for that thread. Looking forward to it. Welcoming the
> chance to improve the CSS + Qt workflow
> On Jun 7, 2014 9:36 PM, "Marcus Ottosson" <[email protected]> wrote:
>
>>  Like keeping a bunch of template snippets that you recompose?
>>
>> Not sure if you’re speaking from experience or just winging it, but this
>> sounds like a really good idea.
>>
>> I was going to say that no, css and dynamic properties don’t mix.
>> Anything that has to change at run-time, I change via Python and in some
>> cases by re-setting stylesheets via in-line css on particular widgets;
>> generally avoiding re-setting stylesheets on the entire application due to
>> performance concerns. Having “css snippets” sounds really powerful and
>> aligns well with another methodology I use. I’m mocking up a new thread on
>> CSS as we speak, let’s continue our discussions in there.
>> ​
>>
>>
>> On 6 June 2014 21:48, Justin Israel <[email protected]> wrote:
>>
>>> Does that mean when wanting to change size constraints dynamically, you
>>> have to rewrite and assign new css strings? Like keeping a bunch of
>>> template snippets that you recompose? Like if I wanted to adjust the min
>>> height constraint on a widget in response to certain situation.
>>>
>>>
>>> On Sat, Jun 7, 2014 at 1:45 AM, Marcus Ottosson <[email protected]>
>>> wrote:
>>>
>>>> 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
>>>> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAkwM7GD_W9278Dae-5EDh4Nb-_VNnpHu8oACo1ESGpZA%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/CAPGFgA0hi00L9fs4z8fxc%2B1qZByvkUhJ5NxEnrtR5o1omX0DXw%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0hi00L9fs4z8fxc%2B1qZByvkUhJ5NxEnrtR5o1omX0DXw%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/CAFRtmOBeC1xLLkm31eaz8M62ZHTw-C8EVc6fqy1rNPZqw7shmw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBeC1xLLkm31eaz8M62ZHTw-C8EVc6fqy1rNPZqw7shmw%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/CAPGFgA1U245ku_1buTkSNw8QeJqjO3_6KF%3DJLW7fBL-C9eWcOA%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1U245ku_1buTkSNw8QeJqjO3_6KF%3DJLW7fBL-C9eWcOA%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/CAFRtmODWXJTAw0AdnFJq3VuD%2BRYKzj2uOX2qP6EtMy_ZhpanCg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to