Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Issue while I try to assign a QSharedPointer to a variable
beidaochuan last edited by
I make some as follows.
QSharedPointer<User> pointer(new User()); // UserSettings is a Class const UserSettings &userSettingsRef = pointer;
Complie error should happen, but it not.
Could somebody tell me why?
A Former User last edited by
Hi! This gives me the following compile error:
invalid initialization of reference of type 'const UserSettings&' from expression of type 'QSharedPointer<User>' const UserSettings &userSettingsRef = pointer; ^
What's your platform / compiler?