GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
QGo4LineEdit.cpp
Go to the documentation of this file.
1 // $Id: QGo4LineEdit.cpp 2627 2019-10-01 08:02:45Z 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 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 
21 QGo4LineEdit::QGo4LineEdit(QWidget* parent, const char* name) :
22  QLineEdit(parent)
23 {
24  setObjectName(name ? name : "Go4LineEdit");
25  setAcceptDrops( true );
26 }
27 
29 {
30 }
31 
32 void QGo4LineEdit::dragEnterEvent(QDragEnterEvent* event)
33 {
34  if (event->mimeData()->hasText())
35  event->acceptProposedAction();
36 }
37 
38 void QGo4LineEdit::dropEvent(QDropEvent* event)
39 {
40  setText(event->mimeData()->text());
41  emit textDropped();
42 }
QGo4LineEdit(QWidget *parent=0, const char *name=0)
virtual void dropEvent(QDropEvent *)
void textDropped()
virtual ~QGo4LineEdit()
virtual void dragEnterEvent(QDragEnterEvent *)