QGIS/python/core/auto_generated/qgsbrowsermodel.sip.in
2018-06-17 15:09:07 +10:00

191 lines
5.7 KiB
Plaintext

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsbrowsermodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsBrowserModel : QAbstractItemModel
{
%Docstring
A model for showing available data sources and other items in a structured
tree.
QgsBrowserModel is the foundation for the QGIS browser panel, and includes
items for the different data providers and folders accessible to users.
QgsBrowserModel models are not initially populated and use a deferred initialization
approach. After constructing a QgsBrowserModel, a call must be made
to initialize() in order to populate the model.
%End
%TypeHeaderCode
#include "qgsbrowsermodel.h"
%End
public:
explicit QgsBrowserModel( QObject *parent = 0 );
%Docstring
Constructor for QgsBrowserModel, with the specified ``parent`` object.
.. note::
QgsBrowserModel models are not initially populated and use a deferred initialization
approach. After constructing a QgsBrowserModel, a call must be made
to initialize() in order to populate the model.
%End
~QgsBrowserModel();
enum ItemDataRole
{
PathRole,
CommentRole,
SortRole,
};
virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
virtual QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const;
virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
virtual QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const;
virtual QModelIndex parent( const QModelIndex &index ) const;
virtual QStringList mimeTypes() const;
virtual QMimeData *mimeData( const QModelIndexList &indexes ) const;
virtual bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent );
virtual bool hasChildren( const QModelIndex &parent = QModelIndex() ) const;
virtual bool canFetchMore( const QModelIndex &parent ) const;
virtual void fetchMore( const QModelIndex &parent );
QModelIndex findItem( QgsDataItem *item, QgsDataItem *parent = 0 ) const;
QgsDataItem *dataItem( const QModelIndex &idx ) const;
void refresh( const QString &path );
%Docstring
Refresh item specified by path
%End
void refresh( const QModelIndex &index = QModelIndex() );
%Docstring
Refresh item children
%End
QModelIndex findPath( const QString &path, Qt::MatchFlag matchFlag = Qt::MatchExactly );
%Docstring
Returns index of item with given path. It only searches in currently fetched
items, i.e. it does not fetch children.
:param path: item path
:param matchFlag: supported is Qt.MatchExactly and Qt.MatchStartsWith which has reverse meaning, i.e. find
item with the longest match from start with path (to get as close/deep as possible to deleted item).
:return: model index, invalid if item not found *
%End
void connectItem( QgsDataItem *item );
bool initialized() const;
%Docstring
Returns true if the model has been initialized.
.. seealso:: :py:func:`initialize`
%End
signals:
void stateChanged( const QModelIndex &index, QgsDataItem::State oldState );
%Docstring
Emitted when item children fetch was finished
%End
void connectionsChanged();
%Docstring
Connections changed in the browser, forwarded to the widget and used to
notify the provider dialogs of a changed connection
%End
public slots:
void reload();
%Docstring
Reload the whole model
%End
void beginInsertItems( QgsDataItem *parent, int first, int last );
void endInsertItems();
void beginRemoveItems( QgsDataItem *parent, int first, int last );
void endRemoveItems();
void itemDataChanged( QgsDataItem *item );
void itemStateChanged( QgsDataItem *item, QgsDataItem::State oldState );
void addFavoriteDirectory( const QString &directory, const QString &name = QString() );
%Docstring
Adds a ``directory`` to the favorites group.
If ``name`` is specified, it will be used as the favorite's name. Otherwise
the name will be set to match ``directory``.
.. seealso:: :py:func:`removeFavorite`
.. versionadded:: 3.0
%End
void removeFavorite( const QModelIndex &index );
%Docstring
Removes a favorite directory from its corresponding model index.
.. seealso:: :py:func:`addFavoriteDirectory`
.. versionadded:: 3.0
%End
void updateProjectHome();
void hidePath( QgsDataItem *item );
%Docstring
Hide the given path in the browser model
%End
void initialize();
%Docstring
Delayed initialization, needed because the provider registry must be already populated.
.. seealso:: :py:func:`initialized`
%End
protected:
void addRootItems();
%Docstring
Populates the model
%End
void removeRootItems();
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsbrowsermodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/