Your approach is wrong and bad! To extend Qt and, moreover, C ++ code, you do not need to copy the source code and modify it where you need to. You should (should) use the OOP (Object Oriented Programming) paradigm extension. In C ++ you should write something like:
Thus, B does everything that the base class A does, and you add your methods (extend the base class) according to your needs. If you look at the sample qt code, this is usually the approach used to execute something that is not included in the default qt widget behavior. In the example settings for ItemDelegate: you write your own class MyItemDelegate, which extends QItemDelegate: link
Or are the Qt classes just awful in terms of extensibility?
Qt is a "only" structure that creates the C ++ language. This means that everything you can do in C ++ you can do with Qt.
Alberto
source share