QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
diagrameventaddimage.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2026 The QElectroTech Team
3 This file is part of QElectroTech.
4
5 QElectroTech is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9
10 QElectroTech is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef DIAGRAMEVENTADDIMAGE_H
19#define DIAGRAMEVENTADDIMAGE_H
20
22
23#include <QPointF>
24
25class Diagram;
27
33{
34 Q_OBJECT
35
36 public:
38 ~DiagramEventAddImage() override;
39
40 void mousePressEvent (QGraphicsSceneMouseEvent *event) override;
41 void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override;
42 void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override;
43 void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override;
44 void wheelEvent (QGraphicsSceneWheelEvent *event) override;
45
46 bool isNull () const;
47 private:
48 void openDialog();
49 void showHint() const;
50
53 bool m_pressed = false; // left button held: dragging out a size, not just positioning
54 bool m_resize_engaged = false; // latched once the drag threshold is crossed, matching the pen tool's own curve-drag threshold convention -- so dragging out and back near the start point doesn't "snap back" to original size before release
55 QPointF m_press_pos; // scene position of the left-button press, the resize anchor
56};
57
58#endif // DIAGRAMEVENTADDIMAGE_H
void showHint() const
DiagramEventAddImage::showHint Re-asserted on every move (see mouseMoveEvent), not just once at activ...
Definition diagrameventaddimage.cpp:89
bool m_is_added
Definition diagrameventaddimage.h:52
QPointF m_press_pos
Definition diagrameventaddimage.h:55
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override
DiagramEventAddImage::mouseDoubleClickEvent This method is used only to overwrite double click....
Definition diagrameventaddimage.cpp:227
bool isNull() const
DiagramEventAddImage::isNull.
Definition diagrameventaddimage.cpp:262
bool m_resize_engaged
Definition diagrameventaddimage.h:54
void openDialog()
DiagramEventAddImage::openDialog Open dialog to select the image to add.
Definition diagrameventaddimage.cpp:272
void wheelEvent(QGraphicsSceneWheelEvent *event) override
DiagramEventAddImage::wheelEvent Action when mouse wheel is rotated.
Definition diagrameventaddimage.cpp:236
DiagramImageItem * m_image
Definition diagrameventaddimage.h:51
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
DiagramEventAddImage::mouseReleaseEvent Left button release commits whatever mouseMoveEvent last set ...
Definition diagrameventaddimage.cpp:205
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
DiagramEventAddImage::mouseMoveEvent Action when mouse move.
Definition diagrameventaddimage.cpp:130
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
DiagramEventAddImage::mousePressEvent Left button: starts a potential drag-to-resize,...
Definition diagrameventaddimage.cpp:109
bool m_pressed
Definition diagrameventaddimage.h:53
~DiagramEventAddImage() override
DiagramEventAddImage::~DiagramEventAddImage.
Definition diagrameventaddimage.cpp:56
DiagramEventAddImage(Diagram *diagram)
DiagramEventAddImage::DiagramEventAddImage Default constructor.
Definition diagrameventaddimage.cpp:35
DiagramEventInterface(Diagram *diagram)
Definition diagrameventinterface.cpp:25
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:54
Definition diagramimageitem.h:40