Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4QtBaseWidgets/TGo4QLineEdit.cpp

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 
00017 
00018 #include "TGo4QLineEdit.h"
00019 TGo4QLineEdit::TGo4QLineEdit(QWidget *parent, const char *name)
00020    :QLineEdit( parent, name )
00021 {
00022    setAcceptDrops( TRUE );
00023    RemoteDrop=FALSE;
00024 }
00025 void TGo4QLineEdit::dropEvent( QDropEvent *e )
00026 {
00027     if(strcmp(e->source()->name(),"ListViewRemote")==0){
00028       RemoteDrop=TRUE;
00029    }else if(strcmp(e->source()->name(),"FileListView")==0){
00030       RemoteDrop=FALSE;
00031    }
00032    clear();
00033    QString str;
00034     QCString plain = "plain";
00035 
00036     // try text/plain
00037     bool decoded = QTextDrag::decode(e, str, plain);
00038     // otherwise we'll accept any kind of text (like text/uri-list)
00039     if (! decoded) decoded = QTextDrag::decode(e, str);
00040 
00041    insert( str );
00042    DropedString=str;
00043    e->acceptAction();
00044 
00045 
00046 }
00047 void TGo4QLineEdit::dragEnterEvent( QDragEnterEvent *Event)
00048 {
00049     if ( QTextDrag::canDecode( Event )){
00050         Event->accept();
00051     }
00052 }
00053 bool TGo4QLineEdit::IsRemoteDrop()
00054 {
00055    return RemoteDrop;
00056 }
00057 TGo4QLineEdit::~TGo4QLineEdit(){}
00058 
00059 
00060 
00061 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:56:04 2005 for Go4-v2.10-5 by doxygen1.2.15