QGIS API Documentation 3.41.0-Master (3440c17df1d)
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
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 horizontalAlignmentChanged();
73 void verticalAlignmentChanged();
74 void setGuiElementValues();
75 void fontChanged();
76
77 private:
78 QPointer< QgsLayoutItemLabel > mLabel = nullptr;
79
80 QgsLayoutItemPropertiesWidget *mItemPropertiesWidget = nullptr;
81
82 QMenu *mDynamicTextMenu = nullptr;
83
84 void blockAllSignals( bool block );
85};
86
87#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.