QGIS API Documentation  2.10.1-Pisa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgssizescalewidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssizescalewidget.h - continuous size scale assistant
3 
4  ---------------------
5  begin : March 2015
6  copyright : (C) 2015 by Vincent Mora
7  email : vincent dot mora at oslandia dot com
8  ***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef QGSSIZESCALEWIDGET_H
18 #define QGSSIZESCALEWIDGET_H
19 
20 #include "qgslayertreegroup.h"
21 #include "qgslayertreemodel.h"
22 #include "qgsdatadefinedbutton.h"
23 #include "ui_widget_size_scale.h"
24 #include <QStandardItemModel>
25 
26 class QgsVectorLayer;
27 class QgsMarkerSymbolV2;
28 class QgsLayerTreeLayer;
29 class QgsScaleExpression;
30 class QgsDataDefined;
31 
32 class GUI_EXPORT QgsSizeScaleWidget : public QgsDataDefinedAssistant, private Ui_SizeScaleBase
33 {
34  Q_OBJECT
35 
36  public:
37  QgsSizeScaleWidget( const QgsVectorLayer * layer, const QgsMarkerSymbolV2 * symbol );
38 
39  QgsDataDefined dataDefined() const override;
40 
41  protected:
42 
43  virtual void showEvent( QShowEvent * ) override;
44 
45  private slots:
46  void computeFromLayerTriggered();
47  void updatePreview();
48 
49  private:
50 
51  const QgsMarkerSymbolV2* mSymbol;
52  QgsVectorLayer* mLayer;
53  QgsLayerTreeLayer* mLayerTreeLayer;
54  QgsLayerTreeGroup mRoot;
55  QStandardItemModel mPreviewList;
56 
57  QgsScaleExpression* createExpression() const;
58  void setFromSymbol();
59 
60 };
61 
62 #endif //QGSSIZESCALEWIDGET_H
Layer tree group node serves as a container for layers and further groups.
An assistant (wizard) dialog, accessible from a QgsDataDefinedButton.
A container class for data source field mapping or expression.
virtual QgsDataDefined dataDefined() const =0
Class storing parameters of a scale expression, which is a subclass of QgsExpression for expressions ...
virtual void showEvent(QShowEvent *event)
Represents a vector layer which manages a vector based data sets.
Layer tree node points to a map layer.