QGIS API Documentation  2.99.0-Master (cb63e82)
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>

Inheritance diagram for QgsFileDropEdit:
Inheritance graph
[legend]

Public Member Functions

 QgsFileDropEdit (QWidget *parent=nullptr)
 
bool isDirOnly () const
 
bool isFileOnly () const
 
void setDirOnly (bool isDirOnly)
 Limit drops to directories. More...
 
void setFileOnly (bool isFileOnly)
 Limit drops to files. More...
 
void setSuffixFilter (const QString &suffix)
 Limit drops to files with specified extension. More...
 
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.

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 28 of file qgsfiledropedit.h.

Constructor & Destructor Documentation

◆ QgsFileDropEdit()

QgsFileDropEdit::QgsFileDropEdit ( QWidget *  parent = nullptr)

Definition at line 23 of file qgsfiledropedit.cpp.

Member Function Documentation

◆ dragEnterEvent()

void QgsFileDropEdit::dragEnterEvent ( QDragEnterEvent *  event)
overrideprotectedvirtual

Definition at line 69 of file qgsfiledropedit.cpp.

◆ dragLeaveEvent()

void QgsFileDropEdit::dragLeaveEvent ( QDragLeaveEvent *  event)
overrideprotectedvirtual

Definition at line 84 of file qgsfiledropedit.cpp.

◆ dropEvent()

void QgsFileDropEdit::dropEvent ( QDropEvent *  event)
overrideprotectedvirtual

Definition at line 92 of file qgsfiledropedit.cpp.

◆ isDirOnly()

bool QgsFileDropEdit::isDirOnly ( ) const
inline

Definition at line 35 of file qgsfiledropedit.h.

◆ isFileOnly()

bool QgsFileDropEdit::isFileOnly ( ) const
inline

Definition at line 42 of file qgsfiledropedit.h.

◆ paintEvent()

void QgsFileDropEdit::paintEvent ( QPaintEvent *  e)
overrideprotectedvirtual

Definition at line 110 of file qgsfiledropedit.cpp.

◆ setDirOnly()

void QgsFileDropEdit::setDirOnly ( bool  isDirOnly)

Limit drops to directories.

Definition at line 32 of file qgsfiledropedit.cpp.

◆ setFileOnly()

void QgsFileDropEdit::setFileOnly ( bool  isFileOnly)

Limit drops to files.

Definition at line 41 of file qgsfiledropedit.cpp.

◆ setSuffixFilter()

void QgsFileDropEdit::setSuffixFilter ( const QString &  suffix)

Limit drops to files with specified extension.

Definition at line 50 of file qgsfiledropedit.cpp.

◆ suffixFilter()

QString QgsFileDropEdit::suffixFilter ( ) const
inline

Definition at line 49 of file qgsfiledropedit.h.


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