[PyQt] QStyle.styleHint() returning negative value for rgb

Jugdish jugdizh at gmail.com
Tue Mar 23 11:39:41 GMT 2010


I'm trying to get the color value for the table grid by making the following
call:

QtGui.QApplication.style().styleHint(QtGui.QStyle.SH_Table_GridLineColor,
option, self)

but this returns -3684409, which is not a valid qRgb (throws an error when
constructing a QColor from it). Looking at the internals of styleHint, the
number that it's returning is actually
option.palette.color(QPalette.Mid).rgb(). If I call that method directly, I
get 4291282887. So at what point is this value becoming negative?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100323/ae2288f3/attachment.html>


More information about the PyQt mailing list