QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
layout
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
22
#include "ui_qgslayoutguidewidgetbase.h"
23
24
#include "qgis_gui.h"
25
#include "
qgspanelwidget.h
"
26
27
#include <QStyledItemDelegate>
28
29
#define SIP_NO_FILE
30
31
class
QgsLayoutView
;
32
class
QgsLayout
;
33
class
QgsLayoutGuideProxyModel
;
34
42
class
GUI_EXPORT
QgsLayoutGuideWidget
:
public
QgsPanelWidget
,
private
Ui::QgsLayoutGuideWidgetBase
43
{
44
Q_OBJECT
45
public
:
47
QgsLayoutGuideWidget
( QWidget *parent,
QgsLayout
*layout,
QgsLayoutView
*layoutView );
48
49
public
slots:
50
54
void
setCurrentPage
(
int
page );
55
56
private
slots:
57
58
void
addHorizontalGuide();
59
void
addVerticalGuide();
60
61
void
deleteHorizontalGuide();
62
void
deleteVerticalGuide();
63
64
void
clearAll();
65
66
void
applyToAll();
67
68
void
updatePageCount();
69
70
private
:
71
QgsLayout
*mLayout =
nullptr
;
72
QgsLayoutGuideProxyModel
*mHozProxyModel =
nullptr
;
73
QgsLayoutGuideProxyModel
*mVertProxyModel =
nullptr
;
74
int
mPage = 0;
75
};
76
84
class
GUI_EXPORT
QgsLayoutGuidePositionDelegate
:
public
QStyledItemDelegate
85
{
86
Q_OBJECT
87
88
public
:
90
QgsLayoutGuidePositionDelegate
( QObject *parent );
91
92
protected
:
93
QWidget *
createEditor
( QWidget *parent,
const
QStyleOptionViewItem &
/*option*/
,
const
QModelIndex &index )
const override
;
94
void
setModelData
( QWidget *editor, QAbstractItemModel *model,
const
QModelIndex &index )
const override
;
95
};
96
104
class
GUI_EXPORT
QgsLayoutGuideUnitDelegate
:
public
QStyledItemDelegate
105
{
106
Q_OBJECT
107
108
public
:
110
QgsLayoutGuideUnitDelegate
( QObject *parent );
111
112
protected
:
113
QWidget *
createEditor
( QWidget *parent,
const
QStyleOptionViewItem &
/*option*/
,
const
QModelIndex &index )
const override
;
114
void
setModelData
( QWidget *editor, QAbstractItemModel *model,
const
QModelIndex &index )
const override
;
115
};
116
117
#endif
// QGSLAYOUTGUIDEWIDGET_H
QgsLayoutGuidePositionDelegate::createEditor
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &index) const override
Definition
qgslayoutguidewidget.cpp:195
QgsLayoutGuidePositionDelegate::QgsLayoutGuidePositionDelegate
QgsLayoutGuidePositionDelegate(QObject *parent)
constructor
Definition
qgslayoutguidewidget.cpp:191
QgsLayoutGuidePositionDelegate::setModelData
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
Definition
qgslayoutguidewidget.cpp:209
QgsLayoutGuideProxyModel
Filters QgsLayoutGuideCollection models to guides of a single orientation (horizontal or vertical).
Definition
qgslayoutguidecollection.h:318
QgsLayoutGuideUnitDelegate::setModelData
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
Definition
qgslayoutguidewidget.cpp:229
QgsLayoutGuideUnitDelegate::QgsLayoutGuideUnitDelegate
QgsLayoutGuideUnitDelegate(QObject *parent)
constructor
Definition
qgslayoutguidewidget.cpp:215
QgsLayoutGuideUnitDelegate::createEditor
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &index) const override
Definition
qgslayoutguidewidget.cpp:219
QgsLayoutGuideWidget::QgsLayoutGuideWidget
QgsLayoutGuideWidget(QWidget *parent, QgsLayout *layout, QgsLayoutView *layoutView)
constructor
Definition
qgslayoutguidewidget.cpp:28
QgsLayoutGuideWidget::setCurrentPage
void setCurrentPage(int page)
Sets the current page number to manage the guides for.
Definition
qgslayoutguidewidget.cpp:130
QgsLayoutView
A graphical widget to display and interact with QgsLayouts.
Definition
qgslayoutview.h:52
QgsLayout
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition
qgslayout.h:51
QgsPanelWidget::QgsPanelWidget
QgsPanelWidget(QWidget *parent=nullptr)
Base class for any widget that can be shown as an inline panel.
Definition
qgspanelwidget.cpp:30
qgspanelwidget.h
Generated on
for QGIS API Documentation by
1.17.0