Skip to content
Permalink
Browse files

Update more rotation widgets to standard behavior, fix tests

  • Loading branch information
nyalldawson committed May 31, 2017
1 parent f83d2f4 commit c019314f86283482407d26a1fe82fe63137e12ab
@@ -235,6 +235,7 @@ QgsShadowEffectWidget::QgsShadowEffectWidget( QWidget *parent )
mShadowColorBtn->setAllowOpacity( false );
mShadowColorBtn->setColorDialogTitle( tr( "Select shadow color" ) );
mShadowColorBtn->setContext( QStringLiteral( "symbology" ) );
mShadowOffsetAngleSpnBx->setClearValue( 0 );

mOffsetUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderPixels << QgsUnitTypes::RenderMapUnits
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
@@ -40,6 +40,7 @@ Qgs25DRendererWidget::Qgs25DRendererWidget( QgsVectorLayer *layer, QgsStyle *sty
setupUi( this );
this->layout()->setContentsMargins( 0, 0, 0, 0 );

mAngleWidget->setClearValue( 0 );
mWallColorButton->setColorDialogTitle( tr( "Select wall color" ) );
mWallColorButton->setAllowOpacity( true );
mWallColorButton->setContext( QStringLiteral( "symbology" ) );
@@ -174,14 +174,17 @@
</item>
<item>
<widget class="QgsSpinBox" name="mShadowOffsetAngleSpnBx">
<property name="wrapping">
<bool>true</bool>
</property>
<property name="suffix">
<string>˚</string>
</property>
<property name="minimum">
<number>-180</number>
<number>-360</number>
</property>
<property name="maximum">
<number>180</number>
<number>360</number>
</property>
<property name="showClearButton" stdset="0">
<bool>false</bool>
@@ -249,11 +252,6 @@
<extends>QComboBox</extends>
<header>qgsblendmodecombobox.h</header>
</customwidget>
<customwidget>
<class>QgsEffectDrawModeComboBox</class>
<extends>QComboBox</extends>
<header>qgseffectdrawmodecombobox.h</header>
</customwidget>
<customwidget>
<class>QgsUnitSelectionWidget</class>
<extends>QWidget</extends>
@@ -266,6 +264,11 @@
<header>qgsopacitywidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsEffectDrawModeComboBox</class>
<extends>QComboBox</extends>
<header>qgseffectdrawmodecombobox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>mShadowOffsetAngleDial</tabstop>
@@ -6572,7 +6572,6 @@ font-style: italic;</string>
<tabstop>mPointOffsetUnitWidget</tabstop>
<tabstop>mPointOffsetUnitsDDBtn</tabstop>
<tabstop>mPointAngleSpinBox</tabstop>
<tabstop>mPointAngleDDBtn</tabstop>
<tabstop>mRepeatDistanceSpinBox</tabstop>
<tabstop>mRepeatDistanceDDBtn</tabstop>
<tabstop>mRepeatDistanceUnitWidget</tabstop>
@@ -58,21 +58,24 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="suffix">
<string>˚</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Altitude (degrees)</string>
<string>Altitude</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Azimuth (degrees)</string>
<string>Azimuth</string>
</property>
</widget>
</item>
@@ -91,6 +94,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="suffix">
<string>˚</string>
</property>
<property name="singleStep">
<double>5.000000000000000</double>
</property>
@@ -115,10 +115,16 @@
<widget class="QgsFieldExpressionWidget" name="mHeightWidget" native="true"/>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="mAngleWidget">
<widget class="QgsSpinBox" name="mAngleWidget">
<property name="wrapping">
<bool>true</bool>
</property>
<property name="suffix">
<string>°</string>
</property>
<property name="minimum">
<number>-360</number>
</property>
<property name="maximum">
<number>359</number>
</property>
@@ -137,18 +143,23 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QgsFieldExpressionWidget</class>
<extends>QWidget</extends>
<header location="global">qgsfieldexpressionwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsColorButton</class>
<extends>QToolButton</extends>
<header>qgscolorbutton.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsSpinBox</class>
<extends>QSpinBox</extends>
<header>qgsspinbox.h</header>
</customwidget>
<customwidget>
<class>QgsFieldExpressionWidget</class>
<extends>QWidget</extends>
<header>qgsfieldexpressionwidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
@@ -153,7 +153,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 5, 5 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsLinearlyInterpolatedDiagramRenderer *dr = new QgsLinearlyInterpolatedDiagramRenderer();
dr->setLowerValue( 0.0 );
@@ -190,7 +190,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 5, 5 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsLinearlyInterpolatedDiagramRenderer *dr = new QgsLinearlyInterpolatedDiagramRenderer();
dr->setLowerValue( 0.0 );
@@ -232,7 +232,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 15, 15 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsSingleCategoryDiagramRenderer *dr = new QgsSingleCategoryDiagramRenderer();
dr->setDiagram( new QgsPieDiagram() );
@@ -269,7 +269,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 15, 15 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsSingleCategoryDiagramRenderer *dr = new QgsSingleCategoryDiagramRenderer();
dr->setDiagram( new QgsPieDiagram() );
@@ -306,7 +306,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 15, 15 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsSingleCategoryDiagramRenderer *dr = new QgsSingleCategoryDiagramRenderer();
dr->setDiagram( new QgsPieDiagram() );
@@ -318,7 +318,7 @@ class TestQgsDiagram : public QObject
dls.setShowAllDiagrams( true );

//setup data defined start angle
dls.dataDefinedProperties().setProperty( QgsDiagramLayerSettings::StartAngle, QgsProperty::fromExpression( "\"Importance\"/20.0 * 360.0", true ) );
dls.dataDefinedProperties().setProperty( QgsDiagramLayerSettings::StartAngle, QgsProperty::fromExpression( "360.0-\"Importance\"/20.0 * 360.0", true ) );

mPointsLayer->setDiagramLayerSettings( dls );

@@ -342,7 +342,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 15, 15 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsSingleCategoryDiagramRenderer *dr = new QgsSingleCategoryDiagramRenderer();
dr->setDiagram( new QgsPieDiagram() );
@@ -378,7 +378,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 15, 15 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsSingleCategoryDiagramRenderer *dr = new QgsSingleCategoryDiagramRenderer();
dr->setDiagram( new QgsPieDiagram() );
@@ -414,7 +414,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 50, 50 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsSingleCategoryDiagramRenderer *dr = new QgsSingleCategoryDiagramRenderer();
dr->setDiagram( new QgsPieDiagram() );
@@ -448,7 +448,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 50, 50 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsSingleCategoryDiagramRenderer *dr = new QgsSingleCategoryDiagramRenderer();
dr->setDiagram( new QgsPieDiagram() );
@@ -484,7 +484,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 50, 50 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsSingleCategoryDiagramRenderer *dr = new QgsSingleCategoryDiagramRenderer();
dr->setDiagram( new QgsPieDiagram() );
@@ -525,7 +525,7 @@ class TestQgsDiagram : public QObject
ds.scaleByArea = true;
ds.sizeType = QgsUnitTypes::RenderMillimeters;
ds.size = QSizeF( 15, 15 );
ds.rotationOffset = 270;
ds.rotationOffset = 0;

QgsSingleCategoryDiagramRenderer *dr = new QgsSingleCategoryDiagramRenderer();
dr->setDiagram( new QgsTextDiagram() );

0 comments on commit c019314

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