Unsolved Assigning a value to a QScopedPointer<QString>?
-
Hello, hope everyone is well. Got a pickle of an error here, any tips would be appreciated. Been googling for over an hour and no luck so far. Is it possible to assign a value to a variable wrapped in a QScopedPointer? Error I get is "no operator = matches these operands"
ThanksTestCode.cpp QScopedPointer<QString> customerString; QString newString01 = "Valued Customer"; existingString = newString01; // error line
-
I can't say what type
existingString
is, but you can't assign aQString
value to aQScopedPointer
.As stated here,
QScopedPointer
does not have any= operator
or copy c'tor. -
But the real question here is - why do you want to use
QScopedPointer<QString>
in the first place?