Laser Cutter application v1.0

Public Member Functions | Protected Member Functions | Private Attributes | List of all members
DragWidget Class Reference

Custom Widget for drag&drop action. More...

`#include <dragwidget.h>`

Inheritance diagram for DragWidget:

## Public Member Functions
| DragWidget (QWidget *parent=nullptr)
| Default c'tor. More...
| ~DragWidget ()
| Default d'tor. More...
void | ClearWidget (bool flag)
| ClearWidget. More...

## Protected Member Functions
void | dragEnterEvent (QDragEnterEvent *event) override
| dragEnterEvent, overridden More...
void | dragMoveEvent (QDragMoveEvent *event) override
| dragMoveEvent, overridden More...
void | dropEvent (QDropEvent *event) override
| dropEvent, overridden More...
void | mousePressEvent (QMouseEvent *event) override
| mousePressEvent, overridden More...

## Private Attributes
QString | pathToImg

## Detailed Description

Custom Widget for drag&drop action.

Serves as a custom Widget for drag&drop action (between two instances). In the UI reffered to as image_source, image_destination

## Constructor & Destructor Documentation

## ◆ DragWidget()

DragWidget::DragWidget | ( | QWidget * | parent = `nullptr` | ) |

Default c'tor.

Creates a DragWidget instance on the parent Widget.

Parameters

  parent | Widget to be created on

## ◆ ~DragWidget()

DragWidget::~DragWidget | ( |  | ) |

Default d'tor.

## Member Function Documentation

## ◆ ClearWidget()

void DragWidget::ClearWidget | ( | bool | flag | ) |

ClearWidget.

## ◆ dragEnterEvent()

void DragWidget::dragEnterEvent | ( | QDragEnterEvent * | event | ) |
| override protected

dragEnterEvent, overridden

Checks for the mime-data of the object that triggered the event. Chooses whether to accept the event.

Parameters

  event | Event that triggers the method

## ◆ dragMoveEvent()

void DragWidget::dragMoveEvent | ( | QDragMoveEvent * | event | ) |
| override protected

dragMoveEvent, overridden

Checks for the mime-data of the object that triggered the event. Chooses whether to accept the event.

Parameters

  event | Event that triggers the method

## ◆ dropEvent()

void DragWidget::dropEvent | ( | QDropEvent * | event | ) |
| override protected

dropEvent, overridden

Extracts the data from mime-data and creates a new instance of SvgLabel class on the drop position with the source's pixmap and initializes some members of said SvgLabel instance

Parameters

  event | Event that triggers the method

## ◆ mousePressEvent()

void DragWidget::mousePressEvent | ( | QMouseEvent * | event | ) |
| override protected

mousePressEvent, overridden

Checks whether the event source is a child (SvgLabel). If not, deselects all the children. If so, sets the path to the image(which is later passed on to the child in the drop event) and initializes the start of the DragEvent process.

Parameters

  event | Event that triggers the method

## Member Data Documentation

## ◆ pathToImg

QString DragWidget::pathToImg
| private

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

- dragwidget.h
- dragwidget.cpp