QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
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 <QComboBox>
19
#include "qgis_gui.h"
20
#include "
qgis_sip.h
"
21
#include "
qgsunittypes.h
"
22
#include <QDoubleSpinBox>
23
#include <QPointer>
24
25
class
QgsLayoutMeasurementConverter
;
26
33
class
GUI_EXPORT
QgsLayoutUnitsComboBox
:
public
QComboBox
34
{
35
Q_OBJECT
36
Q_PROPERTY(
QgsUnitTypes::LayoutUnit
unit READ unit WRITE setUnit NOTIFY changed )
37
38
public
:
39
43
QgsLayoutUnitsComboBox
( QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
44
49
QgsUnitTypes::LayoutUnit
unit()
const
;
50
55
void
setUnit(
QgsUnitTypes::LayoutUnit
unit );
56
67
void
linkToWidget( QDoubleSpinBox *widget );
68
73
QgsLayoutMeasurementConverter
*converter()
const
;
74
81
void
setConverter(
QgsLayoutMeasurementConverter
*converter );
82
83
signals:
84
88
void
changed
(
QgsUnitTypes::LayoutUnit
unit );
89
90
private
slots:
91
92
void
indexChanged(
int
index );
93
94
private
:
95
96
QgsLayoutMeasurementConverter
*mConverter =
nullptr
;
97
98
QgsUnitTypes::LayoutUnit
mOldUnit =
QgsUnitTypes::LayoutMillimeters
;
99
100
QList< QPointer< QDoubleSpinBox > > mLinkedSpinBoxes;
101
};
102
103
#endif // QGSLAYOUTUNITSCOMBOBOX_H
QgsLayoutUnitsComboBox::changed
void changed(QgsUnitTypes::LayoutUnit unit)
Emitted when the unit is changed.
QgsUnitTypes::LayoutUnit
LayoutUnit
Layout measurement units.
Definition:
qgsunittypes.h:181
qgsunittypes.h
qgis_sip.h
QgsLayoutUnitsComboBox
A custom combo box for selecting units for layout settings.
Definition:
qgslayoutunitscombobox.h:34
QgsLayoutMeasurementConverter
This class provides a method of converting QgsLayoutMeasurements from one unit to another.
Definition:
qgslayoutmeasurementconverter.h:41
QgsUnitTypes::LayoutMillimeters
@ LayoutMillimeters
Millimeters.
Definition:
qgsunittypes.h:182
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition:
qgis_sip.h:53
Generated on Sat Oct 24 2020 17:43:09 for QGIS API Documentation by
1.8.20