Expand Up
@@ -19,9 +19,52 @@
#include " qgsgraduatedsymbolrendererv2.h"
#include " qgsrendererv2widget.h"
#include < QStandardItem>
#include < QProxyStyle>
#include " ui_qgsgraduatedsymbolrendererv2widget.h"
class GUI_EXPORT QgsGraduatedSymbolRendererV2Model : public QAbstractItemModel
{
Q_OBJECT
public:
QgsGraduatedSymbolRendererV2Model ( QObject * parent = 0 );
Qt::ItemFlags flags ( const QModelIndex & index ) const ;
Qt::DropActions supportedDropActions () const ;
QVariant data ( const QModelIndex &index, int role ) const ;
bool setData ( const QModelIndex & index, const QVariant & value, int role );
QVariant headerData ( int section, Qt::Orientation orientation, int role ) const ;
int rowCount ( const QModelIndex &parent = QModelIndex() ) const ;
int columnCount ( const QModelIndex & = QModelIndex() ) const ;
QModelIndex index ( int row, int column, const QModelIndex &parent = QModelIndex() ) const ;
QModelIndex parent ( const QModelIndex &index ) const ;
QStringList mimeTypes () const ;
QMimeData *mimeData ( const QModelIndexList &indexes ) const ;
bool dropMimeData ( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent );
void setRenderer ( QgsGraduatedSymbolRendererV2* renderer );
void addClass ( QgsSymbolV2* symbol );
void removeRows ( QList<int > rows );
void removeAllRows ( );
void sort ( int column, Qt::SortOrder order = Qt::AscendingOrder );
signals:
void rowsMoved ();
private:
QgsGraduatedSymbolRendererV2* mRenderer ;
QString mMimeFormat ;
};
// View style which shows drop indicator line between items
class QgsGraduatedSymbolRendererV2ViewStyle : public QProxyStyle
{
public:
QgsGraduatedSymbolRendererV2ViewStyle ( QStyle* style = 0 );
void drawPrimitive ( PrimitiveElement element, const QStyleOption * option, QPainter * painter, const QWidget * widget = 0 ) const ;
};
class GUI_EXPORT QgsGraduatedSymbolRendererV2Widget : public QgsRendererV2Widget, private Ui::QgsGraduatedSymbolRendererV2Widget
{
Q_OBJECT
Expand All
@@ -45,26 +88,30 @@ class GUI_EXPORT QgsGraduatedSymbolRendererV2Widget : public QgsRendererV2Widget
/* *Adds a class manually to the classification*/
void addClass ();
/* *Removes a class from the classification*/
void deleteCurrentClass ();
/* *Removes currently selected classes */
void deleteClasses ();
/* *Removes all classes from the classification*/
void deleteAllClasses ();
void rotationFieldChanged ( QString fldName );
void sizeScaleFieldChanged ( QString fldName );
void scaleMethodChanged ( QgsSymbolV2::ScaleMethod scaleMethod );
void showSymbolLevels ();
void rowsMoved ();
protected:
void updateUiFromRenderer ();
void updateGraduatedSymbolIcon ();
// ! return a list of indexes for the classes under selection
QList<int > selectedClasses ();
// ! populate column combos in categorized and graduated page
void populateColumns ();
// ! populate ranges of graduated symbol renderer
void populateRanges ();
void changeRangeSymbol ( int rangeIdx );
void changeRange ( int rangeIdx );
Expand All
@@ -84,6 +131,8 @@ class GUI_EXPORT QgsGraduatedSymbolRendererV2Widget : public QgsRendererV2Widget
QgsRendererV2DataDefinedMenus* mDataDefinedMenus ;
QgsGraduatedSymbolRendererV2Model* mModel ;
};
Expand Down