diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kounavail | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kounavail')
-rw-r--r-- | kounavail/kounavail.cc | 46 | ||||
-rw-r--r-- | kounavail/kounavail.h | 53 |
2 files changed, 51 insertions, 48 deletions
diff --git a/kounavail/kounavail.cc b/kounavail/kounavail.cc index a704eea4..21af38c7 100644 --- a/kounavail/kounavail.cc +++ b/kounavail/kounavail.cc @@ -19,8 +19,8 @@ #include "kounavail.h" -#include <qpainter.h> -#include <qiconset.h> +#include <tqpainter.h> +#include <tqiconset.h> #include <kaction.h> #include <kinstance.h> #include <kstdaction.h> @@ -28,26 +28,26 @@ #include <kaboutdata.h> #include <kdebug.h> #include <kglobalsettings.h> -#include <qapplication.h> +#include <tqapplication.h> -KoUnavailPart::KoUnavailPart( QWidget *parentWidget, const char *widgetName, QObject* parent, const char* name ) - : KoDocument( parentWidget, widgetName, parent, name, false /*singleViewMode*/ ) +KoUnavailPart::KoUnavailPart( TQWidget *tqparentWidget, const char *widgetName, TQObject* tqparent, const char* name ) + : KoDocument( tqparentWidget, widgetName, tqparent, name, false /*singleViewMode*/ ) { setReadWrite( false ); } -KoView* KoUnavailPart::createViewInstance( QWidget* parent, const char* name ) +KoView* KoUnavailPart::createViewInstance( TQWidget* tqparent, const char* name ) { - return new KoUnavailView( this, parent, name ); + return new KoUnavailView( this, tqparent, name ); } -bool KoUnavailPart::loadOasis( const QDomDocument& doc, KoOasisStyles&, const QDomDocument&, KoStore* ) +bool KoUnavailPart::loadOasis( const TQDomDocument& doc, KoOasisStyles&, const TQDomDocument&, KoStore* ) { m_doc = doc; return true; } -bool KoUnavailPart::loadXML( QIODevice *, const QDomDocument &doc ) +bool KoUnavailPart::loadXML( TQIODevice *, const TQDomDocument &doc ) { // Simply keep a copy of the whole document ;) m_doc = doc; @@ -62,7 +62,7 @@ bool KoUnavailPart::saveFile() return true; } -QDomDocument KoUnavailPart::saveXML() +TQDomDocument KoUnavailPart::saveXML() { kdDebug() << "KoUnavailPart::saveXML" << endl; return m_doc; @@ -75,17 +75,17 @@ bool KoUnavailPart::saveOasis(KoStore*, KoXmlWriter*) return false; } -void KoUnavailPart::setMimeType( const QCString& mime ) +void KoUnavailPart::setMimeType( const TQCString& mime ) { kdDebug() << "KoUnavailPart::setMimeType " << mime << endl; m_mimetype = mime; } -void KoUnavailPart::paintContent( QPainter& painter, const QRect& rect, bool /*transparent*/, +void KoUnavailPart::paintContent( TQPainter& painter, const TQRect& rect, bool /*transparent*/, double /*zoomX*/, double /*zoomY*/ ) { painter.save(); - painter.setPen( QApplication::palette().color( QPalette::Active, QColorGroup::Text ) ); + painter.setPen( TQApplication::palette().color( TQPalette::Active, TQColorGroup::Text ) ); // Need to draw only the document rectangle described in the parameter rect. int left = rect.left() / 20; int right = rect.right() / 20 + 1; @@ -97,24 +97,24 @@ void KoUnavailPart::paintContent( QPainter& painter, const QRect& rect, bool /*t for( int y = left; y < right; ++y ) painter.drawLine( left * 20, y * 20, right * 20, y * 20 ); - QFont defaultFont = KGlobalSettings::generalFont(); + TQFont defaultFont = KGlobalSettings::generalFont(); defaultFont.setPointSize( 16 ); // ### painter.setFont( defaultFont ); //painter.drawText( 20, 20, m_reason ); - painter.drawText( rect, Qt::AlignCenter | Qt::WordBreak, m_reason ); + painter.drawText( rect, TQt::AlignCenter | TQt::WordBreak, m_reason ); painter.restore(); } -KoUnavailView::KoUnavailView( KoUnavailPart* part, QWidget* parent, const char* name ) - : KoView( part, parent, name ) +KoUnavailView::KoUnavailView( KoUnavailPart* part, TQWidget* tqparent, const char* name ) + : KoView( part, tqparent, name ) { setInstance( KoUnavailFactory::global() ); //setXMLFile( "kounavail.rc" ); } -void KoUnavailView::paintEvent( QPaintEvent* ev ) +void KoUnavailView::paintEvent( TQPaintEvent* ev ) { - QPainter painter; + TQPainter painter; painter.begin( this ); // ### TODO: Scaling @@ -130,8 +130,8 @@ K_EXPORT_COMPONENT_FACTORY( libkounavailpart, KoUnavailFactory ) KInstance* KoUnavailFactory::s_global = 0L; KAboutData* KoUnavailFactory::s_aboutData = 0L; -KoUnavailFactory::KoUnavailFactory( QObject* parent, const char* name ) - : KoFactory( parent, name ) +KoUnavailFactory::KoUnavailFactory( TQObject* tqparent, const char* name ) + : KoFactory( tqparent, name ) { global(); } @@ -144,9 +144,9 @@ KoUnavailFactory::~KoUnavailFactory() s_global = 0L; } -KParts::Part* KoUnavailFactory::createPartObject( QWidget *parentWidget, const char *widgetName, QObject* parent, const char* name, const char*, const QStringList & ) +KParts::Part* KoUnavailFactory::createPartObject( TQWidget *tqparentWidget, const char *widgetName, TQObject* tqparent, const char* name, const char*, const TQStringList & ) { - return new KoUnavailPart( parentWidget, widgetName, parent, name ); + return new KoUnavailPart( tqparentWidget, widgetName, tqparent, name ); } KAboutData* KoUnavailFactory::aboutData() diff --git a/kounavail/kounavail.h b/kounavail/kounavail.h index dab3a002..1dbe522d 100644 --- a/kounavail/kounavail.h +++ b/kounavail/kounavail.h @@ -25,47 +25,48 @@ class KoUnavailPart : public KoDocument { Q_OBJECT - Q_PROPERTY( QCString mimetype READ nativeFormatMimeType WRITE setMimeType ) - Q_PROPERTY( QString unavailReason READ unavailReason WRITE setUnavailReason ) - Q_PROPERTY( QString realURL READ realURL WRITE setRealURL ) + TQ_OBJECT + TQ_PROPERTY( TQCString mimetype READ nativeFormatMimeType WRITE setMimeType ) + TQ_PROPERTY( TQString unavailReason READ unavailReason WRITE setUnavailReason ) + TQ_PROPERTY( TQString realURL READ realURL WRITE setRealURL ) public: - KoUnavailPart( QWidget *parentWidget = 0, const char *widgetName = 0, QObject* parent = 0, const char* name = 0 ); + KoUnavailPart( TQWidget *tqparentWidget = 0, const char *widgetName = 0, TQObject* tqparent = 0, const char* name = 0 ); - virtual void paintContent( QPainter& painter, const QRect& rect, bool transparent = FALSE, double zoomX = 1.0, double zoomY = 1.0 ); + virtual void paintContent( TQPainter& painter, const TQRect& rect, bool transparent = FALSE, double zoomX = 1.0, double zoomY = 1.0 ); - virtual bool initDoc(InitDocFlags, QWidget* = 0) { return true; } - virtual bool loadOasis( const QDomDocument& doc, KoOasisStyles& oasisStyles, const QDomDocument& settings, KoStore* ); + virtual bool initDoc(InitDocFlags, TQWidget* = 0) { return true; } + virtual bool loadOasis( const TQDomDocument& doc, KoOasisStyles& oasisStyles, const TQDomDocument& settings, KoStore* ); virtual bool saveOasis(KoStore*, KoXmlWriter*); - virtual bool loadXML( QIODevice *, const QDomDocument & ); + virtual bool loadXML( TQIODevice *, const TQDomDocument & ); virtual bool saveFile(); - virtual QDomDocument saveXML(); + virtual TQDomDocument saveXML(); virtual bool saveChildren( KoStore* /*_store*/ ) { return true; } /** This is called by KoDocumentChild::save */ - virtual QCString nativeFormatMimeType() const { return m_mimetype; } + virtual TQCString nativeFormatMimeType() const { return m_mimetype; } /** This is called by KoDocumentChild::createUnavailDocument */ - void setMimeType( const QCString& mime ); + void setMimeType( const TQCString& mime ); // keep in sync with koDocumentChild.h enum UnavailReason { DocumentNotFound, HandlerNotFound }; /** This is called by KoDocumentChild::createUnavailDocument */ - void setUnavailReason( const QString& reason ) { m_reason = reason; } - // stupid moc - I want a write-only property ! - QString unavailReason() const { return m_reason; } + void setUnavailReason( const TQString& reason ) { m_reason = reason; } + // stupid tqmoc - I want a write-only property ! + TQString unavailReason() const { return m_reason; } /** This is called by KoDocumentChild::createUnavailDocument * Note the trick: we directly modify the URL of the document, * the one returned by KPart's url() */ - void setRealURL( const QString& u ) { m_url = u; } - // stupid moc again - QString realURL() const { return m_url.url(); } + void setRealURL( const TQString& u ) { m_url = u; } + // stupid tqmoc again + TQString realURL() const { return m_url.url(); } protected: - virtual KoView* createViewInstance( QWidget* parent, const char* name ); + virtual KoView* createViewInstance( TQWidget* tqparent, const char* name ); - QDomDocument m_doc; - QCString m_mimetype; - QString m_reason; + TQDomDocument m_doc; + TQCString m_mimetype; + TQString m_reason; }; #include <KoView.h> @@ -73,11 +74,12 @@ protected: class KoUnavailView : public KoView { Q_OBJECT + TQ_OBJECT public: - KoUnavailView( KoUnavailPart* part, QWidget* parent = 0, const char* name = 0 ); + KoUnavailView( KoUnavailPart* part, TQWidget* tqparent = 0, const char* name = 0 ); protected: - virtual void paintEvent( QPaintEvent* ); + virtual void paintEvent( TQPaintEvent* ); virtual void updateReadWrite( bool ) {} }; @@ -89,11 +91,12 @@ class KAboutData; class KoUnavailFactory : public KoFactory { Q_OBJECT + TQ_OBJECT public: - KoUnavailFactory( QObject* parent = 0, const char* name = 0 ); + KoUnavailFactory( TQObject* tqparent = 0, const char* name = 0 ); ~KoUnavailFactory(); - virtual KParts::Part *createPartObject( QWidget *parentWidget = 0, const char *widgetName = 0, QObject *parent = 0, const char *name = 0, const char *classname = "KoDocument", const QStringList &args = QStringList() ); + virtual KParts::Part *createPartObject( TQWidget *tqparentWidget = 0, const char *widgetName = 0, TQObject *tqparent = 0, const char *name = 0, const char *classname = "KoDocument", const TQStringList &args = TQStringList() ); static KInstance* global(); |