[PyKDE] QColorGroup

Phil Thompson phil at river-bank.demon.co.uk
Fri Jan 14 19:27:29 GMT 2000


Pete Ware wrote:
> 
> Wow, it's because a QPalette puts the foreground as the first object:
> 
> class Q_EXPORT QColorGroup                              // color group class
> {
> public:
>     ...
> private:
>     QColor fg_col;
>     QColor bg_col;
>     ...
> };
> 
> QColorGroup  color_group;
> 
> "color_group" is the same memory location as the first element
> color_group.fg_col.
> 
> --pete

Which implies that C++ creates a temporary copy of an object when it
returns a reference to it (and it's re-using the same memory in this
case).  But (to me anyway) that goes against what C++ references are for
- I'd always assumed they were semantic sugar for pointers.  I am
confused in my ignorance...looks like I'm going to have to go out an
find a book.

Phil




More information about the PyQt mailing list