2017-04-19 14:56:11 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/qgsfilewidget.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-01-15 09:53:26 +01:00
|
|
|
class QgsFileWidget : QWidget
|
2016-01-11 16:52:39 +01:00
|
|
|
{
|
2017-04-19 14:56:11 +02:00
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
The QgsFileWidget class creates a widget for selecting a file or a folder.
|
2016-01-11 16:52:39 +01:00
|
|
|
%End
|
|
|
|
|
2017-04-19 14:56:11 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsfilewidget.h"
|
2017-05-10 08:34:51 +02:00
|
|
|
%End
|
|
|
|
%ConvertToSubClassCode
|
|
|
|
if ( qobject_cast<QgsFileWidget *>( sipCpp ) )
|
|
|
|
sipType = sipType_QgsFileWidget;
|
|
|
|
else
|
|
|
|
sipType = NULL;
|
2017-04-19 14:56:11 +02:00
|
|
|
%End
|
2016-01-11 16:52:39 +01:00
|
|
|
public:
|
2017-04-19 14:56:11 +02:00
|
|
|
|
2016-01-11 16:52:39 +01:00
|
|
|
enum StorageMode
|
|
|
|
{
|
2016-01-15 08:48:57 +01:00
|
|
|
GetFile,
|
2017-08-23 16:17:15 +02:00
|
|
|
GetDirectory,
|
|
|
|
GetMultipleFiles,
|
2017-12-07 10:40:17 +07:00
|
|
|
SaveFile,
|
2016-01-11 16:52:39 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
enum RelativeStorage
|
|
|
|
{
|
|
|
|
Absolute,
|
|
|
|
RelativeProject,
|
|
|
|
RelativeDefaultPath
|
|
|
|
};
|
|
|
|
|
2017-04-19 14:56:11 +02:00
|
|
|
explicit QgsFileWidget( QWidget *parent /TransferThis/ = 0 );
|
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
QgsFileWidget creates a widget for selecting a file or a folder.
|
2017-04-19 14:56:11 +02:00
|
|
|
%End
|
2016-01-11 16:52:39 +01:00
|
|
|
|
|
|
|
QString filePath();
|
2017-04-19 14:56:11 +02:00
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
Returns the current file path(s)
|
2017-12-15 10:36:55 -04:00
|
|
|
when multiple files are selected, they are quoted and separated
|
|
|
|
by a single space (for example: '"/path/foo" "path/bar"')
|
|
|
|
|
2018-05-25 09:00:58 +10:00
|
|
|
.. seealso:: :py:func:`splitFilePaths`
|
2017-04-19 14:56:11 +02:00
|
|
|
%End
|
2016-01-11 16:52:39 +01:00
|
|
|
|
2017-08-24 08:29:40 +02:00
|
|
|
static QStringList splitFilePaths( const QString &path );
|
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
Split the the quoted and space separated ``path`` and returns a QString list
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`filePath`
|
2017-08-24 08:29:40 +02:00
|
|
|
%End
|
|
|
|
|
2016-01-11 16:52:39 +01:00
|
|
|
void setFilePath( QString path );
|
2017-04-19 14:56:11 +02:00
|
|
|
%Docstring
|
|
|
|
Sets the file path
|
|
|
|
%End
|
2016-01-11 16:52:39 +01:00
|
|
|
|
|
|
|
void setReadOnly( bool readOnly );
|
2017-04-19 14:56:11 +02:00
|
|
|
%Docstring
|
|
|
|
defines if the widget is readonly
|
|
|
|
%End
|
2016-01-11 16:52:39 +01:00
|
|
|
|
|
|
|
QString dialogTitle() const;
|
2017-04-19 14:56:11 +02:00
|
|
|
%Docstring
|
|
|
|
returns the open file dialog title
|
|
|
|
%End
|
|
|
|
|
|
|
|
void setDialogTitle( const QString &title );
|
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
setDialogTitle defines the open file dialog title
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-04-19 14:56:11 +02:00
|
|
|
.. note::
|
|
|
|
|
2017-08-23 16:17:15 +02:00
|
|
|
if not defined, the title is "Select a file" or "Select a directory" or "Select one or more files" depending on the configuration.
|
2017-04-19 14:56:11 +02:00
|
|
|
%End
|
2016-01-11 16:52:39 +01:00
|
|
|
|
2016-01-15 08:48:57 +01:00
|
|
|
QString filter() const;
|
2017-04-19 14:56:11 +02:00
|
|
|
%Docstring
|
|
|
|
returns the filters used for QDialog.getOpenFileName
|
|
|
|
%End
|
|
|
|
|
2016-01-15 08:48:57 +01:00
|
|
|
void setFilter( const QString &filter );
|
2017-04-19 14:56:11 +02:00
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
setFilter sets the filter used by the model to filters. The filter is used to specify the kind of files that should be shown.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
: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 ';;',
|
2020-05-07 11:56:39 +03:00
|
|
|
%End
|
|
|
|
|
|
|
|
QFileDialog::Options options() const;
|
|
|
|
%Docstring
|
|
|
|
Returns additional options used for QFileDialog
|
|
|
|
|
|
|
|
.. versionadded:: 3.14
|
|
|
|
%End
|
|
|
|
|
|
|
|
void setOptions( QFileDialog::Options options );
|
|
|
|
%Docstring
|
|
|
|
setOptions sets additional options used for QFileDialog. These options affect the look and feel of the QFileDialog
|
|
|
|
|
|
|
|
.. versionadded:: 3.14
|
2017-12-20 12:43:30 +07:00
|
|
|
%End
|
|
|
|
|
2018-02-02 14:33:38 +10:00
|
|
|
void setSelectedFilter( const QString &selectedFilter );
|
2017-12-20 12:43:30 +07:00
|
|
|
%Docstring
|
|
|
|
Sets the selected filter when the file dialog opens.
|
|
|
|
%End
|
|
|
|
|
|
|
|
QString selectedFilter() const;
|
|
|
|
%Docstring
|
|
|
|
Returns the selected filter from the last opened file dialog.
|
2017-04-19 14:56:11 +02:00
|
|
|
%End
|
2016-01-15 08:48:57 +01:00
|
|
|
|
2017-12-07 10:40:17 +07:00
|
|
|
void setConfirmOverwrite( bool confirmOverwrite );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets whether a confirmation to overwrite an existing file will appear.
|
|
|
|
By default, a confirmation will appear.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2019-02-26 19:54:09 +10:00
|
|
|
:param confirmOverwrite: If set to ``True``, an overwrite confirmation will be shown
|
2017-12-07 10:40:17 +07:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool confirmOverwrite() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns whether a confirmation will be shown when overwriting an existing file
|
2017-12-07 10:40:17 +07:00
|
|
|
%End
|
|
|
|
|
2016-01-15 09:53:26 +01:00
|
|
|
bool fileWidgetButtonVisible() const;
|
2017-04-19 14:56:11 +02:00
|
|
|
%Docstring
|
|
|
|
determines if the tool button is shown
|
|
|
|
%End
|
2016-01-15 09:53:26 +01:00
|
|
|
void setFileWidgetButtonVisible( bool visible );
|
2017-04-19 14:56:11 +02:00
|
|
|
%Docstring
|
|
|
|
determines if the tool button is shown
|
|
|
|
%End
|
2016-01-11 16:52:39 +01:00
|
|
|
|
|
|
|
bool useLink() const;
|
2017-04-19 14:56:11 +02:00
|
|
|
%Docstring
|
|
|
|
determines if the file path will be shown as a link
|
|
|
|
%End
|
2016-01-11 16:52:39 +01:00
|
|
|
void setUseLink( bool useLink );
|
2017-04-19 14:56:11 +02:00
|
|
|
%Docstring
|
|
|
|
determines if the file path will be shown as a link
|
|
|
|
%End
|
2016-01-11 16:52:39 +01:00
|
|
|
|
|
|
|
bool fullUrl() const;
|
2017-04-19 14:56:11 +02:00
|
|
|
%Docstring
|
|
|
|
returns if the links shows the full path or not
|
|
|
|
%End
|
2016-01-11 16:52:39 +01:00
|
|
|
void setFullUrl( bool fullUrl );
|
2017-04-19 14:56:11 +02:00
|
|
|
%Docstring
|
|
|
|
determines if the links shows the full path or not
|
|
|
|
%End
|
2016-01-11 16:52:39 +01:00
|
|
|
|
|
|
|
QString defaultRoot() const;
|
2017-04-19 14:56:11 +02:00
|
|
|
%Docstring
|
|
|
|
returns the default root path
|
|
|
|
%End
|
|
|
|
void setDefaultRoot( const QString &defaultRoot );
|
|
|
|
%Docstring
|
|
|
|
determines the default root path used as the first shown location when picking a file and used if the RelativeStorage is RelativeDefaultPath
|
|
|
|
%End
|
2016-01-11 16:52:39 +01:00
|
|
|
|
2016-01-15 09:53:26 +01:00
|
|
|
QgsFileWidget::StorageMode storageMode() const;
|
2017-04-19 14:56:11 +02:00
|
|
|
%Docstring
|
|
|
|
returns the storage mode (i.e. file or directory)
|
|
|
|
%End
|
2016-01-15 09:53:26 +01:00
|
|
|
void setStorageMode( QgsFileWidget::StorageMode storageMode );
|
2017-04-19 14:56:11 +02:00
|
|
|
%Docstring
|
|
|
|
determines the storage mode (i.e. file or directory)
|
|
|
|
%End
|
2016-01-11 16:52:39 +01:00
|
|
|
|
2016-01-15 09:53:26 +01:00
|
|
|
QgsFileWidget::RelativeStorage relativeStorage() const;
|
2017-04-19 14:56:11 +02:00
|
|
|
%Docstring
|
|
|
|
returns if the relative path is with respect to the project path or the default path
|
|
|
|
%End
|
2016-01-15 09:53:26 +01:00
|
|
|
void setRelativeStorage( QgsFileWidget::RelativeStorage relativeStorage );
|
2017-04-19 14:56:11 +02:00
|
|
|
%Docstring
|
|
|
|
determines if the relative path is with respect to the project path or the default path
|
|
|
|
%End
|
2016-01-11 16:52:39 +01:00
|
|
|
|
2017-12-05 11:22:17 +10:00
|
|
|
QgsFilterLineEdit *lineEdit();
|
2017-08-06 16:32:10 +10:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
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.
|
|
|
|
|
2017-08-06 16:32:10 +10:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
2016-01-11 16:52:39 +01:00
|
|
|
signals:
|
2019-09-23 09:20:12 +10:00
|
|
|
|
|
|
|
void fileChanged( const QString &path );
|
2017-04-19 14:56:11 +02:00
|
|
|
%Docstring
|
2019-09-23 09:20:12 +10:00
|
|
|
Emitted whenever the current file or directory ``path`` is changed.
|
2017-04-19 14:56:11 +02:00
|
|
|
%End
|
2016-01-11 16:52:39 +01:00
|
|
|
|
|
|
|
};
|
2017-04-19 14:56:11 +02:00
|
|
|
|
2017-08-06 16:32:10 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-19 14:56:11 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/qgsfilewidget.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|