QGIS API Documentation 3.99.0-Master (d270888f95f)
Loading...
Searching...
No Matches
qgsalignmentcombobox.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsalignmentcombobox.h
3 ---------------------
4 begin : June 2019
5 copyright : (C) 2019 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 QGSALIGNMENTCOMBOBOX_H
17#define QGSALIGNMENTCOMBOBOX_H
18
19#include "qgis.h"
20#include "qgis_gui.h"
21#include "qgis_sip.h"
22
23#include <QComboBox>
24
36class GUI_EXPORT QgsAlignmentComboBox : public QComboBox
37{
38 Q_OBJECT
39
40 public:
44 QgsAlignmentComboBox( QWidget *parent SIP_TRANSFERTHIS = nullptr );
45
49 void setAvailableAlignments( Qt::Alignment alignments );
50
56 Qt::Alignment currentAlignment() const;
57
63 void setCurrentAlignment( Qt::Alignment alignment );
64
72
80
87
94
103 void customizeAlignmentDisplay( Qt::Alignment alignment, const QString &text = QString(), const QIcon &icon = QIcon() );
104
105 signals:
106
110 void changed();
111
112 private:
113 void populate();
114
115 Qt::Alignment mAlignments = Qt::AlignLeft | Qt::AlignHCenter | Qt::AlignRight;
116 bool mBlockChanged = false;
117};
118
119#endif //QGSALIGNMENTCOMBOBOX_H
TextVerticalAlignment
Text vertical alignment.
Definition qgis.h:3019
TextHorizontalAlignment
Text horizontal alignment.
Definition qgis.h:3000
QgsAlignmentComboBox(QWidget *parent=nullptr)
Constructor for QgsAlignmentComboBox, with the specified parent widget.
void changed()
Emitted when the alignment is changed.
Qgis::TextHorizontalAlignment horizontalAlignment() const
Returns the current alignment choice as a QGIS horizontal text alignment enum.
void setCurrentAlignment(Qt::Alignment alignment)
Sets the current alignment choice.
void customizeAlignmentDisplay(Qt::Alignment alignment, const QString &text=QString(), const QIcon &icon=QIcon())
Sets the text and icon to use for a particular alignment option, replacing the default text or icon.
Qgis::TextVerticalAlignment verticalAlignment() const
Returns the current alignment choice as a QGIS horizontal text alignment enum.
Qt::Alignment currentAlignment() const
Returns the current alignment choice.
void setAvailableAlignments(Qt::Alignment alignments)
Sets the available alignment choices shown in the combo box.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53