cool, thank you.<br><br><div class="gmail_quote">On Tue, Apr 12, 2011 at 1:24 PM, Hans-Peter Jansen <span dir="ltr"><<a href="mailto:hpj@urpla.net">hpj@urpla.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Tuesday 12 April 2011, 11:23:33 goocreations wrote:<br>
> I want to store and retrieve a QColor from QSettings. storing is no<br>
> problem:<br>
><br>
> self.settings.setValue("Color", myColor)<br>
><br>
> But I can't figure out how to retrieve it again. In C++ you would<br>
> just call .value<QColor>(), but this is not possible in Python.<br>
><br>
> Any ideas?<br>
<br>
</div>Simply wrap the value with a matching c'tor:<br>
<br>
QtGui.QColor(value)<br>
<br>
Using a reasonably current PyQt, you can provide a type argument:<br>
<br>
QSettings.value("Color", QtGui.QColor)<br>
<br>
Pete<br>
<div><div></div><div class="h5">_______________________________________________<br>
PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br>
</div></div></blockquote></div><br>