QWT 7.0.1
Loading...
Searching...
No Matches
qwt_cache_panner.h
1/******************************************************************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *
9 * Modified by ChenZongYan in 2024 <czy.t@163.com>
10 * Summary of major modifications (see ChangeLog.md for full history):
11 * 1. CMake build system & C++11 throughout.
12 * 2. Core panner/ zoomer refactored:
13 * - QwtPanner → QwtCachePanner (pixmap-cache version)
14 * - New real-time QwtPlotPanner derived from QwtPicker.
15 * 3. Zoomer supports multi-axis.
16 * 4. Parasite-plot framework:
17 * - QwtFigure, QwtPlotParasiteLayout, QwtPlotTransparentCanvas,
18 * - QwtPlotScaleEventDispatcher, built-in pan/zoom on axis.
19 * 5. New picker: QwtPlotSeriesDataPicker (works with date axis).
20 * 6. Raster & color-map extensions:
21 * - QwtGridRasterData (2-D table + interpolation)
22 * - QwtLinearColorMap::stopColors(), stopPos() API rename.
23 * 7. Bar-chart: expose pen/brush control.
24 * 8. Amalgamated build: single QwtPlot.h / QwtPlot.cpp pair in src-amalgamate.
25 *****************************************************************************/
26
27#ifndef QWT_CACHE_PANNER_H
28#define QWT_CACHE_PANNER_H
29
30#include "qwt_global.h"
31#include <qwidget.h>
32
33class QCursor;
34class QPixmap;
35
52class QWT_EXPORT QwtCachePanner : public QWidget
53{
54 Q_OBJECT
55
56public:
57 explicit QwtCachePanner(QWidget* parent);
58 virtual ~QwtCachePanner();
59
60 void setEnabled(bool);
61 bool isEnabled() const;
62
63 void setMouseButton(Qt::MouseButton, Qt::KeyboardModifiers = Qt::NoModifier);
64 void getMouseButton(Qt::MouseButton& button, Qt::KeyboardModifiers&) const;
65
66 void setAbortKey(int key, Qt::KeyboardModifiers = Qt::NoModifier);
67 void getAbortKey(int& key, Qt::KeyboardModifiers&) const;
68
69 void setCursor(const QCursor&);
70 const QCursor cursor() const;
71
72 void setOrientations(Qt::Orientations);
73 Qt::Orientations orientations() const;
74
75 bool isOrientationEnabled(Qt::Orientation) const;
76
77 virtual bool eventFilter(QObject*, QEvent*) QWT_OVERRIDE;
78
79Q_SIGNALS:
86 void panned(int dx, int dy);
87
95 void moved(int dx, int dy);
96
97protected:
98 virtual void widgetMousePressEvent(QMouseEvent*);
99 virtual void widgetMouseReleaseEvent(QMouseEvent*);
100 virtual void widgetMouseMoveEvent(QMouseEvent*);
101 virtual void widgetKeyPressEvent(QKeyEvent*);
102 virtual void widgetKeyReleaseEvent(QKeyEvent*);
103
104 virtual void paintEvent(QPaintEvent*) QWT_OVERRIDE;
105
106 virtual QBitmap contentsMask() const;
107 virtual QPixmap grab() const;
108
109private:
110#ifndef QT_NO_CURSOR
111 void showCursor(bool);
112#endif
113
114 class PrivateData;
115 PrivateData* m_data;
116};
117
118#endif
QwtCachePanner provides panning of a widget.
Definition qwt_cache_panner.h:53
void moved(int dx, int dy)
Signal emitted, while the widget moved, but panning is not finished.
void panned(int dx, int dy)
Signal emitted, when panning is done.