invalid use of member (did you forget '&')
Unsolved
General and Desktop
-
QPushButton inherits QString text from QAbstractButton.
MyClass inherits QPushButton, some function of MyClass uses QString text directly.
heres my code:
void MyCLass::mouseReleaseEvent(QMouseEvent *e)
{
if ( e->button() == Qt::LeftButton )
{
emit clickedToPause(QMediaPlayer::State::PausedState);
if ( text == "Pause" ) text = "Resume";
else text = "Pause";
}
}error: invalid use of member (did you forget the '&' ?)
if ( text == "Pause" ) text = "Resume";i have no idea in that error
-
what about setText("Resume"); ?
-
Hi,
There's no "member" text, text is a property which has a getter named
text()
so what you are currently doing is trying assign a string to a method.