[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyKDE] QColor.fromRgb and QColor.setRgb bug??
From: David Boddie <david () boddie ! org ! uk>
Date: 2006-09-29 23:24:56
Message-ID: 200609300124.56899.david () boddie ! org ! uk
[Download RAW message or body]
On Friday 29 September 2006 09:07:58 -0500, Allen Bierbaum wrote:
> From the documentation to PyQt it seems that this line should work:
> >>> QtGui.QColor.fromRgb(QtGui.QApplication.style().styleHint(QtGui.QStyle.
> >>>SH_Table_GridLineColor,option))
>
> Traceback (most recent call last):
> File "<string>", line 1, in <string>
> TypeError: insufficient number of arguments to QColor.fromRgb()
>
> Unfortunately calling setRgb has the same problem. Does anyone see
> anything I am doing wrong here or is there a way to work around this
> problem?
I imagine you're getting a negative integer from styleHint(), where
QColor.fromRgb() expected an unsigned integer. It should be possible
to add 2^32 to any negative values to obtain a suitable unsigned
integer for use with QColor.fromRgb().
Maybe this case could be handled by adding an extra overloaded fromRgb()
function to QColor in sip/QtCore/qcolor.sip that accepts negative integers.
David
_______________________________________________
PyKDE mailing list PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic