Assigning a value to a QScopedPointer<QString>?
-
wrote on 3 Feb 2021, 21:04 last edited by
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
-
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
wrote on 3 Feb 2021, 22:32 last edited by Pl45m4 2 Mar 2021, 22:36I 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?
1/3