File: qgsdirectoryitem.sip.in

package info (click to toggle)
qgis 3.40.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,183,800 kB
  • sloc: cpp: 1,595,841; python: 372,637; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 154
file content (242 lines) | stat: -rw-r--r-- 7,391 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/browser/qgsdirectoryitem.h                                  *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/




class QgsDirectoryItem : QgsDataCollectionItem
{
%Docstring(signature="appended")
A directory: contains subdirectories and layers
%End

%TypeHeaderCode
#include "qgsdirectoryitem.h"
%End
  public:

    QgsDirectoryItem( QgsDataItem *parent /TransferThis/, const QString &name, const QString &path );
%Docstring
Constructor for QgsDirectoryItem, with the specified ``parent`` item.

The ``name`` argument specifies the text to show in the model for the
item. This is usually the directory name, but in certain cases may
differ for special directories (e.g. "Home"). If a non-directory-name
text is used, it should be a translated string when appropriate.

The ``path`` argument specifies the directory path in the file system
(e.g. "/home/gsherman/stuff"). A valid directory path must be specified.
%End



    QgsDirectoryItem( QgsDataItem *parent /TransferThis/, const QString &name, const QString &dirPath, const QString &path, const QString &providerKey = QString() );
%Docstring
Constructor for QgsDirectoryItem, with the specified ``parent`` item.

The ``name`` argument specifies the text to show in the model for the
item. This is usually the directory name, but in certain cases may
differ for special directories (e.g. "Home"). If a non-directory-name
text is used, it should be a translated string when appropriate.

The ``dirPath`` argument specifies the directory path in the file system
(e.g. "/home/gsherman/stuff"). A valid directory path must be specified.

The ``path`` argument gives the item path in the browser tree. The
``path`` string can take any form, but is usually the same as
``dirPath`` or ``dirPath`` with a prefix, e.g.
"favorites:/home/gsherman/Downloads"). QgsDirectoryItem items pointing
to different ``dirPaths`` should always use a different item ``path``.

The optional ``providerKey`` string can be used to specify the key for
the :py:class:`QgsDataItemProvider` that created this item.
%End

    SIP_PYOBJECT __repr__();
%MethodCode
    QString str = QStringLiteral( "<QgsDirectoryItem: %1 - %2>" ).arg( sipCpp->dirPath(), sipCpp->path() );
    sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End
    virtual void setState( Qgis::BrowserItemState state );


    virtual QVector<QgsDataItem *> createChildren();


    QString dirPath() const;
%Docstring
Returns the full path to the directory the item represents.
%End

    virtual bool equal( const QgsDataItem *other );

    virtual QIcon icon();


    QColor iconColor() const;
%Docstring
Returns the directory's icon color.

An invalid color will be returned if the default icon color is used.

.. seealso:: :py:func:`setIconColor`

.. versionadded:: 3.20
%End

    void setIconColor( const QColor &color );
%Docstring
Sets the directory's icon ``color``.

Setting an invalid color will cause the default icon color to be used.

This is a transient property, and will not permanently alter the
directory's colors in future QGIS sessions. Use
:py:func:`~QgsDirectoryItem.setCustomColor` to permanently set the
directory's color.

.. seealso:: :py:func:`iconColor`

.. versionadded:: 3.20
%End

    static void setCustomColor( const QString &directory, const QColor &color );
%Docstring
Sets a custom icon ``color`` to use for the items for the corresponding
``directory`` path.

If ``color`` is an invalid color then the default icon color will be
used.

.. versionadded:: 3.20
%End

 virtual QWidget *paramWidget() /Factory,Deprecated/;

    virtual bool hasDragEnabled() const;
    virtual QgsMimeDataUtils::UriList mimeUris() const;


    static bool hiddenPath( const QString &path );
%Docstring
Check if the given path is hidden from the browser model
%End

    static Qgis::BrowserDirectoryMonitoring monitoringForPath( const QString &path );
%Docstring
Returns the monitoring setting for a directory ``path``.

This method returns the monitoring setting for ``path`` only. If no
explicit monitoring setting is in place for the path then
:py:class:`Qgis`.BrowserDirectoryMonitoring.Default is returned.

This method does not consider the monitoring setting of parent
directories.

.. versionadded:: 3.20
%End

    static bool pathShouldByMonitoredByDefault( const QString &path );
%Docstring
Returns ``True`` if a directory ``path`` should be monitored by default.

In the absence of any other settings this will dictate whether the
directory is monitored. This method does not consider an explicit
monitoring setting set for the path, which can be determined by calling
:py:func:`~QgsDirectoryItem.monitoringForPath`.

All parent directories will be checked to determine whether they have
monitoring manually enabled or disabled. As soon as a parent directory
is found which has monitoring manually enabled or disabled then the
corresponding value will be returned.

If no explicit setting is in place for a parent directory, then a check
will be made to determine whether the path resides on a known slow
drive. If so, monitoring is disabled by default and ``False`` will be
returned. Otherwise paths are monitored by default and the function will
return ``True``.

.. seealso:: :py:func:`isMonitored`

.. seealso:: :py:func:`setMonitoring`

.. versionadded:: 3.20
%End

    bool isMonitored() const;
%Docstring
Returns ``True`` if the directory is currently being monitored for
changes and the item auto-refreshed when these occur.

.. versionadded:: 3.20
%End

    Qgis::BrowserDirectoryMonitoring monitoring() const;
%Docstring
Returns the monitoring setting for this directory item.

.. seealso:: :py:func:`setMonitoring`

.. versionadded:: 3.20
%End

    void setMonitoring( Qgis::BrowserDirectoryMonitoring monitoring );
%Docstring
Sets the ``monitoring`` setting for this directory.

This is a persistent setting, which is saved in QSettings.

.. seealso:: :py:func:`monitoring`

.. versionadded:: 3.20
%End


  public slots:
    virtual void childrenCreated();

    void directoryChanged();

  protected:


};



class QgsDirectoryParamWidget : QTreeWidget
{
%Docstring(signature="appended")
Browser parameter widget implementation for directory items.
%End

%TypeHeaderCode
#include "qgsdirectoryitem.h"
%End
  public:
    QgsDirectoryParamWidget( const QString &path, QWidget *parent /TransferThis/ = 0 );

  protected:
    virtual void mousePressEvent( QMouseEvent *event );


  public slots:
    void showHideColumn();
};





/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/browser/qgsdirectoryitem.h                                  *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/