QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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_gui.h"
20#include "qgis_sip.h"
21
22#include <QComboBox>
23
35class GUI_EXPORT QgsAlignmentComboBox : public QComboBox
36{
37 Q_OBJECT
38
39 public:
43 QgsAlignmentComboBox( QWidget *parent SIP_TRANSFERTHIS = nullptr );
44
48 void setAvailableAlignments( Qt::Alignment alignments );
49
55 Qt::Alignment currentAlignment() const;
56
62 void setCurrentAlignment( Qt::Alignment alignment );
63
72 void customizeAlignmentDisplay( Qt::Alignment alignment, const QString &text = QString(), const QIcon &icon = QIcon() );
73
74 signals:
75
79 void changed();
80
81 private:
82 void populate();
83
84 Qt::Alignment mAlignments = Qt::AlignLeft | Qt::AlignHCenter | Qt::AlignRight;
85 bool mBlockChanged = false;
86};
87
88#endif //QGSALIGNMENTCOMBOBOX_H
QgsAlignmentComboBox(QWidget *parent=nullptr)
Constructor for QgsAlignmentComboBox, with the specified parent widget.
void changed()
Emitted when the alignment is changed.
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.
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