Is “implicit separation” inherited from Qt classes?

If I create a subclass of an implicitly separated Qt class (e.g. QList), will my subclass also be implicitly split?

I read a brief introduction to implicit exchange located in the QtCore5.3 documentation, but I did not notice a mention of heritability.

My goal is to ask for more efficient code when deciding which arguments to pass and how to pass them.

+4
source share
1 answer

As stated in the comments, Qt classes that use implicit sharing are usually data containers or tools and are not intended to be subclassed.
You may notice that since there is no virtual destructor, there is virtually no virtual function.

Due to the risks and bad practice, you probably want to create a different design without inheritance.


To answer your question:

?
, (, , ), detach().
, - , . , , .
, .

, .
detach . :
http://doc.qt.io/qt-5/qshareddatapointer.html#details

+1

All Articles