0

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.

Maxbester
  • 2,435
  • 7
  • 42
  • 70

1 Answers1

0

Use the following code :

 MyClass *objRef = const_cast<MyClass *>(obj);
Adnan Akbar
  • 718
  • 6
  • 16