QGIS API Documentation
2.2.0-Valmiera
|
A line edit for capturing file names that can have files dropped onto it via drag & drop. More...
#include <qgsfiledropedit.h>
Public Member Functions | |
QgsFileDropEdit (QWidget *parent=0) | |
virtual | ~QgsFileDropEdit () |
bool | isDirOnly () const |
void | setDirOnly (bool isDirOnly) |
bool | isFileOnly () const |
void | setFileOnly (bool isFileOnly) |
const QString & | suffixFilter () const |
void | setSuffixFilter (const QString &suffix) |
Protected Member Functions | |
virtual void | dragEnterEvent (QDragEnterEvent *event) |
virtual void | dragLeaveEvent (QDragLeaveEvent *event) |
virtual void | dropEvent (QDropEvent *event) |
virtual void | paintEvent (QPaintEvent *e) |
Private Member Functions | |
QString | acceptableFilePath (QDropEvent *event) const |
Private Attributes | |
QString | mSuffix |
bool | mDirOnly |
bool | mFileOnly |
bool | mDragActive |
A line edit for capturing file names that can have files dropped onto it via drag & drop.
The QgsDropNameEdit class provides a line edit widget which accepts file drops.
Dropping can be limited to files only, files with a specific extension or directories only. By default, dropping is limited to files only.
Definition at line 24 of file qgsfiledropedit.h.
QgsFileDropEdit::QgsFileDropEdit | ( | QWidget * | parent = 0 | ) |
Definition at line 32 of file qgsfiledropedit.cpp.
References mDirOnly, mDragActive, and mFileOnly.
|
virtual |
Definition at line 41 of file qgsfiledropedit.cpp.
|
private |
Return file name if object meets drop criteria.
Definition at line 79 of file qgsfiledropedit.cpp.
References file, mDirOnly, mFileOnly, and mSuffix.
Referenced by dragEnterEvent(), and dropEvent().
|
protectedvirtual |
Check if dragged object is acceptible. Called when a drag is in progress and the mouse enters this widget.
Definition at line 97 of file qgsfiledropedit.cpp.
References acceptableFilePath(), and mDragActive.
|
protectedvirtual |
Called when a drag is in progress and the mouse leaves this widget.
Definition at line 115 of file qgsfiledropedit.cpp.
References mDragActive.
|
protectedvirtual |
Receive the dragged object. Called when the drag is dropped on this widget.
Definition at line 126 of file qgsfiledropedit.cpp.
References acceptableFilePath(), and mDragActive.
|
inline |
Definition at line 30 of file qgsfiledropedit.h.
Referenced by setDirOnly().
|
inline |
Definition at line 33 of file qgsfiledropedit.h.
Referenced by setFileOnly().
|
protectedvirtual |
Paints line edit with drag highlight in response to a paint event.
Definition at line 147 of file qgsfiledropedit.cpp.
References mDragActive.
void QgsFileDropEdit::setDirOnly | ( | bool | isDirOnly | ) |
Limit drops to directories.
Definition at line 47 of file qgsfiledropedit.cpp.
References isDirOnly(), mDirOnly, and mFileOnly.
void QgsFileDropEdit::setFileOnly | ( | bool | isFileOnly | ) |
Limit drops to files.
Definition at line 59 of file qgsfiledropedit.cpp.
References isFileOnly(), mDirOnly, and mFileOnly.
void QgsFileDropEdit::setSuffixFilter | ( | const QString & | suffix | ) |
Limit drops to files with specified extension.
Definition at line 71 of file qgsfiledropedit.cpp.
References mSuffix.
|
inline |
Definition at line 36 of file qgsfiledropedit.h.
|
private |
Definition at line 50 of file qgsfiledropedit.h.
Referenced by acceptableFilePath(), QgsFileDropEdit(), setDirOnly(), and setFileOnly().
|
private |
Definition at line 52 of file qgsfiledropedit.h.
Referenced by dragEnterEvent(), dragLeaveEvent(), dropEvent(), paintEvent(), and QgsFileDropEdit().
|
private |
Definition at line 51 of file qgsfiledropedit.h.
Referenced by acceptableFilePath(), QgsFileDropEdit(), setDirOnly(), and setFileOnly().
|
private |
Definition at line 49 of file qgsfiledropedit.h.
Referenced by acceptableFilePath(), and setSuffixFilter().