QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | List of all members
QgsFileDropEdit Class Reference

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
bool isFileOnly () const
void setDirOnly (bool isDirOnly)
void setFileOnly (bool isFileOnly)
void setSuffixFilter (const QString &suffix)
const QString & suffixFilter () const

Protected Member Functions

virtual void dragEnterEvent (QDragEnterEvent *event) override
virtual void dragLeaveEvent (QDragLeaveEvent *event) override
virtual void dropEvent (QDropEvent *event) override
virtual void paintEvent (QPaintEvent *e) override

Detailed Description

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.

Constructor & Destructor Documentation

QgsFileDropEdit::QgsFileDropEdit ( QWidget *  parent = 0)

Definition at line 33 of file qgsfiledropedit.cpp.

QgsFileDropEdit::~QgsFileDropEdit ( )
virtual

Definition at line 42 of file qgsfiledropedit.cpp.

Member Function Documentation

void QgsFileDropEdit::dragEnterEvent ( QDragEnterEvent *  event)
overrideprotectedvirtual

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.

void QgsFileDropEdit::dragLeaveEvent ( QDragLeaveEvent *  event)
overrideprotectedvirtual

Called when a drag is in progress and the mouse leaves this widget.

Definition at line 116 of file qgsfiledropedit.cpp.

void QgsFileDropEdit::dropEvent ( QDropEvent *  event)
overrideprotectedvirtual

Receive the dragged object. Called when the drag is dropped on this widget.

Definition at line 127 of file qgsfiledropedit.cpp.

bool QgsFileDropEdit::isDirOnly ( ) const
inline

Definition at line 30 of file qgsfiledropedit.h.

bool QgsFileDropEdit::isFileOnly ( ) const
inline

Definition at line 33 of file qgsfiledropedit.h.

void QgsFileDropEdit::paintEvent ( QPaintEvent *  e)
overrideprotectedvirtual

Paints line edit with drag highlight in response to a paint event.

Definition at line 148 of file qgsfiledropedit.cpp.

void QgsFileDropEdit::setDirOnly ( bool  isDirOnly)

Limit drops to directories.

Definition at line 48 of file qgsfiledropedit.cpp.

void QgsFileDropEdit::setFileOnly ( bool  isFileOnly)

Limit drops to files.

Definition at line 60 of file qgsfiledropedit.cpp.

void QgsFileDropEdit::setSuffixFilter ( const QString &  suffix)

Limit drops to files with specified extension.

Definition at line 72 of file qgsfiledropedit.cpp.

const QString& QgsFileDropEdit::suffixFilter ( ) const
inline

Definition at line 36 of file qgsfiledropedit.h.


The documentation for this class was generated from the following files: