QGIS API Documentation
2.14.0-Essen
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
src
gui
editorwidgets
qgsspinbox.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsspinbox.h
3
--------------------------------------
4
Date : 09.2014
5
Copyright : (C) 2014 Denis Rouzaud
6
Email :
[email protected]
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSSPPINBOX_H
17
#define QGSSPPINBOX_H
18
19
#include <QSpinBox>
20
#include <QToolButton>
21
27
class
GUI_EXPORT
QgsSpinBox
:
public
QSpinBox
28
{
29
Q_OBJECT
30
Q_PROPERTY(
bool
showClearButton READ showClearButton WRITE setShowClearButton )
31
32
public
:
33
enum
ClearValueMode
34
{
35
MinimumValue
,
36
MaximumValue
,
37
CustomValue
38
};
39
40
explicit
QgsSpinBox
(
QWidget
*parent =
nullptr
);
41
44
void
setShowClearButton(
const
bool
showClearButton );
45
bool
showClearButton
()
const
{
return
mShowClearButton;}
46
52
void
setExpressionsEnabled(
const
bool
enabled );
58
bool
expressionsEnabled
()
const
{
return
mExpressionsEnabled;}
59
61
virtual
void
clear
()
override
;
62
68
void
setClearValue(
int
customValue,
const
QString
& clearValueText =
QString
() );
74
void
setClearValueMode(
ClearValueMode
mode,
const
QString
& clearValueText =
QString
() );
75
77
int
clearValue()
const
;
78
79
virtual
int
valueFromText
(
const
QString
& text )
const override
;
80
virtual
QValidator::State
validate
(
QString
& input,
int
& pos )
const override
;
81
82
protected
:
83
virtual
void
resizeEvent
(
QResizeEvent
* event )
override
;
84
virtual
void
changeEvent
(
QEvent
* event )
override
;
85
virtual
void
paintEvent
(
QPaintEvent
* event )
override
;
86
87
private
slots:
88
void
changed(
int
value );
89
90
private
:
91
int
frameWidth()
const
;
92
bool
shouldShowClearForValue(
const
int
value )
const
;
93
94
bool
mShowClearButton;
95
ClearValueMode
mClearValueMode;
96
int
mCustomClearValue;
97
98
bool
mExpressionsEnabled;
99
100
QToolButton
* mClearButton;
101
QString
stripped(
const
QString
&originalText )
const
;
102
};
103
104
#endif // QGSSPPINBOX_H
QEvent
QResizeEvent
QWidget
QAbstractSpinBox::clear
virtual void clear()
QgsSpinBox::ClearValueMode
ClearValueMode
Definition:
qgsspinbox.h:33
QgsSpinBox::MaximumValue
Definition:
qgsspinbox.h:36
QgsSpinBox
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value...
Definition:
qgsspinbox.h:27
QgsSpinBox::MinimumValue
Definition:
qgsspinbox.h:35
QString
QSpinBox
QgsSpinBox::expressionsEnabled
bool expressionsEnabled() const
Returns whether the widget will allow entry of simple expressions, which are evaluated and then disca...
Definition:
qgsspinbox.h:58
QToolButton
QSpinBox::valueFromText
virtual int valueFromText(const QString &text) const
QSpinBox::validate
virtual QValidator::State validate(QString &text, int &pos) const
QAbstractSpinBox::paintEvent
virtual void paintEvent(QPaintEvent *event)
QAbstractSpinBox::resizeEvent
virtual void resizeEvent(QResizeEvent *event)
QAbstractSpinBox::changeEvent
virtual void changeEvent(QEvent *event)
QPaintEvent
QgsSpinBox::showClearButton
bool showClearButton() const
Definition:
qgsspinbox.h:45
Generated on Sat Feb 27 2016 18:33:25 for QGIS API Documentation by
1.8.11