QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
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#include <functional>
29
37class GUI_EXPORT QgsLayoutLabelWidget: public QgsLayoutItemBaseWidget, public QgsExpressionContextGenerator, private Ui::QgsLayoutLabelWidgetBase
38{
39 Q_OBJECT
40 public:
43 void setMasterLayout( QgsMasterLayoutInterface *masterLayout ) override;
45
60 static void buildInsertDynamicTextMenu( QgsLayout *layout, QMenu *menu, const std::function< void( const QString &expression ) > &callback );
61
62 protected:
63
64 bool setNewItem( QgsLayoutItem *item ) override;
65
66 private slots:
67 void mHtmlCheckBox_stateChanged( int i );
68 void mTextEdit_textChanged();
69 void mInsertExpressionButton_clicked();
70 void mMarginXDoubleSpinBox_valueChanged( double d );
71 void mMarginYDoubleSpinBox_valueChanged( double d );
72 void mCenterRadioButton_clicked();
73 void mLeftRadioButton_clicked();
74 void mRightRadioButton_clicked();
75 void mTopRadioButton_clicked();
76 void mBottomRadioButton_clicked();
77 void mMiddleRadioButton_clicked();
78 void setGuiElementValues();
79 void fontChanged();
80 void justifyClicked();
81
82 private:
83 QPointer< QgsLayoutItemLabel > mLabel = nullptr;
84
85 QgsLayoutItemPropertiesWidget *mItemPropertiesWidget = nullptr;
86
87 QMenu *mDynamicTextMenu = nullptr;
88
89 void blockAllSignals( bool block );
90};
91
92#endif //QGSLAYOUTLABELWIDGET_H
Abstract interface for generating an expression context.
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
A base class for property widgets for layout items.
virtual bool setNewItem(QgsLayoutItem *item)
Attempts to update the widget to show the properties for the specified item.
virtual void setMasterLayout(QgsMasterLayoutInterface *masterLayout)
Sets the master layout associated with the item.
A layout item subclass for text labels.
A widget for controlling the common properties of layout items (e.g.
Base class for graphical items within a QgsLayout.
A widget for layout item settings.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition: qgslayout.h:51
Interface for master layout type objects, such as print layouts and reports.