Problem using overridden methods
-
[quote author="Zlatomir" date="1331641008"]broadpeak you forgot the virtual destructor for MyClass and also you forgot to delete the dynamic allocated memory.[/quote]
I have forgotten nothing :)
But in this very simple example I would have liked to avoid any complications: I focused only polymorphically behavior. Of course, you are right, in a bigger project we have to use virtual desctructor. -
The polymorphic parts were posted before, so i assumed you wanted to give a complete example... and the things i said you forgot are pretty important parts of the example.
Anyway i "vote" for you to edit the post and add the missing parts, i don't think that 4 lines of code would complicate the example.
-
I do really like being able to do this:
class MyObj : public SomeObj<-right click here....
go to refactor->insert virtual functions of base classes
which opens a wonderful window that displays EVERY child class of that object with a checkbox by each function. You can just check off each signature you want to override and be done with it in one go!
-
@osirisgothra said in Problem using overridden methods:
I do really like being able to do this:
which opens a wonderful window that
You could write a QtCreator extension/plugin and try to find out how to get your hand on the data you need.
displays EVERY child class of that object with a checkbox by each function. You can just check off each signature you want to override
Probably via the Code Model / Symbols.
If you wanna try it, start a new topic.
People who have more experience with such things than I do may be able to help you then.