Skip to content

Commit 2d4f1a8

Browse files
authoredApr 23, 2023
Merge pull request #52043 from YoannQDQ/measure-tool-copy-coordinates
Measure tool copy coordinates
2 parents 4dcd0d4 + 0945734 commit 2d4f1a8

File tree

7 files changed

+517
-293
lines changed

7 files changed

+517
-293
lines changed
 

‎src/app/options/qgsoptions.cpp

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
#include "options/qgsadvancedoptions.h"
6060
#include "qgssettingsentryimpl.h"
6161
#include "qgssettingsentryenumflag.h"
62+
#include "qgsmeasuredialog.h"
6263

6364
#ifdef HAVE_OPENCL
6465
#include "qgsopenclutils.h"
@@ -643,16 +644,33 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
643644

644645
// set if base unit of measure tool should be changed
645646
bool baseUnit = mSettings->value( QStringLiteral( "qgis/measure/keepbaseunit" ), true ).toBool();
646-
if ( baseUnit )
647-
{
648-
mKeepBaseUnitCheckBox->setChecked( true );
649-
}
647+
mKeepBaseUnitCheckBox->setChecked( baseUnit );
648+
649+
mPlanimetricMeasurementsComboBox->setChecked( mSettings->value( QStringLiteral( "measure/planimetric" ), false, QgsSettings::Core ).toBool() );
650+
651+
// set the measure tool copy settings
652+
connect( mSeparatorOther, &QRadioButton::toggled, mSeparatorCustom, &QLineEdit::setEnabled );
653+
mIncludeHeader->setChecked( QgsMeasureDialog::settingClipboardHeader->value() );
654+
655+
const QString sep = QgsMeasureDialog::settingClipboardSeparator->value();
656+
657+
if ( sep.isEmpty() || sep == QStringLiteral( "\t" ) )
658+
mSeparatorTab->setChecked( true );
659+
else if ( sep == QStringLiteral( "," ) )
660+
mSeparatorComma->setChecked( true );
661+
else if ( sep == QStringLiteral( ";" ) )
662+
mSeparatorSemicolon->setChecked( true );
663+
else if ( sep == QStringLiteral( " " ) )
664+
mSeparatorSpace->setChecked( true );
665+
else if ( sep == QStringLiteral( ":" ) )
666+
mSeparatorColon->setChecked( true );
650667
else
651668
{
652-
mKeepBaseUnitCheckBox->setChecked( false );
669+
mSeparatorOther->setChecked( true );
670+
mSeparatorCustom->setText( sep );
653671
}
654-
mPlanimetricMeasurementsComboBox->setChecked( mSettings->value( QStringLiteral( "measure/planimetric" ), false, QgsSettings::Core ).toBool() );
655672

673+
// set the default icon size
656674
cmbIconSize->setCurrentIndex( cmbIconSize->findText( mSettings->value( QStringLiteral( "qgis/iconSize" ), QGIS_ICON_SIZE ).toString() ) );
657675

658676
// set font size and family
@@ -1665,6 +1683,23 @@ void QgsOptions::saveOptions()
16651683
bool baseUnit = mKeepBaseUnitCheckBox->isChecked();
16661684
mSettings->setValue( QStringLiteral( "/qgis/measure/keepbaseunit" ), baseUnit );
16671685

1686+
QgsMeasureDialog::settingClipboardHeader->setValue( mIncludeHeader->isChecked() );
1687+
QString separator;
1688+
if ( mSeparatorTab->isChecked() )
1689+
separator = QStringLiteral( "\t" );
1690+
else if ( mSeparatorComma->isChecked() )
1691+
separator = QStringLiteral( "," );
1692+
else if ( mSeparatorSemicolon->isChecked() )
1693+
separator = QStringLiteral( ";" );
1694+
else if ( mSeparatorSpace->isChecked() )
1695+
separator = QStringLiteral( " " );
1696+
else if ( mSeparatorColon->isChecked() )
1697+
separator = QStringLiteral( ":" );
1698+
else
1699+
separator = mSeparatorCustom->text();
1700+
1701+
QgsMeasureDialog::settingClipboardSeparator->setValue( separator );
1702+
16681703
//set the color for selections
16691704
QColor myColor = pbnSelectionColor->color();
16701705
mSettings->setValue( QStringLiteral( "/qgis/default_selection_color_red" ), myColor.red() );

‎src/app/qgsmeasuredialog.cpp

Lines changed: 104 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
***************************************************************************/
1616

1717
#include "qgisapp.h"
18+
#include "qgsmessagebar.h"
1819
#include "qgsmeasuredialog.h"
1920
#include "qgsmeasuretool.h"
2021
#include "qgsdistancearea.h"
@@ -23,6 +24,8 @@
2324
#include "qgscoordinatereferencesystem.h"
2425
#include "qgsunittypes.h"
2526
#include "qgssettings.h"
27+
#include "qgssettingsentryimpl.h"
28+
#include "qgssettingstree.h"
2629
#include "qgsgui.h"
2730

2831
#include <QClipboard>
@@ -31,6 +34,11 @@
3134
#include <QPushButton>
3235

3336

37+
const QgsSettingsEntryBool *QgsMeasureDialog::settingClipboardHeader = new QgsSettingsEntryBool( QStringLiteral( "clipboard-header" ), QgsSettingsTree::sTreeMeasure, false, QObject::tr( "Whether the header should be copied to the cliboard along the coordinates, distances" ) );
38+
39+
const QgsSettingsEntryString *QgsMeasureDialog::settingClipboardSeparator = new QgsSettingsEntryString( QStringLiteral( "clipboard-separator" ), QgsSettingsTree::sTreeMeasure, QStringLiteral( "\t" ), QObject::tr( "Separator between the measure columns copied to the clipboard" ) );
40+
41+
3442
QgsMeasureDialog::QgsMeasureDialog( QgsMeasureTool *tool, Qt::WindowFlags f )
3543
: QDialog( tool->canvas()->topLevelWidget(), f )
3644
, mMeasureArea( tool->measureArea() )
@@ -56,9 +64,15 @@ QgsMeasureDialog::QgsMeasureDialog( QgsMeasureTool *tool, Qt::WindowFlags f )
5664

5765
if ( !mMeasureArea )
5866
{
59-
QPushButton *cpb = new QPushButton( tr( "Copy &All" ) );
67+
QAction *copyAction = new QAction( tr( "Copy" ), this );
68+
QPushButton *cpb = new QPushButton( tr( "Copy" ) );
6069
buttonBox->addButton( cpb, QDialogButtonBox::ActionRole );
61-
connect( cpb, &QAbstractButton::clicked, this, &QgsMeasureDialog::copyMeasurements );
70+
connect( cpb, &QAbstractButton::clicked, copyAction, &QAction::trigger );
71+
connect( copyAction, &QAction::triggered, this, &QgsMeasureDialog::copyMeasurements );
72+
73+
// Add context menu in the table
74+
mTable->setContextMenuPolicy( Qt::ActionsContextMenu );
75+
mTable->addAction( copyAction );
6276
}
6377

6478
repopulateComboBoxUnits( mMeasureArea );
@@ -107,8 +121,7 @@ void QgsMeasureDialog::projChanged()
107121
mDa.setEllipsoid( QgsProject::instance()->ellipsoid() );
108122
}
109123

110-
mTable->clear();
111-
mTotal = 0.;
124+
// Update the table and information displayed to the user
112125
updateUi();
113126
}
114127

@@ -132,8 +145,6 @@ void QgsMeasureDialog::crsChanged()
132145
mUnitsCombo->setEnabled( true );
133146
}
134147

135-
mTable->clear();
136-
mTotal = 0.;
137148
updateUi();
138149
}
139150

@@ -148,8 +159,9 @@ void QgsMeasureDialog::updateSettings()
148159
mMapDistanceUnits = QgsProject::instance()->crs().mapUnits();
149160
mAreaUnits = QgsProject::instance()->areaUnits();
150161
mDa.setSourceCrs( mCanvas->mapSettings().destinationCrs(), QgsProject::instance()->transformContext() );
151-
projChanged();
152162

163+
// Calling projChanged() will set the ellipsoid and clear then re-populate the table
164+
projChanged();
153165

154166
if ( mCartesian->isChecked() || !mCanvas->mapSettings().destinationCrs().isValid() ||
155167
( mCanvas->mapSettings().destinationCrs().mapUnits() == Qgis::DistanceUnit::Degrees
@@ -192,24 +204,12 @@ void QgsMeasureDialog::unitsChanged( int index )
192204
}
193205
}
194206

195-
mTable->clear();
196-
mTotal = 0.;
197207
updateUi();
198-
199-
if ( !mTool->done() )
200-
{
201-
// re-add temporary mouse cursor position
202-
addPoint();
203-
mouseMove( mLastMousePoint );
204-
}
205208
}
206209

207210
void QgsMeasureDialog::restart()
208211
{
209212
mTool->restart();
210-
211-
mTable->clear();
212-
mTotal = 0.;
213213
updateUi();
214214
}
215215

@@ -239,7 +239,9 @@ void QgsMeasureDialog::mouseMove( const QgsPointXY &point )
239239
QTreeWidgetItem *item = mTable->topLevelItem( mTable->topLevelItemCount() - 1 );
240240
if ( item )
241241
{
242-
item->setText( 0, QLocale().toString( d, 'f', mDecimalPlaces ) );
242+
item->setText( Columns::X, QLocale().toString( p2.x(), 'f', mDecimalPlacesCoordinates ) );
243+
item->setText( Columns::Y, QLocale().toString( p2.y(), 'f', mDecimalPlacesCoordinates ) );
244+
item->setText( Columns::Distance, QLocale().toString( d, 'f', mDecimalPlaces ) );
243245
}
244246
}
245247
}
@@ -256,8 +258,21 @@ void QgsMeasureDialog::addPoint()
256258
{
257259
if ( !mTool->done() )
258260
{
259-
QTreeWidgetItem *item = new QTreeWidgetItem( QStringList( QLocale().toString( 0.0, 'f', mDecimalPlaces ) ) );
260-
item->setTextAlignment( 0, Qt::AlignRight );
261+
if ( numPoints == 1 )
262+
{
263+
// First point, so we add a first item, with no computed distance and only the coordinates
264+
QTreeWidgetItem *item = new QTreeWidgetItem();
265+
QgsPointXY lastPoint = mTool->points().last();
266+
item->setText( Columns::X, QLocale().toString( lastPoint.x(), 'f', mDecimalPlacesCoordinates ) );
267+
item->setText( Columns::Y, QLocale().toString( lastPoint.y(), 'f', mDecimalPlacesCoordinates ) );
268+
mTable->addTopLevelItem( item );
269+
}
270+
QTreeWidgetItem *item = new QTreeWidgetItem();
271+
QgsPointXY lastPoint = mTool->points().last();
272+
item->setText( Columns::X, QLocale().toString( lastPoint.x(), 'f', mDecimalPlacesCoordinates ) );
273+
item->setText( Columns::Y, QLocale().toString( lastPoint.y(), 'f', mDecimalPlacesCoordinates ) );
274+
item->setText( Columns::Distance, QLocale().toString( 0.0, 'f', mDecimalPlaces ) );
275+
item->setTextAlignment( Columns::Distance, Qt::AlignRight );
261276
mTable->addTopLevelItem( item );
262277
mTable->scrollToItem( item );
263278
}
@@ -304,7 +319,9 @@ void QgsMeasureDialog::removeLastPoint()
304319
d = convertLength( d, mDistanceUnits );
305320

306321
QTreeWidgetItem *item = mTable->topLevelItem( mTable->topLevelItemCount() - 1 );
307-
item->setText( 0, QLocale().toString( d, 'f', mDecimalPlaces ) );
322+
item->setText( Columns::X, QLocale().toString( mLastMousePoint.x(), 'f', mDecimalPlacesCoordinates ) );
323+
item->setText( Columns::Y, QLocale().toString( mLastMousePoint.y(), 'f', mDecimalPlacesCoordinates ) );
324+
item->setText( Columns::Distance, QLocale().toString( d, 'f', mDecimalPlaces ) );
308325
editTotal->setText( formatDistance( mTotal + d ) );
309326
}
310327
else
@@ -368,6 +385,10 @@ QString QgsMeasureDialog::formatArea( double area, bool convertUnits ) const
368385

369386
void QgsMeasureDialog::updateUi()
370387
{
388+
// Clear the table
389+
mTable->clear();
390+
mTotal = 0.;
391+
371392
// Set tooltip to indicate how we calculate measurements
372393
QString toolTip = tr( "The calculations are based on:" );
373394

@@ -551,6 +572,15 @@ void QgsMeasureDialog::updateUi()
551572
}
552573
}
553574

575+
if ( mCanvas->mapSettings().destinationCrs().mapUnits() == Qgis::DistanceUnit::Degrees )
576+
{
577+
mDecimalPlacesCoordinates = 5;
578+
}
579+
else
580+
{
581+
mDecimalPlacesCoordinates = 3;
582+
}
583+
554584
editTotal->setToolTip( toolTip );
555585
mTable->setToolTip( toolTip );
556586
mNotesLabel->setText( toolTip );
@@ -567,15 +597,15 @@ void QgsMeasureDialog::updateUi()
567597
if ( mUseMapUnits )
568598
{
569599
mUnitsCombo->setCurrentIndex( mUnitsCombo->findData( static_cast< int >( Qgis::DistanceUnit::Unknown ) ) );
570-
mTable->setHeaderLabels( QStringList( tr( "Segments [%1]" ).arg( QgsUnitTypes::toString( mMapDistanceUnits ) ) ) );
600+
mTable->headerItem()->setText( Columns::Distance, tr( "Segments [%1]" ).arg( QgsUnitTypes::toString( mMapDistanceUnits ) ) );
571601
}
572602
else
573603
{
574604
mUnitsCombo->setCurrentIndex( mUnitsCombo->findData( static_cast< int >( mDistanceUnits ) ) );
575605
if ( mDistanceUnits != Qgis::DistanceUnit::Unknown )
576-
mTable->setHeaderLabels( QStringList( tr( "Segments [%1]" ).arg( QgsUnitTypes::toString( mDistanceUnits ) ) ) );
606+
mTable->headerItem()->setText( Columns::Distance, tr( "Segments [%1]" ).arg( QgsUnitTypes::toString( mDistanceUnits ) ) );
577607
else
578-
mTable->setHeaderLabels( QStringList( tr( "Segments" ) ) );
608+
mTable->headerItem()->setText( Columns::Distance, tr( "Segments" ) );
579609
}
580610
}
581611

@@ -592,40 +622,54 @@ void QgsMeasureDialog::updateUi()
592622
}
593623
else
594624
{
625+
// Repopulate the table
595626
QVector<QgsPointXY>::const_iterator it;
596-
bool b = true; // first point
627+
bool firstPoint = true;
597628

598-
QgsPointXY p1, p2;
629+
QgsPointXY previousPoint, point;
599630
mTotal = 0;
600631
const QVector< QgsPointXY > tmpPoints = mTool->points();
601632
for ( it = tmpPoints.constBegin(); it != tmpPoints.constEnd(); ++it )
602633
{
603-
p2 = *it;
604-
if ( !b )
634+
point = *it;
635+
636+
QTreeWidgetItem *item = new QTreeWidgetItem();
637+
item->setText( Columns::X, QLocale().toString( point.x(), 'f', mDecimalPlacesCoordinates ) );
638+
item->setText( Columns::Y, QLocale().toString( point.y(), 'f', mDecimalPlacesCoordinates ) );
639+
640+
if ( !firstPoint )
605641
{
606642
double d = -1;
607-
d = mDa.measureLine( p1, p2 );
643+
d = mDa.measureLine( previousPoint, point );
608644
if ( mConvertToDisplayUnits )
609645
{
610646
if ( mDistanceUnits == Qgis::DistanceUnit::Unknown && mMapDistanceUnits != Qgis::DistanceUnit::Unknown )
611647
d = convertLength( d, mMapDistanceUnits );
612648
else
613649
d = convertLength( d, mDistanceUnits );
614650
}
615-
616-
QTreeWidgetItem *item = new QTreeWidgetItem( QStringList( QLocale().toString( d, 'f', mDecimalPlaces ) ) );
617-
item->setTextAlignment( 0, Qt::AlignRight );
618-
mTable->addTopLevelItem( item );
619-
mTable->scrollToItem( item );
651+
item->setText( Columns::Distance, QLocale().toString( d, 'f', mDecimalPlaces ) );
652+
item->setTextAlignment( Columns::Distance, Qt::AlignRight );
620653
}
621-
p1 = p2;
622-
b = false;
654+
655+
mTable->addTopLevelItem( item );
656+
mTable->scrollToItem( item );
657+
658+
previousPoint = point;
659+
firstPoint = false;
623660
}
624661

625662
mTotal = mDa.measureLine( mTool->points() );
626663
mTable->show(); // Show the table with items
627664
mSpacer->changeSize( 40, 5, QSizePolicy::Fixed, QSizePolicy::Maximum );
628665
editTotal->setText( formatDistance( mTotal, mConvertToDisplayUnits ) );
666+
667+
if ( !mTool->done() )
668+
{
669+
// re-add temporary mouse cursor position
670+
addPoint();
671+
mouseMove( mLastMousePoint );
672+
}
629673
}
630674
}
631675

@@ -676,15 +720,36 @@ double QgsMeasureDialog::convertArea( double area, Qgis::AreaUnit toUnit ) const
676720

677721
void QgsMeasureDialog::copyMeasurements()
678722
{
723+
bool includeHeader = settingClipboardHeader->value();
724+
725+
// Get the separator
726+
QString separator = settingClipboardSeparator->value();
727+
if ( separator.isEmpty() )
728+
separator = QStringLiteral( "\t" );
729+
679730
QClipboard *clipboard = QApplication::clipboard();
680731
QString text;
681732
QTreeWidgetItemIterator it( mTable );
733+
734+
if ( includeHeader )
735+
{
736+
text += mTable->headerItem()->text( Columns::X ) + separator;
737+
text += mTable->headerItem()->text( Columns::Y ) + separator;
738+
text += mTable->headerItem()->text( Columns::Distance ) + QStringLiteral( "\n" );
739+
}
740+
682741
while ( *it )
683742
{
684-
text += ( *it )->text( 0 ) + QStringLiteral( "\n" );
743+
text += ( *it )->text( Columns::X ) + separator;
744+
text += ( *it )->text( Columns::Y ) + separator;
745+
text += ( *it )->text( Columns::Distance ) + QStringLiteral( "\n" );
685746
it++;
686747
}
748+
687749
clipboard->setText( text );
750+
751+
// Display a message to the user
752+
QgisApp::instance()->messageBar()->pushInfo( tr( "Measure" ), tr( "Measurements copied to clipboard" ) );
688753
}
689754

690755
void QgsMeasureDialog::reject()

‎src/app/qgsmeasuredialog.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,18 @@
2727
class QCloseEvent;
2828
class QgsMeasureTool;
2929
class QgsMapCanvas;
30+
class QgsSettingsEntryBool;
31+
class QgsSettingsEntryString;
3032

3133
class APP_EXPORT QgsMeasureDialog : public QDialog, private Ui::QgsMeasureBase
3234
{
3335
Q_OBJECT
3436

3537
public:
3638

39+
static const QgsSettingsEntryBool *settingClipboardHeader;
40+
static const QgsSettingsEntryString *settingClipboardSeparator;
41+
3742
//! Constructor
3843
QgsMeasureDialog( QgsMeasureTool *tool, Qt::WindowFlags f = Qt::WindowFlags() );
3944

@@ -79,6 +84,14 @@ class APP_EXPORT QgsMeasureDialog : public QDialog, private Ui::QgsMeasureBase
7984

8085
private:
8186

87+
//! \since QGIS 3.32 columns
88+
enum Columns
89+
{
90+
X = 0,
91+
Y,
92+
Distance,
93+
};
94+
8295
//! formats distance to most appropriate units
8396
QString formatDistance( double distance, bool convertUnits = true ) const;
8497

@@ -112,6 +125,9 @@ class APP_EXPORT QgsMeasureDialog : public QDialog, private Ui::QgsMeasureBase
112125
//! Number of decimal places we want.
113126
int mDecimalPlaces = 3;
114127

128+
//! Number of decimal places we want for the coordinates.
129+
int mDecimalPlacesCoordinates = 3;
130+
115131
//! Current unit for input values
116132
Qgis::DistanceUnit mCanvasUnits = Qgis::DistanceUnit::Unknown;
117133

‎src/app/qgsmeasuretool.cpp

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ QgsMeasureTool::QgsMeasureTool( QgsMapCanvas *canvas, bool measureArea )
3636
mRubberBand = new QgsRubberBand( canvas, mMeasureArea ? Qgis::GeometryType::Polygon : Qgis::GeometryType::Line );
3737
mRubberBandPoints = new QgsRubberBand( canvas, Qgis::GeometryType::Point );
3838

39-
// Append point we will move
40-
mPoints.append( QgsPointXY( 0, 0 ) );
4139
mDestinationCrs = canvas->mapSettings().destinationCrs();
4240

4341
mDialog = new QgsMeasureDialog( this );
@@ -97,17 +95,6 @@ void QgsMeasureTool::deactivate()
9795
mDialog->hide();
9896
mRubberBand->hide();
9997
mRubberBandPoints->hide();
100-
101-
// Deactivating the tool does not reset the measure.
102-
// Remove the last temporary point as to not duplicate it when
103-
// the tool is re activated
104-
int nbTempVertices = mRubberBand->numberOfVertices();
105-
int nbVertices = mRubberBandPoints->numberOfVertices();
106-
if ( nbTempVertices > nbVertices )
107-
{
108-
mRubberBand->removeLastPoint();
109-
}
110-
11198
QgsMapTool::deactivate();
11299
}
113100

@@ -163,18 +150,20 @@ void QgsMeasureTool::updateSettings()
163150
}
164151

165152
mRubberBand->updatePosition();
166-
mRubberBand->update();
167153
mRubberBandPoints->updatePosition();
168-
mRubberBandPoints->update();
169154
}
170155
mDestinationCrs = mCanvas->mapSettings().destinationCrs();
171156

157+
// Update the dialog. This will clear then re-populate the table
172158
mDialog->updateSettings();
173159

174-
if ( !mDone && mRubberBand->size() > 0 )
160+
int nbTempVertices = mRubberBand->numberOfVertices();
161+
int nbVertices = mRubberBandPoints->numberOfVertices();
162+
163+
// Add a temporary point to the rubber band if the user is currently measuring
164+
if ( !mDone && mRubberBand->size() > 0 && nbTempVertices <= nbVertices )
175165
{
176166
mRubberBand->addPoint( mPoints.last() );
177-
mDialog->addPoint();
178167
}
179168
if ( mRubberBand->size() > 0 )
180169
{

‎src/core/settings/qgssettingstree.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class CORE_EXPORT QgsSettingsTree
6161
static inline QgsSettingsTreeNode *sTreeRendering = treeRoot()->createChildNode( QStringLiteral( "rendering" ) );
6262
static inline QgsSettingsTreeNode *sTreeSvg = treeRoot()->createChildNode( QStringLiteral( "svg" ) );
6363
static inline QgsSettingsTreeNode *sTreeWms = treeRoot()->createChildNode( QStringLiteral( "wms" ) );
64+
static inline QgsSettingsTreeNode *sTreeMeasure = treeRoot()->createChildNode( QStringLiteral( "measure" ) );
6465

6566
#endif
6667

‎src/ui/qgsmeasurebase.ui

Lines changed: 102 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>462</width>
10-
<height>376</height>
9+
<width>430</width>
10+
<height>300</height>
1111
</rect>
1212
</property>
1313
<property name="baseSize">
@@ -39,57 +39,45 @@
3939
<property name="spacing">
4040
<number>6</number>
4141
</property>
42-
<item row="2" column="0" colspan="4">
43-
<widget class="QTreeWidget" name="mTable">
44-
<property name="editTriggers">
45-
<set>QAbstractItemView::NoEditTriggers</set>
46-
</property>
47-
<property name="rootIsDecorated">
48-
<bool>false</bool>
49-
</property>
50-
<property name="columnCount">
51-
<number>1</number>
52-
</property>
53-
<column>
54-
<property name="text">
55-
<string>Segments</string>
56-
</property>
57-
<property name="textAlignment">
58-
<set>AlignTrailing|AlignVCenter</set>
59-
</property>
60-
</column>
61-
</widget>
62-
</item>
63-
<item row="4" column="0">
64-
<widget class="QLabel" name="totalDistanceLabel">
65-
<property name="text">
66-
<string>Total</string>
67-
</property>
68-
<property name="buddy">
69-
<cstring>editTotal</cstring>
42+
<item row="8" column="0" colspan="4">
43+
<widget class="QgsCollapsibleGroupBox" name="groupBox">
44+
<property name="title">
45+
<string>Info</string>
7046
</property>
47+
<layout class="QVBoxLayout" name="verticalLayout">
48+
<item>
49+
<widget class="QLabel" name="mNotesLabel">
50+
<property name="text">
51+
<string/>
52+
</property>
53+
<property name="wordWrap">
54+
<bool>true</bool>
55+
</property>
56+
</widget>
57+
</item>
58+
</layout>
7159
</widget>
7260
</item>
73-
<item row="4" column="1">
74-
<spacer>
61+
<item row="9" column="0" colspan="4">
62+
<spacer name="mSpacer">
7563
<property name="orientation">
76-
<enum>Qt::Horizontal</enum>
77-
</property>
78-
<property name="sizeType">
79-
<enum>QSizePolicy::Fixed</enum>
64+
<enum>Qt::Vertical</enum>
8065
</property>
8166
<property name="sizeHint" stdset="0">
8267
<size>
83-
<width>41</width>
84-
<height>25</height>
68+
<width>40</width>
69+
<height>20</height>
8570
</size>
8671
</property>
8772
</spacer>
8873
</item>
89-
<item row="6" column="0">
90-
<widget class="QLabel" name="totalHorizontalDistanceLabel">
74+
<item row="7" column="0">
75+
<widget class="QRadioButton" name="mCartesian">
9176
<property name="text">
92-
<string>Total Horizontal Distance</string>
77+
<string>Cartesian</string>
78+
</property>
79+
<property name="checked">
80+
<bool>false</bool>
9381
</property>
9482
</widget>
9583
</item>
@@ -109,6 +97,9 @@
10997
</property>
11098
</widget>
11199
</item>
100+
<item row="4" column="3">
101+
<widget class="QComboBox" name="mUnitsCombo"/>
102+
</item>
112103
<item row="7" column="2">
113104
<widget class="QRadioButton" name="mEllipsoidal">
114105
<property name="text">
@@ -119,45 +110,6 @@
119110
</property>
120111
</widget>
121112
</item>
122-
<item row="7" column="0">
123-
<widget class="QRadioButton" name="mCartesian">
124-
<property name="text">
125-
<string>Cartesian</string>
126-
</property>
127-
<property name="checked">
128-
<bool>false</bool>
129-
</property>
130-
</widget>
131-
</item>
132-
<item row="9" column="0" colspan="4">
133-
<widget class="QgsCollapsibleGroupBox" name="groupBox">
134-
<property name="title">
135-
<string>Info</string>
136-
</property>
137-
<layout class="QVBoxLayout" name="verticalLayout">
138-
<item>
139-
<widget class="QLabel" name="mNotesLabel">
140-
<property name="text">
141-
<string/>
142-
</property>
143-
<property name="wordWrap">
144-
<bool>true</bool>
145-
</property>
146-
</widget>
147-
</item>
148-
</layout>
149-
</widget>
150-
</item>
151-
<item row="4" column="3">
152-
<widget class="QComboBox" name="mUnitsCombo"/>
153-
</item>
154-
<item row="11" column="0" colspan="4">
155-
<widget class="QDialogButtonBox" name="buttonBox">
156-
<property name="standardButtons">
157-
<set>QDialogButtonBox::Close|QDialogButtonBox::Help</set>
158-
</property>
159-
</widget>
160-
</item>
161113
<item row="4" column="2">
162114
<widget class="QLineEdit" name="editTotal">
163115
<property name="font">
@@ -174,19 +126,80 @@
174126
</property>
175127
</widget>
176128
</item>
177-
<item row="10" column="0" colspan="4">
178-
<spacer name="mSpacer">
129+
<item row="6" column="0">
130+
<widget class="QLabel" name="totalHorizontalDistanceLabel">
131+
<property name="text">
132+
<string>Total Horizontal Distance</string>
133+
</property>
134+
</widget>
135+
</item>
136+
<item row="2" column="0" colspan="4">
137+
<widget class="QTreeWidget" name="mTable">
138+
<property name="editTriggers">
139+
<set>QAbstractItemView::NoEditTriggers</set>
140+
</property>
141+
<property name="rootIsDecorated">
142+
<bool>false</bool>
143+
</property>
144+
<property name="columnCount">
145+
<number>3</number>
146+
</property>
147+
<attribute name="headerDefaultSectionSize">
148+
<number>100</number>
149+
</attribute>
150+
<column>
151+
<property name="text">
152+
<string>x</string>
153+
</property>
154+
</column>
155+
<column>
156+
<property name="text">
157+
<string>y</string>
158+
</property>
159+
</column>
160+
<column>
161+
<property name="text">
162+
<string>Segments</string>
163+
</property>
164+
<property name="textAlignment">
165+
<set>AlignTrailing|AlignVCenter</set>
166+
</property>
167+
</column>
168+
</widget>
169+
</item>
170+
<item row="4" column="1">
171+
<spacer>
179172
<property name="orientation">
180-
<enum>Qt::Vertical</enum>
173+
<enum>Qt::Horizontal</enum>
174+
</property>
175+
<property name="sizeType">
176+
<enum>QSizePolicy::Fixed</enum>
181177
</property>
182178
<property name="sizeHint" stdset="0">
183179
<size>
184-
<width>40</width>
185-
<height>20</height>
180+
<width>41</width>
181+
<height>25</height>
186182
</size>
187183
</property>
188184
</spacer>
189185
</item>
186+
<item row="4" column="0">
187+
<widget class="QLabel" name="totalDistanceLabel">
188+
<property name="text">
189+
<string>Total</string>
190+
</property>
191+
<property name="buddy">
192+
<cstring>editTotal</cstring>
193+
</property>
194+
</widget>
195+
</item>
196+
<item row="10" column="0" colspan="4">
197+
<widget class="QDialogButtonBox" name="buttonBox">
198+
<property name="standardButtons">
199+
<set>QDialogButtonBox::Close|QDialogButtonBox::Help</set>
200+
</property>
201+
</widget>
202+
</item>
190203
</layout>
191204
</widget>
192205
<layoutdefault spacing="6" margin="11"/>
@@ -201,6 +214,10 @@
201214
<tabstops>
202215
<tabstop>mTable</tabstop>
203216
<tabstop>editTotal</tabstop>
217+
<tabstop>mEllipsoidal</tabstop>
218+
<tabstop>mUnitsCombo</tabstop>
219+
<tabstop>editHorizontalTotal</tabstop>
220+
<tabstop>mCartesian</tabstop>
204221
</tabstops>
205222
<resources/>
206223
<connections/>

‎src/ui/qgsoptionsbase.ui

Lines changed: 247 additions & 146 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.