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 & );
188 void openFileDialog();
189 void textEdited(
const QString &path );
193 bool mButtonVisible =
true;
194 bool mUseLink =
false;
195 bool mFullUrl =
false;
196 QString mDialogTitle;
198 QString mSelectedFilter;
199 QString mDefaultRoot;
200 bool mConfirmOverwrite =
true;
204 QLabel *mLinkLabel =
nullptr;
205 QgsFileDropEdit *mLineEdit =
nullptr;
206 QToolButton *mFileWidgetButton =
nullptr;
207 QHBoxLayout *mLayout =
nullptr;
210 QString toUrl(
const QString &path )
const;
213 QString relativePath(
const QString &filePath,
bool removeRelative )
const;
215 friend class TestQgsFileWidget;
242 void setFilters(
const QString &filters );
246 void dragEnterEvent( QDragEnterEvent *event )
override;
247 void dragLeaveEvent( QDragLeaveEvent *event )
override;
248 void dropEvent( QDropEvent *event )
override;
249 void paintEvent( QPaintEvent *e )
override;
254 QString acceptableFilePath( QDropEvent *event )
const;
256 QStringList mAcceptableExtensions;
259 friend class TestQgsFileWidget;
265 #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)