Not adding much to the conversation with details but I have also hit the
same limitation in the past.

On Tue, Mar 10, 2015 at 3:19 PM, Justin Israel <justinisr...@gmail.com>
wrote:

> Apparently I can’t find an example off-hand of the limitations in wanting
> to query parent colors that were applied via a stylesheet, so I will have
> to dig through some of my code. I will also try to find the various posts I
> have found from others outlining the same limitations. It is related to
> situations where I have wanted to set a certain widgets colors to be
> lighter/darker than the parent, and the parent palette values did not
> reflect the actual stylesheet.
>
> But the part about the stylsheets being converted and not stored was
> definitely not right:
>
>     app = QtGui.QApplication([])
>     stylesheet = 'QWidget { background: #ff0000; }'
>     app.setStyleSheet(stylesheet)
>     assert(app.styleSheet() == stylesheet)
>
> If the stylesheet value is set on the application, you should be able to
> ask for it back.
>
> On Wed, Mar 11, 2015 at 8:09 AM Marcus Ottosson konstrukt...@gmail.com
> <http://mailto:konstrukt...@gmail.com> wrote:
>
> and setting a stylesheet doesn’t transform it into a QPalette that you can
>> then access values of.​
>>
>> Sure it does. :)
>>
>> Here’s an example of sampling the QPalette of a QWindow, setting a
>> stylesheet, and then sampling again.
>> https://gist.github.com/mottosso/9f27229fa75815bf4969
>>
>> The stylesheet is:
>>
>> QWidget {
>>     background-color: "blue"}
>>
>> And the corresponding changes to the QPalette are:
>>
>> Changed (Window) #444444 = #0000ff
>> Changed (Base) #2a2a2a = #0000ff
>> Changed (Background) #444444 = #0000ff
>> Changed (Button) #646464 = #0000ff
>>
>> Basically, from various levels of gray (Maya default) to blue, where the
>> parentheses name is the Role taken from QtGui.QPalette.
>> ​
>>
>> --
>> 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 python_inside_maya+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAZ9jA89WvEuX7HjVRyZzsWPWA2jH1z7LOkQ2%2BLkF8qUw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAZ9jA89WvEuX7HjVRyZzsWPWA2jH1z7LOkQ2%2BLkF8qUw%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 python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0Qi%3DiwpMBJ%2B40b7WHuR1YZ9jGxkRav4Vng7VKyAvGwiQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0Qi%3DiwpMBJ%2B40b7WHuR1YZ9jGxkRav4Vng7VKyAvGwiQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Tony

-- 
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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAJhmvsTtyx%3D8uThN7Bt50Y_PZ4x%2BShfu-s-fOTxJvWGixr0g2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to