QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
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
26
32class GUI_EXPORT QgsLayoutUnitsComboBox : public QComboBox
33{
34 Q_OBJECT
35 Q_PROPERTY( Qgis::LayoutUnit unit READ unit WRITE setUnit NOTIFY changed )
36
37 public:
41 QgsLayoutUnitsComboBox( QWidget *parent SIP_TRANSFERTHIS = nullptr );
42
47 Qgis::LayoutUnit unit() const;
48
53 void setUnit( Qgis::LayoutUnit unit );
54
65 void linkToWidget( QDoubleSpinBox *widget );
66
71 QgsLayoutMeasurementConverter *converter() const;
72
79 void setConverter( QgsLayoutMeasurementConverter *converter );
80
81 signals:
82
83#ifndef SIP_RUN
84
89#endif
90
94 void changed( int unit );
95
96 private slots:
97
98 void indexChanged( int index );
99
100 private:
101 QgsLayoutMeasurementConverter *mConverter = nullptr;
102
104
105 QList<QPointer<QDoubleSpinBox>> mLinkedSpinBoxes;
106};
107
108#endif // QGSLAYOUTUNITSCOMBOBOX_H
LayoutUnit
Layout measurement units.
Definition qgis.h:4930
@ Millimeters
Millimeters.
This class provides a method of converting QgsLayoutMeasurements from one unit to another.
A custom combo box for selecting units for layout settings.
void unitChanged(Qgis::LayoutUnit unit)
Emitted when the unit is changed.
void changed(int unit)
Emitted when the unit is changed.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53