Skip to content

Commit

Permalink
[gui][sensors] Add a introductory label in the project properties sen…
Browse files Browse the repository at this point in the history
…sors panel
  • Loading branch information
nirvn committed Apr 1, 2023
1 parent 49d1be6 commit b80ca54
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/sensor/qgsprojectsensorsettingswidget.cpp
Expand Up @@ -29,6 +29,11 @@ QgsProjectSensorSettingsWidget::QgsProjectSensorSettingsWidget( QWidget *parent

QgsSensorTableWidget *widget = new QgsSensorTableWidget( this );
mPanelStack->setMainPanel( widget );
connect( widget, &QgsPanelWidget::showPanel, this, [ = ]( QgsPanelWidget * panel )
{
mSensorIntroductionLabel->setVisible( false );
connect( panel, &QgsPanelWidget::panelAccepted, this, [ = ]() { mSensorIntroductionLabel->setVisible( true ); } );
} );

QDomElement sensorElem = QgsProject::instance()->sensorManager()->writeXml( mPreviousSensors );
mPreviousSensors.appendChild( sensorElem );
Expand Down
10 changes: 10 additions & 0 deletions src/ui/sensor/qgsprojectsensorettingswidgetbase.ui
Expand Up @@ -38,6 +38,16 @@
<item>
<widget class="QgsPanelWidgetStack" name="mPanelStack" native="true"/>
</item>
<item>
<widget class="QLabel" name="mSensorIntroductionLabel">
<property name="text">
<string>When connected, a sensor will passively capture data in the background. The latest captured data can be accessed within expressions using the &lt;i&gt;sensor_data('sensor name')&lt;/i&gt; function.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down

0 comments on commit b80ca54

Please sign in to comment.