##// END OF EJS Templates
Fix QNX build issue...
Fix QNX build issue Use qmath and cmath methods instead of math.h methods. Change-Id: I7c853f2e1218a1d3cde15a089192c24a6b0b1395 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>

File last commit:

r2774:7b74d88b3f3d
r2775:143be951b1fe
Show More
scroller_p.h
110 lines | 2.5 KiB | text/x-c | CLexer
Michal Klocek
Refactor qledgend handling...
r855 /****************************************************************************
**
Titta Heikkala
Update copyright year...
r2688 ** Copyright (C) 2014 Digia Plc
Michal Klocek
Refactor qledgend handling...
r855 ** All rights reserved.
Titta Heikkala
Updated license headers...
r2740 ** For any questions to Digia, 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
** agreement between you and Digia.
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 */