##// END OF EJS Templates
Fix crash with empty BarSet values...
Fix crash with empty BarSet values Change-Id: I6c82ad2985f7efc501ed0df34b8205875a369fd0 Task-number: QTBUG-51287 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>

File last commit:

r2845:ae12522d475c
r2869:8f454d1f8b44
Show More
scroller_p.h
113 lines | 2.6 KiB | text/x-c | CLexer
Titta Heikkala
Updated license headers...
r2845 /******************************************************************************
Michal Klocek
Refactor qledgend handling...
r855 **
Titta Heikkala
Updated license headers...
r2845 ** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
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...
r2845 ** $QT_BEGIN_LICENSE:COMM$
Michal Klocek
Refactor qledgend handling...
r855 **
Titta Heikkala
Updated license headers...
r2845 ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
Michal Klocek
Refactor qledgend handling...
r855 **
Titta Heikkala
Updated license headers...
r2845 ** $QT_END_LICENSE$
**
******************************************************************************/
Michal Klocek
Refactor qledgend handling...
r855
// W A R N I N G
// -------------
//
Titta Heikkala
Updated private header warning...
r2807 // This file is not part of the Qt 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 */