17 #ifndef QGSFILEWIDGET_H 18 #define QGSFILEWIDGET_H 23 class QgsFileDropEdit;
40 if ( qobject_cast<QgsFileWidget *>( sipCpp ) )
41 sipType = sipType_QgsFileWidget;
49 Q_PROPERTY(
bool fileWidgetButtonVisible READ fileWidgetButtonVisible WRITE setFileWidgetButtonVisible )
50 Q_PROPERTY(
bool useLink READ useLink WRITE setUseLink )
51 Q_PROPERTY(
bool fullUrl READ fullUrl WRITE setFullUrl )
52 Q_PROPERTY( QString dialogTitle READ dialogTitle WRITE setDialogTitle )
53 Q_PROPERTY( QString filter READ filter WRITE setFilter )
54 Q_PROPERTY( QString defaultRoot READ defaultRoot WRITE setDefaultRoot )
55 Q_PROPERTY(
StorageMode storageMode READ storageMode WRITE setStorageMode )
56 Q_PROPERTY(
RelativeStorage relativeStorage READ relativeStorage WRITE setRelativeStorage )
98 static QStringList splitFilePaths(
const QString &path );
101 void setFilePath( QString path );
104 void setReadOnly(
bool readOnly );
107 QString dialogTitle()
const;
113 void setDialogTitle(
const QString &title );
116 QString filter()
const;
122 void setFilter(
const QString &filter );
147 bool fileWidgetButtonVisible()
const;
149 void setFileWidgetButtonVisible(
bool visible );
152 bool useLink()
const;
154 void setUseLink(
bool useLink );
157 bool fullUrl()
const;
159 void setFullUrl(
bool fullUrl );
162 QString defaultRoot()
const;
164 void setDefaultRoot(
const QString &defaultRoot );
188 void fileChanged(
const QString &path );
199 void openFileDialog();
200 void textEdited(
const QString &path );
204 bool mButtonVisible =
true;
205 bool mUseLink =
false;
206 bool mFullUrl =
false;
207 QString mDialogTitle;
209 QString mSelectedFilter;
210 QString mDefaultRoot;
211 bool mConfirmOverwrite =
true;
215 QLabel *mLinkLabel =
nullptr;
216 QgsFileDropEdit *mLineEdit =
nullptr;
217 QToolButton *mFileWidgetButton =
nullptr;
218 QHBoxLayout *mLayout =
nullptr;
221 QString toUrl(
const QString &path )
const;
224 QString relativePath(
const QString &filePath,
bool removeRelative )
const;
226 friend class TestQgsFileWidget;
253 void setFilters(
const QString &filters );
257 void dragEnterEvent( QDragEnterEvent *event )
override;
258 void dragLeaveEvent( QDragLeaveEvent *event )
override;
259 void dropEvent( QDropEvent *event )
override;
260 void paintEvent( QPaintEvent *e )
override;
265 QString acceptableFilePath( QDropEvent *event )
const;
267 QStringList mAcceptableExtensions;
270 friend class TestQgsFileWidget;
276 #endif // QGSFILEWIDGET_H
QLineEdit subclass with built in support for clearing the widget's value and handling custom null val...
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)