invalid use of member (did you forget the '&' ?)
why do I receive this error for the second statement?
Quote:
error: invalid use of member (did you forget the '&' ?)
Code:
const QPixmap *orig_pixmap
= ui
->label
->pixmap
();
degrees++;
if(degrees == 90) degrees = 0;
QTransform rotate_disc;
rotate_disc.translate((orig_pixmap->width()-rotate->width())/2 , (orig_pixmap->width()-rotate->height())/2);
rotate_disc.rotate(degrees,Qt::ZAxis);
//pixmap = orig_disc->scaled(89,89,Qt::IgnoreAspectRatio,Qt::SmoothTransformation);
pixmap = orig_pixmap->transformed(rotate_disc,Qt::SmoothTransformation);
ui->label->setPixmap(pixmap);
Re: invalid use of member (did you forget the '&' ?)
There is nothing wrong with that code that I can see, but then you haven't shown enough to tell whether or not there is something about the context in which that code appears which would cause the error. For example, is the method a const method? Is there a member function named "degrees()"?
Re: invalid use of member (did you forget the '&' ?)
Second statement meaning "degrees++"? What is the type of "degrees"? Do you have a method with that name?
Re: invalid use of member (did you forget the '&' ?)