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 /kword/KWInsertPicDia.cpp | |
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 'kword/KWInsertPicDia.cpp')
-rw-r--r-- | kword/KWInsertPicDia.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/kword/KWInsertPicDia.cpp b/kword/KWInsertPicDia.cpp index df29e330..a8b6ee49 100644 --- a/kword/KWInsertPicDia.cpp +++ b/kword/KWInsertPicDia.cpp @@ -18,12 +18,12 @@ * Boston, MA 02110-1301, USA. */ -#include <qpainter.h> -#include <qpushbutton.h> -#include <qbitmap.h> -#include <qlayout.h> -#include <qcheckbox.h> -#include <qscrollview.h> +#include <tqpainter.h> +#include <tqpushbutton.h> +#include <tqbitmap.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqscrollview.h> #include <kdebug.h> #include <klocale.h> @@ -36,18 +36,18 @@ #include "KWDocument.h" #include "KWInsertPicDia.h" -#include <qtimer.h> +#include <tqtimer.h> /** * This is the preview that appears on the right of the "Insert picture" dialog. * Not to be confused with KoPictureFilePreview, the one inside the file dialog! * (Note: this one has to remain separate, for the day we add options like flipping, rotating, etc.) */ -class KWInsertPicPreview : public QScrollView +class KWInsertPicPreview : public TQScrollView { public: - KWInsertPicPreview( QWidget *parent ) - : QScrollView( parent ) + KWInsertPicPreview( TQWidget *tqparent ) + : TQScrollView( tqparent ) { viewport()->setBackgroundMode( PaletteBase ); setMinimumSize( 300, 200 ); @@ -62,44 +62,44 @@ public: m_size = picture.getOriginalSize(); m_picture = picture; resizeContents( m_size.width(), m_size.height() ); - repaint( false ); + tqrepaint( false ); return true; } else return false; } - void drawContents( QPainter *p, int, int, int, int ) + void drawContents( TQPainter *p, int, int, int, int ) { - p->setBackgroundColor( Qt::white ); + p->setBackgroundColor( TQt::white ); // Be sure that the background is white (for transparency) - p->fillRect(0, 0, m_size.width(), m_size.height(), QBrush( Qt::white )); + p->fillRect(0, 0, m_size.width(), m_size.height(), TQBrush( TQt::white )); m_picture.draw( *p, 0 ,0, m_size.width(), m_size.height()); } private: KoPicture m_picture; - QSize m_size; + TQSize m_size; }; ////////////// -KWInsertPicDia::KWInsertPicDia( QWidget *parent, bool _inline, bool _keepRatio, KWDocument *_doc, const char *name ) - : KDialogBase( Plain, i18n("Insert Picture"), Ok|Cancel, Ok, parent, name, true ), +KWInsertPicDia::KWInsertPicDia( TQWidget *tqparent, bool _inline, bool _keepRatio, KWDocument *_doc, const char *name ) + : KDialogBase( Plain, i18n("Insert Picture"), Ok|Cancel, Ok, tqparent, name, true ), m_bFirst ( true ), m_doc ( _doc ) { - setInitialSize( QSize(400, 300) ); - QWidget *page = plainPage(); - QGridLayout *grid = new QGridLayout( page, 4, 2, KDialog::marginHint(), KDialog::spacingHint() ); + setInitialSize( TQSize(400, 300) ); + TQWidget *page = plainPage(); + TQGridLayout *grid = new TQGridLayout( page, 4, 2, KDialog::marginHint(), KDialog::spacingHint() ); - QPushButton *pbImage = new QPushButton( i18n( "Choose &Picture..." ), page ); + TQPushButton *pbImage = new TQPushButton( i18n( "Choose &Picture..." ), page ); grid->addWidget( pbImage, 0, 0 ); - connect( pbImage, SIGNAL( clicked() ), SLOT( slotChooseImage() ) ); + connect( pbImage, TQT_SIGNAL( clicked() ), TQT_SLOT( slotChooseImage() ) ); - m_cbInline = new QCheckBox( i18n( "Insert picture inline" ), page ); + m_cbInline = new TQCheckBox( i18n( "Insert picture inline" ), page ); grid->addWidget( m_cbInline, 1, 0 ); - m_cbKeepRatio= new QCheckBox( i18n("Retain original aspect ratio"),page); + m_cbKeepRatio= new TQCheckBox( i18n("Retain original aspect ratio"),page); grid->addWidget( m_cbKeepRatio, 2, 0); m_preview = new KWInsertPicPreview( page ); @@ -138,35 +138,35 @@ void KWInsertPicDia::slotChooseImage() { kdDebug() << "KWInsertPicDia::slotChooseImage cancelled by user." << endl; // Close, but delayed, otherwise it won't work (we only return from the ctor) - QTimer::singleShot( 0, this, SLOT( cancel() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( cancel() ) ); return; } enableButtonOK ( m_preview->setPicture( m_picture ) ); m_bFirst = false; } -KoPicture KWInsertPicDia::selectPictureDia( const QString & _path, QWidget* parent ) +KoPicture KWInsertPicDia::selectPictureDia( const TQString & _path, TQWidget* tqparent ) { - QStringList mimetypes ( KImageIO::mimeTypes( KImageIO::Reading ) ); + TQStringList mimetypes ( KImageIO::mimeTypes( KImageIO::Reading ) ); mimetypes += KoPictureFilePreview::clipartMimeTypes(); - KFileDialog fd( _path, QString::null, parent, 0, TRUE ); + KFileDialog fd( _path, TQString(), tqparent, 0, TRUE ); fd.setMimeFilter( mimetypes ); fd.setCaption(i18n("Choose Picture")); - return selectPicture( fd, parent ); + return selectPicture( fd, tqparent ); } -KoPicture KWInsertPicDia::selectPicture( KFileDialog & fd, QWidget *parent ) +KoPicture KWInsertPicDia::selectPicture( KFileDialog & fd, TQWidget *tqparent ) { KoPicture picture; fd.setPreviewWidget( new KoPictureFilePreview( &fd ) ); KURL url; - if ( fd.exec() == QDialog::Accepted ) + if ( fd.exec() == TQDialog::Accepted ) url = fd.selectedURL(); if( !url.isEmpty() ) - picture.setKeyAndDownloadPicture( url, parent ); + picture.setKeyAndDownloadPicture( url, tqparent ); return picture; } |