Error: passing 'const QString' as 'this' argument of 'QString& QString::operator=
Hi,
I am getting this error:
Code:
error: passing 'const QString' as 'this' argument of 'QString& QString::operator=(const QString&)' discards qualifiers
In this code
Code:
{
description = "Something";
temp = description;
}
temp is declared in the h as a private member
why? And how can I do temp = description;!!!
Thanks!
Re: Error: passing 'const QString' as 'this' argument of 'QString& QString::operator
You can't because the method is const -- it can't change any of the object fields. Such assignment in the delegate's paint routine wouldn't make any sense anyway. The delegate will be called in some time for some totally different item and what would such "temp" variable be helpful with?
Re: Error: passing 'const QString' as 'this' argument of 'QString& QString::operator
yep! I was doing something stupid!
Thanks