QGIS API Documentation
3.41.0-Master (af5edcb665c)
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
:
45
QgsNumericFormatSelectorWidget
( QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
46
47
~QgsNumericFormatSelectorWidget
()
override
;
48
52
void
setFormat(
const
QgsNumericFormat
*format );
53
59
QgsNumericFormat
*format() const
SIP_TRANSFERBACK
;
60
69
void
registerExpressionContextGenerator(
QgsExpressionContextGenerator
*generator );
70
71
signals:
72
76
void
changed();
77
78
private slots:
79
void
formatTypeChanged();
80
void
formatChanged();
81
82
private:
83
void
populateTypes();
84
void
updateFormatWidget();
85
void
updateSampleText();
86
87
std::unique_ptr<
QgsNumericFormat
> mCurrentFormat;
88
std::unique_ptr<
QgsBasicNumericFormat
> mPreviewFormat;
89
90
QgsExpressionContextGenerator
*mExpressionContextGenerator =
nullptr
;
91
};
92
93
102
class GUI_EXPORT
QgsNumericFormatSelectorDialog
: public QDialog
103
{
104
Q_OBJECT
105
106
public
:
112
QgsNumericFormatSelectorDialog
( QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
, Qt::WindowFlags flags = QgsGuiUtils::ModalDialogFlags );
113
117
void
setFormat(
const
QgsNumericFormat
*format );
118
124
QgsNumericFormat
*format()
const
SIP_TRANSFERBACK
;
125
132
void
registerExpressionContextGenerator(
QgsExpressionContextGenerator
*generator );
133
134
private
:
135
QgsNumericFormatSelectorWidget
*mFormatWidget =
nullptr
;
136
QDialogButtonBox *mButtonBox =
nullptr
;
137
};
138
139
#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:103
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 Thu Dec 26 2024 02:19:01 for QGIS API Documentation by
1.9.8