diff options
Diffstat (limited to 'kivio/kiviopart/kiviodragobject.cpp')
-rw-r--r-- | kivio/kiviopart/kiviodragobject.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/kivio/kiviopart/kiviodragobject.cpp b/kivio/kiviopart/kiviodragobject.cpp index 811f4adb..35a6d7ff 100644 --- a/kivio/kiviopart/kiviodragobject.cpp +++ b/kivio/kiviopart/kiviodragobject.cpp @@ -19,12 +19,12 @@ #include "kiviodragobject.h" -#include <qcstring.h> -#include <qstringlist.h> -#include <qdom.h> -#include <qtextstream.h> -#include <qpixmap.h> -#include <qimage.h> +#include <tqcstring.h> +#include <tqstringlist.h> +#include <tqdom.h> +#include <tqtextstream.h> +#include <tqpixmap.h> +#include <tqimage.h> #include <kdebug.h> @@ -37,8 +37,8 @@ #include "kivio_doc.h" #include "kivio_stencil_spawner.h" -KivioDragObject::KivioDragObject(QWidget* dragSource, const char* name) - : QDragObject(dragSource, name) +KivioDragObject::KivioDragObject(TQWidget* dragSource, const char* name) + : TQDragObject(dragSource, name) { m_encodeMimeList[0] = "application/vnd.kde.kivio"; m_encodeMimeList[1] = "text/xml"; @@ -51,12 +51,12 @@ const char* KivioDragObject::format(int i) const return m_encodeMimeList[i]; } - QImageDrag id; - id.setImage(QImage()); // We need the format list!!! + TQImageDrag id; + id.setImage(TQImage()); // We need the format list!!! return id.format(i - NumEncodeFormats); } -QByteArray KivioDragObject::encodedData(const char* mimetype) const +TQByteArray KivioDragObject::tqencodedData(const char* mimetype) const { if((m_encodeMimeList[0] == mimetype) || (m_encodeMimeList[1] == mimetype)) @@ -66,16 +66,16 @@ QByteArray KivioDragObject::encodedData(const char* mimetype) const return imageEncoded(mimetype); } - return QByteArray(); + return TQByteArray(); } -bool KivioDragObject::canDecode(QMimeSource* e) +bool KivioDragObject::canDecode(TQMimeSource* e) { - QValueList<QCString> decodeMimeList; + TQValueList<TQCString> decodeMimeList; decodeMimeList.append("application/vnd.kde.kivio"); decodeMimeList.append("text/plain"); - for(QValueList<QCString>::Iterator it = decodeMimeList.begin(); it != decodeMimeList.end(); ++it) { + for(TQValueList<TQCString>::Iterator it = decodeMimeList.begin(); it != decodeMimeList.end(); ++it) { if(e->provides(*it)) { return true; } @@ -84,14 +84,14 @@ bool KivioDragObject::canDecode(QMimeSource* e) return false; } -bool KivioDragObject::decode(QMimeSource* e, QPtrList<KivioStencil>& sl, KivioPage* page) +bool KivioDragObject::decode(TQMimeSource* e, TQPtrList<KivioStencil>& sl, KivioPage* page) { bool ok = false; if(e->provides("application/vnd.kde.kivio")) { - QDomDocument doc("KivioSelection"); - QByteArray data = e->encodedData("application/vnd.kde.kivio"); - doc.setContent( QCString( data, data.size()+1 ) ); + TQDomDocument doc("KivioSelection"); + TQByteArray data = e->tqencodedData("application/vnd.kde.kivio"); + doc.setContent( TQCString( data, data.size()+1 ) ); KivioLayer l(page); ok = l.loadXML(doc.documentElement()); KivioStencil* stencil = l.stencilList()->first(); @@ -102,8 +102,8 @@ bool KivioDragObject::decode(QMimeSource* e, QPtrList<KivioStencil>& sl, KivioPa stencil = l.stencilList()->next(); } } else if(e->provides("text/plain")) { - QString str; - ok = QTextDrag::decode(e, str); + TQString str; + ok = TQTextDrag::decode(e, str); KivioStencilSpawner* ss = page->doc()->findInternalStencilSpawner("Dave Marotti - Text"); KivioStencil* stencil = ss->newStencil(); stencil->setPosition(0, 0); @@ -117,7 +117,7 @@ bool KivioDragObject::decode(QMimeSource* e, QPtrList<KivioStencil>& sl, KivioPa return ok; } -void KivioDragObject::setStencilList(QPtrList<KivioStencil> l) +void KivioDragObject::setStencilList(TQPtrList<KivioStencil> l) { KivioStencil* stencil = l.first(); m_stencilList.clear(); @@ -133,16 +133,16 @@ void KivioDragObject::setStencilRect(KoRect r) m_stencilRect = r; } -QByteArray KivioDragObject::kivioEncoded() const +TQByteArray KivioDragObject::kivioEncoded() const { if(m_stencilList.count() <= 0) - return QByteArray(); + return TQByteArray(); - QDomDocument doc("KivioSelection"); - QDomElement elem = doc.createElement( "KivioSelection" ); + TQDomDocument doc("KivioSelection"); + TQDomElement elem = doc.createElement( "KivioSelection" ); doc.appendChild(elem); KivioStencil *stencil = 0; - QPtrListIterator<KivioStencil> it(m_stencilList); + TQPtrListIterator<KivioStencil> it(m_stencilList); while((stencil = it.current()) != 0) { ++it; @@ -153,21 +153,21 @@ QByteArray KivioDragObject::kivioEncoded() const return doc.toCString(); } -QByteArray KivioDragObject::imageEncoded(const char* mimetype) const +TQByteArray KivioDragObject::imageEncoded(const char* mimetype) const { KoZoomHandler zoomHandler; zoomHandler.setZoomAndResolution(100, KoGlobal::dpiX(), KoGlobal::dpiY()); - QPixmap buffer(zoomHandler.zoomItX(m_stencilRect.width()), zoomHandler.zoomItY(m_stencilRect.height())); - buffer.fill(Qt::white); + TQPixmap buffer(zoomHandler.zoomItX(m_stencilRect.width()), zoomHandler.zoomItY(m_stencilRect.height())); + buffer.fill(TQt::white); KivioScreenPainter p; - p.start( &buffer ); + p.start( TQT_TQPAINTDEVICE(&buffer) ); p.setTranslation(-zoomHandler.zoomItX(m_stencilRect.x()), -zoomHandler.zoomItY(m_stencilRect.y())); KivioIntraStencilData data; data.painter = &p; data.zoomHandler = &zoomHandler; data.printing = true; KivioStencil *stencil = 0; - QPtrListIterator<KivioStencil> it(m_stencilList); + TQPtrListIterator<KivioStencil> it(m_stencilList); while((stencil = it.current()) != 0) { ++it; @@ -176,9 +176,9 @@ QByteArray KivioDragObject::imageEncoded(const char* mimetype) const p.stop(); - QImageDrag id; + TQImageDrag id; id.setImage(buffer.convertToImage()); - return id.encodedData(mimetype); + return id.tqencodedData(mimetype); } #include "kiviodragobject.moc" |