Skip to content
Permalink
Browse files

Doxygen and sip bindings

  • Loading branch information
m-kuhn committed Apr 29, 2016
1 parent dd88fa9 commit c369aabac4c8a9999db0391b15cbc879a2760837
@@ -1,5 +1,5 @@
/***************************************************************************
qgsattributemanager.h
qgsactionmanager.sip

These classes store and control the managment and execution of actions
associated with a particular Qgis layer. Actions are defined to be
@@ -1,5 +1,5 @@
/***************************************************************************
qgsactionmanager.h
qgsattributeaction.sip

This is a legacy header to keep backwards compatibility until QGIS 3.

@@ -1,5 +1,5 @@
/***************************************************************************
qgsattributetableconfig.h - QgsAttributeTableConfig
qgsattributetableconfig.sip

---------------------
begin : 27.4.2016
@@ -4,6 +4,9 @@ class QgsAttributeTableFilterModel: QSortFilterProxyModel, QgsFeatureModel
#include <qgsattributetablefiltermodel.h>
%End
public:
/**
* The filter mode defines how the rows should be filtered.
*/
enum FilterMode
{
ShowAll,
@@ -13,20 +16,27 @@ class QgsAttributeTableFilterModel: QSortFilterProxyModel, QgsFeatureModel
ShowEdited
};

/**
* The type of a column.
*/
enum ColumnType
{
ColumnTypeField, //!< This column shows a field
ColumnTypeActionButton //!< This column shows action buttons
};

/**
* The additional roles defined by this filter model.
* The values of these roles start just after the roles defined by
* QgsAttributeTableModel so they do not conflict.
*/
enum Role
{
TypeRole = QgsAttributeTableModel::UserRole //!< The type of a given column
};


/**
*
* Make sure, the master model is already loaded, so the selection will get synchronized.
*
* @param parent parent object (owner)
@@ -35,6 +45,13 @@ class QgsAttributeTableFilterModel: QSortFilterProxyModel, QgsFeatureModel
*/
QgsAttributeTableFilterModel( QgsMapCanvas* canvas, QgsAttributeTableModel* sourceModel, QObject* parent /TransferThis/ = 0 );

/**
* Set the attribute table model that backs this model
*
* @param sourceModel The model
*
* @note added in 2.0
*/
void setSourceModel( QgsAttributeTableModel* sourceModel );

/**
@@ -60,6 +77,11 @@ class QgsAttributeTableFilterModel: QSortFilterProxyModel, QgsFeatureModel
*/
virtual void setFilteredFeatures( const QgsFeatureIds& ids );

/**
* Get a list of currently filtered feature ids
*
* @return A list of feature ids
*/
QgsFeatureIds filteredFeatures();

/**
@@ -69,6 +91,9 @@ class QgsAttributeTableFilterModel: QSortFilterProxyModel, QgsFeatureModel
*/
void setFilterMode( FilterMode filterMode );

/**
* The current filterModel
*/
FilterMode filterMode();

/**
@@ -108,6 +133,15 @@ class QgsAttributeTableFilterModel: QSortFilterProxyModel, QgsFeatureModel

virtual QModelIndex mapFromMaster( const QModelIndex &sourceIndex ) const;

/**
* Sort by the given column using the given order.
* Prefetches all the data from the layer to speed up sorting.
*
* @param column The column which should be sorted
* @param order The order ( Qt::AscendingOrder or Qt::DescendingOrder )
*/
virtual void sort( int column, Qt::SortOrder order = Qt::AscendingOrder );

/** Returns the map canvas*/
QgsMapCanvas* mapCanvas() const;

@@ -151,20 +185,10 @@ class QgsAttributeTableFilterModel: QSortFilterProxyModel, QgsFeatureModel
*/
bool lessThan( const QModelIndex &left, const QModelIndex &right ) const;

/**
* Sort by the given column using the given order.
* Prefetches all the data from the layer to speed up sorting.
*
* @param column The column which should be sorted
* @param order The order ( Qt::AscendingOrder or Qt::DescendingOrder )
*/
virtual void sort( int column, Qt::SortOrder order = Qt::AscendingOrder );

public slots:
/**
* Is called upon every change of the visible extents on the map canvas.
* When a change is signalled, the filter is updated and invalidated if needed.
*
*/
void extentsChanged();

@@ -35,26 +35,45 @@ class CORE_EXPORT QgsAction
OpenUrl,
};

/**
* Create a new QgsAction
*
* @param type The type of this action
* @param description A human readable description string
* @param action The action text. Its interpretation depends on the type
* @param capture If this is set to true, the output will be captured when an action is run
*/
QgsAction( ActionType type, const QString& description, const QString& action, bool capture )
: mType( type )
, mDescription( description )
, mAction( action )
, mCaptureOutput( capture )
{}

QgsAction( ActionType type, const QString& description, const QString& action, const QString& icon, bool capture, const QString& shortTitle = QString(), bool showInAttributeTable = true )

/**
* Create a new QgsAction
*
* @param type The type of this action
* @param description A human readable description string
* @param action The action text. Its interpretation depends on the type
* @param icon Path to an icon for this action
* @param capture If this is set to true, the output will be captured when an action is run
* @param shortTitle A short string used to label user interface elements like buttons
*/
QgsAction( ActionType type, const QString& description, const QString& action, const QString& icon, bool capture, const QString& shortTitle = QString() )
: mType( type )
, mDescription( description )
, mShortTitle( shortTitle )
, mIcon( icon )
, mAction( action )
, mCaptureOutput( capture )
, mShowInAttributeTable( showInAttributeTable )
{}

//! The name of the action. This may be a longer description.
QString name() const { return mDescription; }

//! The short title is used to label user interface elements like buttons
QString shortTitle() const { return mShortTitle; }

//! The path to the icon
@@ -72,9 +91,6 @@ class CORE_EXPORT QgsAction
//! Whether to capture output for display when this action is run
bool capture() const { return mCaptureOutput; }

//! Returns true if the action should be shown on the attribute table
bool showInAttributeTable() const { return mShowInAttributeTable; }

//! Checks if the action is runable on the current platform
bool runable() const;

@@ -85,7 +101,6 @@ class CORE_EXPORT QgsAction
QString mIcon;
QString mAction;
bool mCaptureOutput;
bool mShowInAttributeTable;
};

#endif // QGSACTION_H
@@ -283,7 +283,6 @@ bool QgsActionManager::writeXML( QDomNode& layer_node, QDomDocument& doc ) const
actionSetting.setAttribute( "shortTitle", action.shortTitle() );
actionSetting.setAttribute( "icon", action.iconPath() );
actionSetting.setAttribute( "action", action.action() );
actionSetting.setAttribute( "showInAttributeTable", action.showInAttributeTable() );
actionSetting.setAttribute( "capture", action.capture() );
aActions.appendChild( actionSetting );
}
@@ -310,8 +309,8 @@ bool QgsActionManager::readXML( const QDomNode& layer_node )
setting.attributeNode( "action" ).value(),
setting.attributeNode( "icon" ).value(),
setting.attributeNode( "capture" ).value().toInt() != 0,
setting.attributeNode( "shortTitle" ).value(),
setting.attributeNode( "showInAttributeTable" ).value().toInt() != 0 )
setting.attributeNode( "shortTitle" ).value()
)
);
}
}
@@ -68,8 +68,6 @@ class GUI_EXPORT QgsAttributeTableDelegate : public QItemDelegate
*/
void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override;

void setLayer( QgsVectorLayer* layer );

/**
* Sets data from model into the editor. Overloads default method
* @param editor editor which was created by create editor function in this class
@@ -33,29 +33,39 @@ class GUI_EXPORT QgsAttributeTableFilterModel: public QSortFilterProxyModel, pub
Q_OBJECT

public:
/**
* The filter mode defines how the rows should be filtered.
*/
enum FilterMode
{
ShowAll,
ShowSelected,
ShowVisible,
ShowFilteredList,
ShowEdited
ShowAll, //!< Show all features
ShowSelected, //!< Show only selected features
ShowVisible, //!< Show only visible features (depends on the map canvas)
ShowFilteredList, //!< Show only features whose ids are on the filter list. {@see setFilteredFeatures}
ShowEdited //!< Show only features which have unsaved changes
};

/**
* The type of a column.
*/
enum ColumnType
{
ColumnTypeField, //!< This column shows a field
ColumnTypeActionButton //!< This column shows action buttons
};

/**
* The additional roles defined by this filter model.
* The values of these roles start just after the roles defined by
* QgsAttributeTableModel so they do not conflict.
*/
enum Role
{
TypeRole = QgsAttributeTableModel::UserRole //!< The type of a given column
};


/**
*
* Make sure, the master model is already loaded, so the selection will get synchronized.
*
* @param parent parent object (owner)
@@ -112,8 +122,6 @@ class GUI_EXPORT QgsAttributeTableFilterModel: public QSortFilterProxyModel, pub

/**
* The current filterModel
*
* @return Mode
*/
FilterMode filterMode() { return mFilterMode; }

@@ -215,7 +223,6 @@ class GUI_EXPORT QgsAttributeTableFilterModel: public QSortFilterProxyModel, pub
/**
* Is called upon every change of the visible extents on the map canvas.
* When a change is signalled, the filter is updated and invalidated if needed.
*
*/
void extentsChanged();

0 comments on commit c369aab

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