diff --git a/python/core/auto_generated/qgsbrowsermodel.sip.in b/python/core/auto_generated/qgsbrowsermodel.sip.in index 0af1c47d71f..d804d1c48a7 100644 --- a/python/core/auto_generated/qgsbrowsermodel.sip.in +++ b/python/core/auto_generated/qgsbrowsermodel.sip.in @@ -11,12 +11,35 @@ 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 @@ -28,77 +51,34 @@ class QgsBrowserModel : QAbstractItemModel virtual Qt::ItemFlags flags( const QModelIndex &index ) const; -%Docstring -Used by other components to obtain information about each item provided by the model. -In many models, the combination of flags should include Qt.ItemIsEnabled and Qt.ItemIsSelectable. * -%End - virtual QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const; -%Docstring -Used to supply item data to views and delegates. Generally, models only need to supply data -for Qt.DisplayRole and any application-specific user roles, but it is also good practice -to provide data for Qt.ToolTipRole, Qt.AccessibleTextRole, and Qt.AccessibleDescriptionRole. -See the Qt.ItemDataRole enum documentation for information about the types associated with each role. * -%End - virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const; -%Docstring -Provides views with information to show in their headers. The information is only retrieved -by views that can display header information. * -%End - virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const; -%Docstring -Provides the number of rows of data exposed by the model. -%End - virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const; -%Docstring -Provides the number of columns of data exposed by the model. List models do not provide this function -because it is already implemented in QAbstractListModel. * -%End - virtual QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const; -%Docstring -Returns the index of the item in the model specified by the given row, column and parent index. -%End - - QModelIndex findItem( QgsDataItem *item, QgsDataItem *parent = 0 ) const; - virtual QModelIndex parent( const QModelIndex &index ) const; -%Docstring -Returns the parent of the model item with the given index. -If the item has no parent, an invalid QModelIndex is returned. -%End - virtual QStringList mimeTypes() const; -%Docstring -Returns a list of mime that can describe model indexes -%End - virtual QMimeData *mimeData( const QModelIndexList &indexes ) const; -%Docstring -Returns an object that contains serialized items of data corresponding to the list of indexes specified -%End - virtual bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent ); -%Docstring -Handles the data supplied by a drag and drop operation that ended with the given action -%End - - QgsDataItem *dataItem( const QModelIndex &idx ) const; - 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 @@ -125,14 +105,11 @@ items, i.e. it does not fetch children. void connectItem( QgsDataItem *item ); - virtual bool canFetchMore( const QModelIndex &parent ) const; - - virtual void fetchMore( const QModelIndex &parent ); - - - bool initialized( ) const; + bool initialized() const; %Docstring -Returns true if the model has been initialized +Returns true if the model has been initialized. + +.. seealso:: :py:func:`initialize` %End signals: @@ -189,7 +166,9 @@ Hide the given path in the browser model void initialize(); %Docstring -Delayed initialization, needed because the provider registry must be already populated +Delayed initialization, needed because the provider registry must be already populated. + +.. seealso:: :py:func:`initialized` %End protected: diff --git a/python/gui/auto_generated/qgsmapcanvas.sip.in b/python/gui/auto_generated/qgsmapcanvas.sip.in index c149ba438ce..e4ea88d791b 100644 --- a/python/gui/auto_generated/qgsmapcanvas.sip.in +++ b/python/gui/auto_generated/qgsmapcanvas.sip.in @@ -1021,7 +1021,7 @@ called on resize or changed extent to notify canvas items to change their rectan %End private: - QgsMapCanvas( QgsMapCanvas const & ); + QgsMapCanvas( const QgsMapCanvas &const ); }; // class QgsMapCanvas diff --git a/src/core/qgsbrowsermodel.h b/src/core/qgsbrowsermodel.h index a03816a9a29..8d90f188859 100644 --- a/src/core/qgsbrowsermodel.h +++ b/src/core/qgsbrowsermodel.h @@ -51,13 +51,32 @@ class CORE_EXPORT QgsBrowserWatcher : public QFutureWatcher