I am quite new to Qt. Let MyClass be a sub-class of QObject.
Is there a way to convert properly a const MyClass *
object to a MyClass *
object?
I wanted to create a constructor MyClass(const MyClass *object);
but it doesn't seem to be recommended.
使用以下代码:
MyClass *objRef = const_cast<MyClass *>(obj);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.