QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
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 "ui_qgsnumericformatselectorbase.h"
20
21
#include <memory>
22
23
#include "qgis_gui.h"
24
#include "
qgis_sip.h
"
25
#include "
qgsguiutils.h
"
26
27
#include <QDialog>
28
29
class
QgsNumericFormat
;
30
class
QgsBasicNumericFormat
;
31
class
QgsExpressionContextGenerator
;
32
class
QDialogButtonBox;
33
40
class
GUI_EXPORT
QgsNumericFormatSelectorWidget
:
public
QgsPanelWidget
,
private
Ui::QgsNumericFormatSelectorBase
41
{
42
Q_OBJECT
43
44
public
:
48
QgsNumericFormatSelectorWidget
( QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
49
50
~QgsNumericFormatSelectorWidget
()
override
;
51
55
void
setFormat
(
const
QgsNumericFormat
*
format
);
56
62
QgsNumericFormat
*
format
() const
SIP_TRANSFERBACK
;
63
72
void
registerExpressionContextGenerator
(
QgsExpressionContextGenerator
*generator );
73
74
private slots:
75
void
formatTypeChanged();
76
void
formatChanged();
77
78
private:
79
void
populateTypes();
80
void
updateFormatWidget();
81
void
updateSampleText();
82
83
std::unique_ptr<
QgsNumericFormat
> mCurrentFormat;
84
std::unique_ptr<
QgsBasicNumericFormat
> mPreviewFormat;
85
86
QgsExpressionContextGenerator
*mExpressionContextGenerator =
nullptr
;
87
};
88
89
98
class GUI_EXPORT
QgsNumericFormatSelectorDialog
: public QDialog
99
{
100
Q_OBJECT
101
102
public
:
108
QgsNumericFormatSelectorDialog
( QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
, Qt::WindowFlags flags = QgsGuiUtils::ModalDialogFlags );
109
113
void
setFormat
(
const
QgsNumericFormat
*
format
);
114
120
QgsNumericFormat
*
format
()
const
SIP_TRANSFERBACK
;
121
128
void
registerExpressionContextGenerator
(
QgsExpressionContextGenerator
*generator );
129
130
private
:
131
QgsNumericFormatSelectorWidget
*mFormatWidget =
nullptr
;
132
QDialogButtonBox *mButtonBox =
nullptr
;
133
};
134
135
#endif
//QGSNUMERICFORMATSELECTORWIDGET_H
QgsBasicNumericFormat
A numeric formatter which returns a simple text representation of a value.
Definition
qgsbasicnumericformat.h:33
QgsExpressionContextGenerator
Abstract interface for generating an expression context.
Definition
qgsexpressioncontextgenerator.h:36
QgsNumericFormatSelectorDialog::format
QgsNumericFormat * format() const
Returns a new format object representing the settings currently configured in the dialog.
Definition
qgsnumericformatselectorwidget.cpp:205
QgsNumericFormatSelectorDialog::setFormat
void setFormat(const QgsNumericFormat *format)
Sets the format to show in the dialog.
Definition
qgsnumericformatselectorwidget.cpp:200
QgsNumericFormatSelectorDialog::QgsNumericFormatSelectorDialog
QgsNumericFormatSelectorDialog(QWidget *parent=nullptr, Qt::WindowFlags flags=QgsGuiUtils::ModalDialogFlags)
Constructor for QgsNumericFormatSelectorDialog.
Definition
qgsnumericformatselectorwidget.cpp:179
QgsNumericFormatSelectorDialog::registerExpressionContextGenerator
void registerExpressionContextGenerator(QgsExpressionContextGenerator *generator)
Register an expression context generator class that will be used to retrieve an expression context fo...
Definition
qgsnumericformatselectorwidget.cpp:210
QgsNumericFormatSelectorWidget
A widget which allows choice of numeric formats and the properties of them.
Definition
qgsnumericformatselectorwidget.h:41
QgsNumericFormatSelectorWidget::format
QgsNumericFormat * format() const
Returns a new format object representing the settings currently configured in the widget.
Definition
qgsnumericformatselectorwidget.cpp:79
QgsNumericFormatSelectorWidget::~QgsNumericFormatSelectorWidget
~QgsNumericFormatSelectorWidget() override
QgsNumericFormatSelectorWidget::registerExpressionContextGenerator
void registerExpressionContextGenerator(QgsExpressionContextGenerator *generator)
Register an expression context generator class that will be used to retrieve an expression context fo...
Definition
qgsnumericformatselectorwidget.cpp:84
QgsNumericFormatSelectorWidget::QgsNumericFormatSelectorWidget
QgsNumericFormatSelectorWidget(QWidget *parent=nullptr)
Constructor for QgsNumericFormatSelectorWidget with the specified parent widget.
Definition
qgsnumericformatselectorwidget.cpp:36
QgsNumericFormatSelectorWidget::setFormat
void setFormat(const QgsNumericFormat *format)
Sets the format to show in the widget.
Definition
qgsnumericformatselectorwidget.cpp:58
QgsNumericFormat
Abstract base class for numeric formatters, which allow for formatting a numeric value for display.
Definition
qgsnumericformat.h:232
QgsPanelWidget::QgsPanelWidget
QgsPanelWidget(QWidget *parent=nullptr)
Base class for any widget that can be shown as an inline panel.
Definition
qgspanelwidget.cpp:30
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
SIP_TRANSFERBACK
#define SIP_TRANSFERBACK
Definition
qgis_sip.h:47
qgsguiutils.h
Generated on
for QGIS API Documentation by
1.17.0