Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
737 B
Raw Blame
/*
 *  SPDX-FileCopyrightText: 2019 Dmitry Kazakov <[email protected]>
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef KISMOUSECLICKEATER_H
#define KISMOUSECLICKEATER_H

#include <QtGlobal>
#include <QObject>
#include <QElapsedTimer>


class KisMouseClickEater : public QObject
{
public:
    KisMouseClickEater(Qt::MouseButtons buttons,
                       int clicksToEat = 1,
                       QObject *parent = 0);

    ~KisMouseClickEater();

    void reset();
    bool eventFilter(QObject *watched, QEvent *event) override;

private:
    Qt::MouseButtons m_buttons = Qt::NoButton;
    int m_clicksToEat = 1;
    int m_clicksHappened = 0;
    QElapsedTimer m_timeSinceReset;
};

#endif // KISMOUSECLICKEATER_H