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 /example | |
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 'example')
-rw-r--r-- | example/example_factory.cc | 10 | ||||
-rw-r--r-- | example/example_factory.h | 5 | ||||
-rw-r--r-- | example/example_part.cc | 30 | ||||
-rw-r--r-- | example/example_part.h | 17 | ||||
-rw-r--r-- | example/example_view.cc | 18 | ||||
-rw-r--r-- | example/example_view.h | 7 |
6 files changed, 45 insertions, 42 deletions
diff --git a/example/example_factory.cc b/example/example_factory.cc index e3b46cf3..eaba7ee4 100644 --- a/example/example_factory.cc +++ b/example/example_factory.cc @@ -30,8 +30,8 @@ K_EXPORT_COMPONENT_FACTORY( libexamplepart, ExampleFactory ) KInstance* ExampleFactory::s_global = 0L; KAboutData* ExampleFactory::s_aboutData = 0L; -ExampleFactory::ExampleFactory( QObject* parent, const char* name ) - : KoFactory( parent, name ) +ExampleFactory::ExampleFactory( TQObject* tqparent, const char* name ) + : KoFactory( tqparent, name ) { global(); } @@ -44,14 +44,14 @@ ExampleFactory::~ExampleFactory() s_global = 0L; } -KParts::Part* ExampleFactory::createPartObject( QWidget *parentWidget, const char *widgetName, QObject* parent, const char* name, const char* classname, const QStringList & ) +KParts::Part* ExampleFactory::createPartObject( TQWidget *tqparentWidget, const char *widgetName, TQObject* tqparent, const char* name, const char* classname, const TQStringList & ) { // If classname is "KoDocument", our host is a koffice application // otherwise, the host wants us as a simple part, so switch to readonly and single view. bool bWantKoDocument = ( strcmp( classname, "KoDocument" ) == 0 ); - // parentWidget and widgetName are used by KoDocument for the "readonly+singleView" case. - ExamplePart *part = new ExamplePart( parentWidget, widgetName, parent, name, !bWantKoDocument ); + // tqparentWidget and widgetName are used by KoDocument for the "readonly+singleView" case. + ExamplePart *part = new ExamplePart( tqparentWidget, widgetName, tqparent, name, !bWantKoDocument ); if ( !bWantKoDocument ) part->setReadWrite( false ); diff --git a/example/example_factory.h b/example/example_factory.h index 1df86325..d7fa0e72 100644 --- a/example/example_factory.h +++ b/example/example_factory.h @@ -28,11 +28,12 @@ class KAboutData; class ExampleFactory : public KoFactory { Q_OBJECT + TQ_OBJECT public: - ExampleFactory( QObject* parent = 0, const char* name = 0 ); + ExampleFactory( TQObject* tqparent = 0, const char* name = 0 ); ~ExampleFactory(); - 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(); diff --git a/example/example_part.cc b/example/example_part.cc index e459040a..7d695a9b 100644 --- a/example/example_part.cc +++ b/example/example_part.cc @@ -21,15 +21,15 @@ #include "example_factory.h" #include "example_view.h" -#include <qpainter.h> +#include <tqpainter.h> -ExamplePart::ExamplePart( QWidget *parentWidget, const char *widgetName, QObject* parent, const char* name, bool singleViewMode ) - : KoDocument( parentWidget, widgetName, parent, name, singleViewMode ) +ExamplePart::ExamplePart( TQWidget *tqparentWidget, const char *widgetName, TQObject* tqparent, const char* name, bool singleViewMode ) + : KoDocument( tqparentWidget, widgetName, tqparent, name, singleViewMode ) { setInstance( ExampleFactory::global(), false ); } -bool ExamplePart::initDoc(InitDocFlags flags, QWidget* parentWidget) +bool ExamplePart::initDoc(InitDocFlags flags, TQWidget* tqparentWidget) { // If nothing is loaded, do initialize here // Most KOffice applications use the template dialog here, with code like: @@ -46,27 +46,27 @@ bool ExamplePart::initDoc(InitDocFlags flags, QWidget* parentWidget) return TRUE; } -KoView* ExamplePart::createViewInstance( QWidget* parent, const char* name ) +KoView* ExamplePart::createViewInstance( TQWidget* tqparent, const char* name ) { - return new ExampleView( this, parent, name ); + return new ExampleView( this, tqparent, name ); } -bool ExamplePart::loadXML( QIODevice *, const QDomDocument & ) +bool ExamplePart::loadXML( TQIODevice *, const TQDomDocument & ) { - // TODO load the document from the QDomDocument + // TODO load the document from the TQDomDocument return true; } -QDomDocument ExamplePart::saveXML() +TQDomDocument ExamplePart::saveXML() { - // TODO save the document into a QDomDocument - return QDomDocument(); + // TODO save the document into a TQDomDocument + return TQDomDocument(); } -bool ExamplePart::loadOasis( const QDomDocument & doc, KoOasisStyles& oasisStyles, - const QDomDocument & settings, KoStore* store ) +bool ExamplePart::loadOasis( const TQDomDocument & doc, KoOasisStyles& oasisStyles, + const TQDomDocument & settings, KoStore* store ) { - // TODO load the document from the QDomDocument + // TODO load the document from the TQDomDocument return true; } @@ -76,7 +76,7 @@ bool ExamplePart::saveOasis( KoStore* store, KoXmlWriter* manifestWriter ) return true; } -void ExamplePart::paintContent( QPainter& painter, const QRect& rect, bool /*transparent*/, +void ExamplePart::paintContent( TQPainter& painter, const TQRect& rect, bool /*transparent*/, double /*zoomX*/, double /*zoomY*/ ) { // ####### handle transparency diff --git a/example/example_part.h b/example/example_part.h index 5945f8e4..4b28e71a 100644 --- a/example/example_part.h +++ b/example/example_part.h @@ -25,22 +25,23 @@ class ExamplePart : public KoDocument { Q_OBJECT + TQ_OBJECT public: - ExamplePart( QWidget *parentWidget = 0, const char *widgetName = 0, QObject* parent = 0, const char* name = 0, bool singleViewMode = false ); + ExamplePart( TQWidget *tqparentWidget = 0, const char *widgetName = 0, TQObject* tqparent = 0, const char* name = 0, bool singleViewMode = false ); - 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 flags, QWidget* parentWidget=0); + virtual bool initDoc(InitDocFlags flags, TQWidget* tqparentWidget=0); - virtual bool loadXML( QIODevice *, const QDomDocument & ); - virtual QDomDocument saveXML(); + virtual bool loadXML( TQIODevice *, const TQDomDocument & ); + virtual TQDomDocument saveXML(); - virtual bool loadOasis( const QDomDocument & doc, KoOasisStyles& oasisStyles, - const QDomDocument & settings, KoStore* store ); + virtual bool loadOasis( const TQDomDocument & doc, KoOasisStyles& oasisStyles, + const TQDomDocument & settings, KoStore* store ); virtual bool saveOasis( KoStore* store, KoXmlWriter* manifestWriter ); protected: - virtual KoView* createViewInstance( QWidget* parent, const char* name ); + virtual KoView* createViewInstance( TQWidget* tqparent, const char* name ); }; #endif diff --git a/example/example_view.cc b/example/example_view.cc index 2e97a206..b23412c6 100644 --- a/example/example_view.cc +++ b/example/example_view.cc @@ -21,31 +21,31 @@ #include "example_factory.h" #include "example_part.h" -#include <qpainter.h> -#include <qiconset.h> +#include <tqpainter.h> +#include <tqiconset.h> #include <kaction.h> #include <kstdaction.h> #include <klocale.h> #include <kdebug.h> -ExampleView::ExampleView( ExamplePart* part, QWidget* parent, const char* name ) - : KoView( part, parent, name ) +ExampleView::ExampleView( ExamplePart* part, TQWidget* tqparent, const char* name ) + : KoView( part, tqparent, name ) { setInstance( ExampleFactory::global() ); if ( !part->isReadWrite() ) // readonly case, e.g. when embedded into konqueror setXMLFile( "example_readonly.rc" ); // simplified GUI else setXMLFile( "example.rc" ); - KStdAction::copy(this, SLOT( copy() ), actionCollection(), "copy" ); - KStdAction::cut(this, SLOT( cut() ), actionCollection(), "cut" ); + KStdAction::copy(this, TQT_SLOT( copy() ), actionCollection(), "copy" ); + KStdAction::cut(this, TQT_SLOT( cut() ), actionCollection(), "cut" ); // Note: Prefer KStdAction::* to any custom action if possible. - //m_cut = new KAction( i18n("&Cut"), "editcut", 0, this, SLOT( cut() ), + //m_cut = new KAction( i18n("&Cut"), "editcut", 0, this, TQT_SLOT( cut() ), // actionCollection(), "cut"); } -void ExampleView::paintEvent( QPaintEvent* ev ) +void ExampleView::paintEvent( TQPaintEvent* ev ) { - QPainter painter; + TQPainter painter; painter.begin( this ); // ### TODO: Scaling diff --git a/example/example_view.h b/example/example_view.h index 932af33a..3f4866f7 100644 --- a/example/example_view.h +++ b/example/example_view.h @@ -23,22 +23,23 @@ #include <KoView.h> class KAction; -class QPaintEvent; +class TQPaintEvent; class ExamplePart; class ExampleView : public KoView { Q_OBJECT + TQ_OBJECT public: - ExampleView( ExamplePart* part, QWidget* parent = 0, const char* name = 0 ); + ExampleView( ExamplePart* part, TQWidget* tqparent = 0, const char* name = 0 ); protected slots: void cut(); void copy(); protected: - void paintEvent( QPaintEvent* ); + void paintEvent( TQPaintEvent* ); virtual void updateReadWrite( bool readwrite ); |