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/notifier/notifierwindowtabs.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/notifier/notifierwindowtabs.cpp')
-rw-r--r-- | src/modules/notifier/notifierwindowtabs.cpp | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/src/modules/notifier/notifierwindowtabs.cpp b/src/modules/notifier/notifierwindowtabs.cpp index 9eaa2f12..7455049f 100644 --- a/src/modules/notifier/notifierwindowtabs.cpp +++ b/src/modules/notifier/notifierwindowtabs.cpp @@ -30,11 +30,11 @@ #include "kvi_options.h" #include "kvi_window.h" -#include <qevent.h> -#include <qpainter.h> -#include <qbrush.h> -#include <qcolor.h> -#include <qfontmetrics.h> +#include <tqevent.h> +#include <tqpainter.h> +#include <tqbrush.h> +#include <tqcolor.h> +#include <tqfontmetrics.h> #include "notifiermessage.h" #include "notifierwindowtabs.h" @@ -45,7 +45,7 @@ KviNotifierWindowTabs * g_pTabs; // --- tab object definition class -KviNotifierWindowTab::KviNotifierWindowTab(KviWindow * pWnd, QString label) +KviNotifierWindowTab::KviNotifierWindowTab(KviWindow * pWnd, TQString label) { m_pWnd = pWnd; m_label = label; @@ -58,14 +58,14 @@ KviNotifierWindowTab::KviNotifierWindowTab(KviWindow * pWnd, QString label) g_pApp->getReadOnlyConfigPath(buffer,"libkvinotifier.kvc",KviApp::ConfigPlugins,true); KviConfig cfg(buffer.ptr(),KviConfig::Read); cfg.setGroup("NotifierSkin"); - m_clrHighlightedLabel = cfg.readColorEntry("HighlightedTabLablerColor",QColor(200,0,0)); - m_clrNormalLabel = cfg.readColorEntry("NormalTabLablerColor",QColor(0,0,0)); - m_clrChangedLabel = cfg.readColorEntry("ChangedTabLablerColor",QColor(0,0,100)); + m_clrHighlightedLabel = cfg.readColorEntry("HighlightedTabLablerColor",TQColor(200,0,0)); + m_clrNormalLabel = cfg.readColorEntry("NormalTabLablerColor",TQColor(0,0,0)); + m_clrChangedLabel = cfg.readColorEntry("ChangedTabLablerColor",TQColor(0,0,100)); if(pWnd) { - connect(pWnd,SIGNAL(windowNameChanged()),this,SLOT(labelChanged())); - connect(pWnd,SIGNAL(destroyed()),this,SLOT(closeMe())); + connect(pWnd,TQT_SIGNAL(windowNameChanged()),this,TQT_SLOT(labelChanged())); + connect(pWnd,TQT_SIGNAL(destroyed()),this,TQT_SLOT(closeMe())); } } @@ -77,7 +77,7 @@ KviNotifierWindowTab::~KviNotifierWindowTab() void KviNotifierWindowTab::setNextMessageAsCurrent() { if(!m_pCurrentMessage)return; - if(m_pMessageList->findRef(m_pCurrentMessage) == -1)return; + if(m_pMessageList->tqfindRef(m_pCurrentMessage) == -1)return; m_pCurrentMessage = m_pMessageList->next(); if(!m_pCurrentMessage)m_pCurrentMessage = m_pMessageList->last(); } @@ -85,7 +85,7 @@ void KviNotifierWindowTab::setNextMessageAsCurrent() void KviNotifierWindowTab::setPrevMessageAsCurrent() { if(!m_pCurrentMessage)return; - if(!m_pMessageList->findRef(m_pCurrentMessage) == -1)return; + if(!m_pMessageList->tqfindRef(m_pCurrentMessage) == -1)return; m_pCurrentMessage = m_pMessageList->prev(); if(!m_pCurrentMessage)m_pCurrentMessage = m_pMessageList->first(); } @@ -149,10 +149,10 @@ void KviNotifierWindowTab::setState(TabState state) int KviNotifierWindowTab::width(bool b) { int width = 0; - QFont * font; + TQFont * font; - QPixmap * sx; - QPixmap * dx; + TQPixmap * sx; + TQPixmap * dx; if (focused()) { font = g_pTabs->fontFocused(); @@ -164,7 +164,7 @@ int KviNotifierWindowTab::width(bool b) { font = g_pTabs->fontUnfocused(); } - QFontMetrics fm(*font); + TQFontMetrics fm(*font); width = fm.width(label())+2; if (!b) width += sx->width() + dx->width(); @@ -176,11 +176,11 @@ int KviNotifierWindowTab::width(bool b) { // ##################################################################################à -KviNotifierWindowTabs::KviNotifierWindowTabs(QRect r) +KviNotifierWindowTabs::KviNotifierWindowTabs(TQRect r) { g_pTabs = this; - m_pPixmap = new QPixmap(); - m_pPainter = new QPainter(); + m_pPixmap = new TQPixmap(); + m_pPainter = new TQPainter(); m_pTabFocused = 0; m_pWndTabFocused = 0; m_iTabToStartFrom = 0; @@ -195,7 +195,7 @@ KviNotifierWindowTabs::KviNotifierWindowTabs(QRect r) KviNotifierWindowTabs::~KviNotifierWindowTabs() { - QMap<KviWindow *, KviNotifierWindowTab *>::Iterator tab; + TQMap<KviWindow *, KviNotifierWindowTab *>::Iterator tab; for(tab = m_tabMap.begin(); tab != m_tabMap.end(); tab++ ) delete tab.data(); m_tabMap.clear(); @@ -214,16 +214,16 @@ void KviNotifierWindowTabs::initConfig() cfg.setGroup("NotifierSkin"); - QString szFamily = cfg.readEntry("TextFontFocusedTab","Arial"); - m_pFocusedFont = new QFont(szFamily,cfg.readIntEntry("TextFocusedFontSize",10)); + TQString szFamily = cfg.readEntry("TextFontFocusedTab","Arial"); + m_pFocusedFont = new TQFont(szFamily,cfg.readIntEntry("TextFocusedFontSize",10)); m_pFocusedFont->setBold(true); szFamily = cfg.readEntry("TextFontUnfocusedTab","Arial"); - m_pUnfocusedFont = new QFont(szFamily,cfg.readIntEntry("TextUnfocusedFontSize",9)); + m_pUnfocusedFont = new TQFont(szFamily,cfg.readIntEntry("TextUnfocusedFontSize",9)); } void KviNotifierWindowTabs::loadImages() { - QPixmap * p; + TQPixmap * p; if((p = g_pIconManager->getPixmap("notifier_pix_tab_dx.png"))) m_pixDX = *p; if((p = g_pIconManager->getPixmap("notifier_pix_tab_sx.png"))) @@ -278,14 +278,14 @@ void KviNotifierWindowTabs::loadImages() void KviNotifierWindowTabs::addMessage(KviWindow * pWnd, KviNotifierMessage * message) { - QString sender = pWnd ? pWnd->windowName() : "----"; + TQString sender = pWnd ? pWnd->windowName() : "----"; // Qui servirebbe anche una lista... perche' quando si inserisce // un tab lui lo piazza dove gli pare nell'ordine // e quindi iterando i tab nuovi possono trovarsi PRIMA dei tab vecchi // il che' confonde un po KviNotifierWindowTab * tab; - if (!m_tabMap.contains(pWnd)) { + if (!m_tabMap.tqcontains(pWnd)) { m_tabMap.insert(pWnd, tab = new KviNotifierWindowTab(pWnd, sender)); m_tabPtrList.append(tab); } else { @@ -302,7 +302,7 @@ void KviNotifierWindowTabs::addMessage(KviWindow * pWnd, KviNotifierMessage * me } } -void KviNotifierWindowTabs::resize(QRect r) +void KviNotifierWindowTabs::resize(TQRect r) { m_rct.setX(r.x()); m_rct.setY(r.y()); @@ -411,37 +411,37 @@ void KviNotifierWindowTabs::next() } -void KviNotifierWindowTabs::mousePressEvent(QMouseEvent * e) { +void KviNotifierWindowTabs::mousePressEvent(TQMouseEvent * e) { - if (m_bIsOverRightBound && m_rctNextIcon.contains(e->pos())) { + if (m_bIsOverRightBound && m_rctNextIcon.tqcontains(e->pos())) { return; } - if (m_bIsOverLeftBound && m_rctPrevIcon.contains(e->pos())) { + if (m_bIsOverLeftBound && m_rctPrevIcon.tqcontains(e->pos())) { return; } - if(m_rctTabs.contains(e->pos())) + if(m_rctTabs.tqcontains(e->pos())) { - QMap<KviWindow *, KviNotifierWindowTab *>::Iterator tab; + TQMap<KviWindow *, KviNotifierWindowTab *>::Iterator tab; for (tab = m_tabMap.begin(); tab != m_tabMap.end(); tab++ ) { - if (tab.data()->rect().contains(e->pos())) { + if (tab.data()->rect().tqcontains(e->pos())) { setFocusOn(tab.data()); return; } } } - if (m_rctCloseTabIconHotArea.contains(e->pos())) { + if (m_rctCloseTabIconHotArea.tqcontains(e->pos())) { setCloseTabIcon(WDG_ICON_CLICKED); return; } } -void KviNotifierWindowTabs::mouseMoveEvent(QMouseEvent * e) +void KviNotifierWindowTabs::mouseMoveEvent(TQMouseEvent * e) { - if (m_rctCloseTabIconHotArea.contains(e->pos())) + if (m_rctCloseTabIconHotArea.tqcontains(e->pos())) { setCloseTabIcon(WDG_ICON_ON); } else { @@ -450,22 +450,22 @@ void KviNotifierWindowTabs::mouseMoveEvent(QMouseEvent * e) } } -void KviNotifierWindowTabs::mouseReleaseEvent(QMouseEvent * e) +void KviNotifierWindowTabs::mouseReleaseEvent(TQMouseEvent * e) { - if (m_bIsOverRightBound && m_rctNextIcon.contains(e->pos())) { + if (m_bIsOverRightBound && m_rctNextIcon.tqcontains(e->pos())) { scrollTabsLeft(); return; } - if (m_bIsOverLeftBound && m_rctPrevIcon.contains(e->pos())) { + if (m_bIsOverLeftBound && m_rctPrevIcon.tqcontains(e->pos())) { scrollTabsRight(); return; } if(currentTab()) { - if (rctCloseTabIconHotArea().contains(e->pos())) + if (rctCloseTabIconHotArea().tqcontains(e->pos())) { closeCurrentTab(); g_pNotifierWindow->update(); @@ -524,7 +524,7 @@ void KviNotifierWindowTabs::setFocusOn(KviNotifierWindowTab * tab) g_pNotifierWindow->update(); } -void KviNotifierWindowTabs::draw(QPainter * p) +void KviNotifierWindowTabs::draw(TQPainter * p) { if(!m_bNeedToRedraw)return; @@ -532,12 +532,12 @@ void KviNotifierWindowTabs::draw(QPainter * p) m_pPainter->begin(m_pPixmap); - QFont tmpFont; + TQFont tmpFont; tmpFont = p->font(); m_pPainter->setFont(tmpFont); - QString str; + TQString str; bool isBigger = false; @@ -555,9 +555,9 @@ void KviNotifierWindowTabs::draw(QPainter * p) KviPointerListIterator<KviNotifierWindowTab> tabIterator (m_tabPtrList); - //m_tabPtrList.findRef(m_tabMap[m_pTabFocused->wnd()]); + //m_tabPtrList.tqfindRef(m_tabMap[m_pTabFocused->wnd()]); -// QMap<KviWindow *, KviNotifierWindowTab *>::Iterator tab; +// TQMap<KviWindow *, KviNotifierWindowTab *>::Iterator tab; KviNotifierWindowTab * tab; //for (tab = m_tabMap.begin(); tab != m_tabMap.end() && !isBigger; tab++ ) tabIterator.moveFirst(); @@ -581,7 +581,7 @@ void KviNotifierWindowTabs::draw(QPainter * p) m_pPainter->drawPixmap(offset,0,m_pixSXFocused); m_pPainter->drawTiledPixmap(offset+m_pixSXFocused.width(),0,tab->width(true),m_rctTabs.height(),m_pixBKGFocused); m_pPainter->drawPixmap(offset+m_pixSXFocused.width()+tab->width(true),0,m_pixDXFocused); - QPen tmpP = m_pPainter->pen(); m_pPainter->setPen(tab->labelColor()); + TQPen tmpP = m_pPainter->pen(); m_pPainter->setPen(tab->labelColor()); m_pPainter->drawText(offset+m_pixSXFocused.width()+1,m_rctTabs.height()-NTF_TABS_FONT_BASELINE,tab->label()); m_pPainter->setPen(tmpP); @@ -596,7 +596,7 @@ void KviNotifierWindowTabs::draw(QPainter * p) m_pPainter->drawPixmap(offset, 0, m_pixSXUnfocused); m_pPainter->drawTiledPixmap(offset+m_pixSXUnfocused.width(), 0, tab->width(true), m_rctTabs.height(), m_pixBKGUnfocused); m_pPainter->drawPixmap(offset+m_pixSXUnfocused.width()+tab->width(true), 0, m_pixDXUnfocused); - QPen tmpP = m_pPainter->pen(); m_pPainter->setPen(tab->labelColor()); + TQPen tmpP = m_pPainter->pen(); m_pPainter->setPen(tab->labelColor()); m_pPainter->drawText(offset+m_pixSXUnfocused.width()+1,m_rctTabs.height()-NTF_TABS_FONT_BASELINE+1,tab->label()); m_pPainter->setPen(tmpP); offset += tab->width(); @@ -634,7 +634,7 @@ void KviNotifierWindowTabs::draw(QPainter * p) void KviNotifierWindowTabs::markAllMessagesAsHistoric() { /* - QMap<KviWindow *, KviNotifierWindowTab *>::Iterator tab; + TQMap<KviWindow *, KviNotifierWindowTab *>::Iterator tab; // Iterating every tab for (tab = m_tabMap.begin(); tab != m_tabMap.end(); ++tab) { @@ -654,7 +654,7 @@ void KviNotifierWindowTabs::markAllMessagesAsHistoric() void KviNotifierWindowTabs::closeTab(KviWindow * pWnd) { - KviNotifierWindowTab * pTab = m_tabMap.find(pWnd).data(); + KviNotifierWindowTab * pTab = m_tabMap.tqfind(pWnd).data(); closeTab(pWnd, pTab); } @@ -671,7 +671,7 @@ void KviNotifierWindowTabs::closeCurrentTab() KviNotifierWindowTab * pTab = m_pTabFocused; if (m_tabMap.isEmpty()) return; // Empty??? The World is ending... KviWindow * pWnd = pTab->wnd(); - if (!m_tabMap.contains(pWnd)) return; // The current tab is not on the map??? Call 911!! + if (!m_tabMap.tqcontains(pWnd)) return; // The current tab is not on the map??? Call 911!! // End paranoic stuff, go back to sanity... closeTab(pWnd, pTab); |