QGIS API Documentation
2.12.0-Lyon
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
src
gui
editorwidgets
qgsdoublespinbox.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsdoublespinbox.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 QGSDOUBLESPPINBOX_H
17
#define QGSDOUBLESPPINBOX_H
18
19
#include <QDoubleSpinBox>
20
#include <QToolButton>
21
27
class
GUI_EXPORT
QgsDoubleSpinBox
:
public
QDoubleSpinBox
28
{
29
Q_OBJECT
30
Q_PROPERTY(
bool
showClearButton READ showClearButton WRITE setShowClearButton )
31
Q_PROPERTY(
bool
expressionsEnabled READ expressionsEnabled WRITE setExpressionsEnabled )
32
33
public:
34
enum
ClearValueMode
35
{
36
MinimumValue
,
37
MaximumValue
,
38
CustomValue
39
};
40
41
explicit
QgsDoubleSpinBox
(
QWidget
*parent = 0 );
42
45
void
setShowClearButton(
const
bool
showClearButton );
46
bool
showClearButton
()
const
{
return
mShowClearButton;}
47
53
void
setExpressionsEnabled(
const
bool
enabled );
59
bool
expressionsEnabled
()
const
{
return
mExpressionsEnabled;}
60
62
virtual
void
clear
()
override
;
63
69
void
setClearValue(
double
customValue,
const
QString
& clearValueText =
QString
() );
75
void
setClearValueMode( ClearValueMode mode,
const
QString
& clearValueText =
QString
() );
76
78
double
clearValue()
const
;
79
80
virtual
double
valueFromText
(
const
QString
& text )
const override
;
81
virtual
QValidator::State
validate
(
QString
& input,
int
& pos )
const override
;
82
83
protected
:
84
virtual
void
resizeEvent
(
QResizeEvent
* event )
override
;
85
virtual
void
changeEvent
(
QEvent
* event )
override
;
86
virtual
void
paintEvent
(
QPaintEvent
* event )
override
;
87
88
private
slots:
89
void
changed(
const
double
&value );
90
91
private
:
92
int
frameWidth()
const
;
93
bool
shouldShowClearForValue(
const
double
value )
const
;
94
95
bool
mShowClearButton;
96
ClearValueMode mClearValueMode;
97
double
mCustomClearValue;
98
99
bool
mExpressionsEnabled;
100
101
QToolButton
* mClearButton;
102
QString
stripped(
const
QString
&originalText )
const
;
103
};
104
105
#endif // QGSDOUBLESPPINBOX_H
QgsDoubleSpinBox
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value...
Definition:
qgsdoublespinbox.h:27
QDoubleSpinBox::validate
virtual QValidator::State validate(QString &text, int &pos) const
QEvent
QResizeEvent
QWidget
QAbstractSpinBox::clear
virtual void clear()
QgsDoubleSpinBox::showClearButton
bool showClearButton() const
Definition:
qgsdoublespinbox.h:46
QgsDoubleSpinBox::MaximumValue
Definition:
qgsdoublespinbox.h:37
QgsDoubleSpinBox::ClearValueMode
ClearValueMode
Definition:
qgsdoublespinbox.h:34
QgsDoubleSpinBox::expressionsEnabled
bool expressionsEnabled() const
Returns whether the widget will allow entry of simple expressions, which are evaluated and then disca...
Definition:
qgsdoublespinbox.h:59
QDoubleSpinBox
QString
QToolButton
QAbstractSpinBox::paintEvent
virtual void paintEvent(QPaintEvent *event)
QAbstractSpinBox::resizeEvent
virtual void resizeEvent(QResizeEvent *event)
QAbstractSpinBox::changeEvent
virtual void changeEvent(QEvent *event)
QDoubleSpinBox::valueFromText
virtual double valueFromText(const QString &text) const
QgsDoubleSpinBox::MinimumValue
Definition:
qgsdoublespinbox.h:36
QPaintEvent
Generated on Sat Oct 24 2015 04:11:25 for QGIS API Documentation by
1.8.9.1