• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

Plasma

  • plasma
  • widgets
spinbox.h
Go to the documentation of this file.
1/*
2 * Copyright 2008 Aaron Seigo <aseigo@kde.org>
3 * Copyright 2009 Davide Bettio <davide.bettio@kdemail.net>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Library General Public License as
7 * published by the Free Software Foundation; either version 2, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details
14 *
15 * You should have received a copy of the GNU Library General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef PLASMA_SPINBOX_H
22#define PLASMA_SPINBOX_H
23
24#include <QtGui/QGraphicsProxyWidget>
25
26#include <plasma/plasma_export.h>
27
28class KIntSpinBox;
29
30namespace Plasma
31{
32
33class SpinBoxPrivate;
34
40class PLASMA_EXPORT SpinBox : public QGraphicsProxyWidget
41{
42 Q_OBJECT
43
44 Q_PROPERTY(QGraphicsWidget *parentWidget READ parentWidget)
45 Q_PROPERTY(int maximum READ maximum WRITE setMinimum)
46 Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
47 Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged)
48 Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet)
49 Q_PROPERTY(KIntSpinBox *nativeWidget READ nativeWidget)
50
51public:
52 explicit SpinBox(QGraphicsWidget *parent = 0);
53 ~SpinBox();
54
58 int maximum() const;
59
63 int minimum() const;
64
68 int value() const;
69
75 void setStyleSheet(const QString &stylesheet);
76
80 QString styleSheet();
81
85 KIntSpinBox *nativeWidget() const;
86
87protected:
88 void changeEvent(QEvent *event);
89 void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
90 void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
91 void resizeEvent(QGraphicsSceneResizeEvent *event);
92 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
93 void mousePressEvent(QGraphicsSceneMouseEvent *event);
94 void focusOutEvent(QFocusEvent *event);
95
96public Q_SLOTS:
100 void setMaximum(int maximum);
101
105 void setMinimum(int minimum);
106
110 void setRange(int minimum, int maximum);
111
118 void setValue(int value);
119
120Q_SIGNALS:
128 void sliderMoved(int value);
129
134 void valueChanged(int value);
135
140 void editingFinished();
141
142private:
143 Q_PRIVATE_SLOT(d, void setPalette())
144
145 SpinBoxPrivate * const d;
146};
147
148} // namespace Plasma
149
150#endif // multiple inclusion guard
Plasma::SpinBox::focusOutEvent
void focusOutEvent(QFocusEvent *event)
Definition spinbox.cpp:203
Plasma::SpinBox::setMinimum
void setMinimum(int minimum)
Sets the minimum value the slider can take.
Definition spinbox.cpp:109
Plasma::SpinBox::hoverLeaveEvent
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
Definition spinbox.cpp:161
Plasma::SpinBox::value
int value
Definition spinbox.h:47
Plasma::SpinBox::styleSheet
QString styleSheet
Definition spinbox.h:48
Plasma::SpinBox::minimum
int minimum
Definition spinbox.h:46
Plasma::SpinBox::nativeWidget
KIntSpinBox * nativeWidget
Definition spinbox.h:49
Plasma::SpinBox::setMaximum
void setMaximum(int maximum)
Sets the maximum value the slider can take.
Definition spinbox.cpp:99
Plasma::SpinBox::setValue
void setValue(int value)
Sets the value of the slider.
Definition spinbox.cpp:124
Plasma::SpinBox::setRange
void setRange(int minimum, int maximum)
Sets the minimum and maximum values the slider can take.
Definition spinbox.cpp:119
Plasma::SpinBox::hoverEnterEvent
void hoverEnterEvent(QGraphicsSceneHoverEvent *event)
Definition spinbox.cpp:155
Plasma::SpinBox::SpinBox
SpinBox(QGraphicsWidget *parent=0)
Definition spinbox.cpp:59
Plasma::SpinBox::sliderMoved
void sliderMoved(int value)
This signal is emitted when the user drags the slider.
Plasma::SpinBox::maximum
int maximum
Definition spinbox.h:45
Plasma::SpinBox::valueChanged
void valueChanged(int value)
This signal is emitted when the slider value has changed, with the new slider value as argument.
Plasma::SpinBox::resizeEvent
void resizeEvent(QGraphicsSceneResizeEvent *event)
Definition spinbox.cpp:167
Plasma::SpinBox::parentWidget
QGraphicsWidget * parentWidget
Definition spinbox.h:44
Plasma::SpinBox::paint
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Definition spinbox.cpp:179
Plasma::SpinBox::editingFinished
void editingFinished()
This signal is emitted when editing is finished.
Plasma::SpinBox::changeEvent
void changeEvent(QEvent *event)
Definition spinbox.cpp:149
Plasma::SpinBox::setStyleSheet
void setStyleSheet(const QString &stylesheet)
Sets the stylesheet used to control the visual display of this SpinBox.
Definition spinbox.cpp:134
Plasma::SpinBox::mousePressEvent
void mousePressEvent(QGraphicsSceneMouseEvent *event)
Definition spinbox.cpp:187
QGraphicsProxyWidget
QGraphicsWidget
QStyleOptionGraphicsItem
QWidget
Plasma
Namespace for everything in libplasma.
Definition abstractdialogmanager.cpp:25
plasma_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 17 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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