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 );
185 void fileChanged(
const QString & );
196 void openFileDialog();
197 void textEdited(
const QString &path );
201 bool mButtonVisible =
true;
202 bool mUseLink =
false;
203 bool mFullUrl =
false;
204 QString mDialogTitle;
206 QString mSelectedFilter;
207 QString mDefaultRoot;
208 bool mConfirmOverwrite =
true;
212 QLabel *mLinkLabel =
nullptr;
213 QgsFileDropEdit *mLineEdit =
nullptr;
214 QToolButton *mFileWidgetButton =
nullptr;
215 QHBoxLayout *mLayout =
nullptr;
218 QString toUrl(
const QString &path )
const;
221 QString relativePath(
const QString &filePath,
bool removeRelative )
const;
223 friend class TestQgsFileWidget;
250 void setFilters(
const QString &filters );
254 void dragEnterEvent( QDragEnterEvent *event )
override;
255 void dragLeaveEvent( QDragLeaveEvent *event )
override;
256 void dropEvent( QDropEvent *event )
override;
257 void paintEvent( QPaintEvent *e )
override;
262 QString acceptableFilePath( QDropEvent *event )
const;
264 QStringList mAcceptableExtensions;
267 friend class TestQgsFileWidget;
273 #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)