wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
ICDropZone Class Reference

Drop zone widget that accepts opposite-type IC label drops. More...

#include <ICDropZone.h>

Inheritance diagram for ICDropZone:
[legend]

Public Types

enum class  Section { FileBased , Embedded }
 Identifies which IC palette section this zone belongs to. More...

Public Member Functions

void embedByFileRequested (const QString &fileName)
 Emitted when a file-based IC is dropped onto the embedded section.
void extractByBlobNameRequested (const QString &blobName)
 Emitted when an embedded IC is dropped onto the file-based section.
 ICDropZone (Section section, QWidget *parent=nullptr)
 Constructs a drop zone for the given palette section.

Protected Member Functions

void dragEnterEvent (QDragEnterEvent *event) override
void dragLeaveEvent (QDragLeaveEvent *event) override
void dragMoveEvent (QDragMoveEvent *event) override
void dropEvent (QDropEvent *event) override
void resizeEvent (QResizeEvent *event) override

Detailed Description

Drop zone widget that accepts opposite-type IC label drops.

Used in the IC palette to enable cross-section drag-and-drop: dropping a file-based IC onto the embedded section triggers embedding, and dropping an embedded IC onto the file-based section triggers extraction.

Definition at line 22 of file ICDropZone.h.

Member Enumeration Documentation

◆ Section

enum class ICDropZone::Section
strong

Identifies which IC palette section this zone belongs to.

Enumerator
FileBased 

The file-backed IC section (accepts embedded drops for extraction).

Embedded 

The embedded IC section (accepts file-backed drops for embedding).

Definition at line 28 of file ICDropZone.h.

Constructor & Destructor Documentation

◆ ICDropZone()

ICDropZone::ICDropZone ( Section section,
QWidget * parent = nullptr )
explicit

Constructs a drop zone for the given palette section.

Definition at line 40 of file ICDropZone.cpp.

References Embedded.

Member Function Documentation

◆ dragEnterEvent()

void ICDropZone::dragEnterEvent ( QDragEnterEvent * event)
overrideprotected
Reimplemented from base class.

Definition at line 82 of file ICDropZone.cpp.

References Embedded, and FileBased.

◆ dragLeaveEvent()

void ICDropZone::dragLeaveEvent ( QDragLeaveEvent * event)
overrideprotected
Reimplemented from base class. — hides the drop hint when the drag leaves without dropping.

Definition at line 102 of file ICDropZone.cpp.

◆ dragMoveEvent()

void ICDropZone::dragMoveEvent ( QDragMoveEvent * event)
overrideprotected
Reimplemented from base class.

Definition at line 97 of file ICDropZone.cpp.

◆ dropEvent()

void ICDropZone::dropEvent ( QDropEvent * event)
overrideprotected
Reimplemented from base class.

Definition at line 108 of file ICDropZone.cpp.

References embedByFileRequested(), Embedded, extractByBlobNameRequested(), and FileBased.

◆ embedByFileRequested()

void ICDropZone::embedByFileRequested ( const QString & fileName)

Emitted when a file-based IC is dropped onto the embedded section.

Referenced by dropEvent().

◆ extractByBlobNameRequested()

void ICDropZone::extractByBlobNameRequested ( const QString & blobName)

Emitted when an embedded IC is dropped onto the file-based section.

Referenced by dropEvent().

◆ resizeEvent()

void ICDropZone::resizeEvent ( QResizeEvent * event)
overrideprotected
Reimplemented from base class. — keeps the hint overlay covering the whole zone.

Definition at line 76 of file ICDropZone.cpp.


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