[PyQt] QSettings with QColor in PyQt
goocreations at gmail.com
Tue Apr 12 13:18:52 BST 2011
cool, thank you.
On Tue, Apr 12, 2011 at 1:24 PM, Hans-Peter Jansen <hpj at urpla.net> wrote:
> On Tuesday 12 April 2011, 11:23:33 goocreations wrote:
> > I want to store and retrieve a QColor from QSettings. storing is no
> > problem:
> > self.settings.setValue("Color", myColor)
> > But I can't figure out how to retrieve it again. In C++ you would
> > just call .value<QColor>(), but this is not possible in Python.
> > Any ideas?
> Simply wrap the value with a matching c'tor:
> Using a reasonably current PyQt, you can provide a type argument:
> QSettings.value("Color", QtGui.QColor)
> PyQt mailing list PyQt at riverbankcomputing.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt