QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgslayoutlabelwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgslayoutlabelwidget.h
3  ----------------------
4  begin : October 2017
5  copyright : (C) 2017 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSLAYOUTLABELWIDGET_H
19 #define QGSLAYOUTLABELWIDGET_H
20 
21 // We don't want to expose this in the public API
22 #define SIP_NO_FILE
23 
24 #include "qgis_gui.h"
25 #include "ui_qgslayoutlabelwidgetbase.h"
26 #include "qgslayoutitemwidget.h"
27 #include "qgslayoutitemlabel.h"
28 
36 class GUI_EXPORT QgsLayoutLabelWidget: public QgsLayoutItemBaseWidget, private Ui::QgsLayoutLabelWidgetBase
37 {
38  Q_OBJECT
39  public:
41  explicit QgsLayoutLabelWidget( QgsLayoutItemLabel *label );
42  void setMasterLayout( QgsMasterLayoutInterface *masterLayout ) override;
43 
44  protected:
45 
46  bool setNewItem( QgsLayoutItem *item ) override;
47 
48  private slots:
49  void mHtmlCheckBox_stateChanged( int i );
50  void mTextEdit_textChanged();
51  void mInsertExpressionButton_clicked();
52  void mMarginXDoubleSpinBox_valueChanged( double d );
53  void mMarginYDoubleSpinBox_valueChanged( double d );
54  void mFontColorButton_colorChanged( const QColor &newLabelColor );
55  void mCenterRadioButton_clicked();
56  void mLeftRadioButton_clicked();
57  void mRightRadioButton_clicked();
58  void mTopRadioButton_clicked();
59  void mBottomRadioButton_clicked();
60  void mMiddleRadioButton_clicked();
61  void setGuiElementValues();
62  void fontChanged();
63  void justifyClicked();
64 
65  private:
66  QPointer< QgsLayoutItemLabel > mLabel = nullptr;
67 
68  QgsLayoutItemPropertiesWidget *mItemPropertiesWidget = nullptr;
69 
70  void blockAllSignals( bool block );
71 };
72 
73 #endif //QGSLAYOUTLABELWIDGET_H
QgsLayoutLabelWidget
A widget for layout item settings.
Definition: qgslayoutlabelwidget.h:37
qgslayoutitemlabel.h
QgsLayoutItemPropertiesWidget
A widget for controlling the common properties of layout items (e.g.
Definition: qgslayoutitemwidget.h:219
qgslayoutitemwidget.h
QgsLayoutItem
Base class for graphical items within a QgsLayout.
Definition: qgslayoutitem.h:113
QgsLayoutItemBaseWidget
A base class for property widgets for layout items.
Definition: qgslayoutitemwidget.h:123
QgsLayoutItemBaseWidget::setNewItem
virtual bool setNewItem(QgsLayoutItem *item)
Attempts to update the widget to show the properties for the specified item.
Definition: qgslayoutitemwidget.cpp:222
QgsLayoutItemBaseWidget::setMasterLayout
virtual void setMasterLayout(QgsMasterLayoutInterface *masterLayout)
Sets the master layout associated with the item.
Definition: qgslayoutitemwidget.cpp:202
QgsLayoutItemLabel
A layout item subclass for text labels.
Definition: qgslayoutitemlabel.h:35
QgsMasterLayoutInterface
Interface for master layout type objects, such as print layouts and reports.
Definition: qgsmasterlayoutinterface.h:43