Skip to content
Permalink
Browse files

Fix some QGIS 3.0 symbology todos

  • Loading branch information
nyalldawson committed Sep 13, 2016
1 parent 098f69d commit b7111775e8722a52ddeed389823ec001bf10e49b
@@ -920,9 +920,16 @@ be returned instead of a null pointer if no transformation is required.</li>

<ul>
<li>QgsRuleBasedRenderer.Rule checkState() and setCheckState() were removed. Use active() and setActive() instead.</li>
<li>QgsRuleBasedRenderer.Rule updateElseRules() was removed.</li>
<li>startRender( QgsRenderContext& context, const QgsFields& fields ) was removed. Use startRender( QgsRenderContext& context, const QgsFields& fields, QString& filter ) instead.</li>
</ul>

\subsection qgis_api_break_3_0_QgsRuleBasedRendererWidget QgsRuleBasedRendererWidget

<ul>
<li>refineRuleCategoriesGui() and refineRuleRangesGui() no longer take a QModelIndexList argument.</li>
</ul>

\subsection qgis_api_break_3_0_QgsSimpleMarkerSymbolLayer QgsSimpleMarkerSymbolLayer

<ul>
@@ -931,6 +938,13 @@ be returned instead of a null pointer if no transformation is required.</li>
<li>prepareShape() and preparePath() were removed. Calling these methods manually should no longer be required.</li>
</ul>

\subsection qgis_api_break_3_0_QgsSimpleMarkerSymbolLayerWidget QgsSimpleMarkerSymbolLayerWidget

<ul>
<li>setName() was removed.</li>
</ul>


\subsection qgis_api_break_3_0_QgsSingleSymbolRendererWidget QgsSingleSymbolRendererWidget
<ul>
<li>sizeScaleFieldChanged() and scaleMethodChanged() were removed. These settings are no longer exposed in the widget's GUI.</li>
@@ -295,13 +295,6 @@ class QgsRuleBasedRenderer : QgsFeatureRenderer
//! @note added in 2.6
QgsRuleBasedRenderer::Rule* findRuleByKey( const QString& key );

/**
* Check which child rules are else rules and update the internal list of else rules
*
* TODO QGIS 3: Does this need to be public?
*/
void updateElseRules();

/**
* Sets if this rule is an ELSE rule
*
@@ -86,8 +86,10 @@ class QgsRuleBasedRendererWidget : QgsRendererWidget

protected:
void refineRule( int type );
void refineRuleCategoriesGui( const QModelIndexList& index );
void refineRuleRangesGui( const QModelIndexList& index );
//! Opens the dialog for refining a rule using categories
void refineRuleCategoriesGui();
//! Opens the dialog for refining a rule using ranges
void refineRuleRangesGui();
void refineRuleScalesGui( const QModelIndexList& index );

QgsRuleBasedRenderer::Rule* currentRule();
@@ -126,7 +126,6 @@ class QgsSimpleMarkerSymbolLayerWidget : QgsSymbolLayerWidget
virtual QgsSymbolLayer* symbolLayer();

public slots:
void setName();
void setColorBorder( const QColor& color );
void setColorFill( const QColor& color );
void setSize();
@@ -689,7 +689,6 @@ QgsSimpleMarkerSymbolLayer::QgsSimpleMarkerSymbolLayer( QgsSimpleMarkerSymbolLay
, mOutlineWidth( 0 )
, mOutlineWidthUnit( QgsUnitTypes::RenderMillimeters )
, mPenJoinStyle( penJoinStyle )
, mName( encodeShape( shape ) )
, mUsingCache( false )
{
mColor = color;
@@ -366,9 +366,6 @@ class CORE_EXPORT QgsSimpleMarkerSymbolLayer : public QgsSimpleMarkerSymbolLayer
//! QBrush corresponding to marker's fill style
QBrush mBrush;

//TODO QGIS 3.0 - remove
QString mName;

//! Cached image of marker, if using cached version
QImage mCache;
//! QPen to use as outline of selected symbols
@@ -353,13 +353,6 @@ class CORE_EXPORT QgsRuleBasedRenderer : public QgsFeatureRenderer
//! @note added in 2.6
Rule* findRuleByKey( const QString& key );

/**
* Check which child rules are else rules and update the internal list of else rules
*
* TODO QGIS 3: Does this need to be public?
*/
void updateElseRules();

/**
* Sets if this rule is an ELSE rule
*
@@ -398,6 +391,12 @@ class CORE_EXPORT QgsRuleBasedRenderer : public QgsFeatureRenderer

Rule( const Rule& rh );
Rule& operator=( const Rule& rh );

/**
* Check which child rules are else rules and update the internal list of else rules
*
*/
void updateElseRules();
};

/////
@@ -227,9 +227,9 @@ void QgsRuleBasedRendererWidget::refineRule( int type )


if ( type == 0 ) // categories
refineRuleCategoriesGui( indexlist );
refineRuleCategoriesGui();
else if ( type == 1 ) // ranges
refineRuleRangesGui( indexlist );
refineRuleRangesGui();
else // scales
refineRuleScalesGui( indexlist );

@@ -255,7 +255,7 @@ void QgsRuleBasedRendererWidget::refineRuleScales()
refineRule( 2 );
}

void QgsRuleBasedRendererWidget::refineRuleCategoriesGui( const QModelIndexList& )
void QgsRuleBasedRendererWidget::refineRuleCategoriesGui()
{
QgsCategorizedSymbolRendererWidget* w = new QgsCategorizedSymbolRendererWidget( mLayer, mStyle, nullptr );
w->setPanelTitle( tr( "Add categories to rules" ) );
@@ -265,7 +265,7 @@ void QgsRuleBasedRendererWidget::refineRuleCategoriesGui( const QModelIndexList&
openPanel( w );
}

void QgsRuleBasedRendererWidget::refineRuleRangesGui( const QModelIndexList& )
void QgsRuleBasedRendererWidget::refineRuleRangesGui()
{
QgsGraduatedSymbolRendererWidget* w = new QgsGraduatedSymbolRendererWidget( mLayer, mStyle, nullptr );
w->setPanelTitle( tr( "Add ranges to rules" ) );
@@ -137,10 +137,10 @@ class GUI_EXPORT QgsRuleBasedRendererWidget : public QgsRendererWidget, private

protected:
void refineRule( int type );
//TODO QGIS 3.0 - remove index parameter
void refineRuleCategoriesGui( const QModelIndexList& index );
//TODO QGIS 3.0 - remove index parameter
void refineRuleRangesGui( const QModelIndexList& index );
//! Opens the dialog for refining a rule using categories
void refineRuleCategoriesGui();
//! Opens the dialog for refining a rule using ranges
void refineRuleRangesGui();
void refineRuleScalesGui( const QModelIndexList& index );

QgsRuleBasedRenderer::Rule* currentRule();
@@ -428,7 +428,7 @@ QgsSimpleMarkerSymbolLayerWidget::QgsSimpleMarkerSymbolLayerWidget( const QgsVec
delete lyr;
}

connect( lstNames, SIGNAL( currentRowChanged( int ) ), this, SLOT( setName() ) );
connect( lstNames, SIGNAL( currentRowChanged( int ) ), this, SLOT( setShape() ) );
connect( btnChangeColorBorder, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( setColorBorder( const QColor& ) ) );
connect( btnChangeColorFill, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( setColorFill( const QColor& ) ) );
connect( cboJoinStyle, SIGNAL( currentIndexChanged( int ) ), this, SLOT( penJoinStyleChanged() ) );
@@ -539,7 +539,7 @@ QgsSymbolLayer* QgsSimpleMarkerSymbolLayerWidget::symbolLayer()
return mLayer;
}

void QgsSimpleMarkerSymbolLayerWidget::setName()
void QgsSimpleMarkerSymbolLayerWidget::setShape()
{
mLayer->setShape( static_cast< QgsSimpleMarkerSymbolLayerBase::Shape>( lstNames->currentItem()->data( Qt::UserRole ).toInt() ) );
btnChangeColorFill->setEnabled( QgsSimpleMarkerSymbolLayerBase::shapeIsFilled( mLayer->shape() ) );
@@ -191,8 +191,7 @@ class GUI_EXPORT QgsSimpleMarkerSymbolLayerWidget : public QgsSymbolLayerWidget,
virtual QgsSymbolLayer* symbolLayer() override;

public slots:
//TODO QGIS 3.0 - rename to setShape
void setName();

void setColorBorder( const QColor& color );
void setColorFill( const QColor& color );
void setSize();
@@ -210,7 +209,7 @@ class GUI_EXPORT QgsSimpleMarkerSymbolLayerWidget : public QgsSymbolLayerWidget,
QgsSimpleMarkerSymbolLayer* mLayer;

private slots:

void setShape();
void updateAssistantSymbol();
void penJoinStyleChanged();

0 comments on commit b711177

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