43 if ( qobject_cast<QgsFileWidget *>( sipCpp ) )
44 sipType = sipType_QgsFileWidget;
51 Q_PROPERTY(
bool fileWidgetButtonVisible READ fileWidgetButtonVisible WRITE setFileWidgetButtonVisible )
52 Q_PROPERTY(
bool useLink READ useLink WRITE setUseLink )
53 Q_PROPERTY(
bool fullUrl READ fullUrl WRITE setFullUrl )
54 Q_PROPERTY( QString dialogTitle READ dialogTitle WRITE setDialogTitle )
55 Q_PROPERTY( QString filter READ filter WRITE setFilter )
56 Q_PROPERTY( QString defaultRoot READ defaultRoot WRITE setDefaultRoot )
57 Q_PROPERTY(
StorageMode storageMode READ storageMode WRITE setStorageMode )
58 Q_PROPERTY(
RelativeStorage relativeStorage READ relativeStorage WRITE setRelativeStorage )
59 Q_PROPERTY( QFileDialog::Options options READ options WRITE setOptions )
84 Q_ENUM( RelativeStorage )
107 static QStringList splitFilePaths(
const QString &path );
114 void setFilePath(
const QString &path );
119 virtual void setReadOnly(
bool readOnly );
126 QString dialogTitle()
const;
135 void setDialogTitle(
const QString &title );
138 QString filter()
const;
144 void setFilter(
const QString &filter );
153 QFileDialog::Options options()
const;
165 void setOptions( QFileDialog::Options options );
204 bool fileWidgetButtonVisible()
const;
211 void setFileWidgetButtonVisible(
bool visible );
218 bool useLink()
const;
225 void setUseLink(
bool useLink );
232 bool fullUrl()
const;
239 void setFullUrl(
bool fullUrl );
246 QString defaultRoot()
const;
253 void setDefaultRoot(
const QString &defaultRoot );
297 void openFileDialog();
298 void textEdited(
const QString &path );
300 void fileDropped(
const QString &filePath );
307 virtual void updateLayout();
312 virtual void setSelectedFileNames( QStringList fileNames );
317 static bool isMultiFiles(
const QString &path );
322 void setFilePaths(
const QStringList &filePaths );
325 bool mButtonVisible =
true;
326 bool mUseLink =
false;
327 bool mFullUrl =
false;
328 bool mReadOnly =
false;
329 bool mIsLinkEdited =
false;
334 bool mConfirmOverwrite =
true;
337 QFileDialog::Options mOptions = QFileDialog::Options();
339 QLabel *mLinkLabel =
nullptr;
340 QgsFileDropEdit *mLineEdit =
nullptr;
341 QToolButton *mLinkEditButton =
nullptr;
342 QToolButton *mFileWidgetButton =
nullptr;
343 QHBoxLayout *mLayout =
nullptr;
346 QString toUrl(
const QString &path )
const;
349 QString relativePath(
const QString &filePath,
bool removeRelative )
const;
353 QSize minimumSizeHint()
const override;
355 friend class TestQgsFileWidget;
356 friend class TestQgsExternalStorageFileWidget;
357 friend class TestQgsExternalResourceWidgetWrapper;