File tree Expand file tree Collapse file tree 7 files changed +144
-4
lines changed Expand file tree Collapse file tree 7 files changed +144
-4
lines changed Original file line number Diff line number Diff line change 277
277
%Include layout/qgslayoutdesignerinterface.sip
278
278
%Include layout/qgslayoutview.sip
279
279
%Include layout/qgslayoutviewtool.sip
280
+ %Include layout/qgslayoutviewtooladditem.sip
280
281
%Include locator/qgslocator.sip
281
282
%Include locator/qgslocatorfilter.sip
282
283
%Include locator/qgslocatorwidget.sip
Original file line number Diff line number Diff line change 9
9
10
10
11
11
12
+ %ModuleHeaderCode
13
+ #include <qgslayoutviewtooladditem.h>
14
+ %End
15
+
12
16
class QgsLayoutViewTool : QObject
13
17
{
14
18
%Docstring
@@ -23,8 +27,8 @@ class QgsLayoutViewTool : QObject
23
27
%End
24
28
25
29
%ConvertToSubClassCode
26
- if ( dynamic_cast<QgsMapToolZoom *>( sipCpp ) != NULL )
27
- sipType = sipType_QgsMapToolZoom ;
30
+ if ( dynamic_cast<QgsLayoutViewToolAddItem *>( sipCpp ) != NULL )
31
+ sipType = sipType_QgsLayoutViewToolAddItem ;
28
32
else
29
33
sipType = NULL;
30
34
%End
Original file line number Diff line number Diff line change
1
+ /************************************************************************
2
+ * This file has been generated automatically from *
3
+ * *
4
+ * src/gui/layout/qgslayoutviewtooladditem.h *
5
+ * *
6
+ * Do not edit manually ! Edit header and run scripts/sipify.pl again *
7
+ ************************************************************************/
8
+
9
+
10
+
11
+ class QgsLayoutViewToolAddItem : QgsLayoutViewTool
12
+ {
13
+ %Docstring
14
+ Layout view tool for adding items to a layout.
15
+ .. versionadded:: 3.0
16
+ %End
17
+
18
+ %TypeHeaderCode
19
+ #include "qgslayoutviewtooladditem.h"
20
+ %End
21
+ public:
22
+
23
+ QgsLayoutViewToolAddItem( QgsLayoutView *view );
24
+
25
+ int itemType() const;
26
+ %Docstring
27
+ Returns the item type for items created by the tool.
28
+ .. seealso:: setItemType()
29
+ :rtype: int
30
+ %End
31
+
32
+ void setItemType( int type );
33
+ %Docstring
34
+ Sets the item ``type`` for items created by the tool.
35
+ .. seealso:: itemType()
36
+ %End
37
+
38
+ };
39
+
40
+ /************************************************************************
41
+ * This file has been generated automatically from *
42
+ * *
43
+ * src/gui/layout/qgslayoutviewtooladditem.h *
44
+ * *
45
+ * Do not edit manually ! Edit header and run scripts/sipify.pl again *
46
+ ************************************************************************/
Original file line number Diff line number Diff line change @@ -160,6 +160,7 @@ SET(QGIS_GUI_SRCS
160
160
161
161
layout/qgslayoutview.cpp
162
162
layout/qgslayoutviewtool.cpp
163
+ layout/qgslayoutviewtooladditem.cpp
163
164
164
165
locator/qgslocator.cpp
165
166
locator/qgslocatorfilter.cpp
@@ -625,6 +626,7 @@ SET(QGIS_GUI_MOC_HDRS
625
626
layout/qgslayoutdesignerinterface.h
626
627
layout/qgslayoutview.h
627
628
layout/qgslayoutviewtool.h
629
+ layout/qgslayoutviewtooladditem.h
628
630
629
631
locator/qgslocator.h
630
632
locator/qgslocatorfilter.h
Original file line number Diff line number Diff line change @@ -27,6 +27,12 @@ class QWheelEvent;
27
27
class QKeyEvent ;
28
28
class QgsLayoutView ;
29
29
30
+ #ifdef SIP_RUN
31
+ % ModuleHeaderCode
32
+ #include < qgslayoutviewtooladditem.h>
33
+ % End
34
+ #endif
35
+
30
36
/* *
31
37
* \ingroup gui
32
38
* Abstract base class for all layout view tools.
@@ -39,8 +45,8 @@ class GUI_EXPORT QgsLayoutViewTool : public QObject
39
45
40
46
#ifdef SIP_RUN
41
47
SIP_CONVERT_TO_SUBCLASS_CODE
42
- if ( dynamic_cast <QgsMapToolZoom *>( sipCpp ) != NULL )
43
- sipType = sipType_QgsMapToolZoom ;
48
+ if ( dynamic_cast <QgsLayoutViewToolAddItem *>( sipCpp ) != NULL )
49
+ sipType = sipType_QgsLayoutViewToolAddItem ;
44
50
else
45
51
sipType = NULL ;
46
52
SIP_END
Original file line number Diff line number Diff line change
1
+ /* **************************************************************************
2
+ qgslayoutviewtooladditem.cpp
3
+ ----------------------------
4
+ Date : July 2017
5
+ Copyright : (C) 2017 Nyall Dawson
6
+ Email : nyall dot dawson at gmail dot com
7
+ ***************************************************************************
8
+ * *
9
+ * This program is free software; you can redistribute it and/or modify *
10
+ * it under the terms of the GNU General Public License as published by *
11
+ * the Free Software Foundation; either version 2 of the License, or *
12
+ * (at your option) any later version. *
13
+ * *
14
+ ***************************************************************************/
15
+
16
+ #include " qgslayoutviewtooladditem.h"
17
+
18
+ QgsLayoutViewToolAddItem::QgsLayoutViewToolAddItem ( QgsLayoutView *view )
19
+ : QgsLayoutViewTool( view, tr( " Add item" ) )
20
+ {
21
+
22
+ }
23
+
24
+ int QgsLayoutViewToolAddItem::itemType () const
25
+ {
26
+ return mItemType ;
27
+ }
Original file line number Diff line number Diff line change
1
+ /* **************************************************************************
2
+ qgslayoutviewtooladditem.h
3
+ --------------------------
4
+ Date : July 2017
5
+ Copyright : (C) 2017 Nyall Dawson
6
+ Email : nyall dot dawson at gmail dot com
7
+ ***************************************************************************
8
+ * *
9
+ * This program is free software; you can redistribute it and/or modify *
10
+ * it under the terms of the GNU General Public License as published by *
11
+ * the Free Software Foundation; either version 2 of the License, or *
12
+ * (at your option) any later version. *
13
+ * *
14
+ ***************************************************************************/
15
+
16
+ #ifndef QGSLAYOUTVIEWTOOLADDITEM_H
17
+ #define QGSLAYOUTVIEWTOOLADDITEM_H
18
+
19
+ #include " qgis.h"
20
+ #include " qgis_gui.h"
21
+ #include " qgslayoutviewtool.h"
22
+
23
+ /* *
24
+ * \ingroup gui
25
+ * Layout view tool for adding items to a layout.
26
+ * \since QGIS 3.0
27
+ */
28
+ class GUI_EXPORT QgsLayoutViewToolAddItem : public QgsLayoutViewTool
29
+ {
30
+
31
+ Q_OBJECT
32
+
33
+ public:
34
+
35
+ QgsLayoutViewToolAddItem ( QgsLayoutView *view );
36
+
37
+ /* *
38
+ * Returns the item type for items created by the tool.
39
+ * \see setItemType()
40
+ */
41
+ int itemType () const ;
42
+
43
+ /* *
44
+ * Sets the item \a type for items created by the tool.
45
+ * \see itemType()
46
+ */
47
+ void setItemType ( int type );
48
+
49
+ private:
50
+
51
+ int mItemType = 0 ;
52
+ };
53
+
54
+ #endif // QGSLAYOUTVIEWTOOLADDITEM_H
You can’t perform that action at this time.
0 commit comments