[Solved] Keeping a menubar for repeated use in QMainWindow::setMenuBar
Solved
General and Desktop
-
@Harry123 said:
This can only not work if there is a bug in the C++ compiler.
As I said - it works here and now for you. But who's to say in a month or a year another person will for whatever reason create a local variable of type QMainWindow* and copy your pointer. The point is that because this method is not virtual a different method will be called depending on the type of pointer you access it through. That's a time bomb type of bug. It does not explode here and now for you but it will for someone else or future you.
-
@Chris-Kawa
Totally agree.