Skip to content

Commit

Permalink
[FEATURE][needs-docs] add a floater showing advanced input editlines …
Browse files Browse the repository at this point in the history
…next to the mouse

Sponsored by Kanton Schaffhausen in collaboration with OPENGIS.ch
  • Loading branch information
olivierdalang committed May 13, 2019
1 parent fe39b26 commit d6ac603
Show file tree
Hide file tree
Showing 10 changed files with 1,124 additions and 15 deletions.
1 change: 1 addition & 0 deletions images/images.qrc
Expand Up @@ -614,6 +614,7 @@
<file>themes/default/mActionPanHighlightFeature.svg</file>
<file>themes/default/cadtools/construction.svg</file>
<file>themes/default/cadtools/delta.svg</file>
<file>themes/default/cadtools/floater.svg</file>
<file>themes/default/cadtools/cad.svg</file>
<file>themes/default/cadtools/lock.svg</file>
<file>themes/default/cadtools/parallel.svg</file>
Expand Down
21 changes: 21 additions & 0 deletions images/themes/default/cadtools/floater.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
234 changes: 228 additions & 6 deletions python/gui/auto_generated/qgsadvanceddigitizingdockwidget.sip.in
Expand Up @@ -161,12 +161,6 @@ Create an advanced digitizing dock widget

:param canvas: The map canvas on which the widget operates
:param parent: The parent
%End

virtual void hideEvent( QHideEvent * );

%Docstring
Disables the CAD tools when hiding the dock
%End

bool canvasKeyPressEventFilter( QKeyEvent *e );
Expand Down Expand Up @@ -336,6 +330,54 @@ Disable the widget. Normally done automatically from :py:func:`QgsMapToolAdvance
Updates canvas item that displays constraints on the ma

.. versionadded:: 3.0
%End

void setX( const QString &value );
%Docstring
Set and lock the X ``value``.
Can be used to set constraints.

.. note::

The value is a QString, as it could be an expression.

.. versionadded:: 3.8
%End

void setY( const QString &value );
%Docstring
Set and lock the Y ``value``.
Can be used to set constraints.

.. note::

The value is a QString, as it could be an expression.

.. versionadded:: 3.8
%End

void setAngle( const QString &value );
%Docstring
Set and lock the angle ``value``.
Can be used to set constraints.

.. note::

The value is a QString, as it could be an expression.

.. versionadded:: 3.8
%End

void setDistance( const QString &value );
%Docstring
Set and lock the distance ``value``.
Can be used to set constraints.

.. note::

The value is a QString, as it could be an expression.

.. versionadded:: 3.8
%End

signals:
Expand All @@ -360,6 +402,186 @@ when a constraint is toggled.
:param point: The last known digitizing point. Can be used to emulate a mouse event.
%End


void cadEnabledChanged( bool enabled );
%Docstring
Emitted whenever CAD is enabled or disabled

:param enabled: Whether CAD is enabled or not.

.. versionadded:: 3.8
%End

void valueXChanged( const QString &value );
%Docstring
Emitted whenever the X ``value`` changes (either the mouse moved, or the user changed the input).
Could be used by widgets that must reflect the current advanced digitizing state.

.. versionadded:: 3.8
%End

void valueYChanged( const QString &value );
%Docstring
Emitted whenever the Y ``value`` changes (either the mouse moved, or the user changed the input).
Could be used by widgets that must reflect the current advanced digitizing state.

.. versionadded:: 3.8
%End

void valueAngleChanged( const QString &value );
%Docstring
Emitted whenever the angle ``value`` changes (either the mouse moved, or the user changed the input).
Could be used by widgets that must reflect the current advanced digitizing state.

.. versionadded:: 3.8
%End

void valueDistanceChanged( const QString &value );
%Docstring
Emitted whenever the distance ``value`` changes (either the mouse moved, or the user changed the input).
Could be used by widgets that must reflect the current advanced digitizing state.

.. versionadded:: 3.8
%End

void lockXChanged( bool locked );
%Docstring
Emitted whenever the X parameter is ``locked``.
Could be used by widgets that must reflect the current advanced digitizing state.

.. versionadded:: 3.8
%End

void lockYChanged( bool locked );
%Docstring
Emitted whenever the Y parameter is ``locked``.
Could be used by widgets that must reflect the current advanced digitizing state.

.. versionadded:: 3.8
%End

void lockAngleChanged( bool locked );
%Docstring
Emitted whenever the angle parameter is ``locked``.
Could be used by widgets that must reflect the current advanced digitizing state.
%End

void lockDistanceChanged( bool locked );
%Docstring
Emitted whenever the distance parameter is ``locked``.
Could be used by widgets that must reflect the current advanced digitizing state.

.. versionadded:: 3.8
%End

void relativeXChanged( bool relative );
%Docstring
Emitted whenever the X parameter is toggled between absolute and relative.
Could be used by widgets that must reflect the current advanced digitizing state.

:param relative: Whether the X parameter is relative or not.

.. versionadded:: 3.8
%End

void relativeYChanged( bool relative );
%Docstring
Emitted whenever the Y parameter is toggled between absolute and relative.
Could be used by widgets that must reflect the current advanced digitizing state.

:param relative: Whether the Y parameter is relative or not.

.. versionadded:: 3.8
%End

void relativeAngleChanged( bool relative );
%Docstring
Emitted whenever the angleX parameter is toggled between absolute and relative.
Could be used by widgets that must reflect the current advanced digitizing state.

:param relative: Whether the angle parameter is relative or not.

.. versionadded:: 3.8
%End


void enabledChangedX( bool enabled );
%Docstring
Emitted whenever the X field is enabled or disabled. Depending on the context, some parameters
do not make sense (e.g. you need a previous point to define a distance).
Could be used by widgets that must reflect the current advanced digitizing state.

:param enabled: Whether the X parameter is enabled or not.

.. versionadded:: 3.8
%End

void enabledChangedY( bool enabled );
%Docstring
Emitted whenever the Y field is enabled or disabled. Depending on the context, some parameters
do not make sense (e.g. you need a previous point to define a distance).
Could be used by widgets that must reflect the current advanced digitizing state.

:param enabled: Whether the Y parameter is enabled or not.

.. versionadded:: 3.8
%End

void enabledChangedAngle( bool enabled );
%Docstring
Emitted whenever the angle field is enabled or disabled. Depending on the context, some parameters
do not make sense (e.g. you need a previous point to define a distance).
Could be used by widgets that must reflect the current advanced digitizing state.

:param enabled: Whether the angle parameter is enabled or not.

.. versionadded:: 3.8
%End

void enabledChangedDistance( bool enabled );
%Docstring
Emitted whenever the distance field is enabled or disabled. Depending on the context, some parameters
do not make sense (e.g. you need a previous point to define a distance).
Could be used by widgets that must reflect the current advanced digitizing state.

:param enabled: Whether the distance parameter is enabled or not.

.. versionadded:: 3.8
%End

void focusOnXRequested();
%Docstring
Emitted whenever the X field should get the focus using the shortcuts (X).
Could be used by widgets to capture the focus when a field is being edited.

.. versionadded:: 3.8
%End

void focusOnYRequested();
%Docstring
Emitted whenever the Y field should get the focus using the shortcuts (Y).
Could be used by widgets to capture the focus when a field is being edited.

.. versionadded:: 3.8
%End

void focusOnAngleRequested();
%Docstring
Emitted whenever the angle field should get the focus using the shortcuts (A).
Could be used by widgets to capture the focus when a field is being edited.

.. versionadded:: 3.8
%End

void focusOnDistanceRequested();
%Docstring
Emitted whenever the distance field should get the focus using the shortcuts (D).
Could be used by widgets to capture the focus when a field is being edited.

.. versionadded:: 3.8
%End


private:
//! event filter for line edits in the dock UI (angle/distance/x/y line edits)
bool eventFilter( QObject *obj, QEvent *event );
Expand Down
2 changes: 2 additions & 0 deletions src/gui/CMakeLists.txt
Expand Up @@ -214,6 +214,7 @@ SET(QGIS_GUI_SRCS
qgsactionmenu.cpp
qgsadvanceddigitizingcanvasitem.cpp
qgsadvanceddigitizingdockwidget.cpp
qgsadvanceddigitizingfloater.cpp
qgsaggregatetoolbutton.cpp
qgsattributedialog.cpp
qgsattributeform.cpp
Expand Down Expand Up @@ -401,6 +402,7 @@ SET(QGIS_GUI_MOC_HDRS
qgisinterface.h
qgsactionmenu.h
qgsadvanceddigitizingdockwidget.h
qgsadvanceddigitizingfloater.h
qgsaggregatetoolbutton.h
qgsattributedialog.h
qgsattributeform.h
Expand Down

0 comments on commit d6ac603

Please sign in to comment.