Skip to content

Commit fdf16e3

Browse files
committedJul 6, 2016
Rename QgsLayerStylingPanelFactory to QgsMapLayerConfigWidgetFactory
- Move QgsMapLayerPropertiesFactory into single factory object for dock and properties
1 parent 38e65c3 commit fdf16e3

36 files changed

+243
-455
lines changed
 

‎python/gui/gui.sip

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@
105105
%Include qgsmaplayeractionregistry.sip
106106
%Include qgsmaplayercombobox.sip
107107
%Include qgsmaplayermodel.sip
108-
%Include qgsmaplayerpropertiesfactory.sip
108+
%Include qgsmaplayerconfigwidget.sip
109+
%Include qgsmaplayerconfigwidgetfactory.sip
109110
%Include qgsmaplayerproxymodel.sip
110111
%Include qgsmapmouseevent.sip
111112
%Include qgsmapoverviewcanvas.sip
@@ -120,7 +121,6 @@
120121
%Include qgsmaptoolpan.sip
121122
%Include qgsmaptooltouch.sip
122123
%Include qgsmaptoolzoom.sip
123-
%Include qgsmapstylepanel.sip
124124
%Include qgsmaplayerstylemanagerwidget.sip
125125
%Include qgsmessagebar.sip
126126
%Include qgsmessagebaritem.sip
@@ -164,7 +164,6 @@
164164
%Include qgsunitselectionwidget.sip
165165
%Include qgsuserinputdockwidget.sip
166166
%Include qgsvariableeditorwidget.sip
167-
%Include qgsvectorlayerpropertiespage.sip
168167
%Include qgsvectorlayertools.sip
169168
%Include qgsvertexmarker.sip
170169

‎python/gui/qgisinterface.sip

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,19 +284,13 @@ class QgisInterface : QObject
284284
* @note Ownership of the factory is not transferred, and the factory must
285285
* be unregistered when plugin is unloaded.
286286
* @see unregisterMapLayerPropertiesFactory() */
287-
virtual void registerMapLayerPropertiesFactory( QgsMapLayerPropertiesFactory* factory ) = 0;
287+
virtual void registerMapLayerConfigWidgetFactory( QgsMapLayerConfigWidgetFactory* factory ) = 0;
288288

289289
/** Unregister a previously registered tab in the vector layer properties dialog.
290290
* @note added in QGIS 2.16
291291
* @see registerMapLayerPropertiesFactory()
292292
*/
293-
virtual void unregisterMapLayerPropertiesFactory( QgsMapLayerPropertiesFactory* factory ) = 0;
294-
295-
/** Register a new tab in the layer properties dialog */
296-
virtual void registerMapStylePanelFactory( QgsLayerStylingPanelFactory* factory ) = 0;
297-
298-
/** Unregister a previously registered tab in the layer properties dialog */
299-
virtual void unregisterMapStylePanelFactory( QgsLayerStylingPanelFactory* factory ) = 0;
293+
virtual void unregisterMapLayerConfigWidgetFactory( QgsMapLayerConfigWidgetFactory* factory ) = 0;
300294

301295
// @todo is this deprecated in favour of QgsContextHelp?
302296
/** Open a url in the users browser. By default the QGIS doc directory is used
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/** \ingroup gui
2+
* \class QgsMapLayerConfigWidget
3+
* \class A panel widget that can be shown in the map style dock
4+
* \note added in QGIS 2.16
5+
*/
6+
class QgsMapLayerConfigWidget : public QgsPanelWidget
7+
{
8+
%TypeHeaderCode
9+
#include <qgsmaplayerconfigwidget.h>
10+
%End
11+
public:
12+
/**
13+
* @brief A panel widget that can be shown in the map style dock
14+
* @param layer The layer active in the dock.
15+
* @param canvas The canvas object.
16+
* @param parent The parent of the widget.
17+
* @note The widget is created each time the panel is selected in the dock.
18+
* Keep the loading light as possible for speed in the UI.
19+
*/
20+
QgsMapLayerConfigWidget(QgsMapLayer* layer, QgsMapCanvas *canvas, QWidget *parent = 0);
21+
22+
public slots:
23+
24+
/**
25+
* @brief Called when changes to the layer need to be made.
26+
* Will be called when live update is enabled.
27+
*/
28+
virtual void apply() = 0;
29+
};
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/** \ingroup gui
2+
* \class QgsMapLayerConfigWidgetFactory
3+
* \note added in QGIS 2.16
4+
* Factory class for creating custom map layer property pages
5+
*/
6+
class QgsMapLayerConfigWidgetFactory
7+
{
8+
%TypeHeaderCode
9+
#include <qgsmaplayerconfigwidgetfactory.h>
10+
%End
11+
12+
public:
13+
/** Constructor */
14+
QgsMapLayerConfigWidgetFactory();
15+
16+
/** Destructor */
17+
virtual ~QgsMapLayerConfigWidgetFactory();
18+
19+
/**
20+
* @brief The icon that will be shown in the UI for the panel.
21+
* @return A QIcon for the panel icon.
22+
*/
23+
virtual QIcon icon() const;
24+
25+
/**
26+
* @brief The title of the panel.
27+
* @note This may or may not be shown to the user.
28+
* @return Title of the panel
29+
*/
30+
virtual QString title() const;
31+
32+
/**
33+
* @brief Check if the layer is supported for this widget.
34+
* @return True if this layer is supported for this widget
35+
*/
36+
virtual bool supportsLayer( QgsMapLayer *layer ) const;
37+
38+
/**
39+
* @brief Factory fucntion to create the widget on demand as needed by the dock.
40+
* @note This function is called each time the panel is selected. Keep it light for better UX.
41+
* @param layer The active layer in the dock.
42+
* @param canvas The map canvas.
43+
* @param dockWidget True of the widget will be shown a dock style widget.
44+
* @param parent The parent of the widget.
45+
* @return A new QgsMapStylePanel which is shown in the map style dock.
46+
*/
47+
virtual QgsMapLayerConfigWidget* createWidget( QgsMapLayer* layer, QgsMapCanvas *canvas, bool dockWidget = true, QWidget* parent /TransferThis/ = 0) const = 0 /Factory/;
48+
};

‎python/gui/qgsmaplayerpropertiesfactory.sip

Lines changed: 0 additions & 34 deletions
This file was deleted.

‎python/gui/qgsmaplayerstylemanagerwidget.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @brief The QgsMapLayerStyleManagerWidget class which is used to visually manage
33
* the layer styles.
44
*/
5-
class QgsMapLayerStyleManagerWidget : QgsLayerStylingPanel
5+
class QgsMapLayerStyleManagerWidget : QgsMapLayerConfigWidget
66
{
77
%TypeHeaderCode
88
#include "qgsmaplayerstylemanagerwidget.h"

‎python/gui/qgsmapstylepanel.sip

Lines changed: 0 additions & 86 deletions
This file was deleted.

‎python/gui/qgsvectorlayerpropertiespage.sip

Lines changed: 0 additions & 22 deletions
This file was deleted.

‎python/gui/raster/qgsrendererrasterpropertieswidget.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class QgsRendererRasterPropertiesWidget : QgsLayerStylingPanel
1+
class QgsRendererRasterPropertiesWidget : QgsMapLayerConfigWidget
22
{
33
%TypeHeaderCode
44
#include <qgsrendererrasterpropertieswidget.h>

‎src/app/qgisapp.cpp

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
776776
mMapStylingDock = new QgsDockWidget( this );
777777
mMapStylingDock->setWindowTitle( tr( "Layer Styling" ) );
778778
mMapStylingDock->setObjectName( "LayerStyling" );
779-
mMapStyleWidget = new QgsLayerStylingWidget( mMapCanvas, mMapStylePanelFactories );
779+
mMapStyleWidget = new QgsLayerStylingWidget( mMapCanvas, mMapLayerPanelFactories );
780780
mMapStylingDock->setWidget( mMapStyleWidget );
781781
connect( mMapStyleWidget, SIGNAL( styleChanged( QgsMapLayer* ) ), this, SLOT( updateLabelToolButtons() ) );
782782
connect( mMapStylingDock, SIGNAL( visibilityChanged( bool ) ), mActionStyleDock, SLOT( setChecked( bool ) ) );
@@ -9123,28 +9123,18 @@ void QgisApp::openURL( QString url, bool useQgisDocDirectory )
91239123
#endif
91249124
}
91259125

9126-
void QgisApp::registerMapLayerPropertiesFactory( QgsMapLayerPropertiesFactory* factory )
9126+
void QgisApp::registerMapLayerPropertiesFactory( QgsMapLayerConfigWidgetFactory* factory )
91279127
{
9128-
mMapLayerPropertiesFactories << factory;
9129-
}
9130-
9131-
void QgisApp::unregisterMapLayerPropertiesFactory( QgsMapLayerPropertiesFactory* factory )
9132-
{
9133-
mMapLayerPropertiesFactories.removeAll( factory );
9134-
}
9135-
9136-
void QgisApp::registerMapStylePanelFactory( QgsLayerStylingPanelFactory *factory )
9137-
{
9138-
mMapStylePanelFactories << factory;
9128+
mMapLayerPanelFactories << factory;
91399129
if ( mMapStyleWidget )
9140-
mMapStyleWidget->setPageFactories( mMapStylePanelFactories );
9130+
mMapStyleWidget->setPageFactories( mMapLayerPanelFactories );
91419131
}
91429132

9143-
void QgisApp::unregisterMapStylePanelFactory( QgsLayerStylingPanelFactory *factory )
9133+
void QgisApp::unregisterMapLayerPropertiesFactory( QgsMapLayerConfigWidgetFactory* factory )
91449134
{
9145-
mMapStylePanelFactories.removeAll( factory );
9135+
mMapLayerPanelFactories.removeAll( factory );
91469136
if ( mMapStyleWidget )
9147-
mMapStyleWidget->setPageFactories( mMapStylePanelFactories );
9137+
mMapStyleWidget->setPageFactories( mMapLayerPanelFactories );
91489138
}
91499139

91509140
/** Get a pointer to the currently selected map layer */
@@ -11367,7 +11357,7 @@ void QgisApp::showLayerProperties( QgsMapLayer *ml )
1136711357
#else
1136811358
QgsVectorLayerProperties *vlp = new QgsVectorLayerProperties( vlayer, this );
1136911359
#endif
11370-
Q_FOREACH ( QgsMapLayerPropertiesFactory* factory, mMapLayerPropertiesFactories )
11360+
Q_FOREACH ( QgsMapLayerConfigWidgetFactory* factory, mMapLayerPanelFactories )
1137111361
{
1137211362
vlp->addPropertiesPageFactory( factory );
1137311363
}

‎src/app/qgisapp.h

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ class QgsLayerTreeMapCanvasBridge;
5757
class QgsLayerTreeView;
5858
class QgsMapCanvas;
5959
class QgsMapLayer;
60-
class QgsMapLayerPropertiesFactory;
61-
class QgsLayerStylingPanelFactory;
60+
class QgsMapLayerConfigWidgetFactory;
6261
class QgsMapTip;
6362
class QgsMapTool;
6463
class QgsMapToolAdvancedDigitizing;
@@ -508,16 +507,10 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
508507
void parseVersionInfo( QNetworkReply* reply, int& latestVersion, QStringList& versionInfo );
509508

510509
/** Register a new tab in the layer properties dialog */
511-
void registerMapLayerPropertiesFactory( QgsMapLayerPropertiesFactory* factory );
510+
void registerMapLayerPropertiesFactory( QgsMapLayerConfigWidgetFactory* factory );
512511

513512
/** Unregister a previously registered tab in the layer properties dialog */
514-
void unregisterMapLayerPropertiesFactory( QgsMapLayerPropertiesFactory* factory );
515-
516-
/** Register a new tab in the layer properties dialog */
517-
void registerMapStylePanelFactory( QgsLayerStylingPanelFactory* factory );
518-
519-
/** Unregister a previously registered tab in the layer properties dialog */
520-
void unregisterMapStylePanelFactory( QgsLayerStylingPanelFactory* factory );
513+
void unregisterMapLayerPropertiesFactory( QgsMapLayerConfigWidgetFactory* factory );
521514

522515
public slots:
523516
void layerTreeViewDoubleClicked( const QModelIndex& index );
@@ -1779,8 +1772,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
17791772

17801773
QgsSnappingUtils* mSnappingUtils;
17811774

1782-
QList<QgsMapLayerPropertiesFactory*> mMapLayerPropertiesFactories;
1783-
QList<QgsLayerStylingPanelFactory*> mMapStylePanelFactories;
1775+
QList<QgsMapLayerConfigWidgetFactory*> mMapLayerPanelFactories;
17841776

17851777
QDateTime mProjectLastModified;
17861778

‎src/app/qgisappinterface.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -475,26 +475,16 @@ bool QgisAppInterface::unregisterMainWindowAction( QAction* action )
475475
return QgsShortcutsManager::instance()->unregisterAction( action );
476476
}
477477

478-
void QgisAppInterface::registerMapLayerPropertiesFactory( QgsMapLayerPropertiesFactory* factory )
478+
void QgisAppInterface::registerMapLayerConfigWidgetFactory( QgsMapLayerConfigWidgetFactory* factory )
479479
{
480480
qgis->registerMapLayerPropertiesFactory( factory );
481481
}
482482

483-
void QgisAppInterface::unregisterMapLayerPropertiesFactory( QgsMapLayerPropertiesFactory* factory )
483+
void QgisAppInterface::unregisterMapLayerConfigWidgetFactory( QgsMapLayerConfigWidgetFactory* factory )
484484
{
485485
qgis->unregisterMapLayerPropertiesFactory( factory );
486486
}
487487

488-
void QgisAppInterface::registerMapStylePanelFactory( QgsLayerStylingPanelFactory *factory )
489-
{
490-
qgis->registerMapStylePanelFactory( factory );
491-
}
492-
493-
void QgisAppInterface::unregisterMapStylePanelFactory( QgsLayerStylingPanelFactory *factory )
494-
{
495-
qgis->unregisterMapStylePanelFactory( factory );
496-
}
497-
498488
//! Menus
499489
Q_DECL_DEPRECATED QMenu *QgisAppInterface::fileMenu() { return qgis->projectMenu(); }
500490
QMenu *QgisAppInterface::projectMenu() { return qgis->projectMenu(); }

‎src/app/qgisappinterface.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -293,19 +293,13 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
293293
* @note Ownership of the factory is not transferred, and the factory must
294294
* be unregistered when plugin is unloaded.
295295
* @see unregisterMapLayerPropertiesFactory() */
296-
virtual void registerMapLayerPropertiesFactory( QgsMapLayerPropertiesFactory* factory ) override;
296+
virtual void registerMapLayerConfigWidgetFactory( QgsMapLayerConfigWidgetFactory* factory ) override;
297297

298298
/** Unregister a previously registered tab in the vector layer properties dialog.
299299
* @note added in QGIS 2.16
300300
* @see registerMapLayerPropertiesFactory()
301301
*/
302-
virtual void unregisterMapLayerPropertiesFactory( QgsMapLayerPropertiesFactory* factory ) override;
303-
304-
/** Register a new tab in the layer properties dialog */
305-
virtual void registerMapStylePanelFactory( QgsLayerStylingPanelFactory* factory ) override;
306-
307-
/** Unregister a previously registered tab in the layer properties dialog */
308-
virtual void unregisterMapStylePanelFactory( QgsLayerStylingPanelFactory* factory ) override;
302+
virtual void unregisterMapLayerConfigWidgetFactory( QgsMapLayerConfigWidgetFactory* factory ) override;
309303

310304
/** Accessors for inserting items into menus and toolbars.
311305
* An item can be inserted before any existing action.

‎src/app/qgslabelingwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "qgisapp.h"
2626

2727
QgsLabelingWidget::QgsLabelingWidget( QgsVectorLayer* layer, QgsMapCanvas* canvas, QWidget* parent )
28-
: QgsLayerStylingPanel( layer, canvas, parent )
28+
: QgsMapLayerConfigWidget( layer, canvas, parent )
2929
, mLayer( layer )
3030
, mCanvas( canvas )
3131
, mWidget( nullptr )

‎src/app/qgslabelingwidget.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <qgspallabeling.h>
2222
#include "qgsvectorlayerlabeling.h"
2323

24-
#include "qgsmapstylepanel.h"
24+
#include "qgsmaplayerconfigwidget.h"
2525

2626
class QgsLabelingGui;
2727
class QgsMapCanvas;
@@ -32,7 +32,7 @@ class QgsMapLayer;
3232
/**
3333
* Master widget for configuration of labeling of a vector layer
3434
*/
35-
class QgsLabelingWidget : public QgsLayerStylingPanel, private Ui::QgsLabelingWidget
35+
class QgsLabelingWidget : public QgsMapLayerConfigWidget, private Ui::QgsLabelingWidget
3636
{
3737
Q_OBJECT
3838
public:

‎src/app/qgslayerstylingwidget.cpp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@
3838
#include "qgsrendererv2registry.h"
3939
#include "qgsmaplayerregistry.h"
4040
#include "qgsrasterlayer.h"
41-
#include "qgsmapstylepanel.h"
41+
#include "qgsmaplayerconfigwidget.h"
4242
#include "qgsmaplayerstylemanagerwidget.h"
4343
#include "qgsruntimeprofiler.h"
4444

45-
QgsLayerStylingWidget::QgsLayerStylingWidget( QgsMapCanvas* canvas, QList<QgsLayerStylingPanelFactory*> pages, QWidget *parent )
45+
46+
QgsLayerStylingWidget::QgsLayerStylingWidget( QgsMapCanvas* canvas, QList<QgsMapLayerConfigWidgetFactory*> pages, QWidget *parent )
4647
: QWidget( parent )
4748
, mNotSupportedPage( 0 )
4849
, mLayerPage( 1 )
@@ -70,7 +71,7 @@ QgsLayerStylingWidget::QgsLayerStylingWidget( QgsMapCanvas* canvas, QList<QgsLay
7071

7172
mStyleManagerFactory = new QgsLayerStyleManagerWidgetFactory();
7273

73-
QList<QgsLayerStylingPanelFactory*> l;
74+
QList<QgsMapLayerConfigWidgetFactory*> l;
7475
setPageFactories( pages );
7576

7677
connect( mUndoButton, SIGNAL( pressed() ), this, SLOT( undo() ) );
@@ -91,7 +92,7 @@ QgsLayerStylingWidget::~QgsLayerStylingWidget()
9192
delete mStyleManagerFactory;
9293
}
9394

94-
void QgsLayerStylingWidget::setPageFactories( QList<QgsLayerStylingPanelFactory *> factories )
95+
void QgsLayerStylingWidget::setPageFactories( QList<QgsMapLayerConfigWidgetFactory *> factories )
9596
{
9697
mPageFactories = factories;
9798
// Always append the style manager factory at the bottom of the list
@@ -170,7 +171,7 @@ void QgsLayerStylingWidget::setLayer( QgsMapLayer *layer )
170171
mOptionsListWidget->addItem( histogramItem );
171172
}
172173

173-
Q_FOREACH ( QgsLayerStylingPanelFactory* factory, mPageFactories )
174+
Q_FOREACH ( QgsMapLayerConfigWidgetFactory* factory, mPageFactories )
174175
{
175176
if ( factory->supportsLayer( layer ) )
176177
{
@@ -242,7 +243,7 @@ void QgsLayerStylingWidget::apply()
242243
mRasterStyleWidget->apply();
243244
styleWasChanged = true;
244245
}
245-
else if ( QgsLayerStylingPanel* widget = qobject_cast<QgsLayerStylingPanel*>( current ) )
246+
else if ( QgsMapLayerConfigWidget* widget = qobject_cast<QgsMapLayerConfigWidget*>( current ) )
246247
{
247248
widget->apply();
248249
styleWasChanged = true;
@@ -316,7 +317,7 @@ void QgsLayerStylingWidget::updateCurrentWidgetLayer()
316317
// TODO Make all widgets use this method.
317318
if ( mUserPages.contains( row ) )
318319
{
319-
QgsLayerStylingPanel* panel = mUserPages[row]->createPanel( mCurrentLayer, mMapCanvas, mWidgetStack );
320+
QgsMapLayerConfigWidget* panel = mUserPages[row]->createWidget( mCurrentLayer, mMapCanvas, mWidgetStack );
320321
if ( panel )
321322
{
322323
connect( panel, SIGNAL( widgetChanged( QgsPanelWidget* ) ), this, SLOT( autoApply() ) );
@@ -477,23 +478,24 @@ void QgsMapLayerStyleCommand::redo()
477478
mLayer->triggerRepaint();
478479
}
479480

480-
QIcon QgsLayerStyleManagerWidgetFactory::icon()
481+
QIcon QgsLayerStyleManagerWidgetFactory::icon() const
481482
{
482483
return QgsApplication::getThemeIcon( "propertyicons/stylepreset.svg" );
483484
}
484485

485-
QString QgsLayerStyleManagerWidgetFactory::title()
486+
QString QgsLayerStyleManagerWidgetFactory::title() const
486487
{
487488
return QString();
488489
}
489490

490-
QgsLayerStylingPanel *QgsLayerStyleManagerWidgetFactory::createPanel( QgsMapLayer *layer, QgsMapCanvas *canvas, QWidget *parent )
491+
QgsMapLayerConfigWidget *QgsLayerStyleManagerWidgetFactory::createWidget( QgsMapLayer *layer, QgsMapCanvas *canvas, bool dockMode, QWidget *parent ) const
491492
{
493+
Q_UNUSED( dockMode );
492494
return new QgsMapLayerStyleManagerWidget( layer, canvas, parent );
493495

494496
}
495497

496-
bool QgsLayerStyleManagerWidgetFactory::supportsLayer( QgsMapLayer *layer )
498+
bool QgsLayerStyleManagerWidgetFactory::supportsLayer( QgsMapLayer *layer ) const
497499
{
498500
return ( layer->type() == QgsMapLayer::VectorLayer || layer->type() == QgsMapLayer::RasterLayer );
499501
}

‎src/app/qgslayerstylingwidget.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
#include <QTimer>
2828

2929
#include "ui_qgsmapstylingwidgetbase.h"
30-
#include "qgsmapstylepanel.h"
30+
#include "qgsmaplayerconfigwidget.h"
31+
#include "qgsmaplayerconfigwidgetfactory.h"
3132

3233
class QgsLabelingWidget;
3334
class QgsMapLayer;
@@ -36,16 +37,15 @@ class QgsRendererV2PropertiesDialog;
3637
class QgsRendererRasterPropertiesWidget;
3738
class QgsUndoWidget;
3839
class QgsRasterHistogramWidget;
39-
class QgsLayerStylingPanelFactory;
4040
class QgsMapLayerStyleManagerWidget;
4141

42-
class APP_EXPORT QgsLayerStyleManagerWidgetFactory : public QgsLayerStylingPanelFactory
42+
class APP_EXPORT QgsLayerStyleManagerWidgetFactory : public QgsMapLayerConfigWidgetFactory
4343
{
4444
public:
45-
QIcon icon() override;
46-
QString title() override;
47-
QgsLayerStylingPanel *createPanel( QgsMapLayer *layer, QgsMapCanvas *canvas, QWidget *parent ) override;
48-
bool supportsLayer( QgsMapLayer *layer ) override;
45+
QIcon icon() const override;
46+
QString title() const override;
47+
QgsMapLayerConfigWidget *createWidget( QgsMapLayer *layer, QgsMapCanvas *canvas, bool dockMode, QWidget *parent ) const override;
48+
bool supportsLayer( QgsMapLayer *layer ) const override;
4949
};
5050

5151
class APP_EXPORT QgsMapLayerStyleCommand : public QUndoCommand
@@ -76,11 +76,11 @@ class APP_EXPORT QgsLayerStylingWidget : public QWidget, private Ui::QgsLayerSty
7676
History,
7777
};
7878

79-
QgsLayerStylingWidget( QgsMapCanvas *canvas, QList<QgsLayerStylingPanelFactory *> pages, QWidget *parent = 0 );
79+
QgsLayerStylingWidget( QgsMapCanvas *canvas, QList<QgsMapLayerConfigWidgetFactory *> pages, QWidget *parent = 0 );
8080
~QgsLayerStylingWidget();
8181
QgsMapLayer* layer() { return mCurrentLayer; }
8282

83-
void setPageFactories( QList<QgsLayerStylingPanelFactory*> factories );
83+
void setPageFactories( QList<QgsMapLayerConfigWidgetFactory *> factories );
8484

8585
/** Sets whether updates of the styling widget are blocked. This can be called to prevent
8686
* the widget being refreshed multiple times when a batch of layer style changes are
@@ -122,8 +122,8 @@ class APP_EXPORT QgsLayerStylingWidget : public QWidget, private Ui::QgsLayerSty
122122
QgsMapLayer* mCurrentLayer;
123123
QgsLabelingWidget *mLabelingWidget;
124124
QgsRendererRasterPropertiesWidget* mRasterStyleWidget;
125-
QList<QgsLayerStylingPanelFactory*> mPageFactories;
126-
QMap<int, QgsLayerStylingPanelFactory*> mUserPages;
125+
QList<QgsMapLayerConfigWidgetFactory*> mPageFactories;
126+
QMap<int, QgsMapLayerConfigWidgetFactory*> mUserPages;
127127
QgsLayerStyleManagerWidgetFactory* mStyleManagerFactory;
128128
};
129129

‎src/app/qgsvectorlayerproperties.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "qgslabel.h"
3636
#include "qgsgenericprojectionselector.h"
3737
#include "qgslogger.h"
38-
#include "qgsmaplayerpropertiesfactory.h"
38+
#include "qgsmaplayerconfigwidgetfactory.h"
3939
#include "qgsmaplayerregistry.h"
4040
#include "qgsmaplayerstyleguiutils.h"
4141
#include "qgspluginmetadata.h"
@@ -45,7 +45,6 @@
4545
#include "qgsloadstylefromdbdialog.h"
4646
#include "qgsvectorlayer.h"
4747
#include "qgsvectorlayerproperties.h"
48-
#include "qgsvectorlayerpropertiespage.h"
4948
#include "qgsconfig.h"
5049
#include "qgsvectordataprovider.h"
5150
#include "qgsquerybuilder.h"
@@ -328,14 +327,18 @@ void QgsVectorLayerProperties::setLabelCheckBox()
328327
labelCheckBox->setCheckState( Qt::Checked );
329328
}
330329

331-
void QgsVectorLayerProperties::addPropertiesPageFactory( QgsMapLayerPropertiesFactory* factory )
330+
void QgsVectorLayerProperties::addPropertiesPageFactory( QgsMapLayerConfigWidgetFactory* factory )
332331
{
333-
QListWidgetItem* item = factory->createVectorLayerPropertiesItem( mLayer, mOptionsListWidget );
332+
QListWidgetItem* item = new QListWidgetItem();
333+
item->setIcon( factory->icon() );
334+
item->setText( factory->title() );
335+
item->setToolTip( factory->title() );
336+
334337
if ( item )
335338
{
336339
mOptionsListWidget->addItem( item );
337340

338-
QgsVectorLayerPropertiesPage* page = factory->createVectorLayerPropertiesPage( mLayer, this );
341+
QgsMapLayerConfigWidget* page = factory->createWidget( mLayer, nullptr, this );
339342
mLayerPropertiesPages << page;
340343
mOptionsStackedWidget->addWidget( page );
341344
}
@@ -628,7 +631,7 @@ void QgsVectorLayerProperties::apply()
628631
diagramPropertiesDialog->apply();
629632

630633
// apply all plugin dialogs
631-
Q_FOREACH ( QgsVectorLayerPropertiesPage* page, mLayerPropertiesPages )
634+
Q_FOREACH ( QgsMapLayerConfigWidget* page, mLayerPropertiesPages )
632635
{
633636
page->apply();
634637
}

‎src/app/qgsvectorlayerproperties.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ class QgsLabelingWidget;
4242
class QgsDiagramProperties;
4343
class QgsFieldsProperties;
4444
class QgsRendererV2PropertiesDialog;
45-
class QgsMapLayerPropertiesFactory;
46-
class QgsVectorLayerPropertiesPage;
45+
class QgsMapLayerConfigWidgetFactory;
46+
class QgsMapLayerConfigWidget;
4747
class QgsPanelWidget;
4848

4949
class APP_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private Ui::QgsVectorLayerPropertiesBase
@@ -78,7 +78,7 @@ class APP_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private
7878
bool deleteAttribute( int attr );
7979

8080
/** Adds a properties page factory to the vector layer properties dialog. */
81-
void addPropertiesPageFactory( QgsMapLayerPropertiesFactory *factory );
81+
void addPropertiesPageFactory( QgsMapLayerConfigWidgetFactory *factory );
8282

8383
public slots:
8484

@@ -198,7 +198,7 @@ class APP_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private
198198
QList< QgsVectorJoinInfo > mOldJoins;
199199

200200
//! A list of additional pages provided by plugins
201-
QList<QgsVectorLayerPropertiesPage*> mLayerPropertiesPages;
201+
QList<QgsMapLayerConfigWidget*> mLayerPropertiesPages;
202202

203203
/** Previous layer style. Used to reset style to previous state if new style
204204
* was loaded but dialog is cancelled */

‎src/gui/CMakeLists.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ SET(QGIS_GUI_SRCS
244244
qgsmaplayeractionregistry.cpp
245245
qgsmaplayercombobox.cpp
246246
qgsmaplayermodel.cpp
247-
qgsmaplayerpropertiesfactory.cpp
247+
qgsmaplayerconfigwidgetfactory.cpp
248248
qgsmaplayerproxymodel.cpp
249249
qgsmaplayerstylemanagerwidget.cpp
250250
qgsmapmouseevent.cpp
@@ -259,7 +259,7 @@ SET(QGIS_GUI_SRCS
259259
qgsmaptoolidentifyfeature.cpp
260260
qgsmaptoolpan.cpp
261261
qgsmaptoolzoom.cpp
262-
qgsmapstylepanel.cpp
262+
qgsmaplayerconfigwidget.cpp
263263
qgsmessagebar.cpp
264264
qgsmessagebaritem.cpp
265265
qgsmessagelogviewer.cpp
@@ -303,7 +303,6 @@ SET(QGIS_GUI_SRCS
303303
qgsunitselectionwidget.cpp
304304
qgsuserinputdockwidget.cpp
305305
qgsvariableeditorwidget.cpp
306-
qgsvectorlayerpropertiespage.cpp
307306
qgsvertexmarker.cpp
308307
)
309308

@@ -411,7 +410,7 @@ SET(QGIS_GUI_MOC_HDRS
411410
qgsmaptoolidentifyfeature.h
412411
qgsmaptoolpan.h
413412
qgsmaptoolzoom.h
414-
qgsmapstylepanel.h
413+
qgsmaplayerconfigwidget.h
415414
qgsmessagebar.h
416415
qgsmessagebaritem.h
417416
qgsmessagelogviewer.h
@@ -449,7 +448,6 @@ SET(QGIS_GUI_MOC_HDRS
449448
qgsunitselectionwidget.h
450449
qgsuserinputdockwidget.h
451450
qgsvariableeditorwidget.h
452-
qgsvectorlayerpropertiespage.h
453451

454452
raster/qgsmultibandcolorrendererwidget.h
455453
raster/qgspalettedrendererwidget.h
@@ -631,7 +629,7 @@ SET(QGIS_GUI_HDRS
631629
qgsmapcanvassnapper.h
632630
qgsmapcanvassnappingutils.h
633631
qgsmapcanvastracer.h
634-
qgsmaplayerpropertiesfactory.h
632+
qgsmaplayerconfigwidgetfactory.h
635633
qgsmapmouseevent.h
636634
qgsmaptip.h
637635
qgsnumericsortlistviewitem.h

‎src/gui/qgisinterface.h

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ class QgsLayerTreeView;
3434
class QgsLegendInterface;
3535
class QgsMapCanvas;
3636
class QgsMapLayer;
37-
class QgsMapLayerPropertiesFactory;
38-
class QgsLayerStylingPanelFactory;
37+
class QgsMapLayerConfigWidgetFactory;
3938
class QgsMessageBar;
4039
class QgsPluginManagerInterface;
4140
class QgsRasterLayer;
@@ -335,19 +334,13 @@ class GUI_EXPORT QgisInterface : public QObject
335334
* @note Ownership of the factory is not transferred, and the factory must
336335
* be unregistered when plugin is unloaded.
337336
* @see unregisterMapLayerPropertiesFactory() */
338-
virtual void registerMapLayerPropertiesFactory( QgsMapLayerPropertiesFactory* factory ) = 0;
337+
virtual void registerMapLayerConfigWidgetFactory( QgsMapLayerConfigWidgetFactory* factory ) = 0;
339338

340339
/** Unregister a previously registered tab in the vector layer properties dialog.
341340
* @note added in QGIS 2.16
342341
* @see registerMapLayerPropertiesFactory()
343342
*/
344-
virtual void unregisterMapLayerPropertiesFactory( QgsMapLayerPropertiesFactory* factory ) = 0;
345-
346-
/** Register a new tab in the layer properties dialog */
347-
virtual void registerMapStylePanelFactory( QgsLayerStylingPanelFactory* factory ) = 0;
348-
349-
/** Unregister a previously registered tab in the layer properties dialog */
350-
virtual void unregisterMapStylePanelFactory( QgsLayerStylingPanelFactory* factory ) = 0;
343+
virtual void unregisterMapLayerConfigWidgetFactory( QgsMapLayerConfigWidgetFactory* factory ) = 0;
351344

352345
// @todo is this deprecated in favour of QgsContextHelp?
353346
/** Open a url in the users browser. By default the QGIS doc directory is used

‎src/gui/qgsmapstylepanel.cpp renamed to ‎src/gui/qgsmaplayerconfigwidget.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,13 @@
1212
* (at your option) any later version. *
1313
* *
1414
***************************************************************************/
15-
#include "qgsmapstylepanel.h"
15+
#include "qgsmaplayerconfigwidget.h"
1616
#include "qgspanelwidget.h"
1717

18-
QgsLayerStylingPanel::QgsLayerStylingPanel( QgsMapLayer *layer, QgsMapCanvas *canvas, QWidget *parent )
18+
QgsMapLayerConfigWidget::QgsMapLayerConfigWidget( QgsMapLayer *layer, QgsMapCanvas *canvas, QWidget *parent )
1919
: QgsPanelWidget( parent )
2020
, mLayer( layer )
2121
, mMapCanvas( canvas )
2222
{
2323

2424
}
25-
26-
QgsLayerStylingPanelFactory::QgsLayerStylingPanelFactory()
27-
{
28-
29-
}
30-
31-
QgsLayerStylingPanelFactory::~QgsLayerStylingPanelFactory()
32-
{
33-
34-
}
Lines changed: 4 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/***************************************************************************
2-
qgsmapstylepanel.h
2+
qgsmaplayerconfigwidget.h
33
---------------------
44
begin : June 2016
55
copyright : (C) 2016 by Nathan Woodrow
@@ -24,11 +24,11 @@
2424
class QgsMapCanvas;
2525

2626
/** \ingroup gui
27-
* \class QgsLayerStylingPanel
27+
* \class QgsMapLayerConfigWidget
2828
* \brief A panel widget that can be shown in the map style dock
2929
* \note added in QGIS 2.16
3030
*/
31-
class GUI_EXPORT QgsLayerStylingPanel : public QgsPanelWidget
31+
class GUI_EXPORT QgsMapLayerConfigWidget : public QgsPanelWidget
3232
{
3333
Q_OBJECT
3434
public:
@@ -41,7 +41,7 @@ class GUI_EXPORT QgsLayerStylingPanel : public QgsPanelWidget
4141
* @note The widget is created each time the panel is selected in the dock.
4242
* Keep the loading light as possible for speed in the UI.
4343
*/
44-
QgsLayerStylingPanel( QgsMapLayer* layer, QgsMapCanvas *canvas, QWidget *parent = 0 );
44+
QgsMapLayerConfigWidget( QgsMapLayer* layer, QgsMapCanvas *canvas, QWidget *parent = 0 );
4545

4646
public slots:
4747
/**
@@ -55,51 +55,4 @@ class GUI_EXPORT QgsLayerStylingPanel : public QgsPanelWidget
5555
QgsMapCanvas* mMapCanvas;
5656
};
5757

58-
59-
/** \ingroup gui
60-
* \class QgsLayerStylingPanelFactory
61-
* \note added in QGIS 2.16
62-
*/
63-
class GUI_EXPORT QgsLayerStylingPanelFactory
64-
{
65-
public:
66-
Q_DECLARE_FLAGS( LayerTypesFlags, QgsMapLayer::LayerType )
67-
68-
/** Constructor */
69-
QgsLayerStylingPanelFactory();
70-
71-
/** Destructor */
72-
virtual ~QgsLayerStylingPanelFactory();
73-
74-
/**
75-
* @brief The icon that will be shown in the UI for the panel.
76-
* @return A QIcon for the panel icon.
77-
*/
78-
virtual QIcon icon() = 0;
79-
80-
/**
81-
* @brief The title of the panel.
82-
* @note This may or may not be shown to the user.
83-
* @return Title of the panel
84-
*/
85-
virtual QString title() = 0;
86-
87-
/**
88-
* @brief Check if the layer is supported for this widget.
89-
* @return True if this layer is supported for this widget
90-
*/
91-
virtual bool supportsLayer( QgsMapLayer *layer ) = 0;
92-
93-
/**
94-
* @brief Factory fucntion to create the widget on demand as needed by the dock.
95-
* @note This function is called each time the panel is selected. Keep it light for better UX.
96-
* @param layer The active layer in the dock.
97-
* @param canvas The map canvas.
98-
* @param parent The parent of the widget.
99-
* @return A new QgsMapStylePanel which is shown in the map style dock.
100-
*/
101-
virtual QgsLayerStylingPanel* createPanel( QgsMapLayer* layer, QgsMapCanvas *canvas, QWidget* parent ) = 0;
102-
};
103-
104-
10558
#endif // QGSMAPSTYLEPANEL_H

‎src/gui/qgsmaplayerpropertiesfactory.cpp renamed to ‎src/gui/qgsmaplayerconfigwidgetfactory.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/***************************************************************************
2-
qgslayeroptionsfactory.cpp
2+
qgsmaplayerconfigwidgetfactory.cpp
33
--------------------------------------
44
Date : 9.7.2013
55
Copyright : (C) 2013 Matthias Kuhn
@@ -13,12 +13,18 @@
1313
* *
1414
***************************************************************************/
1515

16-
#include "qgsmaplayerpropertiesfactory.h"
16+
#include "qgsmaplayerconfigwidgetfactory.h"
1717

18-
QgsMapLayerPropertiesFactory::QgsMapLayerPropertiesFactory()
18+
QgsMapLayerConfigWidgetFactory::QgsMapLayerConfigWidgetFactory()
1919
{
2020
}
2121

22-
QgsMapLayerPropertiesFactory::~QgsMapLayerPropertiesFactory()
22+
QgsMapLayerConfigWidgetFactory::~QgsMapLayerConfigWidgetFactory()
2323
{
2424
}
25+
26+
bool QgsMapLayerConfigWidgetFactory::supportsLayer( QgsMapLayer *layer ) const
27+
{
28+
Q_UNUSED( layer );
29+
return true;
30+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/***************************************************************************
2+
qgslayeroptionsfactory.h
3+
--------------------------------------
4+
Date : 9.7.2013
5+
Copyright : (C) 2013 Matthias Kuhn
6+
Email : matthias dot kuhn at gmx dot ch
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
16+
#ifndef QGSLAYERPROPERTIESFACTORY_H
17+
#define QGSLAYERPROPERTIESFACTORY_H
18+
19+
#include <QListWidgetItem>
20+
21+
#include "qgsmaplayerconfigwidget.h"
22+
23+
/** \ingroup gui
24+
* \class QgsMapLayerPropertiesFactory
25+
* \note added in QGIS 2.16
26+
* Factory class for creating custom map layer property pages
27+
*/
28+
class GUI_EXPORT QgsMapLayerConfigWidgetFactory
29+
{
30+
public:
31+
/** Constructor */
32+
QgsMapLayerConfigWidgetFactory();
33+
34+
/** Destructor */
35+
virtual ~QgsMapLayerConfigWidgetFactory();
36+
37+
/**
38+
* @brief The icon that will be shown in the UI for the panel.
39+
* @return A QIcon for the panel icon.
40+
*/
41+
virtual QIcon icon() const { return QIcon(); }
42+
43+
/**
44+
* @brief The title of the panel.
45+
* @note This may or may not be shown to the user.
46+
* @return Title of the panel
47+
*/
48+
virtual QString title() const { return QString(); }
49+
50+
/**
51+
* @brief Check if the layer is supported for this widget.
52+
* @return True if this layer is supported for this widget
53+
*/
54+
virtual bool supportsLayer( QgsMapLayer *layer ) const;
55+
56+
/**
57+
* @brief Factory fucntion to create the widget on demand as needed by the dock.
58+
* @note This function is called each time the panel is selected. Keep it light for better UX.
59+
* @param layer The active layer in the dock.
60+
* @param canvas The map canvas.
61+
* @param dockWidget True of the widget will be shown a dock style widget.
62+
* @param parent The parent of the widget.
63+
* @return A new QgsMapStylePanel which is shown in the map style dock.
64+
*/
65+
virtual QgsMapLayerConfigWidget* createWidget( QgsMapLayer* layer, QgsMapCanvas *canvas, bool dockWidget = true, QWidget* parent = 0 ) const = 0;
66+
};
67+
68+
#endif // QGSLAYERPROPERTIESFACTORY_H

‎src/gui/qgsmaplayerpropertiesfactory.h

Lines changed: 0 additions & 54 deletions
This file was deleted.

‎src/gui/qgsmaplayerstylemanagerwidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "qgslogger.h"
2525
#include "qgsmaplayer.h"
2626
#include "qgsmapcanvas.h"
27-
#include "qgsmapstylepanel.h"
27+
#include "qgsmaplayerconfigwidget.h"
2828
#include "qgsmaplayerstylemanager.h"
2929
#include "qgsvectordataprovider.h"
3030
#include "qgsrasterdataprovider.h"
@@ -33,7 +33,7 @@
3333

3434

3535
QgsMapLayerStyleManagerWidget::QgsMapLayerStyleManagerWidget( QgsMapLayer* layer, QgsMapCanvas *canvas, QWidget *parent )
36-
: QgsLayerStylingPanel( layer, canvas, parent )
36+
: QgsMapLayerConfigWidget( layer, canvas, parent )
3737
{
3838
mModel = new QStandardItemModel( this );
3939
mStyleList = new QListView( this );

‎src/gui/qgsmaplayerstylemanagerwidget.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <QListView>
2020
#include <QStandardItemModel>
2121

22-
#include "qgsmapstylepanel.h"
22+
#include "qgsmaplayerconfigwidget.h"
2323

2424
class QgsMapLayer;
2525
class QgsMapCanvas;
@@ -29,7 +29,7 @@ class QgsMapCanvas;
2929
* @brief The QgsMapLayerStyleManagerWidget class which is used to visually manage
3030
* the layer styles.
3131
*/
32-
class GUI_EXPORT QgsMapLayerStyleManagerWidget : public QgsLayerStylingPanel
32+
class GUI_EXPORT QgsMapLayerStyleManagerWidget : public QgsMapLayerConfigWidget
3333
{
3434
Q_OBJECT
3535
public:

‎src/gui/qgsvectorlayerpropertiespage.cpp

Lines changed: 0 additions & 22 deletions
This file was deleted.

‎src/gui/qgsvectorlayerpropertiespage.h

Lines changed: 0 additions & 43 deletions
This file was deleted.

‎src/gui/raster/qgsrasterhistogramwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
//#define RASTER_HISTOGRAM_BINS 256
5656

5757
QgsRasterHistogramWidget::QgsRasterHistogramWidget( QgsRasterLayer* lyr, QWidget *parent )
58-
: QgsLayerStylingPanel( lyr, nullptr, parent )
58+
: QgsMapLayerConfigWidget( lyr, nullptr, parent )
5959
, mRasterLayer( lyr )
6060
, mRendererWidget( nullptr )
6161
{

‎src/gui/raster/qgsrasterhistogramwidget.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "ui_qgsrasterhistogramwidgetbase.h"
2121

22-
#include "qgsmapstylepanel.h"
22+
#include "qgsmaplayerconfigwidget.h"
2323

2424
class QgsRasterLayer;
2525
class QgsRasterRendererWidget;
@@ -37,7 +37,7 @@ typedef QPointF QwtDoublePoint;
3737
*@author Etienne Tourigny
3838
*/
3939

40-
class GUI_EXPORT QgsRasterHistogramWidget : public QgsLayerStylingPanel, private Ui::QgsRasterHistogramWidgetBase
40+
class GUI_EXPORT QgsRasterHistogramWidget : public QgsMapLayerConfigWidget, private Ui::QgsRasterHistogramWidgetBase
4141
{
4242
Q_OBJECT
4343

‎src/gui/raster/qgsrastertransparencywidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838

3939
QgsRasterTransparencyWidget::QgsRasterTransparencyWidget( QgsRasterLayer *layer, QgsMapCanvas* canvas, QWidget *parent )
40-
: QgsLayerStylingPanel( layer, canvas, parent )
40+
: QgsMapLayerConfigWidget( layer, canvas, parent )
4141
, TRSTRING_NOT_SET( tr( "Not Set" ) )
4242
, mRasterLayer( layer )
4343
, mMapCanvas( canvas )

‎src/gui/raster/qgsrastertransparencywidget.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "ui_qgsrastertransparencywidget.h"
2121

22-
#include "qgsmapstylepanel.h"
22+
#include "qgsmaplayerconfigwidget.h"
2323

2424
class QgsRasterLayer;
2525
class QgsRasterRenderer;
@@ -31,7 +31,7 @@ class QgsPoint;
3131
/** \ingroup gui
3232
* @brief Widget to control a layers transparency and related options
3333
*/
34-
class GUI_EXPORT QgsRasterTransparencyWidget : public QgsLayerStylingPanel, private Ui::QgsRasterTransparencyWidget
34+
class GUI_EXPORT QgsRasterTransparencyWidget : public QgsMapLayerConfigWidget, private Ui::QgsRasterTransparencyWidget
3535
{
3636
Q_OBJECT
3737
public:

‎src/gui/raster/qgsrendererrasterpropertieswidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static void _initRendererWidgetFunctions()
4747

4848

4949
QgsRendererRasterPropertiesWidget::QgsRendererRasterPropertiesWidget( QgsMapLayer *layer, QgsMapCanvas* canvas, QWidget *parent )
50-
: QgsLayerStylingPanel( layer, canvas, parent )
50+
: QgsMapLayerConfigWidget( layer, canvas, parent )
5151
, mRendererWidget( nullptr )
5252
{
5353
mRasterLayer = qobject_cast<QgsRasterLayer*>( layer );

‎src/gui/raster/qgsrendererrasterpropertieswidget.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "ui_qgsrendererrasterpropswidgetbase.h"
2222

23-
#include "qgsmapstylepanel.h"
23+
#include "qgsmaplayerconfigwidget.h"
2424

2525

2626
class QgsRasterLayer;
@@ -30,7 +30,7 @@ class QgsRasterRendererWidget;
3030
/** \ingroup gui
3131
* \class QgsRendererRasterPropertiesWidget
3232
*/
33-
class GUI_EXPORT QgsRendererRasterPropertiesWidget : public QgsLayerStylingPanel, private Ui::QgsRendererRasterPropsWidgetBase
33+
class GUI_EXPORT QgsRendererRasterPropertiesWidget : public QgsMapLayerConfigWidget, private Ui::QgsRendererRasterPropsWidgetBase
3434
{
3535
Q_OBJECT
3636

2 commit comments

Comments
 (2)

jef-n commented on Jul 6, 2016

@jef-n
Member

Breaks the globe plugin - what does it fix?

NathanW2 commented on Jul 6, 2016

@NathanW2
MemberAuthor
Please sign in to comment.