Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make the GPS information dock a stacked panel
Allows the color and symbol settings to open inline instead of as
blocking dialogs
  • Loading branch information
nyalldawson committed Dec 10, 2019
1 parent e262056 commit 3aabafc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/app/gps/qgsgpsinformationwidget.cpp
Expand Up @@ -71,8 +71,8 @@ const int MAXACQUISITIONINTERVAL = 3000; // max gps information acquisition susp
const int MAXDISTANCETHRESHOLD = 200; // max gps distance threshold (in meters)


QgsGpsInformationWidget::QgsGpsInformationWidget( QgsMapCanvas *mapCanvas, QWidget *parent, Qt::WindowFlags f )
: QWidget( parent, f )
QgsGpsInformationWidget::QgsGpsInformationWidget( QgsMapCanvas *mapCanvas, QWidget *parent )
: QgsPanelWidget( parent )
, mMapCanvas( mapCanvas )
{
Q_ASSERT( mMapCanvas ); // precondition
Expand Down
5 changes: 3 additions & 2 deletions src/app/gps/qgsgpsinformationwidget.h
Expand Up @@ -24,6 +24,7 @@
#include "nmeatime.h"
#include "qgsgpsmarker.h"
#include "qgsmaptoolcapture.h"
#include "qgspanelwidget.h"
#include <qwt_plot_curve.h>
#ifdef WITH_QWTPOLAR
#include <qwt_polar_plot.h>
Expand All @@ -46,11 +47,11 @@ class QColor;
* A dock widget that displays information from a GPS device and
* allows the user to capture features using gps readings to
* specify the geometry.*/
class APP_EXPORT QgsGpsInformationWidget: public QWidget, private Ui::QgsGpsInformationWidgetBase
class APP_EXPORT QgsGpsInformationWidget: public QgsPanelWidget, private Ui::QgsGpsInformationWidgetBase
{
Q_OBJECT
public:
QgsGpsInformationWidget( QgsMapCanvas *mapCanvas, QWidget *parent = nullptr, Qt::WindowFlags f = nullptr );
QgsGpsInformationWidget( QgsMapCanvas *mapCanvas, QWidget *parent = nullptr );
~QgsGpsInformationWidget() override;
private slots:
void mConnectButton_toggled( bool flag );
Expand Down
5 changes: 4 additions & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -1165,6 +1165,9 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh

// create the GPS tool on starting QGIS - this is like the browser
mpGpsWidget = new QgsGpsInformationWidget( mMapCanvas );
QgsPanelWidgetStack *gpsStack = new QgsPanelWidgetStack();
gpsStack->setMainPanel( mpGpsWidget );
mpGpsWidget->setDockMode( true );
//create the dock widget
mpGpsDock = new QgsDockWidget( tr( "GPS Information" ), this );

Expand All @@ -1178,7 +1181,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
addDockWidget( Qt::LeftDockWidgetArea, mpGpsDock );
// add to the Panel submenu
// now add our widget to the dock - ownership of the widget is passed to the dock
mpGpsDock->setWidget( mpGpsWidget );
mpGpsDock->setWidget( gpsStack );
mpGpsDock->hide();

mLastMapToolMessage = nullptr;
Expand Down
12 changes: 6 additions & 6 deletions src/ui/qgsgpsinformationwidgetbase.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QgsGpsInformationWidgetBase</class>
<widget class="QWidget" name="QgsGpsInformationWidgetBase">
<widget class="QgsPanelWidget" name="QgsGpsInformationWidgetBase">
<property name="geometry">
<rect>
<x>0</x>
Expand Down Expand Up @@ -1413,16 +1413,16 @@ gray = no data
<header>qgscollapsiblegroupbox.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsColorButton</class>
<extends>QToolButton</extends>
<header>qgscolorbutton.h</header>
</customwidget>
<customwidget>
<class>QgsFieldComboBox</class>
<extends>QComboBox</extends>
<header>qgsfieldcombobox.h</header>
</customwidget>
<customwidget>
<class>QgsPanelWidget</class>
<extends>QWidget</extends>
<header>qgspanelwidget.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>mBtnCloseFeature</tabstop>
Expand Down

0 comments on commit 3aabafc

Please sign in to comment.