42 if ( qobject_cast<QgsFileWidget *>( sipCpp ) )
43 sipType = sipType_QgsFileWidget;
50 Q_PROPERTY(
bool fileWidgetButtonVisible READ fileWidgetButtonVisible WRITE setFileWidgetButtonVisible )
51 Q_PROPERTY(
bool useLink READ useLink WRITE setUseLink )
52 Q_PROPERTY(
bool fullUrl READ fullUrl WRITE setFullUrl )
53 Q_PROPERTY( QString dialogTitle READ dialogTitle WRITE setDialogTitle )
54 Q_PROPERTY( QString filter READ filter WRITE setFilter )
55 Q_PROPERTY( QString defaultRoot READ defaultRoot WRITE setDefaultRoot )
56 Q_PROPERTY(
StorageMode storageMode READ storageMode WRITE setStorageMode )
57 Q_PROPERTY(
RelativeStorage relativeStorage READ relativeStorage WRITE setRelativeStorage )
58 Q_PROPERTY( QFileDialog::Options options READ options WRITE setOptions )
82 Q_ENUM( RelativeStorage )
105 static QStringList splitFilePaths(
const QString &path );
112 void setFilePath(
const QString &path );
117 virtual void setReadOnly(
bool readOnly );
124 QString dialogTitle()
const;
133 void setDialogTitle(
const QString &title );
136 QString filter()
const;
142 void setFilter(
const QString &filter );
151 QFileDialog::Options options()
const;
163 void setOptions( QFileDialog::Options options );
202 bool fileWidgetButtonVisible()
const;
209 void setFileWidgetButtonVisible(
bool visible );
216 bool useLink()
const;
223 void setUseLink(
bool useLink );
230 bool fullUrl()
const;
237 void setFullUrl(
bool fullUrl );
244 QString defaultRoot()
const;
251 void setDefaultRoot(
const QString &defaultRoot );
295 void openFileDialog();
296 void textEdited(
const QString &path );
298 void fileDropped(
const QString &filePath );
304 virtual void updateLayout();
309 virtual void setSelectedFileNames( QStringList fileNames );
314 static bool isMultiFiles(
const QString &path );
319 void setFilePaths(
const QStringList &filePaths );
322 bool mButtonVisible =
true;
323 bool mUseLink =
false;
324 bool mFullUrl =
false;
325 bool mReadOnly =
false;
326 bool mIsLinkEdited =
false;
331 bool mConfirmOverwrite =
true;
334 QFileDialog::Options mOptions = QFileDialog::Options();
336 QLabel *mLinkLabel =
nullptr;
337 QgsFileDropEdit *mLineEdit =
nullptr;
338 QToolButton *mLinkEditButton =
nullptr;
339 QToolButton *mFileWidgetButton =
nullptr;
340 QHBoxLayout *mLayout =
nullptr;
343 QString toUrl(
const QString &path )
const;
346 QString relativePath(
const QString &filePath,
bool removeRelative )
const;
350 QSize minimumSizeHint()
const override;
352 friend class TestQgsFileWidget;
353 friend class TestQgsExternalStorageFileWidget;
354 friend class TestQgsExternalResourceWidgetWrapper;