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_glview.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_glview.cpp')
-rw-r--r-- | ksquirrel/sq_glview.cpp | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/ksquirrel/sq_glview.cpp b/ksquirrel/sq_glview.cpp index 56f9645..18c1520 100644 --- a/ksquirrel/sq_glview.cpp +++ b/ksquirrel/sq_glview.cpp @@ -19,11 +19,11 @@ #include "config.h" #endif -#include <qlayout.h> -#include <qlabel.h> -#include <qtoolbutton.h> -#include <qtooltip.h> -#include <qhbox.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqtoolbutton.h> +#include <tqtooltip.h> +#include <tqhbox.h> #include <kaction.h> #include <kstatusbar.h> @@ -46,7 +46,7 @@ SQ_GLView * SQ_GLView::m_instance = 0; -SQ_GLView::SQ_GLView(QWidget *parent) : QVBox(parent, "ksquirrel-image-window") +SQ_GLView::SQ_GLView(TQWidget *tqparent) : TQVBox(tqparent, "ksquirrel-image-window") { m_instance = this; @@ -60,7 +60,7 @@ SQ_GLView::~SQ_GLView() void SQ_GLView::createContent() { - box = new QVBox(this); + box = new TQVBox(this); m_toolbar = new SQ_ToolBar(box); m_toolbar->setMouseTracking(true); @@ -75,7 +75,7 @@ void SQ_GLView::createContent() m_tabbar->setHoverCloseButton(m_tabsclose); m_tabbar->setHoverCloseButtonDelayed(false); m_tabbar->setMouseTracking(true); - m_tabbar->setFocusPolicy(QWidget::NoFocus); + m_tabbar->setFocusPolicy(TQ_NoFocus); box->setStretchFactor(m_toolbar, 1); @@ -85,39 +85,39 @@ void SQ_GLView::createContent() gl->glInitA(); gl->setFocus(); - connect(m_tabbar, SIGNAL(selected(int)), gl, SLOT(slotChangeTab(int))); - connect(m_tabbar, SIGNAL(closeRequest(int)), gl, SLOT(slotCloseRequest(int))); - connect(m_tabbar, SIGNAL(mouseMiddleClick(int)), gl, SLOT(slotCloseRequest(int))); - connect(gl, SIGNAL(tabCountChanged()), this, SLOT(slotTabCountChanged())); + connect(m_tabbar, TQT_SIGNAL(selected(int)), gl, TQT_SLOT(slotChangeTab(int))); + connect(m_tabbar, TQT_SIGNAL(closeRequest(int)), gl, TQT_SLOT(slotCloseRequest(int))); + connect(m_tabbar, TQT_SIGNAL(mouseMiddleClick(int)), gl, TQT_SLOT(slotCloseRequest(int))); + connect(gl, TQT_SIGNAL(tabCountChanged()), this, TQT_SLOT(slotTabCountChanged())); setStretchFactor(gl, 1); sbar = new KStatusBar(this); sbar->setMouseTracking(true); - // create QLabels, fill 'names' with pointers - QHBox *sqSBDecodedBox = new QHBox; + // create TQLabels, fill 'names' with pointers + TQHBox *sqSBDecodedBox = new TQHBox; sqSBDecodedBox->setSpacing(2); - QLabel *sqSBDecodedI = new QLabel(QString::null, sqSBDecodedBox, "SBDecodedI"); + TQLabel *sqSBDecodedI = new TQLabel(TQString(), sqSBDecodedBox, "SBDecodedI"); names.insert("SBDecodedI", sqSBDecodedI); - QLabel *sqSBDecoded = new QLabel(QString::null, sqSBDecodedBox, "SBDecoded"); + TQLabel *sqSBDecoded = new TQLabel(TQString(), sqSBDecodedBox, "SBDecoded"); names.insert("SBDecoded", sqSBDecoded); - QLabel *sqSBGLZoom = new QLabel(QString::null, 0, "SBGLZoom"); + TQLabel *sqSBGLZoom = new TQLabel(TQString(), 0, "SBGLZoom"); names.insert("SBGLZoom", sqSBGLZoom); - QLabel *sqSBGLAngle = new QLabel(QString::null, 0, "SBGLAngle"); + TQLabel *sqSBGLAngle = new TQLabel(TQString(), 0, "SBGLAngle"); names.insert("SBGLAngle", sqSBGLAngle); - QLabel *sqSBLoaded = new QLabel(QString::null, 0, "SBLoaded"); - QToolTip::add(sqSBLoaded, i18n("Loading time")); + TQLabel *sqSBLoaded = new TQLabel(TQString(), 0, "SBLoaded"); + TQToolTip::add(sqSBLoaded, i18n("Loading time")); names.insert("SBLoaded", sqSBLoaded); - QLabel *sqSBFrame = new QLabel(QString::null, 0, "SBFrame"); + TQLabel *sqSBFrame = new TQLabel(TQString(), 0, "SBFrame"); names.insert("SBFrame", sqSBFrame); - QLabel *sqSBFile = new KSqueezedTextLabel(QString::null, 0, "SBFile"); + TQLabel *sqSBFile = new KSqueezedTextLabel(TQString(), 0, "SBFile"); names.insert("SBFile", sqSBFile); - sqSBFrame->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter | Qt::ExpandTabs); - sqSBFile->setAlignment(Qt::AlignRight | Qt::AlignTop); - QFont font = sqSBFile->font(); + sqSBFrame->tqsetAlignment(TQt::AlignHCenter | TQt::AlignVCenter | TQt::ExpandTabs); + sqSBFile->tqsetAlignment(TQt::AlignRight | TQt::AlignTop); + TQFont font = sqSBFile->font(); font.setBold(true); sqSBFile->setFont(font); @@ -133,13 +133,13 @@ void SQ_GLView::createContent() sbar->setShown(SQ_Config::instance()->readBoolEntry("statusbar", true)); - // restore geometry from config file + // restore tqgeometry from config file restoreGeometry(); gl->matrixChanged(); } -void SQ_GLView::closeEvent(QCloseEvent *e) +void SQ_GLView::closeEvent(TQCloseEvent *e) { // ignore event e->ignore(); @@ -148,18 +148,18 @@ void SQ_GLView::closeEvent(QCloseEvent *e) KSquirrel::app()->closeGLWidget(); } -bool SQ_GLView::eventFilter(QObject *watched, QEvent *e) +bool SQ_GLView::eventFilter(TQObject *watched, TQEvent *e) { - if(watched == this) + if(TQT_BASE_OBJECT(watched) == TQT_BASE_OBJECT(this)) { // stop animation, if SQ_GLView is hidden (animation becomes useless) - if(/*e->type() == QEvent::WindowDeactivate || */e->type() == QEvent::Hide) + if(/*e->type() == TQEvent::WindowDeactivate || */e->type() == TQEvent::Hide) { gl->stopAnimation(); return true; } // resume animation, if needed - else if(/*e->type() == QEvent::WindowActivate || */e->type() == QEvent::Show) + else if(/*e->type() == TQEvent::WindowActivate || */e->type() == TQEvent::Show) { if(!gl->manualBlocked()) gl->startAnimation(); @@ -167,10 +167,10 @@ bool SQ_GLView::eventFilter(QObject *watched, QEvent *e) return true; } else // call to default eventFilter() - return QVBox::eventFilter(watched, e); + return TQVBox::eventFilter(watched, e); } else - return QVBox::eventFilter(watched, e); + return TQVBox::eventFilter(watched, e); } void SQ_GLView::saveGeometry() @@ -181,13 +181,13 @@ void SQ_GLView::saveGeometry() void SQ_GLView::restoreGeometry() { - QPoint p_def(0,0); - QSize sz_def(660, 480); + TQPoint p_def(0,0); + TQSize sz_def(660, 480); SQ_Config::instance()->setGroup("GL view"); - QPoint p = SQ_Config::instance()->readPointEntry("pos", &p_def); - QSize sz = SQ_Config::instance()->readSizeEntry("size", &sz_def); + TQPoint p = SQ_Config::instance()->readPointEntry("pos", &p_def); + TQSize sz = SQ_Config::instance()->readSizeEntry("size", &sz_def); move(p); resize(sz); @@ -198,18 +198,18 @@ void SQ_GLView::restoreGeometry() */ void SQ_GLView::resetStatusBar() { - QString fl = QString::fromLatin1("----"); + TQString fl = TQString::tqfromLatin1("----"); names["SBGLZoom"]->setText(fl); names["SBGLAngle"]->setText(fl); names["SBLoaded"]->setText(fl); - names["SBDecodedI"]->setText(QString::fromLatin1("--")); - names["SBFile"]->setText(QString::fromLatin1("--------")); + names["SBDecodedI"]->setText(TQString::tqfromLatin1("--")); + names["SBFile"]->setText(TQString::tqfromLatin1("--------")); names["SBDecoded"]->setText(fl); - names["SBFrame"]->setText(QString::fromLatin1("0/0")); + names["SBFrame"]->setText(TQString::tqfromLatin1("0/0")); } -SQ_ToolBar::SQ_ToolBar(QWidget *parent) : KToolBar(parent) +SQ_ToolBar::SQ_ToolBar(TQWidget *tqparent) : KToolBar(tqparent) { setFixedHeight(SQ_ToolButton::fixedWidth() + 5); boxLayout()->setSpacing(0); @@ -219,14 +219,14 @@ SQ_ToolBar::SQ_ToolBar(QWidget *parent) : KToolBar(parent) SQ_ToolBar::~SQ_ToolBar() {} -void SQ_ToolBar::mouseReleaseEvent(QMouseEvent *e) +void SQ_ToolBar::mouseReleaseEvent(TQMouseEvent *e) { e->accept(); } -void SQ_GLView::addPage(const QString &label) +void SQ_GLView::addPage(const TQString &label) { - QTab *tab = new QTab(label); + TQTab *tab = new TQTab(label); m_tabbar->addTab(tab); @@ -267,10 +267,10 @@ void SQ_GLView::setupTabbar() cnt = m_tabbar->count(); for(int i = 0;i < cnt;i++) - m_tabbar->tabAt(i)->setIconSet(m_tabsclose ? SmallIcon("fileclose") : QPixmap()); + m_tabbar->tabAt(i)->setIconSet(m_tabsclose ? SmallIcon("fileclose") : TQPixmap()); m_tabbar->setHoverCloseButton(m_tabsclose); - m_tabbar->layoutTabs(); + m_tabbar->tqlayoutTabs(); } if(m_tabs == SQ_Config::instance()->readBoolEntry("tabs", false)) |