Qt 5.10 Book Examples
chapter29
WidgetDragAndDrop
Widget.h
Go to the documentation of this file.
1
// ======================================================================
2
// Widget.h
3
// ======================================================================
4
// This file is a part of the book
5
// "Qt 5.10 Professional programming with C++"
6
// http://qt-book.com
7
// ======================================================================
8
// Copyright (c) 2017 by Max Schlee
9
// ======================================================================
10
11
#pragma once
12
13
#include <QPoint>
14
#include <QLabel>
15
16
// ======================================================================
17
class
Widget
:
public
QLabel {
18
Q_OBJECT
19
private
:
20
QPoint m_ptDragPos;
21
22
void
startDrag();
23
24
protected
:
25
virtual
void
mousePressEvent
(QMouseEvent* );
26
virtual
void
mouseMoveEvent
(QMouseEvent* );
27
virtual
void
dragEnterEvent
(QDragEnterEvent*);
28
virtual
void
dropEvent
(QDropEvent* );
29
30
public
:
31
Widget
(QWidget* pwgt = 0);
32
};
33
Widget::dropEvent
virtual void dropEvent(QDropEvent *)
Definition:
Widget.cpp:59
Widget::mouseMoveEvent
virtual void mouseMoveEvent(QMouseEvent *)
Definition:
Widget.cpp:39
Widget::dragEnterEvent
virtual void dragEnterEvent(QDragEnterEvent *)
Definition:
Widget.cpp:51
Widget::mousePressEvent
virtual void mousePressEvent(QMouseEvent *)
Definition:
Widget.cpp:30
Widget
Definition:
Widget.h:17
Widget::Widget
Widget(QWidget *pwgt=0)
Definition:
Widget.cpp:16
Generated by
1.8.14