diff options
Diffstat (limited to 'examples3/dropsite.py')
-rw-r--r-- | examples3/dropsite.py | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/examples3/dropsite.py b/examples3/dropsite.py index 11d9707..523f7d0 100644 --- a/examples3/dropsite.py +++ b/examples3/dropsite.py @@ -6,21 +6,21 @@ from qt import * import secret -class DropSite(QLabel): +class DropSite(TQLabel): def __init__(self, parent=None, name=None): - QLabel.__init__( self, parent, name ) + TQLabel.__init__( self, parent, name ) self.setAcceptDrops(1) # this is a normal event def mousePressEvent( self, e ): if ( self.pixmap() ) : - drobj = QImageDrag( self.pixmap().convertToImage(), self ) - pm = QPixmap() + drobj = TQImageDrag( self.pixmap().convertToImage(), self ) + pm = TQPixmap() pm.convertFromImage(self.pixmap().convertToImage().smoothScale( self.pixmap().width()/3,self.pixmap().height()/3)) - drobj.setPixmap(pm,QPoint(-5,-7)) + drobj.setPixmap(pm,TQPoint(-5,-7)) else : - drobj = QTextDrag( self.text(), self ) + drobj = TQTextDrag( self.text(), self ) drobj.dragCopy() def backgroundColorChange( self, qcolor ): @@ -35,9 +35,9 @@ class DropSite(QLabel): def dragEnterEvent( self, e ): # Check if you want the drag... if (secret.canDecode( e ) or - QTextDrag.canDecode( e ) or - QImageDrag.canDecode( e ) or - QUriDrag.canDecode( e )): + TQTextDrag.canDecode( e ) or + TQImageDrag.canDecode( e ) or + TQUriDrag.canDecode( e )): e.accept() # Give the user some feedback... @@ -48,41 +48,41 @@ class DropSite(QLabel): t += "\n" t += str(e.format( i )) i += 1 - self.emit(PYSIGNAL('message(QString &)'), (QString(t),)) - self.setEraseColor(Qt.white) + self.emit(PYSIGNAL('message(TQString &)'), (TQString(t),)) + self.setEraseColor(TQt.white) - def dragLeaveEvent( self, QDragLeaveEvent ): + def dragLeaveEvent( self, TQDragLeaveEvent ): # Give the user some feedback... - self.emit(PYSIGNAL('message(QString &)'), (QString(''),)) - self.setEraseColor(Qt.lightGray) + self.emit(PYSIGNAL('message(TQString &)'), (TQString(''),)) + self.setEraseColor(TQt.lightGray) def dropEvent( self, e ): - self.setEraseColor(Qt.lightGray) + self.setEraseColor(TQt.lightGray) # Try to decode to the data you understand... - str = QString() - if ( QTextDrag.decode( e, str ) ) : + str = TQString() + if ( TQTextDrag.decode( e, str ) ) : self.setText( str ) self.setMinimumSize( self.minimumSize().expandedTo(self.sizeHint()) ) return - pm = QPixmap() - if ( QImageDrag.decode( e, pm ) ) : + pm = TQPixmap() + if ( TQImageDrag.decode( e, pm ) ) : self.setPixmap( pm ) self.setMinimumSize(self.minimumSize().expandedTo(self.sizeHint())) return - # QStrList strings - #strings = QStrList() + # TQStrList strings + #strings = TQStrList() strings = [] - if ( QUriDrag.decode( e, strings ) ) : - m = QString("Full URLs:\n") + if ( TQUriDrag.decode( e, strings ) ) : + m = TQString("Full URLs:\n") for u in strings: m = m + " " + u + '\n' - # QStringList files + # TQStringList files files = [] - if ( QUriDrag.decodeLocalFiles( e, files ) ) : + if ( TQUriDrag.decodeLocalFiles( e, files ) ) : m += "Files:\n" - # for (QStringList.Iterator i=files.begin() i!=files.end() ++i) + # for (TQStringList.Iterator i=files.begin() i!=files.end() ++i) for i in files: m = m + " " + i + '\n' self.setText( m ) |