[PyKDE] QColorGroup

Pete Ware ware at cis.ohio-state.edu
Thu Jan 13 17:04:04 GMT 2000


With 0.9, it appears that ColorGroup.foreground() (et. al.) are
returning the result as a QColorGroup object instead of a QColor
object.  Following is some sample code and the error

        self.app = qt.QApplication (sys.argv)
        pallete = qt.QPalette (qt.blue)
        n = normal_group = pallete.normal ()

        print n, n.foreground, n.foreground ()

        my_group = qt.QColorGroup (n.foreground (),
                                   n.background (),
                                   n.light (),
                                   n.dark (),
                                   n.mid (),
                                   n.text (),
                                   n.background ())

This is from the "print".  Notice the last one is a QColorGroup
instead of QColor.

<qt.QColorGroup instance at faee0> 
<built-in method foreground of QColorGroup object at 261a98> 
<qt.QColorGroup instance at faee0>


Looking at the code in sipQColorGroup.cpp:

        res = &((QColorGroup *)sipMapThisToCpp(sipThis,sipClass_QColorGroup)) -> QColorGroup::foreground();
        return sipMapCppToSelf(res,sipClass_QColor);

although I don't know anything about sip to be able to comment.  Is
this a bug or my misunderstanding?

Thanks,
--pete




More information about the PyQt mailing list