QGIS API Documentation 3.99.0-Master (21b3aa880ba)
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:
40
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
73 void customizeAlignmentDisplay( Qt::Alignment alignment, const QString &text = QString(), const QIcon &icon = QIcon() );
74
75 signals:
76
80 void changed();
81
82 private:
83 void populate();
84
85 Qt::Alignment mAlignments = Qt::AlignLeft | Qt::AlignHCenter | Qt::AlignRight;
86 bool mBlockChanged = false;
87};
88
89#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