wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
ICDropZone.h
Go to the documentation of this file.
1// Copyright 2015 - 2026, GIBIS-UNIFESP and the wiRedPanda contributors
2// SPDX-License-Identifier: GPL-3.0-or-later
3
7
8#pragma once
9
10#include <QWidget>
11
12class QLabel;
13
22class ICDropZone : public QWidget
23{
24 Q_OBJECT
25
26public:
28 enum class Section {
31 };
32
34 explicit ICDropZone(Section section, QWidget *parent = nullptr);
35
36signals:
38 void embedByFileRequested(const QString &fileName);
39
41 void extractByBlobNameRequested(const QString &blobName);
42
43protected:
45 void dragEnterEvent(QDragEnterEvent *event) override;
47 void dragMoveEvent(QDragMoveEvent *event) override;
49 void dragLeaveEvent(QDragLeaveEvent *event) override;
51 void dropEvent(QDropEvent *event) override;
53 void resizeEvent(QResizeEvent *event) override;
54
55private:
57 void setHintVisible(bool visible);
58
59 Section m_section;
60 QLabel *m_hintOverlay = nullptr;
61};
void dragMoveEvent(QDragMoveEvent *event) override
void extractByBlobNameRequested(const QString &blobName)
Emitted when an embedded IC is dropped onto the file-based section.
Section
Identifies which IC palette section this zone belongs to.
Definition ICDropZone.h:28
@ Embedded
The embedded IC section (accepts file-backed drops for embedding).
Definition ICDropZone.h:30
@ FileBased
The file-backed IC section (accepts embedded drops for extraction).
Definition ICDropZone.h:29
void embedByFileRequested(const QString &fileName)
Emitted when a file-based IC is dropped onto the embedded section.
void dragEnterEvent(QDragEnterEvent *event) override
ICDropZone(Section section, QWidget *parent=nullptr)
Constructs a drop zone for the given palette section.
void dropEvent(QDropEvent *event) override
void dragLeaveEvent(QDragLeaveEvent *event) override
void resizeEvent(QResizeEvent *event) override