diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 18:31:12 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 18:31:12 +0000 |
commit | 0a80cfd57d271dd44221467efb426675fa470356 (patch) | |
tree | 6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/modules/help/helpwidget.cpp | |
parent | 3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff) | |
download | kvirc-0a80cfd57d271dd44221467efb426675fa470356.tar.gz kvirc-0a80cfd57d271dd44221467efb426675fa470356.zip |
TQt4 port kvirc
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/modules/help/helpwidget.cpp')
-rw-r--r-- | src/modules/help/helpwidget.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/modules/help/helpwidget.cpp b/src/modules/help/helpwidget.cpp index 4036a0dd..67ee30b0 100644 --- a/src/modules/help/helpwidget.cpp +++ b/src/modules/help/helpwidget.cpp @@ -32,61 +32,61 @@ #include "helpwindow.h" #include "kvi_fileutils.h" -#include <qtoolbutton.h> -#include <qlineedit.h> -#include <qtooltip.h> -#include <qtimer.h> -#include <qclipboard.h> +#include <tqtoolbutton.h> +#include <tqlineedit.h> +#include <tqtooltip.h> +#include <tqtimer.h> +#include <tqclipboard.h> extern Index * g_pDocIndex; extern KviPointerList<KviHelpWindow> * g_pHelpWindowList; extern KviPointerList<KviHelpWidget> * g_pHelpWidgetList; -KviHelpWidget::KviHelpWidget(QWidget * par,KviFrame * lpFrm,bool bIsStandalone) -: QWidget(par,"help_widget") +KviHelpWidget::KviHelpWidget(TQWidget * par,KviFrame * lpFrm,bool bIsStandalone) +: TQWidget(par,"help_widget") { if(bIsStandalone)g_pHelpWidgetList->append(this); m_bIsStandalone = bIsStandalone; -//#warning "Re enable this when using Qt 3.0 : QProcess " - m_pTextBrowser = new QTextBrowser(this,"text_browser"); - m_pTextBrowser->setFrameStyle(QFrame::StyledPanel|QFrame::Sunken); +//#warning "Re enable this when using TQt 3.0 : TQProcess " + m_pTextBrowser = new TQTextBrowser(this,"text_browser"); + m_pTextBrowser->setFrameStyle(TQFrame::StyledPanel|TQFrame::Sunken); #ifndef COMPILE_USE_QT4 - m_pTextBrowser->setFocusPolicy(QWidget::NoFocus); + m_pTextBrowser->setFocusPolicy(TQ_NoFocus); #endif m_pToolBar = new KviTalHBox(this); m_pBtnIndex = new KviStyledToolButton(m_pToolBar); m_pBtnIndex->setIconSet(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPINDEX)); - connect(m_pBtnIndex,SIGNAL(clicked()),this,SLOT(showIndex())); + connect(m_pBtnIndex,TQT_SIGNAL(clicked()),this,TQT_SLOT(showIndex())); //m_pBtnIndex->setUsesBigPixmap(true); m_pBtnBackward = new KviStyledToolButton(m_pToolBar); m_pBtnBackward->setIconSet(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPBACK)); - connect(m_pBtnBackward,SIGNAL(clicked()),m_pTextBrowser,SLOT(backward())); + connect(m_pBtnBackward,TQT_SIGNAL(clicked()),m_pTextBrowser,TQT_SLOT(backward())); m_pBtnBackward->setEnabled(false); //m_pBtnBackward->setUsesBigPixmap(true); m_pBtnForward = new KviStyledToolButton(m_pToolBar); m_pBtnForward->setIconSet(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPFORWARD)); - connect(m_pBtnForward,SIGNAL(clicked()),m_pTextBrowser,SLOT(forward())); + connect(m_pBtnForward,TQT_SIGNAL(clicked()),m_pTextBrowser,TQT_SLOT(forward())); m_pBtnForward->setEnabled(false); //m_pBtnForward->setUsesBigPixmap(true); - QWidget* pSpacer=new QWidget(m_pToolBar); + TQWidget* pSpacer=new TQWidget(m_pToolBar); if(bIsStandalone) { - QToolButton * b = new KviStyledToolButton(m_pToolBar); + TQToolButton * b = new KviStyledToolButton(m_pToolBar); b->setIconSet(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPCLOSE)); - connect(b,SIGNAL(clicked()),this,SLOT(doClose())); + connect(b,TQT_SIGNAL(clicked()),this,TQT_SLOT(doClose())); //b->setUsesBigPixmap(true); } m_pToolBar->setStretchFactor(pSpacer,1); - connect(m_pTextBrowser,SIGNAL(backwardAvailable(bool)),m_pBtnBackward,SLOT(setEnabled(bool))); - connect(m_pTextBrowser,SIGNAL(forwardAvailable(bool)),m_pBtnForward,SLOT(setEnabled(bool))); + connect(m_pTextBrowser,TQT_SIGNAL(backwardAvailable(bool)),m_pBtnBackward,TQT_SLOT(setEnabled(bool))); + connect(m_pTextBrowser,TQT_SIGNAL(forwardAvailable(bool)),m_pBtnForward,TQT_SLOT(setEnabled(bool))); m_pTextBrowser->viewport()->installEventFilter(this); @@ -100,15 +100,15 @@ KviHelpWidget::~KviHelpWidget() void KviHelpWidget::showIndex() { #ifdef COMPILE_USE_QT4 - m_pTextBrowser->setSource(QUrl("index.html")); + m_pTextBrowser->setSource(TQUrl("index.html")); #else m_pTextBrowser->setSource("index.html"); #endif } -void KviHelpWidget::resizeEvent(QResizeEvent *e) +void KviHelpWidget::resizeEvent(TQResizeEvent *e) { - int hght = m_pToolBar->sizeHint().height(); + int hght = m_pToolBar->tqsizeHint().height(); if(hght < 40)hght = 40; m_pToolBar->setGeometry(0,0,width(),hght); m_pTextBrowser->setGeometry(0,hght,width(),height() - hght); @@ -116,10 +116,10 @@ void KviHelpWidget::resizeEvent(QResizeEvent *e) void KviHelpWidget::doClose() { - // hack needed to workaround "QToolBar::emulateButtonClicked()" + // hack needed to workaround "TQToolBar::emulateButtonClicked()" // that refers to the "this" pointer after this slot has been // called (from the "too-small-toolbar-for-all-items-popup") - QTimer::singleShot(0,this,SLOT(suicide())); + TQTimer::singleShot(0,this,TQT_SLOT(suicide())); } void KviHelpWidget::suicide() @@ -128,25 +128,25 @@ void KviHelpWidget::suicide() delete this; } -QSize KviHelpWidget::sizeHint() const +TQSize KviHelpWidget::tqsizeHint() const { - int wdth = m_pTextBrowser->sizeHint().width(); - if(m_pToolBar->sizeHint().width() > wdth)wdth = m_pToolBar->sizeHint().width(); - QSize s(wdth,m_pTextBrowser->sizeHint().height() + m_pToolBar->sizeHint().height()); + int wdth = m_pTextBrowser->tqsizeHint().width(); + if(m_pToolBar->tqsizeHint().width() > wdth)wdth = m_pToolBar->tqsizeHint().width(); + TQSize s(wdth,m_pTextBrowser->tqsizeHint().height() + m_pToolBar->tqsizeHint().height()); return s; } -bool KviHelpWidget::eventFilter(QObject * o, QEvent *e) +bool KviHelpWidget::eventFilter(TQObject * o, TQEvent *e) { - QClipboard *cb = QApplication::clipboard(); + TQClipboard *cb = TQApplication::tqclipboard(); - if(e->type() == QEvent::MouseButtonRelease) { + if(e->type() == TQEvent::MouseButtonRelease) { if(m_pTextBrowser->hasSelectedText()) { cb->setText(m_pTextBrowser->selectedText()); } } - return QWidget::eventFilter(o,e); + return TQWidget::eventFilter(o,e); } |