Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ For building ABIs see https://www.qt.io/blog/android-multi-abi-builds-are-back

```
export ANDROID_NDK_HOME=/home/<user>/android/ndk/<current_version>
export ANDROID_NDK_ROOT=/home/<user>/android/ndk/<current_version>
export ANDROID_SDK_ROOT=/home/<user>/android
export QT_ANDROID_KEYSTORE_ALIAS=<local-alias>
export QT_ANDROID_KEYSTORE_KEY_PASS=<password>
Expand Down Expand Up @@ -262,6 +263,7 @@ For building ABIs see https://www.qt.io/blog/android-multi-abi-builds-are-back
```
PATH=+/Users/<user>/Projects/quick/build/vcpkg
ANDROID_NDK_HOME=/Users/<user>/android/ndk/<current_version>
ANDROID_NDK_ROOT=/Users/<user>/android/ndk/<current_version>
ANDROID_SDK_ROOT=/Users/<user>/android
QT_ANDROID_KEYSTORE_ALIAS=<local-alias>
QT_ANDROID_KEYSTORE_KEY_PASS=<password>
Expand Down Expand Up @@ -345,6 +347,7 @@ For building ABIs see https://www.qt.io/blog/android-multi-abi-builds-are-back

```
export ANDROID_NDK_HOME=/Users/<user>/android/ndk/<current_version>
export ANDROID_NDK_ROOT=/Users/<user>/android/ndk/<current_version>
export ANDROID_SDK_ROOT=/Users/<user>/android
export QT_ANDROID_KEYSTORE_ALIAS=<local-alias>
export QT_ANDROID_KEYSTORE_KEY_PASS=<password>
Expand Down Expand Up @@ -379,6 +382,7 @@ For building ABIs see https://www.qt.io/blog/android-multi-abi-builds-are-back
PATH=+/opt/homebrew/Cellar/bison/3.8.2/bin
PATH=+/Users/<user>/Projects/quick/build/vcpkg
ANDROID_NDK_HOME=/Users/<user>/android/ndk/<current_version>
ANDROID_NDK_ROOT=/Users/<user>/android/ndk/<current_version>
ANDROID_SDK_ROOT=/Users/<user>/android
QT_ANDROID_KEYSTORE_ALIAS=<local-alias>
QT_ANDROID_KEYSTORE_KEY_PASS=<password>
Expand Down
16 changes: 16 additions & 0 deletions app/inpututils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,22 @@ QgsGeometry InputUtils::transformGeometryToMapWithCRS( const QgsGeometry &geomet
return transformGeometry( geometry, sourceCRS, targetSettings->destinationCrs(), targetSettings->transformContext() );
}

QVariantList InputUtils::extractGeometryToQml( const QgsGeometry &geometry )
{
QVector<double> coords = extractGeometryCoordinates( geometry );
QVariantList variantList;

// Reserve space to avoid reallocation overhead during the loop
variantList.reserve( coords.size() );

for ( double val : coords )
{
variantList.append( val );
}

return variantList;
}

QgsGeometry InputUtils::extractGeometry( const FeatureLayerPair &pair )
{
if ( !pair.isValid() )
Expand Down
1 change: 1 addition & 0 deletions app/inpututils.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class InputUtils: public QObject
//! Helper methods to use for transforming geometry from QML as overriding does not work properly there
Q_INVOKABLE static QgsGeometry transformGeometryToMapWithLayer( const QgsGeometry &geometry, QgsVectorLayer *sourceLayer, InputMapSettings *targetSettings );
Q_INVOKABLE static QgsGeometry transformGeometryToMapWithCRS( const QgsGeometry &geometry, const QgsCoordinateReferenceSystem &sourceCRS, InputMapSettings *targetSettings );
Q_INVOKABLE static QVariantList extractGeometryToQml( const QgsGeometry &geometry );

/**
* Function extracts QgsGeometry from the given pair.
Expand Down
4 changes: 2 additions & 2 deletions app/mapsketchingcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ void MapSketchingController::undo() const
mLayer->undoStack()->undo();
}

QgsGeometry MapSketchingController::highlightGeometry() const
QVariantList MapSketchingController::highlightGeometry() const
{
return mHighlight;
return InputUtils::extractGeometryToQml( mHighlight );
}

QStringList MapSketchingController::availableColors() const
Expand Down
4 changes: 2 additions & 2 deletions app/mapsketchingcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class MapSketchingController : public QObject
Q_OBJECT

Q_PROPERTY( InputMapSettings *mapSettings READ mapSettings WRITE setMapSettings NOTIFY mapSettingsChanged )
Q_PROPERTY( QgsGeometry highlightGeometry READ highlightGeometry NOTIFY highlightGeometryChanged )
Q_PROPERTY( QVariantList highlightGeometry READ highlightGeometry NOTIFY highlightGeometryChanged )
Q_PROPERTY( QColor activeColor READ activeColor WRITE setActiveColor NOTIFY activeColorChanged )
Q_PROPERTY( bool canRedo READ canRedo NOTIFY canRedoChanged )
Q_PROPERTY( bool canUndo READ canUndo NOTIFY canUndoChanged )
Expand Down Expand Up @@ -51,7 +51,7 @@ class MapSketchingController : public QObject
void eraserActiveChanged();

private:
QgsGeometry highlightGeometry() const;
QVariantList highlightGeometry() const;
void clearHighlight();
void setMapSettings( InputMapSettings *settings );
InputMapSettings *mapSettings() const;
Expand Down
26 changes: 26 additions & 0 deletions app/maptools/recordingmaptool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1694,6 +1694,32 @@ void RecordingMapTool::setActiveFeature( const QgsFeature &newActiveFeature )
emit activeFeatureChanged( mActiveFeature );
}


QVariantList RecordingMapTool::recordedGeometryData() const
{
return InputUtils::extractGeometryToQml( mRecordedGeometry );
}

QVariantList RecordingMapTool::existingVerticesData() const
{
return InputUtils::extractGeometryToQml( mExistingVertices );
}

QVariantList RecordingMapTool::midPointsData() const
{
return InputUtils::extractGeometryToQml( mMidPoints );
}

QVariantList RecordingMapTool::handlesData() const
{
return InputUtils::extractGeometryToQml( mHandles );
}

QVariantList RecordingMapTool::activeVertexGeometryData() const
{
return InputUtils::extractGeometryToQml( mActiveVertexGeometry );
}

void RecordingMapTool::avoidIntersections()
{

Expand Down
14 changes: 14 additions & 0 deletions app/maptools/recordingmaptool.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,15 @@ class RecordingMapTool : public AbstractMapTool
Q_PROPERTY( QgsGeometry midPoints READ midPoints WRITE setMidPoints NOTIFY midPointsChanged )
Q_PROPERTY( QgsGeometry handles READ handles WRITE setHandles NOTIFY handlesChanged )


Q_PROPERTY( QVariantList recordedGeometryData READ recordedGeometryData NOTIFY recordedGeometryChanged )
Q_PROPERTY( QVariantList existingVerticesData READ existingVerticesData NOTIFY existingVerticesChanged )
Q_PROPERTY( QVariantList midPointsData READ midPointsData NOTIFY midPointsChanged )
Q_PROPERTY( QVariantList handlesData READ handlesData NOTIFY handlesChanged )

Q_PROPERTY( Vertex activeVertex READ activeVertex WRITE setActiveVertex NOTIFY activeVertexChanged )
Q_PROPERTY( QgsGeometry activeVertexGeometry READ activeVertexGeometry WRITE setActiveVertexGeometry NOTIFY activeVertexGeometryChanged )
Q_PROPERTY( QVariantList activeVertexGeometryData READ activeVertexGeometryData NOTIFY activeVertexGeometryChanged )
Q_PROPERTY( InsertPolicy insertPolicy READ insertPolicy WRITE setInsertPolicy NOTIFY insertPolicyChanged )

Q_PROPERTY( MapToolState state READ state WRITE setState NOTIFY stateChanged )
Expand Down Expand Up @@ -203,6 +210,13 @@ class RecordingMapTool : public AbstractMapTool
QgsVectorLayer *activeLayer() const;
void setActiveLayer( QgsVectorLayer *newActiveLayer );

QVariantList recordedGeometryData() const;
QVariantList existingVerticesData() const;
QVariantList midPointsData() const;
QVariantList handlesData() const;

QVariantList activeVertexGeometryData() const;

const QgsGeometry &recordedGeometry() const;
void setRecordedGeometry( const QgsGeometry &newRecordedGeometry );

Expand Down
5 changes: 5 additions & 0 deletions app/maptools/splittingmaptool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ const QgsGeometry &SplittingMapTool::recordedGeometry() const
return mRecordedGeometry;
}

QVariantList SplittingMapTool::recordedGeometryData() const
{
return InputUtils::extractGeometryToQml( mRecordedGeometry );
}

void SplittingMapTool::setRecordedGeometry( const QgsGeometry &newRecordedGeometry )
{
if ( mRecordedGeometry.equals( newRecordedGeometry ) )
Expand Down
4 changes: 4 additions & 0 deletions app/maptools/splittingmaptool.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@
#include "qgsgeometry.h"

#include "featurelayerpair.h"
#include "inpututils.h"

class SplittingMapTool : public AbstractMapTool
{
Q_OBJECT

Q_PROPERTY( QgsGeometry recordedGeometry READ recordedGeometry WRITE setRecordedGeometry NOTIFY recordedGeometryChanged )

Q_PROPERTY( QVariantList recordedGeometryData READ recordedGeometryData NOTIFY recordedGeometryChanged )
Q_PROPERTY( FeatureLayerPair featureToSplit READ featureToSplit WRITE setFeatureToSplit NOTIFY featureToSplitChanged )

public:
Expand Down Expand Up @@ -57,6 +60,7 @@ class SplittingMapTool : public AbstractMapTool

// Getters/setters
const QgsGeometry &recordedGeometry() const;
QVariantList recordedGeometryData() const;
void setRecordedGeometry( const QgsGeometry &newRecordedGeometry );

const FeatureLayerPair &featureToSplit() const;
Expand Down
5 changes: 5 additions & 0 deletions app/position/tracking/positiontrackinghighlight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ QgsGeometry PositionTrackingHighlight::highlightGeometry() const
return mHighlightGeometry;
}

QVariantList PositionTrackingHighlight::highlightGeometryData() const
{
return InputUtils::extractGeometryToQml( mHighlightGeometry );
}

void PositionTrackingHighlight::setHighlightGeometry( const QgsGeometry &newHighlightGeometry )
{
if ( mHighlightGeometry.equals( newHighlightGeometry ) )
Expand Down
5 changes: 5 additions & 0 deletions app/position/tracking/positiontrackinghighlight.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <qglobal.h>

#include "qgsgeometry.h"
#include "inpututils.h"

class PositionTrackingHighlight : public QObject
{
Expand All @@ -24,6 +25,8 @@ class PositionTrackingHighlight : public QObject
// Geometry in
Q_PROPERTY( QgsGeometry trackedGeometry READ trackedGeometry WRITE setTrackedGeometry NOTIFY trackedGeometryChanged )

Q_PROPERTY( QVariantList highlightGeometryData READ highlightGeometryData NOTIFY highlightGeometryChanged )

// Geometry out
Q_PROPERTY( QgsGeometry highlightGeometry READ highlightGeometry NOTIFY highlightGeometryChanged )

Expand All @@ -35,6 +38,8 @@ class PositionTrackingHighlight : public QObject

QgsGeometry highlightGeometry() const;

QVariantList highlightGeometryData() const;

QgsPoint mapPosition() const;
void setMapPosition( QgsPoint newMapPosition );

Expand Down
2 changes: 1 addition & 1 deletion app/qml/components/MMButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Button {

State {
name: "hovered"
when: root.hovered && root.enabled
when: (root.hovered || root.down) && root.enabled

PropertyChanges {
target: buttonContent
Expand Down
7 changes: 5 additions & 2 deletions app/qml/form/editors/MMFormPhotoEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,18 @@ MMFormPhotoViewer {
onDeleteImage: {
// schedule the image for deletion
internal.imageSourceToDelete = imageDeleteDialog.imagePath
root.sketchingController.removeBackupSketches()
root.sketchingController.clear()
root.sketchingController?.removeBackupSketches()
root.sketchingController?.clear()
resetValueAndClose()
}

onUnlinkImage: resetValueAndClose()

function resetValueAndClose() {
root.editorValueChanged( "", true )
root.photoState = "notSet"
internal.resolvedImageSource = ""
internal.tempSketchedImageSource = ""

errorMsg = ""
imagePath = ""
Expand Down
Loading
Loading