QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
layout
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
23
#include "ui_qgslayoutlabelwidgetbase.h"
24
25
#include <functional>
26
27
#include "qgis_gui.h"
28
#include "
qgslayoutitemlabel.h
"
29
#include "
qgslayoutitemwidget.h
"
30
31
#define SIP_NO_FILE
32
40
class
GUI_EXPORT
QgsLayoutLabelWidget
:
public
QgsLayoutItemBaseWidget
,
public
QgsExpressionContextGenerator
,
private
Ui::QgsLayoutLabelWidgetBase
41
{
42
Q_OBJECT
43
public
:
45
explicit
QgsLayoutLabelWidget
(
QgsLayoutItemLabel
*label );
46
void
setMasterLayout
(
QgsMasterLayoutInterface
*masterLayout )
override
;
47
QgsExpressionContext
createExpressionContext
()
const override
;
48
63
static
void
buildInsertDynamicTextMenu
(
QgsLayout
*layout, QMenu *menu,
const
std::function<
void
(
const
QString &expression )> &callback );
64
65
protected
:
66
bool
setNewItem
(
QgsLayoutItem
*item )
override
;
67
68
private
slots:
69
void
mHtmlCheckBox_stateChanged(
int
i );
70
void
mTextEdit_textChanged();
71
void
mInsertExpressionButton_clicked();
72
void
mMarginXDoubleSpinBox_valueChanged(
double
d );
73
void
mMarginYDoubleSpinBox_valueChanged(
double
d );
74
void
horizontalAlignmentChanged();
75
void
verticalAlignmentChanged();
76
void
setGuiElementValues();
77
void
fontChanged();
78
79
private
:
80
QPointer<QgsLayoutItemLabel> mLabel =
nullptr
;
81
82
QgsLayoutItemPropertiesWidget
*mItemPropertiesWidget =
nullptr
;
83
84
QMenu *mDynamicTextMenu =
nullptr
;
85
86
void
blockAllSignals(
bool
block );
87
};
88
89
#endif
//QGSLAYOUTLABELWIDGET_H
QgsExpressionContextGenerator
Abstract interface for generating an expression context.
Definition
qgsexpressioncontextgenerator.h:36
QgsExpressionContextGenerator::createExpressionContext
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition
qgsexpressioncontext.h:491
QgsLayoutItemBaseWidget::setNewItem
virtual bool setNewItem(QgsLayoutItem *item)
Attempts to update the widget to show the properties for the specified item.
Definition
qgslayoutitemwidget.cpp:270
QgsLayoutItemBaseWidget::setMasterLayout
virtual void setMasterLayout(QgsMasterLayoutInterface *masterLayout)
Sets the master layout associated with the item.
Definition
qgslayoutitemwidget.cpp:252
QgsLayoutItemBaseWidget::QgsLayoutItemBaseWidget
QgsLayoutItemBaseWidget(QWidget *parent SIP_TRANSFERTHIS, QgsLayoutObject *layoutObject)
Constructor for QgsLayoutItemBaseWidget, linked with the specified layoutObject.
Definition
qgslayoutitemwidget.cpp:202
QgsLayoutItemLabel
A layout item subclass for text labels.
Definition
qgslayoutitemlabel.h:36
QgsLayoutItemPropertiesWidget
A widget for controlling the common properties of layout items (e.g.
Definition
qgslayoutitemwidget.h:214
QgsLayoutItem
Base class for graphical items within a QgsLayout.
Definition
qgslayoutitem.h:106
QgsLayoutLabelWidget::buildInsertDynamicTextMenu
static void buildInsertDynamicTextMenu(QgsLayout *layout, QMenu *menu, const std::function< void(const QString &expression)> &callback)
Populates the specified menu with actions reflecting dynamic text expressions applicable for a layout...
Definition
qgslayoutlabelwidget.cpp:117
QgsLayoutLabelWidget::QgsLayoutLabelWidget
QgsLayoutLabelWidget(QgsLayoutItemLabel *label)
constructor
Definition
qgslayoutlabelwidget.cpp:40
QgsLayout
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition
qgslayout.h:51
QgsMasterLayoutInterface
Interface for master layout type objects, such as print layouts and reports.
Definition
qgsmasterlayoutinterface.h:45
qgslayoutitemlabel.h
qgslayoutitemwidget.h
Generated on
for QGIS API Documentation by
1.17.0