GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
QGo4BrowserTreeWidget.cpp
Go to the documentation of this file.
1// $Id$
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 fuer 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
15
16#include <QDropEvent>
17#include <QDrag>
18
20 QTreeWidget(parent)
21{
22}
23
27
29{
30 QStringList qstrList;
31 qstrList.append("text");
32 return qstrList;
33}
34
36{
37 // returns what actions are supported when dropping
38 return Qt::CopyAction | Qt::MoveAction;
39}
40
41bool QGo4BrowserTreeWidget::dropMimeData(QTreeWidgetItem *item, int, const QMimeData *data, Qt::DropAction)
42{
43 emit ItemDropProcess((void *)item, (void *)data);
44
45 return true;
46}
47
49{
50 // if not left button - return
51 if (event->buttons() & Qt::LeftButton) {
52 QDrag *drag = nullptr;
53 // request from browser drag
54 emit RequestDragObject(&drag);
55
56 if (drag)
57 drag->exec(Qt::CopyAction | Qt::MoveAction);
58 }
59}
void RequestDragObject(QDrag **)
QGo4BrowserTreeWidget(QWidget *parent=nullptr)
Qt::DropActions supportedDropActions() const override
void ItemDropProcess(void *, void *)
QStringList mimeTypes() const override
bool dropMimeData(QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action) override
void mouseMoveEvent(QMouseEvent *event) override