Re: QG_GraphicView::paintEvent conditions
Posted by
dxli on
Oct 13, 2015; 12:02am
URL: https://forum.librecad.org/QG-GraphicView-paintEvent-conditions-tp5712414p5712417.html
using binary flags makes sense, as the flags are supposed to support any combination of on/off flags.
Binary flags are common implementation in Qt, for example:
http://doc.qt.io/qt-5/qsizepolicy.html#PolicyFlag-enum
ravas wrote
Thanks for the reply.
I misunderstood how the & operator worked before;
however, I still don't see the need for bitwise operators.
It seems like this system was written so that the least amount of people could understand it.
There has to be a way to simplify this to three bool member variables;
although, I'm not sure if it would be worth the effort to rewrite everything.
Something I noticed in testing is that the "if (redrawMethod & RS2::RedrawOverlay)" block
is processed when the mouse is moved in the drawing area in the default selection mode.