Fix code to best practices

This commit is contained in:
Withalion 2024-11-19 13:23:42 +01:00 committed by Martin Dobias
parent 1551449df3
commit 7d9d87491b
2 changed files with 12 additions and 6 deletions

View File

@ -88,11 +88,11 @@ void Qgs3DDebugWidget::setMapSettings( Qgs3DMapSettings *mapSettings )
{ {
mMap->setDebugShadowMapSettings( enabled && mMap->shadowSettings().renderShadows(), static_cast<Qt::Corner>( mDebugShadowMapCornerComboBox->currentIndex() ), mDebugShadowMapSizeSpinBox->value() ); mMap->setDebugShadowMapSettings( enabled && mMap->shadowSettings().renderShadows(), static_cast<Qt::Corner>( mDebugShadowMapCornerComboBox->currentIndex() ), mDebugShadowMapSizeSpinBox->value() );
} ); } );
connect( mDebugShadowMapCornerComboBox, QOverload<int>::of( &QComboBox::currentIndexChanged ), this, [ = ]( const int index ) connect( mDebugShadowMapCornerComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [ = ]( const int index )
{ {
mMap->setDebugShadowMapSettings( mDebugShadowMapGroupBox->isChecked() && mMap->shadowSettings().renderShadows(), static_cast<Qt::Corner>( index ), mDebugShadowMapSizeSpinBox->value() ); mMap->setDebugShadowMapSettings( mDebugShadowMapGroupBox->isChecked() && mMap->shadowSettings().renderShadows(), static_cast<Qt::Corner>( index ), mDebugShadowMapSizeSpinBox->value() );
} ); } );
connect( mDebugShadowMapSizeSpinBox, QOverload<double>::of( &QDoubleSpinBox::valueChanged ), this, [ = ]( const double value ) connect( mDebugShadowMapSizeSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [ = ]( const double value )
{ {
mMap->setDebugShadowMapSettings( mDebugShadowMapGroupBox->isChecked() && mMap->shadowSettings().renderShadows(), static_cast<Qt::Corner>( mDebugShadowMapCornerComboBox->currentIndex() ), value ); mMap->setDebugShadowMapSettings( mDebugShadowMapGroupBox->isChecked() && mMap->shadowSettings().renderShadows(), static_cast<Qt::Corner>( mDebugShadowMapCornerComboBox->currentIndex() ), value );
} ); } );
@ -104,11 +104,11 @@ void Qgs3DDebugWidget::setMapSettings( Qgs3DMapSettings *mapSettings )
{ {
mMap->setDebugDepthMapSettings( enabled, static_cast<Qt::Corner>( mDebugDepthMapCornerComboBox->currentIndex() ), mDebugDepthMapSizeSpinBox->value() ); mMap->setDebugDepthMapSettings( enabled, static_cast<Qt::Corner>( mDebugDepthMapCornerComboBox->currentIndex() ), mDebugDepthMapSizeSpinBox->value() );
} ); } );
connect( mDebugDepthMapCornerComboBox, QOverload<int>::of( &QComboBox::currentIndexChanged ), this, [ = ]( const int index ) connect( mDebugDepthMapCornerComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [ = ]( const int index )
{ {
mMap->setDebugDepthMapSettings( mDebugDepthMapGroupBox->isChecked(), static_cast<Qt::Corner>( index ), mDebugDepthMapSizeSpinBox->value() ); mMap->setDebugDepthMapSettings( mDebugDepthMapGroupBox->isChecked(), static_cast<Qt::Corner>( index ), mDebugDepthMapSizeSpinBox->value() );
} ); } );
connect( mDebugDepthMapSizeSpinBox, QOverload<double>::of( &QDoubleSpinBox::valueChanged ), this, [ = ]( const double value ) connect( mDebugDepthMapSizeSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [ = ]( const double value )
{ {
mMap->setDebugDepthMapSettings( mDebugDepthMapGroupBox->isChecked(), static_cast<Qt::Corner>( mDebugDepthMapCornerComboBox->currentIndex() ), value ); mMap->setDebugDepthMapSettings( mDebugDepthMapGroupBox->isChecked(), static_cast<Qt::Corner>( mDebugDepthMapCornerComboBox->currentIndex() ), value );
} ); } );

View File

@ -24,7 +24,7 @@
<enum>QLayout::SetDefaultConstraint</enum> <enum>QLayout::SetDefaultConstraint</enum>
</property> </property>
<item> <item>
<widget class="QScrollArea" name="scrollArea"> <widget class="QgsScrollArea" name="scrollArea">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -44,7 +44,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>-295</y> <y>0</y>
<width>250</width> <width>250</width>
<height>790</height> <height>790</height>
</rect> </rect>
@ -356,6 +356,12 @@
<extends>QDoubleSpinBox</extends> <extends>QDoubleSpinBox</extends>
<header>qgsdoublespinbox.h</header> <header>qgsdoublespinbox.h</header>
</customwidget> </customwidget>
<customwidget>
<class>QgsScrollArea</class>
<extends>QScrollArea</extends>
<header>qgsscrollarea.h</header>
<container>1</container>
</customwidget>
</customwidgets> </customwidgets>
<resources/> <resources/>
<connections/> <connections/>