File: qgsfilewidget.sip.in

package info (click to toggle)
qgis 3.40.10%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,183,672 kB
  • sloc: cpp: 1,595,771; python: 372,544; 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: 161
file content (320 lines) | stat: -rw-r--r-- 7,856 bytes parent folder | download | duplicates (6)
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/gui/qgsfilewidget.h                                              *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/






class QgsFileWidget : QWidget
{
%Docstring(signature="appended")
The :py:class:`QgsFileWidget` class creates a widget for selecting a
file or a folder.
%End

%TypeHeaderCode
#include "qgsfilewidget.h"
%End
%ConvertToSubClassCode
    if ( qobject_cast<QgsFileWidget *>( sipCpp ) )
      sipType = sipType_QgsFileWidget;
    else
      sipType = NULL;
%End
  public:
    enum StorageMode /BaseType=IntEnum/
    {
      GetFile,
      GetDirectory,
      GetMultipleFiles,
      SaveFile,
    };

    enum RelativeStorage /BaseType=IntEnum/
    {
      Absolute,
      RelativeProject,
      RelativeDefaultPath
    };

    explicit QgsFileWidget( QWidget *parent /TransferThis/ = 0 );
%Docstring
QgsFileWidget creates a widget for selecting a file or a folder.
%End

    QString filePath();
%Docstring
Returns the current file path(s).

When multiple files are selected they are quoted and separated by a
single space (for example: '"/path/foo" "path/bar"')

.. seealso:: :py:func:`setFilePath`

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

    static QStringList splitFilePaths( const QString &path );
%Docstring
Split the the quoted and space separated ``path`` and returns a list of
strings.

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

    void setFilePath( const QString &path );
%Docstring
Sets the current file ``path``.

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

    virtual void setReadOnly( bool readOnly );
%Docstring
Sets whether the widget should be read only.
%End

    QString dialogTitle() const;
%Docstring
Returns the open file dialog title.

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

    void setDialogTitle( const QString &title );
%Docstring
Sets the ``title`` to use for the open file dialog.

.. note::

   If not defined, the title is "Select a file" or "Select a directory" or "Select one or more files" depending on the configuration.

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

    QString filter() const;
%Docstring
returns the filters used for QDialog.getOpenFileName
%End

    void setFilter( const QString &filter );
%Docstring
setFilter sets the filter used by the model to filters. The filter is
used to specify the kind of files that should be shown.

:param filter: Only files that match the given filter are shown, it may
               be an empty string. If you want multiple filters,
               separate them with ';;',
%End

    QFileDialog::Options options() const;
%Docstring
Returns the additional options used for QFileDialog.

.. seealso:: :py:func:`setOptions`

.. versionadded:: 3.14
%End

    void setOptions( QFileDialog::Options options );
%Docstring
Set additional options used for QFileDialog.

These options affect the look and feel of the QFileDialog shown when a
user is interactively browsing for paths.

.. seealso:: :py:func:`options`

.. versionadded:: 3.14
%End

    void setSelectedFilter( const QString &selectedFilter );
%Docstring
Sets the selected filter when the file dialog opens.

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

    QString selectedFilter() const;
%Docstring
Returns the selected filter from the last opened file dialog.

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

    void setConfirmOverwrite( bool confirmOverwrite );
%Docstring
Sets whether a confirmation to overwrite an existing file will appear.

By default, a confirmation will appear.

:param confirmOverwrite: If set to ``True``, an overwrite confirmation
                         will be shown

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

    bool confirmOverwrite() const;
%Docstring
Returns whether a confirmation will be shown when overwriting an
existing file.

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

    bool fileWidgetButtonVisible() const;
%Docstring
Returns ``True`` if the tool button is shown.

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

    void setFileWidgetButtonVisible( bool visible );
%Docstring
Sets whether the tool button is ``visible``.

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

    bool useLink() const;
%Docstring
Returns ``True`` if the file path will be shown as a link.

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

    void setUseLink( bool useLink );
%Docstring
Sets whether the file path will be shown as a link.

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

    bool fullUrl() const;
%Docstring
Returns ``True`` if the links shown use the full path.

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

    void setFullUrl( bool fullUrl );
%Docstring
Sets whether links shown use the full path.

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

    QString defaultRoot() const;
%Docstring
Returns the default root path.

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

    void setDefaultRoot( const QString &defaultRoot );
%Docstring
Returns the default root path used as the first shown location when
picking a file and used if the RelativeStorage is RelativeDefaultPath.

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

    QgsFileWidget::StorageMode storageMode() const;
%Docstring
Returns the widget's storage mode (i.e. file or directory).

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

    void setStorageMode( QgsFileWidget::StorageMode storageMode );
%Docstring
Sets the widget's storage mode (i.e. file or directory).

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

    QgsFileWidget::RelativeStorage relativeStorage() const;
%Docstring
Returns if the relative path is with respect to the project path or the
default path.

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

    void setRelativeStorage( QgsFileWidget::RelativeStorage relativeStorage );
%Docstring
Sets whether the relative path is with respect to the project path or
the default path.

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

    QgsFilterLineEdit *lineEdit();
%Docstring
Returns a pointer to the widget's line edit, which can be used to
customize the appearance and behavior of the line edit portion of the
widget.
%End

  signals:

    void fileChanged( const QString &path );
%Docstring
Emitted whenever the current file or directory ``path`` is changed.
%End

  protected:
    virtual void updateLayout();
%Docstring
Update buttons visibility
%End

    virtual void setSelectedFileNames( QStringList fileNames );
%Docstring
Called whenever user select ``fileNames`` from dialog
%End

    static bool isMultiFiles( const QString &path );
%Docstring
Returns true if ``path`` is a multifiles
%End

    void setFilePaths( const QStringList &filePaths );
%Docstring
Update filePath according to ``filePaths`` list
%End



    QString toUrl( const QString &path ) const;
%Docstring
returns a HTML code with a link to the given file path
%End

    QString relativePath( const QString &filePath, bool removeRelative ) const;
%Docstring
Returns a filePath with relative path options applied (or not) !
%End

  public:
    virtual QSize minimumSizeHint() const;


};




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