Expand Up
@@ -24,6 +24,39 @@ class QgsRendererCategoryV2;
#include " ui_qgscategorizedsymbolrendererv2widget.h"
class GUI_EXPORT QgsCategorizedSymbolRendererV2Model : public QAbstractItemModel
{
Q_OBJECT
public:
QgsCategorizedSymbolRendererV2Model ( 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 ( QgsCategorizedSymbolRendererV2* renderer );
void addCategory ( const QgsRendererCategoryV2 &cat );
void removeRows ( QList<int > rows );
void removeAllRows ( );
void sort ( int column, Qt::SortOrder order = Qt::AscendingOrder );
signals:
void rowsMoved ();
private:
QgsCategorizedSymbolRendererV2* mRenderer ;
QString mMimeFormat ;
};
class GUI_EXPORT QgsCategorizedSymbolRendererV2Widget : public QgsRendererV2Widget, private Ui::QgsCategorizedSymbolRendererV2Widget
{
Q_OBJECT
Expand All
@@ -39,39 +72,36 @@ class GUI_EXPORT QgsCategorizedSymbolRendererV2Widget : public QgsRendererV2Widg
void changeCategorizedSymbol ();
void categoryColumnChanged ();
void categoriesDoubleClicked ( const QModelIndex & idx );
void addCategory ();
void addCategories ();
void deleteCategory ();
void deleteCategories ();
void deleteAllCategories ();
void changeCurrentValue ( QStandardItem * item );
void rotationFieldChanged ( QString fldName );
void sizeScaleFieldChanged ( QString fldName );
void scaleMethodChanged ( QgsSymbolV2::ScaleMethod scaleMethod );
void showSymbolLevels ();
void rowsMoved ();
protected:
void updateUiFromRenderer ();
void updateCategorizedSymbolIcon ();
// ! populate categories view
// Called by virtual refreshSymbolView()
void populateCategories ();
// ! populate column combo
void populateColumns ();
void addCategory ( const QgsRendererCategoryV2& cat );
// ! return row index for the currently selected category (-1 if on no selection)
int currentCategoryRow ();
// ! return key for the currently selected category
QVariant currentCategory ();
// ! return a list of keys for the categories unders selection
QList<QVariant> selectedCategories ();
// ! return a list of indexes for the categories unders selection
QList<int > selectedCategories ();
// ! change the selected symbols alone for the change button, if there is a selection
void changeSelectedSymbols ();
Expand All
@@ -81,20 +111,17 @@ class GUI_EXPORT QgsCategorizedSymbolRendererV2Widget : public QgsRendererV2Widg
QList<QgsSymbolV2*> selectedSymbols ();
void refreshSymbolView () { populateCategories (); }
protected slots:
void addCategory ();
protected:
QgsCategorizedSymbolRendererV2* mRenderer ;
QgsSymbolV2* mCategorizedSymbol ;
QgsRendererV2DataDefinedMenus* mDataDefinedMenus ;
QgsCategorizedSymbolRendererV2Model* mModel ;
private:
QString mOldClassificationAttribute ;
};
#endif // QGSCATEGORIZEDSYMBOLRENDERERV2WIDGET_H