QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
layout
qgslayoutunitscombobox.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgslayoutunitscombobox.h
3
------------------------
4
Date : July 2017
5
Copyright : (C) 2017 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
#ifndef QGSLAYOUTUNITSCOMBOBOX_H
16
#define QGSLAYOUTUNITSCOMBOBOX_H
17
18
#include "qgis_gui.h"
19
#include "
qgis_sip.h
"
20
#include "
qgsunittypes.h
"
21
22
#include <QComboBox>
23
#include <QDoubleSpinBox>
24
#include <QPointer>
25
26
class
QgsLayoutMeasurementConverter
;
27
33
class
GUI_EXPORT
QgsLayoutUnitsComboBox
:
public
QComboBox
34
{
35
Q_OBJECT
36
Q_PROPERTY(
Qgis::LayoutUnit
unit
READ
unit
WRITE
setUnit
NOTIFY
changed
)
37
38
public
:
42
QgsLayoutUnitsComboBox
( QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
43
48
Qgis::LayoutUnit
unit
()
const
;
49
54
void
setUnit
(
Qgis::LayoutUnit
unit
);
55
66
void
linkToWidget
( QDoubleSpinBox *widget );
67
72
QgsLayoutMeasurementConverter
*
converter
()
const
;
73
80
void
setConverter
(
QgsLayoutMeasurementConverter
*
converter
);
81
82
signals:
83
84
#ifndef SIP_RUN
85
89
void
unitChanged
(
Qgis::LayoutUnit
unit
);
90
#endif
91
95
void
changed
(
int
unit
);
96
97
private
slots:
98
99
void
indexChanged(
int
index );
100
101
private
:
102
QgsLayoutMeasurementConverter
*mConverter =
nullptr
;
103
104
Qgis::LayoutUnit
mOldUnit =
Qgis::LayoutUnit::Millimeters
;
105
106
QList<QPointer<QDoubleSpinBox>> mLinkedSpinBoxes;
107
};
108
109
#endif
// QGSLAYOUTUNITSCOMBOBOX_H
Qgis::LayoutUnit
LayoutUnit
Layout measurement units.
Definition
qgis.h:5778
Qgis::LayoutUnit::Millimeters
@ Millimeters
Millimeters.
Definition
qgis.h:5779
QgsLayoutMeasurementConverter
Provides a method of converting QgsLayoutMeasurements from one unit to another.
Definition
qgslayoutmeasurementconverter.h:42
QgsLayoutUnitsComboBox::linkToWidget
void linkToWidget(QDoubleSpinBox *widget)
Registers a spin box widget as linked with the combo box.
Definition
qgslayoutunitscombobox.cpp:57
QgsLayoutUnitsComboBox::converter
QgsLayoutMeasurementConverter * converter() const
Returns the converter used when automatically converting units for linked widgets.
Definition
qgslayoutunitscombobox.cpp:79
QgsLayoutUnitsComboBox::unitChanged
void unitChanged(Qgis::LayoutUnit unit)
Emitted when the unit is changed.
QgsLayoutUnitsComboBox::setConverter
void setConverter(QgsLayoutMeasurementConverter *converter)
Sets a converter to use when automatically converting units for linked widgets.
Definition
qgslayoutunitscombobox.cpp:84
QgsLayoutUnitsComboBox::changed
void changed(int unit)
Emitted when the unit is changed.
QgsLayoutUnitsComboBox::setUnit
void setUnit(Qgis::LayoutUnit unit)
Sets the unit currently selected in the combo box.
Definition
qgslayoutunitscombobox.cpp:52
QgsLayoutUnitsComboBox::unit
Qgis::LayoutUnit unit
Definition
qgslayoutunitscombobox.h:36
QgsLayoutUnitsComboBox::QgsLayoutUnitsComboBox
QgsLayoutUnitsComboBox(QWidget *parent=nullptr)
Constructor for QgsLayoutUnitsComboBox.
Definition
qgslayoutunitscombobox.cpp:24
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
qgsunittypes.h
Generated on
for QGIS API Documentation by
1.17.0