GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
QGo4LineEdit.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
14#include "QGo4LineEdit.h"
15
16#include <QDropEvent>
17#include <QDragEnterEvent>
18#include <QMimeData>
19
20
21QGo4LineEdit::QGo4LineEdit(QWidget *parent, const char *name) :
22 QLineEdit(parent)
23{
24 setObjectName(name ? name : "Go4LineEdit");
25 setAcceptDrops( true );
26}
27
31
32void QGo4LineEdit::dragEnterEvent(QDragEnterEvent* event)
33{
34 if (event->mimeData()->hasText())
35 event->acceptProposedAction();
36}
37
38void QGo4LineEdit::dropEvent(QDropEvent* event)
39{
40 setText(event->mimeData()->text());
41 emit textDropped();
42}
void dropEvent(QDropEvent *) override
void dragEnterEvent(QDragEnterEvent *) override
virtual ~QGo4LineEdit()
QGo4LineEdit(QWidget *parent=nullptr, const char *name=nullptr)
void textDropped()