KQuickImageEditor

resizerectangle.h
1/*
2 * SPDX-FileCopyrightText: (C) 2020 Carl Schwan <carl@carlschwan.eu>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5 */
6
7#pragma once
8
9#include "resizehandle.h"
10
11#include <QQmlComponent>
12#include <QQuickItem>
13
14/// \deprecated
16{
18 QML_ELEMENT
19
20 Q_PROPERTY(qreal insideX READ insideX WRITE setInsideX NOTIFY insideXChanged)
21 Q_PROPERTY(qreal insideY READ insideY WRITE setInsideY NOTIFY insideYChanged)
22 Q_PROPERTY(qreal insideWidth READ insideWidth WRITE setInsideWidth NOTIFY insideWidthChanged)
23 Q_PROPERTY(qreal insideHeight READ insideHeight WRITE setInsideHeight NOTIFY insideHeightChanged)
24
25public:
26 explicit ResizeRectangle(QQuickItem *parent = nullptr);
27 ~ResizeRectangle() = default;
28
29 qreal insideX() const;
30 void setInsideX(qreal x);
31 qreal insideY() const;
32 void setInsideY(qreal y);
33 qreal insideWidth() const;
34 void setInsideWidth(qreal width);
35 qreal insideHeight() const;
36 void setInsideHeight(qreal height);
37
38 QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;
39
40protected:
41 void mouseReleaseEvent(QMouseEvent *event) override;
42 void mousePressEvent(QMouseEvent *event) override;
43 void mouseMoveEvent(QMouseEvent *event) override;
44 void mouseDoubleClickEvent(QMouseEvent *event) override;
45 void componentComplete() override;
46
48 /// Double click event signal
49 void acceptSize();
50 void insideXChanged();
51 void insideYChanged();
52 void insideWidthChanged();
53 void insideHeightChanged();
54 void handleComponentChanged();
55
56private:
57 void updateHandles();
58
59 qreal m_insideX;
60 qreal m_insideY;
61 qreal m_insideWidth;
62 qreal m_insideHeight;
63 QPointF m_mouseDownPosition;
64 QPointF m_mouseDownGeometry;
65 bool m_mouseClickedOnRectangle = false;
66 QQmlComponent *m_handleComponent = nullptr;
67 ResizeHandle *m_handleBottomLeft = nullptr;
68 ResizeHandle *m_handleBottomRight = nullptr;
69 ResizeHandle *m_handleTopLeft = nullptr;
70 ResizeHandle *m_handleTopRight = nullptr;
71};
void acceptSize()
Double click event signal.
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
virtual bool event(QEvent *ev) override
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:50:40 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.