QGIS API Documentation
3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
src
gui
numericformats
qgsnumericformatselectorwidget.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsnumericformatselectorwidget.h
3
--------------------------------
4
begin : January 2020
5
copyright : (C) 2020 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
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 QGSNUMERICFORMATSELECTORWIDGET_H
17
#define QGSNUMERICFORMATSELECTORWIDGET_H
18
19
#include "qgis_gui.h"
20
#include "
qgis_sip.h
"
21
#include "
qgsguiutils.h
"
22
#include "ui_qgsnumericformatselectorbase.h"
23
#include <memory>
24
#include <QDialog>
25
26
class
QgsNumericFormat
;
27
class
QgsBasicNumericFormat
;
28
class
QgsExpressionContextGenerator
;
29
class
QDialogButtonBox;
30
37
class
GUI_EXPORT
QgsNumericFormatSelectorWidget
:
public
QgsPanelWidget
,
private
Ui::QgsNumericFormatSelectorBase
38
{
39
Q_OBJECT
40
41
public
:
42
46
QgsNumericFormatSelectorWidget
( QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
47
48
~QgsNumericFormatSelectorWidget
()
override
;
49
53
void
setFormat(
const
QgsNumericFormat
*format );
54
60
QgsNumericFormat
*format() const
SIP_TRANSFERBACK
;
61
70
void
registerExpressionContextGenerator(
QgsExpressionContextGenerator
*generator );
71
72
signals:
73
77
void
changed();
78
79
private slots:
80
void
formatTypeChanged();
81
void
formatChanged();
82
83
private:
84
85
void
populateTypes();
86
void
updateFormatWidget();
87
void
updateSampleText();
88
89
std::unique_ptr<
QgsNumericFormat
> mCurrentFormat;
90
std::unique_ptr<
QgsBasicNumericFormat
> mPreviewFormat;
91
92
QgsExpressionContextGenerator
*mExpressionContextGenerator =
nullptr
;
93
};
94
95
104
class GUI_EXPORT
QgsNumericFormatSelectorDialog
: public QDialog
105
{
106
Q_OBJECT
107
108
public
:
109
115
QgsNumericFormatSelectorDialog
( QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
, Qt::WindowFlags flags = QgsGuiUtils::ModalDialogFlags );
116
120
void
setFormat(
const
QgsNumericFormat
*format );
121
127
QgsNumericFormat
*format()
const
SIP_TRANSFERBACK
;
128
135
void
registerExpressionContextGenerator(
QgsExpressionContextGenerator
*generator );
136
137
private
:
138
139
QgsNumericFormatSelectorWidget
*mFormatWidget =
nullptr
;
140
QDialogButtonBox *mButtonBox =
nullptr
;
141
142
};
143
144
#endif
//QGSNUMERICFORMATSELECTORWIDGET_H
QgsBasicNumericFormat
A numeric formatter which returns a simple text representation of a value.
Definition
qgsbasicnumericformat.h:32
QgsExpressionContextGenerator
Abstract interface for generating an expression context.
Definition
qgsexpressioncontextgenerator.h:36
QgsNumericFormatSelectorDialog
A simple dialog for customizing a numeric format.
Definition
qgsnumericformatselectorwidget.h:105
QgsNumericFormatSelectorWidget
A widget which allows choice of numeric formats and the properties of them.
Definition
qgsnumericformatselectorwidget.h:38
QgsNumericFormatSelectorWidget::~QgsNumericFormatSelectorWidget
~QgsNumericFormatSelectorWidget() override
QgsNumericFormat
A numeric formatter allows for formatting a numeric value for display, using a variety of different f...
Definition
qgsnumericformat.h:279
QgsPanelWidget
Base class for any widget that can be shown as a inline panel.
Definition
qgspanelwidget.h:30
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:53
SIP_TRANSFERBACK
#define SIP_TRANSFERBACK
Definition
qgis_sip.h:48
qgsguiutils.h
Generated on Sat Nov 23 2024 09:26:05 for QGIS API Documentation by
1.9.8