QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
qgslayoutguidewidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslayoutguidewidget.h
3 ----------------------
4 begin : July 2017
5 copyright : (C) 2017 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8/***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16
17#ifndef QGSLAYOUTGUIDEWIDGET_H
18#define QGSLAYOUTGUIDEWIDGET_H
19
20// We don't want to expose this in the public API
21#define SIP_NO_FILE
22
23#include "qgis_gui.h"
24#include "ui_qgslayoutguidewidgetbase.h"
25#include "qgspanelwidget.h"
26#include <QStyledItemDelegate>
27
28
29class QgsLayoutView;
30class QgsLayout;
32
40class GUI_EXPORT QgsLayoutGuideWidget : public QgsPanelWidget, private Ui::QgsLayoutGuideWidgetBase
41{
42 Q_OBJECT
43 public:
45 QgsLayoutGuideWidget( QWidget *parent, QgsLayout *layout, QgsLayoutView *layoutView );
46
47 public slots:
48
52 void setCurrentPage( int page );
53
54 private slots:
55
56 void addHorizontalGuide();
57 void addVerticalGuide();
58
59 void deleteHorizontalGuide();
60 void deleteVerticalGuide();
61
62 void clearAll();
63
64 void applyToAll();
65
66 void updatePageCount();
67
68 private:
69 QgsLayout *mLayout = nullptr;
70 QgsLayoutGuideProxyModel *mHozProxyModel = nullptr;
71 QgsLayoutGuideProxyModel *mVertProxyModel = nullptr;
72 int mPage = 0;
73};
74
82class GUI_EXPORT QgsLayoutGuidePositionDelegate : public QStyledItemDelegate
83{
84 Q_OBJECT
85
86 public:
88 QgsLayoutGuidePositionDelegate( QObject *parent );
89
90 protected:
91 QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem & /*option*/, const QModelIndex &index ) const override;
92 void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override;
93};
94
102class GUI_EXPORT QgsLayoutGuideUnitDelegate : public QStyledItemDelegate
103{
104 Q_OBJECT
105
106 public:
108 QgsLayoutGuideUnitDelegate( QObject *parent );
109
110 protected:
111 QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem & /*option*/, const QModelIndex &index ) const override;
112 void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override;
113};
114
115#endif // QGSLAYOUTGUIDEWIDGET_H
View delegate displaying a QgsDoubleSpinBox for the layout guide position.
Filters QgsLayoutGuideCollection models to guides of a single orientation (horizontal or vertical).
View delegate displaying a QgsLayoutUnitsComboBox for the layout guide unit.
Widget for managing the layout guides.
A graphical widget to display and interact with QgsLayouts.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition qgslayout.h:49
Base class for any widget that can be shown as a inline panel.