##// END OF EJS Templates
Clarified AreaSeries documentation...
Clarified AreaSeries documentation Added note about using a line series only for area series. If the same line series is added to chart and area series it will cause problems. Change-Id: Ie9fbc1f0741e139d82bd3d705b17b0369afc3dc9 Task-number: QTRD-3516 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>

File last commit:

r2776:bc1f6aa59d42
r2790:f40f14281427
Show More
scroller_p.h
110 lines | 2.6 KiB | text/x-c | CLexer
Michal Klocek
Refactor qledgend handling...
r855 /****************************************************************************
**
Titta Heikkala
Copyright header changes...
r2776 ** Copyright (C) 2015 The Qt Company Ltd
Michal Klocek
Refactor qledgend handling...
r855 ** All rights reserved.
Titta Heikkala
Copyright header changes...
r2776 ** For any questions to The Qt Company, please use contact form at http://qt.io
Michal Klocek
Refactor qledgend handling...
r855 **
Titta Heikkala
Updated license headers...
r2740 ** This file is part of the Qt Charts module.
Michal Klocek
Refactor qledgend handling...
r855 **
Titta Heikkala
Updated license headers...
r2740 ** Licensees holding valid commercial license for Qt may use this file in
** accordance with the Qt License Agreement provided with the Software
** or, alternatively, in accordance with the terms contained in a written
Titta Heikkala
Copyright header changes...
r2776 ** agreement between you and The Qt Company.
Michal Klocek
Refactor qledgend handling...
r855 **
** If you have questions regarding the use of this file, please use
Titta Heikkala
Updated license headers...
r2740 ** contact form at http://qt.io
Michal Klocek
Refactor qledgend handling...
r855 **
****************************************************************************/
// W A R N I N G
// -------------
//
Miikka Heikkinen
Qt Commercial -> Qt Enterprise...
r2574 // This file is not part of the Qt Enterprise Chart API. It exists purely as an
Michal Klocek
Refactor qledgend handling...
r855 // implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
Michal Klocek
Fixes header guard style issues
r969 #ifndef SCROLLER_P_H
#define SCROLLER_P_H
Michal Klocek
Refactor qledgend handling...
r855
Titta Heikkala
Fix include syntax...
r2714 #include <QtCharts/QChartGlobal>
Samuli Piippo
Add missing include for QObject...
r2731 #include <QtCore/QObject>
Titta Heikkala
Fix include syntax...
r2714 #include <QtCore/QBasicTimer>
#include <QtCore/QTime>
#include <QtCore/QPointF>
Michal Klocek
Refactor qledgend handling...
r855
Christian Kandeler
Fix compilation with namespaced Qt....
r2774 QT_BEGIN_NAMESPACE
Michal Klocek
Refactor qledgend handling...
r855 class QGraphicsSceneMouseEvent;
Christian Kandeler
Fix compilation with namespaced Qt....
r2774 QT_END_NAMESPACE
Michal Klocek
Refactor qledgend handling...
r855
Titta Heikkala
Qt Charts project file structure change...
r2712 QT_CHARTS_BEGIN_NAMESPACE
Michal Klocek
Refactor qledgend handling...
r855
class Scroller;
class QLegend;
class ScrollTicker : public QObject
{
Michal Klocek
Krazy reported errors...
r974 Q_OBJECT
Michal Klocek
Refactor qledgend handling...
r855 public:
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 explicit ScrollTicker(Scroller *scroller, QObject *parent = 0);
Michal Klocek
Refactor qledgend handling...
r855 void start(int interval);
void stop();
protected:
void timerEvent(QTimerEvent *event);
private:
QBasicTimer m_timer;
Scroller *m_scroller;
};
class Scroller
{
public:
enum State {
Idle,
sauimone
moving mouse event handling logic to scroller
r2199 Pressed,
Michal Klocek
Refactor qledgend handling...
r855 Move,
sauimone
Kinetic scrolling is back for legend
r2189 Scroll
Michal Klocek
Refactor qledgend handling...
r855 };
Michal Klocek
Adds ScrolledQLegend...
r859 Scroller();
Michal Klocek
Refactor qledgend handling...
r855 virtual ~Scroller();
Jani Honkonen
more coding style fixes for src-folder...
r2104 virtual void setOffset(const QPointF &point) = 0;
Michal Klocek
Adds ScrolledQLegend...
r859 virtual QPointF offset() const = 0;
Michal Klocek
Refactor qledgend handling...
r855
sauimone
Kinetic scrolling is back for legend
r2189 void move(const QPointF &delta);
sauimone
better implementation of mouse event handling in legend
r2197 void scrollTo(const QPointF &delta);
sauimone
Legend can now handle clicked and do scrolling
r2183
sauimone
moving mouse event handling logic to scroller
r2199 void handleMousePressEvent(QGraphicsSceneMouseEvent *event);
void handleMouseMoveEvent(QGraphicsSceneMouseEvent *event);
void handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event);
Michal Klocek
Refactor qledgend handling...
r855 void scrollTick();
sauimone
Kinetic scrolling is back for legend
r2189 private:
void startTicker(int interval);
void stopTicker();
Michal Klocek
Refactor qledgend handling...
r855 private:
Jani Honkonen
more coding style fixes for src-folder...
r2104 void calculateSpeed(const QPointF &position);
void lowerSpeed(QPointF &speed, qreal maxSpeed = 100);
Michal Klocek
Refactor qledgend handling...
r855
private:
ScrollTicker m_ticker;
QTime m_timeStamp;
QPointF m_speed;
QPointF m_fraction;
sauimone
Kinetic scrolling is back for legend
r2189 int m_timeTresholdMin;
int m_timeTresholdMax;
State m_state;
sauimone
moving mouse event handling logic to scroller
r2199 QPointF m_pressPos;
QPointF m_lastPos;
qreal m_treshold;
Michal Klocek
Refactor qledgend handling...
r855 };
Titta Heikkala
Qt Charts project file structure change...
r2712 QT_CHARTS_END_NAMESPACE
Michal Klocek
Refactor qledgend handling...
r855
Jani Honkonen
Fix Krazy issues
r1935 #endif /* SCROLLER_P_H */