diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-03 01:36:58 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-03 01:36:58 +0000 |
commit | d9d0ac84a2b1609ff81b399b81842a15704cbefd (patch) | |
tree | 58c783db373c4633201e5a9716901599c1afad92 /ksquirrel/sq_slideshowwidget.cpp | |
parent | 63f270d62c4541f1379f0f82f5255a34e5037e00 (diff) | |
download | ksquirrel-d9d0ac84a2b1609ff81b399b81842a15704cbefd.tar.gz ksquirrel-d9d0ac84a2b1609ff81b399b81842a15704cbefd.zip |
TQt4 port ksquirrel
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ksquirrel@1239132 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksquirrel/sq_slideshowwidget.cpp')
-rw-r--r-- | ksquirrel/sq_slideshowwidget.cpp | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/ksquirrel/sq_slideshowwidget.cpp b/ksquirrel/sq_slideshowwidget.cpp index d650602..ded1424 100644 --- a/ksquirrel/sq_slideshowwidget.cpp +++ b/ksquirrel/sq_slideshowwidget.cpp @@ -19,15 +19,15 @@ #include "config.h" #endif -#include <qimage.h> -#include <qpainter.h> -#include <qtimer.h> -#include <qtoolbutton.h> -#include <qhbox.h> -#include <qfileinfo.h> -#include <qfont.h> -#include <qlabel.h> -#include <qwhatsthis.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqtimer.h> +#include <tqtoolbutton.h> +#include <tqhbox.h> +#include <tqfileinfo.h> +#include <tqfont.h> +#include <tqlabel.h> +#include <tqwhatsthis.h> #include <kcursor.h> #include <klocale.h> @@ -50,25 +50,25 @@ SQ_SlideShowWidget * SQ_SlideShowWidget::m_inst = 0; -SQ_SlideShowWidget::SQ_SlideShowWidget(QWidget *parent, const char *name) - : QWidget(parent,name, Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_StaysOnTop | Qt::WNoAutoErase) +SQ_SlideShowWidget::SQ_SlideShowWidget(TQWidget *tqparent, const char *name) + : TQWidget(tqparent,name, TQt::WStyle_Customize | TQt::WStyle_NoBorder | TQt::WStyle_StaysOnTop | TQt::WNoAutoErase) { m_inst = this; - timerHide = new QTimer(this); + timerHide = new TQTimer(this); - message = new QLabel(this); + message = new TQLabel(this); - QFont f = message->font(); + TQFont f = message->font(); f.setPointSize(12); f.setBold(true); message->setFont(f); message->setMargin(4); - message->setFrameShape(QFrame::NoFrame); + message->setFrameShape(TQFrame::NoFrame); - connect(timerHide, SIGNAL(timeout()), this, SLOT(slotHide())); + connect(timerHide, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotHide())); - options = new QHBox(this, "kde toolbar widget"); + options = new TQHBox(this, "kde toolbar widget"); options->setSpacing(0); options->setMargin(1); options->move(0, 0); @@ -77,28 +77,28 @@ SQ_SlideShowWidget::SQ_SlideShowWidget(QWidget *parent, const char *name) int is = KIcon::SizeMedium; - QToolButton *b = new QToolButton(options); + TQToolButton *b = new TQToolButton(options); b->setIconSet(SQ_IconLoader::instance()->loadIcon("previous", KIcon::Desktop, is)); - connect(b, SIGNAL(clicked()), this, SIGNAL(previous())); - connect(b, SIGNAL(clicked()), this, SLOT(slotResetPause())); + connect(b, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(previous())); + connect(b, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotResetPause())); - b = new QToolButton(options); + b = new TQToolButton(options); b->setIconSet(SQ_IconLoader::instance()->loadIcon("next", KIcon::Desktop, is)); - connect(b, SIGNAL(clicked()), this, SIGNAL(next())); - connect(b, SIGNAL(clicked()), this, SLOT(slotResetPause())); + connect(b, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(next())); + connect(b, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotResetPause())); - buttonPause = new QToolButton(options); + buttonPause = new TQToolButton(options); buttonPause->setToggleButton(true); buttonPause->setIconSet(SQ_IconLoader::instance()->loadIcon("player_pause", KIcon::Desktop, is)); - connect(buttonPause, SIGNAL(clicked()), this, SIGNAL(pause())); + connect(buttonPause, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(pause())); - b = new QToolButton(options); + b = new TQToolButton(options); b->setIconSet(SQ_IconLoader::instance()->loadIcon("help", KIcon::Desktop, is)); - connect(b, SIGNAL(clicked()), this, SLOT(slotShowHelp())); + connect(b, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotShowHelp())); - b = new QToolButton(options); + b = new TQToolButton(options); b->setIconSet(SQ_IconLoader::instance()->loadIcon("cancel", KIcon::Desktop, is)); - connect(b, SIGNAL(clicked()), this, SIGNAL(stopSlideShow())); + connect(b, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(stopSlideShow())); options->adjustSize(); message->setFixedHeight(options->height()); @@ -155,10 +155,10 @@ void SQ_SlideShowWidget::endSlideShow() message->hide(); hide(); - pixmap = QPixmap(); + pixmap = TQPixmap(); } -void SQ_SlideShowWidget::loadImage(const QString &_path, int _current) +void SQ_SlideShowWidget::loadImage(const TQString &_path, int _current) { fmt_info *finfo; RGBA *bits; @@ -178,20 +178,20 @@ void SQ_SlideShowWidget::loadImage(const QString &_path, int _current) constructMessage(); - pixmap = QPixmap(); + pixmap = TQPixmap(); int w = finfo->image[0].w; int h = finfo->image[0].h; - QImage *all = 0, *small = 0; + TQImage *all = 0, *small = 0; - all = new QImage((uchar *)bits, w, h, 32, 0, 0, QImage::LittleEndian); + all = new TQImage((uchar *)bits, w, h, 32, 0, 0, TQImage::LittleEndian); all->setAlphaBuffer(true); // scale down to fit into window if(w > width() || h > height()) { - small = new QImage(); - *small = SQ_Utils::scale(*all, width(), height(), SQ_Utils::SMOOTH_FAST, QImage::ScaleMin); + small = new TQImage(); + *small = SQ_Utils::scale(*all, width(), height(), SQ_Utils::SMOOTH_FAST, TQ_ScaleMin); delete all; all = 0; @@ -209,7 +209,7 @@ void SQ_SlideShowWidget::loadImage(const QString &_path, int _current) unsigned char t; RGBA *sk = reinterpret_cast<RGBA *>(small->bits()); - // swap R and B components - QPixmap need it + // swap R and B components - TQPixmap need it for(int i = 0;i < wh;i++) { t = (sk+i)->r; @@ -220,15 +220,15 @@ void SQ_SlideShowWidget::loadImage(const QString &_path, int _current) #ifdef SQ_HAVE_KEXIF KExifData data; data.readFromFile(_path); - int O = data.getImageOrientation(); + int O = data.getImageQt::Orientation(); if(O != KExifData::UNSPECIFIED && O != KExifData::NORMAL) { // copy original image - QImage img = *small; + TQImage img = *small; // rotate image - SQ_Utils::exifRotate(QString::null, img, O); + SQ_Utils::exifRotate(TQString(), img, O); // transfer back *small = img; @@ -246,9 +246,9 @@ void SQ_SlideShowWidget::loadImage(const QString &_path, int _current) update(); } -void SQ_SlideShowWidget::paintEvent(QPaintEvent *e) +void SQ_SlideShowWidget::paintEvent(TQPaintEvent *e) { - QPainter p(this); + TQPainter p(this); p.setClipRect(e->rect()); p.fillRect(e->rect(), bgcolor); @@ -257,27 +257,27 @@ void SQ_SlideShowWidget::paintEvent(QPaintEvent *e) p.drawPixmap((width() - pixmap.width()) / 2, (height() - pixmap.height()) / 2, pixmap); } -void SQ_SlideShowWidget::closeEvent(QCloseEvent *e) +void SQ_SlideShowWidget::closeEvent(TQCloseEvent *e) { emit stopSlideShow(); e->ignore(); } -void SQ_SlideShowWidget::keyPressEvent(QKeyEvent *e) +void SQ_SlideShowWidget::keyPressEvent(TQKeyEvent *e) { - if(e->key() == Qt::Key_Enter || e->key() == Qt::Key_Escape || e->key() == Qt::Key_Return) + if(e->key() == TQt::Key_Enter || e->key() == TQt::Key_Escape || e->key() == TQt::Key_Return) close(); - else if(e->key() == Qt::Key_Pause || e->key() == Qt::Key_Space) + else if(e->key() == TQt::Key_Pause || e->key() == TQt::Key_Space) { buttonPause->toggle(); emit pause(); } - else if(e->key() == Qt::Key_PageUp) + else if(e->key() == TQt::Key_PageUp) emit previous(); - else if(e->key() == Qt::Key_PageDown) + else if(e->key() == TQt::Key_PageDown) emit next(); - else if(e->key() == Qt::Key_M) + else if(e->key() == TQt::Key_M) { SQ_Config::instance()->setGroup("Slideshow"); @@ -296,7 +296,7 @@ void SQ_SlideShowWidget::keyPressEvent(QKeyEvent *e) e->accept(); } -void SQ_SlideShowWidget::mouseMoveEvent(QMouseEvent *) +void SQ_SlideShowWidget::mouseMoveEvent(TQMouseEvent *) { if(!options->isVisible()) { @@ -314,9 +314,9 @@ void SQ_SlideShowWidget::slotHide() if(messages) message->move(0, 0); } -bool SQ_SlideShowWidget::eventFilter(QObject *, QEvent *e) +bool SQ_SlideShowWidget::eventFilter(TQObject *, TQEvent *e) { - if(e->type() == QEvent::Enter) + if(e->type() == TQEvent::Enter) { timerHide->stop(); return true; @@ -327,7 +327,7 @@ bool SQ_SlideShowWidget::eventFilter(QObject *, QEvent *e) void SQ_SlideShowWidget::slotShowHelp() { - QWhatsThis::display(i18n( + TQWhatsThis::display(i18n( "<table cellspacing=0>" "<tr><td><b>Enter, Escape, Return</b></td><td>stop slideshow</td></tr>" "<tr><td><b>Pause, Space</b></td><td>pause/unpause slideshow</td></tr>" @@ -343,10 +343,10 @@ void SQ_SlideShowWidget::constructMessage() // construct onscreen message if(messages) { - QFileInfo fm(path); - QString s_message; + TQFileInfo fm(path); + TQString s_message; - if(mes_pos) s_message = QString::fromLatin1("[%1/%2] ").arg(current+1).arg(total); + if(mes_pos) s_message = TQString::tqfromLatin1("[%1/%2] ").tqarg(current+1).tqarg(total); if(mes_name) s_message += fm.fileName(); |