Sayonara Player
Loading...
Searching...
No Matches
src
Gui
Utils
Widgets
Dragable.h
1
/* Dragable.h */
2
3
/* Copyright (C) 2011-2024 Michael Lugmair (Lucio Carreras)
4
*
5
* This file is part of sayonara player
6
*
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
*/
20
21
#ifndef DRAGGABLE_H
22
#define DRAGGABLE_H
23
24
#include "Utils/Pimpl.h"
25
#include <QObject>
26
27
class
QPoint;
28
class
QPixmap;
29
class
QMimeData;
30
class
QWidget;
31
class
QDrag;
32
class
QMouseEvent;
33
class
QAbstractItemView;
34
35
namespace
Gui
36
{
37
class
Dragable;
38
class
DragableConnector
:
39
public
QObject
40
{
41
friend
class
Dragable
;
42
43
Q_OBJECT
44
PIMPL(
DragableConnector
)
45
46
private
:
47
DragableConnector
(QAbstractItemView* widget,
Dragable
* dragable);
48
~DragableConnector
()
override
;
49
50
private
slots:
51
void
mousePressed(QMouseEvent* e);
52
void
mouseMoved(QMouseEvent* e);
53
54
void
dragDestroyed();
55
};
56
61
class
Dragable
62
{
63
PIMPL(
Dragable
)
64
friend
class
DragableConnector
;
65
66
public
:
67
explicit
Dragable
(QAbstractItemView* parent);
68
virtual
~Dragable
();
69
70
enum class
ReleaseReason :
71
char
72
{
73
Dropped,
74
Destroyed
75
};
76
77
private
:
78
QDrag* createDrag()
const
;
79
QDrag* moveDrag(
const
QPoint& p);
80
void
startDrag(
const
QPoint& p);
81
void
releaseDrag();
82
83
protected
:
84
virtual
bool
isValidDragPosition(
const
QPoint& p)
const
;
85
virtual
bool
hasDragLabel()
const
;
86
virtual
QString dragLabel()
const
;
87
};
88
}
89
90
#endif
// DRAGGABLE_H
Gui::DragableConnector
Definition
Dragable.h:40
Gui::Dragable
The Dragable class.
Definition
Dragable.h:62
Generated on Fri Apr 25 2025 00:00:00 for Sayonara Player by
1.10.0