
Originally Posted by
ToddAtWSU
I am not sure why putting the * in front helps.
It helps because you are now giving it the argument type that it is expecting rather than the argument type that it is not expecting.
To me that turns the pointer into a pointer to a pointer
No, that de-references the pointer. See any docs on C/C++ to see the meaning of the '*' operator.
I thought the function wanted my argument de-referenced, but I guess not.
The function wants a reference to a QPixmap object, nothing more. Whether that means de-referencing your variable depends on what kind of object you are dealing with, a QPixmap or a 'pointer to QPixmap'. The following should show you how to correctly deal with both cases.
Example 1 - QPixmap allocated on the stack.
...
mpVideoPainter->drawPixmap( target, mOverlay, source );
mOverlay = QPixmap( 561, 351 );
...
mpVideoPainter->drawPixmap( target, mOverlay, source );
To copy to clipboard, switch view to plain text mode
Example 2 - QPixmap allocated on the heap.
mpOverlay
= new QPixmap( 561,
351 );
...
mpVideoPainter->drawPixmap( target, *mpOverlay, source );
mpOverlay = new QPixmap( 561, 351 );
...
mpVideoPainter->drawPixmap( target, *mpOverlay, source );
To copy to clipboard, switch view to plain text mode
Bookmarks