ManiVault 1.0.0
A Flexible and Extensible Visual Analytics Framework for High-Dimensional Data
Loading...
Searching...
No Matches
hdps::gui::DropWidget Class Reference

#include <DropWidget.h>

Inheritance diagram for hdps::gui::DropWidget:

Classes

class  DropIndicatorWidget
 
class  DropRegion
 
class  DropRegionContainerWidget
 

Public Types

using DropRegions = QList< DropRegion * >
 
using GetDropRegionsFunction = std::function< DropRegions(const QMimeData *)>
 

Public Member Functions

 DropWidget (QWidget *parent)
 
bool eventFilter (QObject *target, QEvent *event) override
 
void initialize (const GetDropRegionsFunction &getDropRegions)
 
bool getShowDropIndicator () const
 
void setShowDropIndicator (const bool &showDropIndicator)
 
void setDropIndicatorWidget (QWidget *dropIndicatorWidget)
 

Protected Attributes

GetDropRegionsFunction _getDropRegionsFunction
 
bool _showDropIndicator
 
QWidget * _dropIndicatorWidget
 

Detailed Description

Advanced drop widget class

This class adds advanced drag and drop support to arbitrary (parent) widget without having to change it Depending on the data being dragged, an overlay is presented with one or more drop regions Each region has its own visual representation and drop behaviour (with custom lambda function)

Note: Add the following line to the parent widget to enabled drag and drop: setAcceptDrops(true);

Author
Thomas Kroes

Member Typedef Documentation

◆ DropRegions

Alias for dropping regions list

◆ GetDropRegionsFunction

using hdps::gui::DropWidget::GetDropRegionsFunction = std::function<DropRegions(const QMimeData*)>

Function for obtaining a list of available drop regions

Constructor & Destructor Documentation

◆ DropWidget()

hdps::gui::DropWidget::DropWidget ( QWidget *  parent)

Constructor

Parameters
parentParent widget

Member Function Documentation

◆ eventFilter()

bool hdps::gui::DropWidget::eventFilter ( QObject *  target,
QEvent *  event 
)
override

Respond to target events

Parameters
targetObject of which an event occurred
eventThe event that took place

◆ getShowDropIndicator()

bool hdps::gui::DropWidget::getShowDropIndicator ( ) const

Get/set whether to show the drop indicator widget

◆ initialize()

void hdps::gui::DropWidget::initialize ( const GetDropRegionsFunction getDropRegions)

Initialize the drop widget

Parameters
getDropRegionsFunction that (based on mime data) returns a list of drop regions

◆ setDropIndicatorWidget()

void hdps::gui::DropWidget::setDropIndicatorWidget ( QWidget *  dropIndicatorWidget)

Sets the drop indicator widget

Parameters
dropIndicatorWidgetDrop indicator widget

◆ setShowDropIndicator()

void hdps::gui::DropWidget::setShowDropIndicator ( const bool &  showDropIndicator)

Member Data Documentation

◆ _dropIndicatorWidget

QWidget* hdps::gui::DropWidget::_dropIndicatorWidget
protected

Whether to show a drop indicator widget overlay

◆ _getDropRegionsFunction

GetDropRegionsFunction hdps::gui::DropWidget::_getDropRegionsFunction
protected

◆ _showDropIndicator

bool hdps::gui::DropWidget::_showDropIndicator
protected

Function that (based on mime data) returns a list of drop regions


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