Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double-click Zoom-in ISSUE #50

Closed
Delfinos opened this issue Mar 16, 2021 · 3 comments
Closed

Double-click Zoom-in ISSUE #50

Delfinos opened this issue Mar 16, 2021 · 3 comments
Assignees
Labels

Comments

@Delfinos
Copy link

Hi, I wrote some code to disable default double-click action

plot = new JKQTPlotter(this);
plot->clearAllRegisteredMouseDoubleClickActions(); // this code should block default-click action, which is zoom-in.
plot->clearAllMouseWheelActions();
plot->clearAllMouseWheelActions();

However, when program first start, I still can zoom-in by double-clicking the plotter (only once). I find this function may cause this problem:

    for (JKQTPMouseDoubleClickActionsHashMapIterator it=plotterStyle.registeredMouseDoubleClickActions.begin(); it!=plotterStyle.registeredMouseDoubleClickActions.end(); ++it) {
        if (it.key()==qMakePair<Qt::MouseButton, Qt::KeyboardModifiers>(button, modifiers)) {
            return it;
        }
    }
    return plotterStyle.registeredMouseDoubleClickActions.end();
// ....
auto itAction=findMatchingMouseDoubleClickAction(event->button(), event->modifiers());

The return-value itAction is not equal to plotterStyle.registeredMouseDoubleClickActions.end() which is very strange.

@Delfinos
Copy link
Author

Poor English, my bad.

@jkriege2 jkriege2 self-assigned this Apr 21, 2022
@jkriege2 jkriege2 added the bug label Apr 21, 2022
@jkriege2
Copy link
Owner

I can confirm the behaviour! ... working on a fix

jkriege2 added a commit that referenced this issue Apr 21, 2022
…), JKQtPlotter::clearAllMouseWheelActions(), JKQtPlotter::clearAllRegisteredMouseDragActions() didn't really deactivate all actions
@jkriege2
Copy link
Owner

fixed via ad3a26a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants