![]() |
NDEVR
API Documentation
|
A simple frame that allows the user to drag and drop a file into it. More...
Public Member Functions | |
| FileDropFrame (QWidget *parent=nullptr) | |
| Constructs a FileDropFrame. | |
| void | dragEnterEvent (QDragEnterEvent *event) |
| Handles drag enter events, accepting the drop if the filter allows it. | |
| void | dropEvent (QDropEvent *event) |
| Handles drop events by invoking the registered drop callback. | |
| void | setDropCallback (const std::function< void(QDropEvent *event)> &drop_callback) |
| Sets the callback invoked when a file is dropped onto this frame. | |
| void | setDropFilter (std::function< bool(const QMimeData *event)> filter) |
| Sets a filter function that determines whether a drag should be accepted. | |
A simple frame that allows the user to drag and drop a file into it.
Definition at line 11 of file FileDropFrame.h.
|
inline |
Constructs a FileDropFrame.
| [in] | parent | The parent widget. |
Definition at line 18 of file FileDropFrame.h.
|
inline |
Handles drag enter events, accepting the drop if the filter allows it.
| [in] | event | The drag enter event. |
Definition at line 27 of file FileDropFrame.h.
References m_drop_filter.
|
inline |
Handles drop events by invoking the registered drop callback.
| [in] | event | The drop event. |
Definition at line 38 of file FileDropFrame.h.
References m_drop_callback.
|
inline |
Sets the callback invoked when a file is dropped onto this frame.
| [in] | drop_callback | The callback function to handle drop events. |
Definition at line 47 of file FileDropFrame.h.
References m_drop_callback.
|
inline |
Sets a filter function that determines whether a drag should be accepted.
| [in] | filter | A function returning true if the mime data should be accepted. |
Definition at line 55 of file FileDropFrame.h.
References m_drop_filter.