wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
SceneDropHandler.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 <optional>
11
12#include <QPointF>
13
14class QGraphicsSceneDragDropEvent;
15class QMimeData;
16class Scene;
17
29{
30public:
31 explicit SceneDropHandler(Scene *scene);
32
34 static bool isSupportedDropFormat(const QMimeData *mimeData);
35
37 void handleNewElementDrop(QGraphicsSceneDragDropEvent *event);
38
40 void handleCloneDrag(QGraphicsSceneDragDropEvent *event);
41
45 void addFromMimeData(QMimeData *mimeData, std::optional<QPointF> scenePos = std::nullopt);
46
47private:
48 Scene *m_scene;
49};
SceneDropHandler(Scene *scene)
static bool isSupportedDropFormat(const QMimeData *mimeData)
Returns true if mimeData carries any recognised wiRedPanda drop format.
void handleCloneDrag(QGraphicsSceneDragDropEvent *event)
Re-instantiates a clone-dragged selection at the drop position.
void handleNewElementDrop(QGraphicsSceneDragDropEvent *event)
Builds a new element from a palette drag payload and adds it under the cursor.
void addFromMimeData(QMimeData *mimeData, std::optional< QPointF > scenePos=std::nullopt)
Main circuit editing scene.
Definition Scene.h:56