• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kde-runtime API Reference
  • KDE Home
  • Contact Us
 

PlasmaComponents

  • sources
  • kde-4.14
  • kde-runtime
  • plasma
  • declarativeimports
  • plasmacomponents
qrangemodel.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
6 **
7 ** This file is part of the Qt Components project.
8 **
9 ** $QT_BEGIN_LICENSE:BSD$
10 ** You may use this file under the terms of the BSD license as follows:
11 **
12 ** "Redistribution and use in source and binary forms, with or without
13 ** modification, are permitted provided that the following conditions are
14 ** met:
15 ** * Redistributions of source code must retain the above copyright
16 ** notice, this list of conditions and the following disclaimer.
17 ** * Redistributions in binary form must reproduce the above copyright
18 ** notice, this list of conditions and the following disclaimer in
19 ** the documentation and/or other materials provided with the
20 ** distribution.
21 ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
22 ** the names of its contributors may be used to endorse or promote
23 ** products derived from this software without specific prior written
24 ** permission.
25 **
26 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
37 ** $QT_END_LICENSE$
38 **
39 ****************************************************************************/
40 
41 #ifndef QRANGEMODEL_H
42 #define QRANGEMODEL_H
43 
44 #include <QObject>
45 
46 namespace Plasma
47 {
48 
49 class QRangeModelPrivate;
50 
51 class QRangeModel : public QObject
52 {
53  Q_OBJECT
54 
55  Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY valueChanged USER true)
56  Q_PROPERTY(qreal minimumValue READ minimum WRITE setMinimum NOTIFY minimumChanged)
57  Q_PROPERTY(qreal maximumValue READ maximum WRITE setMaximum NOTIFY maximumChanged)
58  Q_PROPERTY(qreal stepSize READ stepSize WRITE setStepSize NOTIFY stepSizeChanged)
59  Q_PROPERTY(qreal position READ position WRITE setPosition NOTIFY positionChanged)
60  Q_PROPERTY(qreal positionAtMinimum READ positionAtMinimum WRITE setPositionAtMinimum NOTIFY positionAtMinimumChanged)
61  Q_PROPERTY(qreal positionAtMaximum READ positionAtMaximum WRITE setPositionAtMaximum NOTIFY positionAtMaximumChanged)
62  Q_PROPERTY(bool inverted READ inverted WRITE setInverted NOTIFY invertedChanged)
63 
64 public:
65  QRangeModel(QObject *parent = 0);
66  virtual ~QRangeModel();
67 
68  void setRange(qreal min, qreal max);
69  void setPositionRange(qreal min, qreal max);
70 
71  void setStepSize(qreal stepSize);
72  qreal stepSize() const;
73 
74  void setMinimum(qreal min);
75  qreal minimum() const;
76 
77  void setMaximum(qreal max);
78  qreal maximum() const;
79 
80  void setPositionAtMinimum(qreal posAtMin);
81  qreal positionAtMinimum() const;
82 
83  void setPositionAtMaximum(qreal posAtMax);
84  qreal positionAtMaximum() const;
85 
86  void setInverted(bool inverted);
87  bool inverted() const;
88 
89  qreal value() const;
90  qreal position() const;
91 
92  Q_INVOKABLE qreal valueForPosition(qreal position) const;
93  Q_INVOKABLE qreal positionForValue(qreal value) const;
94 
95 public Q_SLOTS:
96  void toMinimum();
97  void toMaximum();
98  void setValue(qreal value);
99  void setPosition(qreal position);
100 
101 Q_SIGNALS:
102  void valueChanged(qreal value);
103  void positionChanged(qreal position);
104 
105  void stepSizeChanged(qreal stepSize);
106 
107  void invertedChanged(bool inverted);
108 
109  void minimumChanged(qreal min);
110  void maximumChanged(qreal max);
111  void positionAtMinimumChanged(qreal min);
112  void positionAtMaximumChanged(qreal max);
113 
114 protected:
115  QRangeModel(QRangeModelPrivate &dd, QObject *parent);
116  QRangeModelPrivate* d_ptr;
117 
118 private:
119  Q_DISABLE_COPY(QRangeModel)
120  Q_DECLARE_PRIVATE(QRangeModel)
121 
122 };
123 
124 } // Plasma namespace
125 
126 #endif // QRANGEMODEL_H
Plasma::QRangeModel::maximumValue
qreal maximumValue
the maximum value that value can assume
Definition: qrangemodel.h:57
Plasma::QRangeModel::setMaximum
void setMaximum(qreal max)
Definition: qrangemodel.cpp:308
Plasma::QRangeModelPrivate
Definition: qrangemodel_p.h:46
Plasma::QRangeModel::positionAtMaximum
qreal positionAtMaximum() const
Plasma::QRangeModel::stepSizeChanged
void stepSizeChanged(qreal stepSize)
Plasma::QRangeModel::valueChanged
void valueChanged(qreal value)
Plasma::QRangeModel::maximumChanged
void maximumChanged(qreal max)
Plasma::QRangeModel::setPositionAtMaximum
void setPositionAtMaximum(qreal posAtMax)
Definition: qrangemodel.cpp:427
Plasma::QRangeModel::minimum
qreal minimum() const
Definition: qrangemodel.cpp:295
Plasma::QRangeModel::valueForPosition
Q_INVOKABLE qreal valueForPosition(qreal position) const
Definition: qrangemodel.cpp:445
Plasma::QRangeModel::setPositionAtMinimum
void setPositionAtMinimum(qreal posAtMin)
Definition: qrangemodel.cpp:408
Plasma::QRangeModel::stepSize
qreal stepSize() const
Plasma::QRangeModel::positionAtMinimum
qreal positionAtMinimum() const
Plasma::QRangeModel::position
qreal position() const
Plasma::QRangeModel::positionChanged
void positionChanged(qreal position)
Plasma::QRangeModel::setPosition
void setPosition(qreal position)
Definition: qrangemodel.cpp:385
Plasma::QRangeModel::minimumValue
qreal minimumValue
the minimum value that value can assume
Definition: qrangemodel.h:56
QObject
Plasma::QRangeModel::toMinimum
void toMinimum()
Definition: qrangemodel.cpp:520
Plasma::QRangeModel::d_ptr
QRangeModelPrivate * d_ptr
Definition: qrangemodel.h:116
Plasma::QRangeModel::value
qreal value() const
Plasma::QRangeModel::maximum
qreal maximum() const
Definition: qrangemodel.cpp:316
Plasma::QRangeModel::toMaximum
void toMaximum()
Definition: qrangemodel.cpp:530
Plasma::QRangeModel::positionForValue
Q_INVOKABLE qreal positionForValue(qreal value) const
Definition: qrangemodel.cpp:358
Plasma::QRangeModel
Definition: qrangemodel.h:51
Plasma::QRangeModel::positionAtMinimumChanged
void positionAtMinimumChanged(qreal min)
Plasma::QRangeModel::minimumChanged
void minimumChanged(qreal min)
Plasma::QRangeModel::setPositionRange
void setPositionRange(qreal min, qreal max)
Definition: qrangemodel.cpp:220
Plasma::QRangeModel::setStepSize
void setStepSize(qreal stepSize)
Definition: qrangemodel.cpp:330
Plasma::QRangeModel::invertedChanged
void invertedChanged(bool inverted)
Plasma::QRangeModel::setValue
void setValue(qreal value)
Definition: qrangemodel.cpp:472
Plasma::QRangeModel::positionAtMaximumChanged
void positionAtMaximumChanged(qreal max)
Plasma::QRangeModel::setInverted
void setInverted(bool inverted)
Definition: qrangemodel.cpp:497
Plasma::QRangeModel::setMinimum
void setMinimum(qreal min)
Definition: qrangemodel.cpp:289
QObject::parent
QObject * parent() const
Plasma::QRangeModel::inverted
bool inverted() const
Plasma::QRangeModel::setRange
void setRange(qreal min, qreal max)
Definition: qrangemodel.cpp:255
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:08:40 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

PlasmaComponents

Skip menu "PlasmaComponents"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List

kde-runtime API Reference

Skip menu "kde-runtime API Reference"
  • KCMShell
  • KNotify
  • Plasma Runtime
  •     PlasmaCore
  •     DragAndDrop
  •     PlasmaComponents
  •     PlasmaExtraComponents
  •     QtExtraComponents

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal