stefanha/wahjam — comment on commit 3f7debec0db5769252aea6fa6b6bcbcc03e11336
File:  line 0
By stefanha:

On Mon, Feb 13, 2012 at 2:35 AM, tea

wrote:
> # MetronomeBar::setCurrentBeat slot
>
> No need range check ? (any case when setCurrentBeat get invalid value ?)
> If no need or don't want the check every times, but assert macro still helps code readability.
>
> Q_ASSERT(bpi >= currentBeat && currentBeat >= 0)

Okay, good idea, we can add it in. My thinking here is that this is
an internal, custom widget, not a public component or API. So I
didn't validate everything because I am relying on Wahjam internally
being consistent. Adding the assert is easy though.

> Current patch code has call update() twice at BPI change, that in reset() and setBeatPerInterval(bpi)
> but the area of MetronomeBar update is not so wide and BPI change is rare event, I think performance won't be problem.
> this can leave until when need optimize or cleanup code.

I haven't had time to check, but I got the impression that Qt will
raise paint events for update(). Paint events get merged - Qt will
try even if the rectangles are not identical - in order to reduce the
amount of redrawing. So calling it twice should not matter.

Stefan