~bzoltan/kubuntu-packaging/decouple_cmake_plugin

« back to all changes in this revision

Viewing changes to src/libs/qtcomponents/styleitem/qrangemodel.h

  • Committer: Timo Jyrinki
  • Date: 2013-11-15 12:25:23 UTC
  • mfrom: (1.1.28)
  • Revision ID: timo.jyrinki@canonical.com-20131115122523-i2kyamsu4gs2mu1m
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/****************************************************************************
2
 
**
3
 
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4
 
** Contact: http://www.qt-project.org/legal
5
 
**
6
 
** This file is part of Qt Creator.
7
 
**
8
 
** Commercial License Usage
9
 
** Licensees holding valid commercial Qt licenses may use this file in
10
 
** accordance with the commercial license agreement provided with the
11
 
** Software or, alternatively, in accordance with the terms contained in
12
 
** a written agreement between you and Digia.  For licensing terms and
13
 
** conditions see http://qt.digia.com/licensing.  For further information
14
 
** use the contact form at http://qt.digia.com/contact-us.
15
 
**
16
 
** GNU Lesser General Public License Usage
17
 
** Alternatively, this file may be used under the terms of the GNU Lesser
18
 
** General Public License version 2.1 as published by the Free Software
19
 
** Foundation and appearing in the file LICENSE.LGPL included in the
20
 
** packaging of this file.  Please review the following information to
21
 
** ensure the GNU Lesser General Public License version 2.1 requirements
22
 
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23
 
**
24
 
** In addition, as a special exception, Digia gives you certain additional
25
 
** rights.  These rights are described in the Digia Qt LGPL Exception
26
 
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27
 
**
28
 
****************************************************************************/
29
 
 
30
 
#ifndef QRANGEMODEL_H
31
 
#define QRANGEMODEL_H
32
 
 
33
 
#include <qobject.h>
34
 
#include <qgraphicsitem.h>
35
 
#include <qabstractslider.h>
36
 
#include <qdeclarative.h>
37
 
 
38
 
class QRangeModelPrivate;
39
 
 
40
 
class QRangeModel : public QObject
41
 
{
42
 
    Q_OBJECT
43
 
    Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY valueChanged USER true)
44
 
    Q_PROPERTY(qreal minimumValue READ minimum WRITE setMinimum NOTIFY minimumChanged)
45
 
    Q_PROPERTY(qreal maximumValue READ maximum WRITE setMaximum NOTIFY maximumChanged)
46
 
    Q_PROPERTY(qreal stepSize READ stepSize WRITE setStepSize NOTIFY stepSizeChanged)
47
 
    Q_PROPERTY(qreal position READ position WRITE setPosition NOTIFY positionChanged)
48
 
    Q_PROPERTY(qreal positionAtMinimum READ positionAtMinimum WRITE setPositionAtMinimum NOTIFY positionAtMinimumChanged)
49
 
    Q_PROPERTY(qreal positionAtMaximum READ positionAtMaximum WRITE setPositionAtMaximum NOTIFY positionAtMaximumChanged)
50
 
    Q_PROPERTY(bool inverted READ inverted WRITE setInverted NOTIFY invertedChanged)
51
 
 
52
 
public:
53
 
    QRangeModel(QObject *parent = 0);
54
 
    virtual ~QRangeModel();
55
 
 
56
 
    void setRange(qreal min, qreal max);
57
 
    void setPositionRange(qreal min, qreal max);
58
 
 
59
 
    void setStepSize(qreal stepSize);
60
 
    qreal stepSize() const;
61
 
 
62
 
    void setMinimum(qreal min);
63
 
    qreal minimum() const;
64
 
 
65
 
    void setMaximum(qreal max);
66
 
    qreal maximum() const;
67
 
 
68
 
    void setPositionAtMinimum(qreal posAtMin);
69
 
    qreal positionAtMinimum() const;
70
 
 
71
 
    void setPositionAtMaximum(qreal posAtMax);
72
 
    qreal positionAtMaximum() const;
73
 
 
74
 
    void setInverted(bool inverted);
75
 
    bool inverted() const;
76
 
 
77
 
    qreal value() const;
78
 
    qreal position() const;
79
 
 
80
 
    Q_INVOKABLE qreal valueForPosition(qreal position) const;
81
 
    Q_INVOKABLE qreal positionForValue(qreal value) const;
82
 
 
83
 
public Q_SLOTS:
84
 
    void toMinimum();
85
 
    void toMaximum();
86
 
    void setValue(qreal value);
87
 
    void setPosition(qreal position);
88
 
 
89
 
Q_SIGNALS:
90
 
    void valueChanged(qreal value);
91
 
    void positionChanged(qreal position);
92
 
 
93
 
    void stepSizeChanged(qreal stepSize);
94
 
 
95
 
    void invertedChanged(bool inverted);
96
 
 
97
 
    void minimumChanged(qreal min);
98
 
    void maximumChanged(qreal max);
99
 
    void positionAtMinimumChanged(qreal min);
100
 
    void positionAtMaximumChanged(qreal max);
101
 
 
102
 
protected:
103
 
    QRangeModel(QRangeModelPrivate &dd, QObject *parent);
104
 
    QRangeModelPrivate* d_ptr;
105
 
 
106
 
private:
107
 
    Q_DISABLE_COPY(QRangeModel)
108
 
    Q_DECLARE_PRIVATE(QRangeModel)
109
 
 
110
 
};
111
 
 
112
 
QML_DECLARE_TYPE(QRangeModel)
113
 
 
114
 
#endif // QRANGEMODEL_H