Krita Source Code Documentation
Loading...
Searching...
No Matches
KoCanvasControllerWidgetViewport_p.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2006-2007 Thomas Zander <zander@kde.org>
3 * SPDX-FileCopyrightText: 2007-2010 Boudewijn Rempt <boud@valdyas.org>
4 *
5 * SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7
8#ifndef KOCANVASCONTROLLERWIDGETVIEWPORT_P_H
9#define KOCANVASCONTROLLERWIDGETVIEWPORT_P_H
10
11#include <QWidget>
12#include <QSize>
13#include <QPoint>
14
16class KoShape;
17
18class Viewport : public QWidget
19{
20 Q_OBJECT
21
22public:
23
24 explicit Viewport(KoCanvasControllerWidget *parent);
25 ~Viewport() override {}
26
27 void setCanvas(QWidget *canvas);
28 QWidget *canvas() const {
29 return m_canvas;
30 }
31
35 void resetLayout();
36
37public:
38
39 void handleDragEnterEvent(QDragEnterEvent *event);
40 void handleDropEvent(QDropEvent *event);
41 void handleDragMoveEvent(QDragMoveEvent *event);
42 void handleDragLeaveEvent(QDragLeaveEvent *event);
43 void handlePaintEvent(QPainter &gc, QPaintEvent *event);
44
45private:
46
47 QPointF correctPosition(const QPoint &point) const;
48 void repaint(KoShape *shape);
49
50
51
52private:
53
56 QWidget *m_canvas;
57};
58
59#endif
void handleDragEnterEvent(QDragEnterEvent *event)
void handleDragLeaveEvent(QDragLeaveEvent *event)
void handleDropEvent(QDropEvent *event)
KoCanvasControllerWidget * m_parent
Viewport(KoCanvasControllerWidget *parent)
void handleDragMoveEvent(QDragMoveEvent *event)
void setCanvas(QWidget *canvas)
QPointF correctPosition(const QPoint &point) const
void handlePaintEvent(QPainter &gc, QPaintEvent *event)