Skip to content
Permalink
Browse files

[3d] Remember last used light configuration tab

Fixes #38167
  • Loading branch information
nyalldawson committed Sep 21, 2020
1 parent e1ca83b commit ca6ffb77ca40da53628edefc76ba34f8bdbb9b62
Showing with 9 additions and 0 deletions.
  1. +8 −0 src/app/3d/qgslightswidget.cpp
  2. +1 −0 src/app/3d/qgslightswidget.h
@@ -17,6 +17,7 @@

#include "qgs3dmapsettings.h"
#include "qgsapplication.h"
#include "qgssettings.h"

#include <QMessageBox>

@@ -54,6 +55,13 @@ QgsLightsWidget::QgsLightsWidget( QWidget *parent )
connect( spinDirectionZ, qgis::overload<double>::of( &QDoubleSpinBox::valueChanged ), this, &QgsLightsWidget::updateCurrentDirectionalLightParameters );
connect( spinDirectionalIntensity, qgis::overload<double>::of( &QDoubleSpinBox::valueChanged ), this, &QgsLightsWidget::updateCurrentDirectionalLightParameters );
connect( btnDirectionalColor, &QgsColorButton::colorChanged, this, &QgsLightsWidget::updateCurrentDirectionalLightParameters );

tabWidget->setCurrentIndex( QgsSettings().value( QStringLiteral( "UI/last3DLightsTab" ), 1 ).toInt() );
}

QgsLightsWidget::~QgsLightsWidget()
{
QgsSettings().setValue( QStringLiteral( "UI/last3DLightsTab" ), tabWidget->currentIndex() );
}

void QgsLightsWidget::setPointLights( const QList<QgsPointLightSettings> &pointLights )
@@ -33,6 +33,7 @@ class QgsLightsWidget : public QWidget, private Ui::QgsLightsWidget
Q_OBJECT
public:
explicit QgsLightsWidget( QWidget *parent = nullptr );
~QgsLightsWidget() override;

void setPointLights( const QList<QgsPointLightSettings> &pointLights );
void setDirectionalLights( const QList<QgsDirectionalLightSettings> &directionalLights );

0 comments on commit ca6ffb7

Please sign in to comment.
You can’t perform that action at this time.