QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
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 bool setNewItem( QgsLayoutItem *item ) override;
64
65 private slots:
66 void mHtmlCheckBox_stateChanged( int i );
67 void mTextEdit_textChanged();
68 void mInsertExpressionButton_clicked();
69 void mMarginXDoubleSpinBox_valueChanged( double d );
70 void mMarginYDoubleSpinBox_valueChanged( double d );
71 void horizontalAlignmentChanged();
72 void verticalAlignmentChanged();
73 void setGuiElementValues();
74 void fontChanged();
75
76 private:
77 QPointer<QgsLayoutItemLabel> mLabel = nullptr;
78
79 QgsLayoutItemPropertiesWidget *mItemPropertiesWidget = nullptr;
80
81 QMenu *mDynamicTextMenu = nullptr;
82
83 void blockAllSignals( bool block );
84};
85
86#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:49
Interface for master layout type objects, such as print layouts and reports.