Skip to content

Commit

Permalink
[api] Add initial framework for QgsMapToolModifyAnnotation
Browse files Browse the repository at this point in the history
This is the start of a map tool for interactive editing of items
in annotation layers. Currently it supports selecting items, and
pre-highlighting their nodes as the cursor is moved over the items.

(Not exposed in QGIS gui yet)
  • Loading branch information
nyalldawson committed Sep 7, 2021
1 parent 20f28a9 commit 758b33e
Show file tree
Hide file tree
Showing 6 changed files with 517 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/CMakeLists.txt
Expand Up @@ -91,6 +91,7 @@ if(WITH_APIDOC)
${CMAKE_SOURCE_DIR}/src/core/vector
${CMAKE_SOURCE_DIR}/src/core/vectortile
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/annotations
${CMAKE_SOURCE_DIR}/src/gui/auth
${CMAKE_SOURCE_DIR}/src/gui/attributetable
${CMAKE_SOURCE_DIR}/src/gui/callouts
Expand Down
@@ -0,0 +1,55 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/annotations/qgsmaptoolmodifyannotation.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/





class QgsMapToolModifyAnnotation : QgsMapToolAdvancedDigitizing
{
%Docstring(signature="appended")
A map tool for modifying annotations in a :py:class:`QgsAnnotationLayer`

.. versionadded:: 3.22
%End

%TypeHeaderCode
#include "qgsmaptoolmodifyannotation.h"
%End
public:

explicit QgsMapToolModifyAnnotation( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget );
%Docstring
Constructor for QgsMapToolModifyAnnotation
%End

~QgsMapToolModifyAnnotation();

virtual void deactivate();

virtual void cadCanvasMoveEvent( QgsMapMouseEvent *event );

virtual void cadCanvasPressEvent( QgsMapMouseEvent *event );


signals:

void itemSelected( QgsAnnotationLayer *layer, const QString &itemId );
%Docstring
Emitted when the selected item is changed.
%End

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/annotations/qgsmaptoolmodifyannotation.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
1 change: 1 addition & 0 deletions python/gui/gui_auto.sip
Expand Up @@ -224,6 +224,7 @@
%Include auto_generated/qgsvertexmarker.sip
%Include auto_generated/qgsvscrollarea.sip
%Include auto_generated/qgswindowmanagerinterface.sip
%Include auto_generated/annotations/qgsmaptoolmodifyannotation.sip
%Include auto_generated/attributetable/qgsattributetabledelegate.sip
%Include auto_generated/attributetable/qgsattributetablefiltermodel.sip
%Include auto_generated/attributetable/qgsattributetablemodel.sip
Expand Down
5 changes: 5 additions & 0 deletions src/gui/CMakeLists.txt
Expand Up @@ -94,6 +94,8 @@ set(QGIS_GUI_SRCS
attributetable/qgsorganizetablecolumnsdialog.cpp
attributetable/qgsfeaturefilterwidget.cpp

annotations/qgsmaptoolmodifyannotation.cpp

auth/qgsauthauthoritieseditor.cpp
auth/qgsauthcertificateinfo.cpp
auth/qgsauthcertificatemanager.cpp
Expand Down Expand Up @@ -878,6 +880,8 @@ set(QGIS_GUI_HDRS
qgsvscrollarea.h
qgswindowmanagerinterface.h

annotations/qgsmaptoolmodifyannotation.h

attributeformconfig/qgsattributeformcontaineredit.h
attributeformconfig/qgsattributetypedialog.h
attributeformconfig/qgsattributewidgetedit.h
Expand Down Expand Up @@ -1417,6 +1421,7 @@ endif()

target_include_directories(qgis_gui PUBLIC
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/annotations
${CMAKE_SOURCE_DIR}/src/gui/attributeformconfig
${CMAKE_SOURCE_DIR}/src/gui/symbology
${CMAKE_SOURCE_DIR}/src/gui/attributetable
Expand Down

0 comments on commit 758b33e

Please sign in to comment.