#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 |
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 25 of file qgsfiledropedit.h.
QgsFileDropEdit::QgsFileDropEdit | ( | QWidget * | parent = 0 |
) |
QgsFileDropEdit::~QgsFileDropEdit | ( | ) | [virtual] |
Definition at line 42 of file qgsfiledropedit.cpp.
bool QgsFileDropEdit::isDirOnly | ( | ) | const [inline] |
Definition at line 31 of file qgsfiledropedit.h.
void QgsFileDropEdit::setDirOnly | ( | bool | isDirOnly | ) |
Limit drops to directories.
Definition at line 48 of file qgsfiledropedit.cpp.
bool QgsFileDropEdit::isFileOnly | ( | ) | const [inline] |
Definition at line 34 of file qgsfiledropedit.h.
void QgsFileDropEdit::setFileOnly | ( | bool | isFileOnly | ) |
Limit drops to files.
Definition at line 60 of file qgsfiledropedit.cpp.
const QString& QgsFileDropEdit::suffixFilter | ( | ) | const [inline] |
Definition at line 37 of file qgsfiledropedit.h.
void QgsFileDropEdit::setSuffixFilter | ( | const QString & | suffix | ) |
Limit drops to files with specified extension.
Definition at line 72 of file qgsfiledropedit.cpp.
References mSuffix.
void QgsFileDropEdit::dragEnterEvent | ( | QDragEnterEvent * | event | ) | [protected, virtual] |
Check if dragged object is acceptible. Called when a drag is in progress and the mouse enters this widget.
Definition at line 98 of file qgsfiledropedit.cpp.
References acceptableFilePath(), and mDragActive.
void QgsFileDropEdit::dragLeaveEvent | ( | QDragLeaveEvent * | event | ) | [protected, virtual] |
Called when a drag is in progress and the mouse leaves this widget.
Definition at line 116 of file qgsfiledropedit.cpp.
References mDragActive.
void QgsFileDropEdit::dropEvent | ( | QDropEvent * | event | ) | [protected, virtual] |
Receive the dragged object. Called when the drag is dropped on this widget.
Definition at line 127 of file qgsfiledropedit.cpp.
References acceptableFilePath(), and mDragActive.
void QgsFileDropEdit::paintEvent | ( | QPaintEvent * | e | ) | [protected, virtual] |
Paints line edit with drag highlight in response to a paint event.
Definition at line 148 of file qgsfiledropedit.cpp.
References mDragActive.
QString QgsFileDropEdit::acceptableFilePath | ( | QDropEvent * | event | ) | const [private] |
Return file name if object meets drop criteria.
Definition at line 80 of file qgsfiledropedit.cpp.
References mDirOnly, mFileOnly, and mSuffix.
Referenced by dragEnterEvent(), and dropEvent().
QString QgsFileDropEdit::mSuffix [private] |
Definition at line 50 of file qgsfiledropedit.h.
Referenced by acceptableFilePath(), and setSuffixFilter().
bool QgsFileDropEdit::mDirOnly [private] |
Definition at line 51 of file qgsfiledropedit.h.
Referenced by acceptableFilePath(), QgsFileDropEdit(), setDirOnly(), and setFileOnly().
bool QgsFileDropEdit::mFileOnly [private] |
Definition at line 52 of file qgsfiledropedit.h.
Referenced by acceptableFilePath(), QgsFileDropEdit(), setDirOnly(), and setFileOnly().
bool QgsFileDropEdit::mDragActive [private] |
Definition at line 53 of file qgsfiledropedit.h.
Referenced by dragEnterEvent(), dragLeaveEvent(), dropEvent(), paintEvent(), and QgsFileDropEdit().