GSI Object Oriented Online Offline (Go4)
GO4-5.3.2
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
qt4
Go4GUI
QGo4BrowserTreeWidget.cpp
Go to the documentation of this file.
1
// $Id: QGo4BrowserTreeWidget.cpp 1134 2014-01-22 14:53:40Z linev $
2
//-----------------------------------------------------------------------
3
// The GSI Online Offline Object Oriented (Go4) Project
4
// Experiment Data Processing at EE department, GSI
5
//-----------------------------------------------------------------------
6
// Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7
// Planckstr. 1, 64291 Darmstadt, Germany
8
// Contact: http://go4.gsi.de
9
//-----------------------------------------------------------------------
10
// This software can be used under the license agreements as stated
11
// in Go4License.txt file which is part of the distribution.
12
//-----------------------------------------------------------------------
13
14
#include "
QGo4BrowserTreeWidget.h
"
15
16
#include <QDropEvent>
17
#include <QDrag>
18
19
QGo4BrowserTreeWidget::QGo4BrowserTreeWidget
(QWidget* parent) :
20
QTreeWidget(parent)
21
{
22
}
23
24
QGo4BrowserTreeWidget::~QGo4BrowserTreeWidget
()
25
{
26
}
27
28
QStringList
QGo4BrowserTreeWidget::mimeTypes
()
const
29
{
30
QStringList qstrList;
31
qstrList.append(
"text"
);
32
return
qstrList;
33
}
34
35
Qt::DropActions
QGo4BrowserTreeWidget::supportedDropActions
()
const
36
{
37
// returns what actions are supported when dropping
38
return
Qt::CopyAction | Qt::MoveAction;
39
}
40
41
bool
QGo4BrowserTreeWidget::dropMimeData
(QTreeWidgetItem *item,
int
,
const
QMimeData *data, Qt::DropAction)
42
{
43
emit
ItemDropProcess
((
void
*)item, (
void
*)data);
44
45
return
true
;
46
}
47
48
void
QGo4BrowserTreeWidget::mouseMoveEvent
(QMouseEvent *event)
49
{
50
// if not left button - return
51
if
(event->buttons() & Qt::LeftButton) {
52
QDrag *drag = 0;
53
// request from browser drag
54
emit
RequestDragObject
(&drag);
55
56
if
(drag)
57
drag->start(Qt::CopyAction | Qt::MoveAction);
58
}
59
}
QGo4BrowserTreeWidget::ItemDropProcess
void ItemDropProcess(void *, void *)
QGo4BrowserTreeWidget::mimeTypes
virtual QStringList mimeTypes() const
Definition:
QGo4BrowserTreeWidget.cpp:28
QGo4BrowserTreeWidget::dropMimeData
virtual bool dropMimeData(QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action)
Definition:
QGo4BrowserTreeWidget.cpp:41
QGo4BrowserTreeWidget::mouseMoveEvent
virtual void mouseMoveEvent(QMouseEvent *event)
Definition:
QGo4BrowserTreeWidget.cpp:48
QGo4BrowserTreeWidget::supportedDropActions
virtual Qt::DropActions supportedDropActions() const
Definition:
QGo4BrowserTreeWidget.cpp:35
QGo4BrowserTreeWidget::RequestDragObject
void RequestDragObject(QDrag **)
QGo4BrowserTreeWidget.h
QGo4BrowserTreeWidget::QGo4BrowserTreeWidget
QGo4BrowserTreeWidget(QWidget *parent=0)
Definition:
QGo4BrowserTreeWidget.cpp:19
QGo4BrowserTreeWidget::~QGo4BrowserTreeWidget
virtual ~QGo4BrowserTreeWidget()
Definition:
QGo4BrowserTreeWidget.cpp:24
Generated on Fri Oct 26 2018 08:34:54 for GSI Object Oriented Online Offline (Go4) by
1.8.8