Files
qt5-legatus-legacy/Lts/Common/LtsTimeline/timeline_header_view_mouse_handler.h
T
2026-08-13 18:33:10 +02:00

50 lines
1.2 KiB
C++
Executable File

#pragma once
#include <LtsTimeline/ltstimeline_export.h>
#include <QPoint>
class QMouseEvent;
class QWheelEvent;
namespace LtsTimeline
{
class TimelineHeaderView;
class LTSTIMELINE_EXPORT TimelineHeaderViewMouseHandler
{
public:
explicit TimelineHeaderViewMouseHandler(TimelineHeaderView *header);
void mouseMoveEvent(QMouseEvent *e);
void mousePressEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *e);
void wheelEvent(QWheelEvent *e);
bool isBusy() const { return m_isIndicatorSelected || m_isResizingSection; }
bool isIndicatorSelected() const { return m_isIndicatorSelected; }
private:
// bool isMouseWithinRange(const QPoint &pos) const;
bool isMouseWithinRangeX(int x) const;
bool isMouseWithinRangeY(int y) const;
bool isMouseOverIndicator(const QPoint &pos) const;
private:
TimelineHeaderView *m_header{nullptr};
QPoint m_lastPos;
bool m_isLeftButtonPressed{false};
bool m_isRightButtonPressed{false};
bool m_hasMouseMovedLeft{false}; // Left means while left button is clicked
bool m_hasMouseMovedRight{false}; // Right means while right button is clicked
bool m_isIndicatorSelected{false};
bool m_isResizingSection{false};
};
} // namespace LtsTimeline