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 /kpresenter/KPrNoteBar.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 'kpresenter/KPrNoteBar.cpp')
-rw-r--r-- | kpresenter/KPrNoteBar.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/kpresenter/KPrNoteBar.cpp b/kpresenter/KPrNoteBar.cpp index f44865f1..9862e2c6 100644 --- a/kpresenter/KPrNoteBar.cpp +++ b/kpresenter/KPrNoteBar.cpp @@ -19,11 +19,11 @@ */ -#include <qlayout.h> -#include <qpainter.h> -#include <qpaintdevicemetrics.h> -#include <qsimplerichtext.h> -#include <qlabel.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqpaintdevicemetrics.h> +#include <tqsimplerichtext.h> +#include <tqlabel.h> #include <kglobalsettings.h> #include <kprinter.h> @@ -37,40 +37,40 @@ #include "KPrPage.h" -KPrNoteBar::KPrNoteBar( QWidget *_parent, KPrView *_view ) - : QWidget( _parent ), +KPrNoteBar::KPrNoteBar( TQWidget *_parent, KPrView *_view ) + : TQWidget( _parent ), view( _view ), initialize( true ) { - QBoxLayout *topLayout = new QVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); + TQBoxLayout *topLayout = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); - label = new QLabel(i18n("Note"), this); + label = new TQLabel(i18n("Note"), this); textEdit = new KTextEdit( this ); - QFont font = KoGlobal::defaultFont(); + TQFont font = KoGlobal::defaultFont(); textEdit->setCurrentFont( font ); int currentPageNum = view->getCurrentPresPage(); // 1 base. - QString text=QString::null; + TQString text=TQString(); if (currentPageNum!=-1) text = view->kPresenterDoc()->pageList().at(currentPageNum - 1)->noteText( ); textEdit->setText( text ); - connect( textEdit, SIGNAL( textChanged() ), - this, SLOT( slotTextChanged() ) ); + connect( textEdit, TQT_SIGNAL( textChanged() ), + this, TQT_SLOT( slotTextChanged() ) ); - connect( textEdit, SIGNAL( selectionChanged() ), - this, SLOT( slotSelectionChanged() ) ); + connect( textEdit, TQT_SIGNAL( selectionChanged() ), + this, TQT_SLOT( slotSelectionChanged() ) ); - connect( textEdit, SIGNAL( copyAvailable( bool ) ), - this, SLOT( slotSelectionChanged() ) ); + connect( textEdit, TQT_SIGNAL( copyAvailable( bool ) ), + this, TQT_SLOT( slotSelectionChanged() ) ); - connect( textEdit, SIGNAL( undoAvailable( bool ) ), - this, SLOT( slotUndoAvailable( bool ) ) ); + connect( textEdit, TQT_SIGNAL( undoAvailable( bool ) ), + this, TQT_SLOT( slotUndoAvailable( bool ) ) ); - connect( textEdit, SIGNAL( redoAvailable( bool ) ), - this, SLOT( slotRedoAvailable( bool ) ) ); + connect( textEdit, TQT_SIGNAL( redoAvailable( bool ) ), + this, TQT_SLOT( slotRedoAvailable( bool ) ) ); topLayout->addWidget( label ); topLayout->addWidget( textEdit ); @@ -81,7 +81,7 @@ KPrNoteBar::~KPrNoteBar() delete textEdit; } -void KPrNoteBar::setCurrentNoteText( const QString &_text ) +void KPrNoteBar::setCurrentNoteText( const TQString &_text ) { initialize = true; textEdit->setText( _text ); @@ -120,32 +120,32 @@ void KPrNoteBar::slotRedoAvailable( bool /*yes*/ ) //kdDebug(33001) << "slotRedoAvailable( " << yes << " )" << endl; } -void KPrNoteBar::printNotes( QPainter *_painter, KPrinter *_printer, QValueList<int> _list ) +void KPrNoteBar::printNotes( TQPainter *_painter, KPrinter *_printer, TQValueList<int> _list ) { - // base code from $QTDIR/example/textedit/textedit.cpp + // base code from $TQTDIR/example/textedit/textedit.cpp _painter->save(); - QPaintDeviceMetrics metrics( _painter->device() ); + TQPaintDeviceMetrics metrics( _painter->device() ); int dpix = metrics.logicalDpiX(); int dpiy = metrics.logicalDpiY(); const int margin = 72; // pt - QRect body( margin * dpix / 72, margin * dpiy / 72, + TQRect body( margin * dpix / 72, margin * dpiy / 72, metrics.width() - margin * dpix / 72 * 2, metrics.height() - margin * dpiy / 72 * 2 ); - QFont font = KoGlobal::defaultFont(); - QString allText = getNotesTextForPrinting(_list); - QString str = QStyleSheet::convertFromPlainText( allText ); + TQFont font = KoGlobal::defaultFont(); + TQString allText = getNotesTextForPrinting(_list); + TQString str = TQStyleSheet::convertFromPlainText( allText ); - QSimpleRichText richText( str, font, QString::null, QStyleSheet::defaultSheet(), - QMimeSourceFactory::defaultFactory(), body.height() ); + TQSimpleRichText richText( str, font, TQString(), TQStyleSheet::defaultSheet(), + TQMimeSourceFactory::defaultFactory(), body.height() ); richText.setWidth( _painter, body.width() ); - QRect viewRect( body ); + TQRect viewRect( body ); do { - richText.draw( _painter, body.left(), body.top(), viewRect, colorGroup() ); + richText.draw( _painter, body.left(), body.top(), viewRect, tqcolorGroup() ); viewRect.moveBy( 0, body.height() ); _painter->translate( 0, -body.height() ); _painter->setFont( font ); @@ -159,22 +159,22 @@ void KPrNoteBar::printNotes( QPainter *_painter, KPrinter *_printer, QValueList< _painter->restore(); } -QString KPrNoteBar::getNotesTextForPrinting(QValueList<int> _list) const +TQString KPrNoteBar::getNotesTextForPrinting(TQValueList<int> _list) const { - QString allText = QString::null; + TQString allText = TQString(); bool firstText = true; bool noteIsEmpty = true; int pageCount = 1; KPrDocument *doc=view->kPresenterDoc(); for ( int i = 0; i < static_cast<int>( doc->pageList().count() ); i++, ++pageCount ) { - if (_list.contains(i+1)==0) // that slide isn't printed, don't print its note either + if (_list.tqcontains(i+1)==0) // that slide isn't printed, don't print its note either continue; if ( !firstText ) - allText += QString("\n\n"); + allText += TQString("\n\n"); - allText += i18n( "Slide Note %1:\n" ).arg( pageCount ); + allText += i18n( "Slide Note %1:\n" ).tqarg( pageCount ); if(noteIsEmpty && !doc->pageList().at(i)->noteText().isEmpty()) noteIsEmpty = false; allText += doc->pageList().at(i)->noteText(); @@ -183,14 +183,14 @@ QString KPrNoteBar::getNotesTextForPrinting(QValueList<int> _list) const } //code for master page if ( !firstText ) - allText += QString("\n\n"); + allText += TQString("\n\n"); allText += i18n( "Master Page Note:\n" ); if ( !doc->masterPage()->noteText().isEmpty() ) noteIsEmpty = false; allText += doc->masterPage()->noteText(); if( noteIsEmpty ) - return QString::null; + return TQString(); return allText; } |