Skip to content
Permalink
Browse files

Add some missing dox

  • Loading branch information
nyalldawson committed Jun 5, 2018
1 parent 2ed144a commit 8f55093642cd907d4f728cba5d5ee4e0cced0f9f
@@ -27,6 +27,7 @@ Constructor for FeatureInfo.
%End

bool isNew;

bool isEdited;
};

@@ -44,7 +45,12 @@ Constructor for QgsFeatureListModel
%End

virtual void setSourceModel( QgsAttributeTableFilterModel *sourceModel );

QgsVectorLayerCache *layerCache();
%Docstring
Returns the vector layer cache which is being used to populate the model.
%End

virtual QVariant data( const QModelIndex &index, int role ) const;

virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
@@ -89,8 +95,20 @@ Returns a detailed message about errors while parsing a :py:class:`QgsExpression

QString displayExpression() const;
bool featureByIndex( const QModelIndex &index, QgsFeature &feat );

QgsFeatureId idxToFid( const QModelIndex &index ) const;
%Docstring
Returns the feature ID corresponding to an ``index`` from the model.

.. seealso:: :py:func:`fidToIdx`
%End

QModelIndex fidToIdx( QgsFeatureId fid ) const;
%Docstring
Returns the model index corresponding to a feature ID.

.. seealso:: :py:func:`idxToFid`
%End

virtual QModelIndex mapToSource( const QModelIndex &proxyIndex ) const;

@@ -27,12 +27,53 @@ Constructor for QgsDetailedItemData.
%End

void setTitle( const QString &title );
%Docstring
Sets the ``title`` for the item.

.. seealso:: :py:func:`title`
%End

void setDetail( const QString &detail );
%Docstring
Sets the detailed description for the item.

.. seealso:: :py:func:`detail`
%End

void setCategory( const QString &category );
%Docstring
Sets the item's ``category``.

.. seealso:: :py:func:`category`
%End

void setIcon( const QPixmap &icon );
%Docstring
Sets the item's ``icon``.

.. seealso:: :py:func:`icon`
%End

void setCheckable( bool flag );
%Docstring
Sets whether the item is checkable.

.. seealso:: :py:func:`isCheckable`
%End

void setChecked( bool flag );
%Docstring
Sets whether the item is checked.

.. seealso:: :py:func:`isChecked`
%End

void setEnabled( bool flag );
%Docstring
Sets whether the item is enabled.

.. seealso:: :py:func:`isEnabled`
%End

void setRenderAsWidget( bool flag );
%Docstring
@@ -44,16 +85,65 @@ part of the list item.

the delegate may completely ignore this
depending on the delegate implementation.

.. seealso:: :py:func:`isRenderedAsWidget`
%End

QString title() const;
%Docstring
Returns the item's title.

.. seealso:: :py:func:`setTitle`
%End

QString detail() const;
%Docstring
Returns the detailed description for the item.

.. seealso:: :py:func:`setDetail`
%End

QString category() const;
%Docstring
Returns the item's category.

.. seealso:: :py:func:`setCategory`
%End

QPixmap icon() const;
%Docstring
Returns the item's icon.

.. seealso:: :py:func:`setIcon`
%End

bool isCheckable() const;
%Docstring
Returns true if the item is checkable.

.. seealso:: :py:func:`setCheckable`
%End

bool isChecked() const;
%Docstring
Returns true if the item is checked.

.. seealso:: :py:func:`setChecked`
%End

bool isEnabled() const;
%Docstring
Returns true if the item is enabled.

.. seealso:: :py:func:`setEnabled`
%End

bool isRenderedAsWidget() const;
%Docstring
Returns true if the item will be rendered using a widget.

.. seealso:: :py:func:`setRenderAsWidget`
%End

};

@@ -50,7 +50,10 @@ class GUI_EXPORT QgsFeatureListModel : public QSortFilterProxyModel, public QgsF
*/
FeatureInfo() = default;

//! True if feature is a newly added feature.
bool isNew = false;

//! True if feature has been edited.
bool isEdited = false;
};

@@ -66,7 +69,12 @@ class GUI_EXPORT QgsFeatureListModel : public QSortFilterProxyModel, public QgsF
explicit QgsFeatureListModel( QgsAttributeTableFilterModel *sourceModel, QObject *parent SIP_TRANSFERTHIS = nullptr );

virtual void setSourceModel( QgsAttributeTableFilterModel *sourceModel );

/**
* Returns the vector layer cache which is being used to populate the model.
*/
QgsVectorLayerCache *layerCache();

QVariant data( const QModelIndex &index, int role ) const override;
Qt::ItemFlags flags( const QModelIndex &index ) const override;

@@ -102,7 +110,17 @@ class GUI_EXPORT QgsFeatureListModel : public QSortFilterProxyModel, public QgsF

QString displayExpression() const;
bool featureByIndex( const QModelIndex &index, QgsFeature &feat );

/**
* Returns the feature ID corresponding to an \a index from the model.
* \see fidToIdx()
*/
QgsFeatureId idxToFid( const QModelIndex &index ) const;

/**
* Returns the model index corresponding to a feature ID.
* \see idxToFid()
*/
QModelIndex fidToIdx( QgsFeatureId fid ) const;

QModelIndex mapToSource( const QModelIndex &proxyIndex ) const override;
@@ -37,12 +37,46 @@ class GUI_EXPORT QgsDetailedItemData
*/
QgsDetailedItemData() = default;

/**
* Sets the \a title for the item.
* \see title()
*/
void setTitle( const QString &title );

/**
* Sets the detailed description for the item.
* \see detail()
*/
void setDetail( const QString &detail );

/**
* Sets the item's \a category.
* \see category()
*/
void setCategory( const QString &category );

/**
* Sets the item's \a icon.
* \see icon()
*/
void setIcon( const QPixmap &icon );

/**
* Sets whether the item is checkable.
* \see isCheckable()
*/
void setCheckable( bool flag );

/**
* Sets whether the item is checked.
* \see isChecked()
*/
void setChecked( bool flag );

/**
* Sets whether the item is enabled.
* \see isEnabled()
*/
void setEnabled( bool flag );

/**
@@ -51,16 +85,56 @@ class GUI_EXPORT QgsDetailedItemData
* part of the list item.
* \note the delegate may completely ignore this
* depending on the delegate implementation.
* \see isRenderedAsWidget()
*/
void setRenderAsWidget( bool flag );

/**
* Returns the item's title.
* \see setTitle()
*/
QString title() const;

/**
* Returns the detailed description for the item.
* \see setDetail()
*/
QString detail() const;

/**
* Returns the item's category.
* \see setCategory()
*/
QString category() const;

/**
* Returns the item's icon.
* \see setIcon()
*/
QPixmap icon() const;

/**
* Returns true if the item is checkable.
* \see setCheckable()
*/
bool isCheckable() const;

/**
* Returns true if the item is checked.
* \see setChecked()
*/
bool isChecked() const;

/**
* Returns true if the item is enabled.
* \see setEnabled()
*/
bool isEnabled() const;

/**
* Returns true if the item will be rendered using a widget.
* \see setRenderAsWidget()
*/
bool isRenderedAsWidget() const;

private:

0 comments on commit 8f55093

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