QGIS API Documentation 3.27.0-Master (f261cc1f8b)
qgslayoutpicturewidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslayoutpicturewidget.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 QGSLAYOUTPICTUREWIDGET_H
19#define QGSLAYOUTPICTUREWIDGET_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_qgslayoutpicturewidgetbase.h"
26#include "qgslayoutitemwidget.h"
27
29
37class GUI_EXPORT QgsLayoutPictureWidget: public QgsLayoutItemBaseWidget, private Ui::QgsLayoutPictureWidgetBase
38{
39 Q_OBJECT
40
41 public:
44 void setMasterLayout( QgsMasterLayoutInterface *masterLayout ) override;
45
46 private slots:
47 void mPictureRotationSpinBox_valueChanged( double d );
48 void mRotationFromComposerMapCheckBox_stateChanged( int state );
49 void mapChanged( QgsLayoutItem *item );
50 void mResizeModeComboBox_currentIndexChanged( int index );
51 void mAnchorPointComboBox_currentIndexChanged( int index );
52
53 protected:
54
55 bool setNewItem( QgsLayoutItem *item ) override;
56
57 protected slots:
59 void populateDataDefinedButtons();
60
61 private slots:
63 void setGuiElementValues();
64
66 void setPicRotationSpinValue( double r );
67
68 void mFillColorButton_colorChanged( const QColor &color );
69 void mStrokeColorButton_colorChanged( const QColor &color );
70 void mStrokeWidthSpinBox_valueChanged( double d );
71 void mPictureRotationOffsetSpinBox_valueChanged( double d );
72 void mNorthTypeComboBox_currentIndexChanged( int index );
73
74 void sourceChanged( const QString &source );
75 void setSvgDynamicParameters( const QMap<QString, QgsProperty> &parameters );
76 void modeChanged( bool checked );
77 private:
78 QPointer< QgsLayoutItemPicture > mPicture;
79 QgsLayoutItemPropertiesWidget *mItemPropertiesWidget = nullptr;
80 int mIconSize = 30;
81 int mBlockSvgModelChanges = 0;
82
83 void updateSvgParamGui( bool resetValues = true );
84};
85
86#endif // QGSLAYOUTPICTUREWIDGET_H
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 that displays SVG files or raster format images (jpg, png, ....
A widget for controlling the common properties of layout items (e.g.
Base class for graphical items within a QgsLayout.
A widget for configuring layout picture items.
Interface for master layout type objects, such as print layouts and reports.