Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cad floater #59

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e8e7f5a
[cad] floater initial implementation
olivierdalang May 8, 2019
6dd0b78
hide unused labels
olivierdalang May 8, 2019
dc5d51a
implementation with signals/slots
olivierdalang May 9, 2019
90a89d8
docstrings & cleanup
olivierdalang May 9, 2019
ae3972e
astyle
olivierdalang May 9, 2019
b53bb91
show delta in floater
olivierdalang May 9, 2019
889ffc6
fix toggle floater button not disabled
olivierdalang May 9, 2019
b027ef7
icon
olivierdalang May 9, 2019
551eb6b
prepare-commit
olivierdalang May 9, 2019
d65e63f
fix display on hidpi
olivierdalang May 13, 2019
ca87869
fix comment
olivierdalang May 13, 2019
af4de6e
pass arguments by reference
olivierdalang May 13, 2019
7a88cdc
connect directly mToggleFloaterAction to floater
olivierdalang May 13, 2019
c9ee061
docstring for each function
olivierdalang May 13, 2019
7fc0787
add \since QGIS 3.8
olivierdalang May 13, 2019
7e328f6
remove now useless hideEvent
olivierdalang May 13, 2019
96ac754
"" -> QString() and "x" -> QStringLiteral("x")
olivierdalang May 13, 2019
dda866e
added a cad enabled changed signal and cleanup hide logic
olivierdalang May 13, 2019
f4996ec
typo
olivierdalang May 13, 2019
e61f20c
QgsAdvancedDigitizingDockWidget slots as normal functions
olivierdalang May 13, 2019
853d98b
prepare-commit.sh
olivierdalang May 13, 2019
211de64
more pass arguments by reference
olivierdalang May 13, 2019
5db4f15
fix spelling
olivierdalang May 13, 2019
7801580
fix saving of floater settings
olivierdalang May 13, 2019
f924295
prepare-commit.sh
olivierdalang May 13, 2019
dbcc9fb
use default font size
olivierdalang May 13, 2019
199bd4d
focusOnX(); -> focusOnXRequested();
olivierdalang May 13, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions images/images.qrc
Original file line number Diff line number Diff line change
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
Loading
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading