Unsolved A double buffering project
-
@tomy said in A double buffering project:
I went for Protected Functions section of QWidget (my base class in this example) on Help, and saw neither minimumSizeHint() nor sizeHint()! :(
Really?
Here it is: http://doc.qt.io/qt-5/qwidget.html#minimumSizeHint-prop and http://doc.qt.io/qt-5/qwidget.html#sizeHint-prop -
Hi
yes, its fine way.
Besides those u can select in drop down, you can write a custom
name in edit just below.
However, if often better to use QWidget and just change classname 2 places if
its not QWidget as else the constructor is not fully created. ( with custom name) -
-
@tomy
But they are ?!
-
@mrjj
Would you Open it in Help mode?
I pressed F1 on QWidget.EDITED:
I found them. They are on Public functions (not Protected!) :(
So we can re-implement public functions too! -
@tomy
Yes, its not important if placed under public, protected, private.
Its the virtual keyword that is important.
That is a key feature of c++.
It allows polymorphism.
http://www.cplusplus.com/doc/tutorial/polymorphism/ -
@mrjj
OK, thanks. -
@tomy
Its a good concept to master.
It allows to have many types and have them in a list mixed.
and instead of having to do toif ( current.type == TypeX )
call TypeX_Something
if ( current.type == TypeY )
call TypeY_Something
...the compiler will do that for you and you can just call
TypeX->Something
and compiler have made sure its correct type you actually call on.
So its used in many cases to achieve good design.
-
@mrjj
Thanks mrjj, but unfortunately I couldn't understand that good concept.
Are you talking about virtual functions? -
@tomy
Yes, virtual function are a way to archive polymorphism.