QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
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 <QComboBox>
20 #include "qgis_gui.h"
21 #include "qgis_sip.h"
22 
34 class GUI_EXPORT QgsAlignmentComboBox : public QComboBox
35 {
36  Q_OBJECT
37 
38  public:
39 
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 
83  void populate();
84 
85  Qt::Alignment mAlignments = Qt::AlignLeft | Qt::AlignHCenter | Qt::AlignRight;
86  bool mBlockChanged = false;
87 };
88 
89 #endif //QGSALIGNMENTCOMBOBOX_H
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
A combo box which allows choice of alignment settings (e.g.