Consistently emit MouseEventListener::pressed signal
ClosedPublic

Authored by apol on May 26 2017, 7:54 PM.

Details

Summary

Update the state before emitting, otherwise things could be not consistent

Diff Detail

Repository
R296 KDeclarative
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
apol created this revision.May 26 2017, 7:54 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMay 26 2017, 7:54 PM
apol updated this revision to Diff 14866.May 26 2017, 7:54 PM

Removed unrelated changes

What things are not consistent?

In onPressed I would expect pressed to be also true which this patch ensures.

apol added a comment.May 31 2017, 10:18 PM

What things are not consistent?

connect(m_listener, &MEL::pressed, this, &ThisClass:blah);

void ThisClass::blah()
{
    if (m_listener->isPressed()) changeSomethingNowThatItsPressed();
}

The same reason why any setter sets the value before emitting.

davidedmundson accepted this revision.Jun 1 2017, 7:21 AM
This revision is now accepted and ready to land.Jun 1 2017, 7:21 AM
This revision was automatically updated to reflect the committed changes.