|
| 1 | +/************************************************************************ |
| 2 | + * This file has been generated automatically from * |
| 3 | + * * |
| 4 | + * src/core/qgsbrowsermodel.h * |
| 5 | + * * |
| 6 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 7 | + ************************************************************************/ |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
1 | 12 | class QgsBrowserModel : QAbstractItemModel
|
2 | 13 | {
|
| 14 | + |
3 | 15 | %TypeHeaderCode
|
4 |
| -#include <qgsbrowsermodel.h> |
| 16 | +#include "qgsbrowsermodel.h" |
5 | 17 | %End
|
6 |
| - |
7 | 18 | public:
|
8 | 19 | explicit QgsBrowserModel( QObject *parent = 0 );
|
9 | 20 | ~QgsBrowserModel();
|
10 | 21 |
|
11 | 22 | enum ItemDataRole
|
12 | 23 | {
|
13 |
| - PathRole, /*!< Item path used to access path in the tree, see QgsDataItem::mPath */ |
14 |
| - CommentRole, /*!< Item comment */ |
| 24 | + PathRole |
| 25 | + CommentRole |
15 | 26 | };
|
16 |
| - // implemented methods from QAbstractItemModel for read-only access |
17 | 27 |
|
18 |
| - /** Used by other components to obtain information about each item provided by the model. |
19 |
| - In many models, the combination of flags should include Qt::ItemIsEnabled and Qt::ItemIsSelectable. */ |
20 | 28 | virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
|
| 29 | +%Docstring |
| 30 | + Used by other components to obtain information about each item provided by the model. |
| 31 | +In many models, the combination of flags should include Qt.ItemIsEnabled and Qt.ItemIsSelectable. * |
| 32 | + :rtype: Qt.ItemFlags |
| 33 | +%End |
21 | 34 |
|
22 |
| - /** Used to supply item data to views and delegates. Generally, models only need to supply data |
23 |
| - for Qt::DisplayRole and any application-specific user roles, but it is also good practice |
24 |
| - to provide data for Qt::ToolTipRole, Qt::AccessibleTextRole, and Qt::AccessibleDescriptionRole. |
25 |
| - See the Qt::ItemDataRole enum documentation for information about the types associated with each role. */ |
26 | 35 | virtual QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const;
|
| 36 | +%Docstring |
| 37 | + Used to supply item data to views and delegates. Generally, models only need to supply data |
| 38 | +for Qt.DisplayRole and any application-specific user roles, but it is also good practice |
| 39 | +to provide data for Qt.ToolTipRole, Qt.AccessibleTextRole, and Qt.AccessibleDescriptionRole. |
| 40 | +See the Qt.ItemDataRole enum documentation for information about the types associated with each role. * |
| 41 | + :rtype: QVariant |
| 42 | +%End |
27 | 43 |
|
28 |
| - /** Provides views with information to show in their headers. The information is only retrieved |
29 |
| - by views that can display header information. */ |
30 | 44 | virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
|
| 45 | +%Docstring |
| 46 | + Provides views with information to show in their headers. The information is only retrieved |
| 47 | +by views that can display header information. * |
| 48 | + :rtype: QVariant |
| 49 | +%End |
31 | 50 |
|
32 |
| - /** Provides the number of rows of data exposed by the model. */ |
33 | 51 | virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
|
| 52 | +%Docstring |
| 53 | +Provides the number of rows of data exposed by the model. |
| 54 | + :rtype: int |
| 55 | +%End |
34 | 56 |
|
35 |
| - /** Provides the number of columns of data exposed by the model. List models do not provide this function |
36 |
| - because it is already implemented in QAbstractListModel. */ |
37 | 57 | virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
|
| 58 | +%Docstring |
| 59 | + Provides the number of columns of data exposed by the model. List models do not provide this function |
| 60 | +because it is already implemented in QAbstractListModel. * |
| 61 | + :rtype: int |
| 62 | +%End |
38 | 63 |
|
39 |
| - /** Returns the index of the item in the model specified by the given row, column and parent index. */ |
40 |
| - virtual QModelIndex index( int row, int column, const QModelIndex & parent = QModelIndex() ) const; |
| 64 | + virtual QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const; |
| 65 | +%Docstring |
| 66 | +Returns the index of the item in the model specified by the given row, column and parent index. |
| 67 | + :rtype: QModelIndex |
| 68 | +%End |
41 | 69 |
|
42 | 70 | QModelIndex findItem( QgsDataItem *item, QgsDataItem *parent = 0 ) const;
|
| 71 | +%Docstring |
| 72 | + :rtype: QModelIndex |
| 73 | +%End |
43 | 74 |
|
44 |
| - /** Returns the parent of the model item with the given index. |
45 |
| - * If the item has no parent, an invalid QModelIndex is returned. |
46 |
| - */ |
47 | 75 | virtual QModelIndex parent( const QModelIndex &index ) const;
|
| 76 | +%Docstring |
| 77 | + Returns the parent of the model item with the given index. |
| 78 | + If the item has no parent, an invalid QModelIndex is returned. |
| 79 | + :rtype: QModelIndex |
| 80 | +%End |
48 | 81 |
|
49 |
| - /** Returns a list of mime that can describe model indexes */ |
50 | 82 | virtual QStringList mimeTypes() const;
|
| 83 | +%Docstring |
| 84 | +Returns a list of mime that can describe model indexes |
| 85 | + :rtype: list of str |
| 86 | +%End |
51 | 87 |
|
52 |
| - /** Returns an object that contains serialized items of data corresponding to the list of indexes specified */ |
53 |
| - virtual QMimeData * mimeData( const QModelIndexList &indexes ) const; |
| 88 | + virtual QMimeData *mimeData( const QModelIndexList &indexes ) const; |
| 89 | +%Docstring |
| 90 | +Returns an object that contains serialized items of data corresponding to the list of indexes specified |
| 91 | + :rtype: QMimeData |
| 92 | +%End |
54 | 93 |
|
55 |
| - /** Handles the data supplied by a drag and drop operation that ended with the given action */ |
56 |
| - virtual bool dropMimeData( const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent ); |
| 94 | + virtual bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent ); |
| 95 | +%Docstring |
| 96 | +Handles the data supplied by a drag and drop operation that ended with the given action |
| 97 | + :rtype: bool |
| 98 | +%End |
57 | 99 |
|
58 | 100 | QgsDataItem *dataItem( const QModelIndex &idx ) const;
|
| 101 | +%Docstring |
| 102 | + :rtype: QgsDataItem |
| 103 | +%End |
| 104 | + |
| 105 | + virtual bool hasChildren( const QModelIndex &parent = QModelIndex() ) const; |
59 | 106 |
|
60 |
| - bool hasChildren( const QModelIndex &parent = QModelIndex() ) const; |
61 | 107 |
|
62 |
| - //! Refresh item specified by path |
63 |
| - void refresh( const QString& path ); |
| 108 | + void refresh( const QString &path ); |
| 109 | +%Docstring |
| 110 | +Refresh item specified by path |
| 111 | +%End |
64 | 112 |
|
65 |
| - //! Refresh item children |
66 | 113 | void refresh( const QModelIndex &index = QModelIndex() );
|
| 114 | +%Docstring |
| 115 | +Refresh item children |
| 116 | +%End |
67 | 117 |
|
68 |
| - /** Return index of item with given path. It only searches in currently fetched |
69 |
| - * items, i.e. it does not fetch children. |
70 |
| - * @param path item path |
71 |
| - * @param matchFlag supported is Qt::MatchExactly and Qt::MatchStartsWith which has reverse meaning, i.e. find |
72 |
| - * item with the longest match from start with path (to get as close/deep as possible to deleted item). |
73 |
| - * @return model index, invalid if item not found */ |
74 |
| - QModelIndex findPath( const QString& path, Qt::MatchFlag matchFlag = Qt::MatchExactly ); |
| 118 | + QModelIndex findPath( const QString &path, Qt::MatchFlag matchFlag = Qt::MatchExactly ); |
| 119 | +%Docstring |
| 120 | + Return index of item with given path. It only searches in currently fetched |
| 121 | + items, i.e. it does not fetch children. |
| 122 | + \param path item path |
| 123 | + \param matchFlag supported is Qt.MatchExactly and Qt.MatchStartsWith which has reverse meaning, i.e. find |
| 124 | + item with the longest match from start with path (to get as close/deep as possible to deleted item). |
| 125 | + :return: model index, invalid if item not found * |
| 126 | + :rtype: QModelIndex |
| 127 | +%End |
75 | 128 |
|
76 |
| - //! @note not available in python bindings |
77 |
| - // static QModelIndex findPath( QAbstractItemModel *model, const QString& path, Qt::MatchFlag matchFlag = Qt::MatchExactly ); |
78 | 129 |
|
79 | 130 | void connectItem( QgsDataItem *item );
|
80 | 131 |
|
81 |
| - bool canFetchMore( const QModelIndex & parent ) const; |
82 |
| - void fetchMore( const QModelIndex & parent ); |
| 132 | + virtual bool canFetchMore( const QModelIndex &parent ) const; |
| 133 | + |
| 134 | + virtual void fetchMore( const QModelIndex &parent ); |
| 135 | + |
83 | 136 |
|
84 | 137 | signals:
|
85 |
| - /** Emitted when item children fetch was finished */ |
86 |
| - void stateChanged( const QModelIndex & index, QgsDataItem::State oldState ); |
| 138 | + void stateChanged( const QModelIndex &index, QgsDataItem::State oldState ); |
| 139 | +%Docstring |
| 140 | +Emitted when item children fetch was finished |
| 141 | +%End |
87 | 142 |
|
88 | 143 | public slots:
|
89 |
| - //! Reload the whole model |
90 | 144 | void reload();
|
| 145 | +%Docstring |
| 146 | +Reload the whole model |
| 147 | +%End |
91 | 148 | void beginInsertItems( QgsDataItem *parent, int first, int last );
|
92 | 149 | void endInsertItems();
|
93 | 150 | void beginRemoveItems( QgsDataItem *parent, int first, int last );
|
94 | 151 | void endRemoveItems();
|
95 |
| - void itemDataChanged( QgsDataItem * item ); |
96 |
| - void itemStateChanged( QgsDataItem * item, QgsDataItem::State oldState ); |
97 |
| - |
98 |
| - /** |
99 |
| - * Adds a directory to the favorites group. |
100 |
| - * @note added in QGIS 3.0 |
101 |
| - * @see removeFavorite() |
102 |
| - */ |
103 |
| - void addFavoriteDirectory( const QString& directory ); |
104 |
| - |
105 |
| - /** |
106 |
| - * Removes a favorite directory from its corresponding model index. |
107 |
| - * @note added in QGIS 3.0 |
108 |
| - * @see addFavoriteDirectory() |
109 |
| - */ |
| 152 | + void itemDataChanged( QgsDataItem *item ); |
| 153 | + void itemStateChanged( QgsDataItem *item, QgsDataItem::State oldState ); |
| 154 | + |
| 155 | + void addFavoriteDirectory( const QString &directory ); |
| 156 | +%Docstring |
| 157 | + Adds a directory to the favorites group. |
| 158 | +.. versionadded:: 3.0 |
| 159 | + \see removeFavorite() |
| 160 | +%End |
| 161 | + |
110 | 162 | void removeFavorite( const QModelIndex &index );
|
| 163 | +%Docstring |
| 164 | + Removes a favorite directory from its corresponding model index. |
| 165 | +.. versionadded:: 3.0 |
| 166 | + \see addFavoriteDirectory() |
| 167 | +%End |
111 | 168 |
|
112 | 169 | void updateProjectHome();
|
113 | 170 |
|
114 |
| - /** Hide the given path in the browser model */ |
115 | 171 | void hidePath( QgsDataItem *item );
|
| 172 | +%Docstring |
| 173 | +Hide the given path in the browser model |
| 174 | +%End |
116 | 175 |
|
117 | 176 | protected:
|
118 |
| - //! Populates the model |
119 | 177 | void addRootItems();
|
| 178 | +%Docstring |
| 179 | +Populates the model |
| 180 | +%End |
120 | 181 | void removeRootItems();
|
| 182 | + |
121 | 183 | };
|
| 184 | + |
| 185 | +/************************************************************************ |
| 186 | + * This file has been generated automatically from * |
| 187 | + * * |
| 188 | + * src/core/qgsbrowsermodel.h * |
| 189 | + * * |
| 190 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 191 | + ************************************************************************/ |
0 commit comments