diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-13 08:32:36 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-13 08:32:36 +0000 |
commit | f7e71d47719ab6094cf4a9fafffa5ea351973522 (patch) | |
tree | 30834aa632d442019e14f88685001d94657d060b /kutils/kmultitabbar.cpp | |
parent | b31cfd9a1ee986fe2ae9a693f3afd7f171dd897c (diff) | |
download | tdelibs-f7e71d47719ab6094cf4a9fafffa5ea351973522.tar.gz tdelibs-f7e71d47719ab6094cf4a9fafffa5ea351973522.zip |
Initial conversion for TQt for Qt4 3.4.0 TP2
This will also compile with TQt for Qt3, and should not cause any problems
with dependent modules such as kdebase. If it does then it needs to be fixed!
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1214149 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kutils/kmultitabbar.cpp')
-rw-r--r-- | kutils/kmultitabbar.cpp | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/kutils/kmultitabbar.cpp b/kutils/kmultitabbar.cpp index a9b648736..53f73e942 100644 --- a/kutils/kmultitabbar.cpp +++ b/kutils/kmultitabbar.cpp @@ -73,7 +73,7 @@ KMultiTabBarInternal::KMultiTabBarInternal(TQWidget *parent, KMultiTabBar::KMult } addChild(box); setFrameStyle(NoFrame); - viewport()->setBackgroundMode(Qt::PaletteBackground); + viewport()->setBackgroundMode(TQt::PaletteBackground); /* box->setPaletteBackgroundColor(Qt::red); setPaletteBackgroundColor(Qt::green);*/ } @@ -110,7 +110,7 @@ void KMultiTabBarInternal::setStyle(enum KMultiTabBar::KMultiTabBarStyle style) mainLayout->setAutoAdd(true); } - viewport()->repaint(); + viewport()->tqrepaint(); } void KMultiTabBarInternal::drawContents ( TQPainter * paint, int clipx, int clipy, int clipw, int cliph ) @@ -120,9 +120,9 @@ void KMultiTabBarInternal::drawContents ( TQPainter * paint, int clipx, int clip if (m_position==KMultiTabBar::Right) { - paint->setPen(colorGroup().shadow()); + paint->setPen(tqcolorGroup().shadow()); paint->drawLine(0,0,0,viewport()->height()); - paint->setPen(colorGroup().background().dark(120)); + paint->setPen(tqcolorGroup().background().dark(120)); paint->drawLine(1,0,1,viewport()->height()); @@ -130,28 +130,28 @@ void KMultiTabBarInternal::drawContents ( TQPainter * paint, int clipx, int clip else if (m_position==KMultiTabBar::Left) { - paint->setPen(colorGroup().light()); + paint->setPen(tqcolorGroup().light()); paint->drawLine(23,0,23,viewport()->height()); paint->drawLine(22,0,22,viewport()->height()); - paint->setPen(colorGroup().shadow()); + paint->setPen(tqcolorGroup().shadow()); paint->drawLine(0,0,0,viewport()->height()); } else if (m_position==KMultiTabBar::Bottom) { - paint->setPen(colorGroup().shadow()); + paint->setPen(tqcolorGroup().shadow()); paint->drawLine(0,0,viewport()->width(),0); - paint->setPen(colorGroup().background().dark(120)); + paint->setPen(tqcolorGroup().background().dark(120)); paint->drawLine(0,1,viewport()->width(),1); } else { - paint->setPen(colorGroup().light()); + paint->setPen(tqcolorGroup().light()); paint->drawLine(0,23,viewport()->width(),23); paint->drawLine(0,22,viewport()->width(),22); -/* paint->setPen(colorGroup().shadow()); +/* paint->setPen(tqcolorGroup().shadow()); paint->drawLine(0,0,0,viewport()->height());*/ } @@ -378,7 +378,7 @@ void KMultiTabBarInternal::setPosition(enum KMultiTabBar::KMultiTabBarPosition p m_position=pos; for (uint i=0;i<m_tabs.count();i++) m_tabs.at(i)->setTabsPosition(m_position); - viewport()->repaint(); + viewport()->tqrepaint(); } KMultiTabBarButton::KMultiTabBarButton(const TQPixmap& pic,const TQString& text, TQPopupMenu *popup, @@ -434,29 +434,29 @@ void KMultiTabBarButton::slotClicked() void KMultiTabBarButton::setPosition(KMultiTabBar::KMultiTabBarPosition pos) { m_position=pos; - repaint(); + tqrepaint(); } void KMultiTabBarButton::setStyle(KMultiTabBar::KMultiTabBarStyle style) { m_style=style; - repaint(); + tqrepaint(); } void KMultiTabBarButton::hideEvent( TQHideEvent* he) { TQPushButton::hideEvent(he); - KMultiTabBar *tb=dynamic_cast<KMultiTabBar*>(parentWidget()); + KMultiTabBar *tb=dynamic_cast<KMultiTabBar*>(tqparentWidget()); if (tb) tb->updateSeparator(); } void KMultiTabBarButton::showEvent( TQShowEvent* he) { TQPushButton::showEvent(he); - KMultiTabBar *tb=dynamic_cast<KMultiTabBar*>(parentWidget()); + KMultiTabBar *tb=dynamic_cast<KMultiTabBar*>(tqparentWidget()); if (tb) tb->updateSeparator(); } -TQSize KMultiTabBarButton::sizeHint() const +TQSize KMultiTabBarButton::tqsizeHint() const { constPolish(); @@ -472,7 +472,7 @@ TQSize KMultiTabBarButton::sizeHint() const } #endif if ( isMenuButton() ) - w += style().pixelMetric(TQStyle::PM_MenuButtonIndicator, this); + w += tqstyle().tqpixelMetric(TQStyle::PM_MenuButtonIndicator, this); if ( pixmap() ) { TQPixmap *pm = (TQPixmap *)pixmap(); @@ -482,7 +482,7 @@ TQSize KMultiTabBarButton::sizeHint() const TQString s( text() ); bool empty = s.isEmpty(); if ( empty ) - s = TQString::fromLatin1("XXXX"); + s = TQString::tqfromLatin1("XXXX"); TQFontMetrics fm = fontMetrics(); TQSize sz = fm.size( ShowPrefix, s ); if(!empty || !w) @@ -491,7 +491,7 @@ TQSize KMultiTabBarButton::sizeHint() const h = QMAX(h, sz.height()); } - return (style().sizeFromContents(TQStyle::CT_ToolButton, this, TQSize(w, h)). + return (tqstyle().tqsizeFromContents(TQStyle::CT_ToolButton, this, TQSize(w, h)). expandedTo(TQApplication::globalStrut())); } @@ -525,7 +525,7 @@ void KMultiTabBarTab::setTabsPosition(KMultiTabBar::KMultiTabBarPosition pos) } setPosition(pos); -// repaint(); +// tqrepaint(); } void KMultiTabBarTab::setIcon(const TQString& icon) @@ -577,12 +577,12 @@ void KMultiTabBarTab::updateState() if ((m_position==KMultiTabBar::Right || m_position==KMultiTabBar::Left)) { setFixedWidth(24); if ((m_style==KMultiTabBar::KDEV3) || (m_style==KMultiTabBar::KDEV3ICON) || (isOn())) { - setFixedHeight(KMultiTabBarButton::sizeHint().width()); + setFixedHeight(KMultiTabBarButton::tqsizeHint().width()); } else setFixedHeight(36); } else { setFixedHeight(24); if ((m_style==KMultiTabBar::KDEV3) || (m_style==KMultiTabBar::KDEV3ICON) || (isOn())) { - setFixedWidth(KMultiTabBarButton::sizeHint().width()); + setFixedWidth(KMultiTabBarButton::tqsizeHint().width()); } else setFixedWidth(36); } } else { @@ -633,7 +633,7 @@ void KMultiTabBarTab::drawButtonStyled(TQPainter *paint) { const int height = 24; if ((m_style==KMultiTabBar::KDEV3) || (m_style==KMultiTabBar::KDEV3ICON) || (isOn())) { if ((m_position==KMultiTabBar::Left) || (m_position==KMultiTabBar::Right)) - sh=TQSize(this->height(),this->width());//KMultiTabBarButton::sizeHint(); + sh=TQSize(this->height(),this->width());//KMultiTabBarButton::tqsizeHint(); else sh=TQSize(this->width(),this->height()); } else @@ -650,8 +650,8 @@ void KMultiTabBarTab::drawButtonStyled(TQPainter *paint) { if (isOn()) st|=TQStyle::Style_On; - style().drawControl(TQStyle::CE_PushButton,&painter,this, TQRect(0,0,pixmap.width(),pixmap.height()), colorGroup(),st); - style().drawControl(TQStyle::CE_PushButtonLabel,&painter,this, TQRect(0,0,pixmap.width(),pixmap.height()), colorGroup(),st); + tqstyle().tqdrawControl(TQStyle::CE_PushButton,&painter,this, TQRect(0,0,pixmap.width(),pixmap.height()), tqcolorGroup(),st); + tqstyle().tqdrawControl(TQStyle::CE_PushButtonLabel,&painter,this, TQRect(0,0,pixmap.width(),pixmap.height()), tqcolorGroup(),st); switch (m_position) { case KMultiTabBar::Left: @@ -667,8 +667,8 @@ void KMultiTabBarTab::drawButtonStyled(TQPainter *paint) { paint->drawPixmap(0,0,pixmap); break; } -// style().drawControl(TQStyle::CE_PushButtonLabel,painter,this, TQRect(0,0,pixmap.width(),pixmap.height()), -// colorGroup(),TQStyle::Style_Enabled); +// tqstyle().tqdrawControl(TQStyle::CE_PushButtonLabel,painter,this, TQRect(0,0,pixmap.width(),pixmap.height()), +// tqcolorGroup(),TQStyle::Style_Enabled); } @@ -678,58 +678,58 @@ void KMultiTabBarTab::drawButtonClassic(TQPainter *paint) TQPixmap pixmap; if ( iconSet()) pixmap = iconSet()->pixmap( TQIconSet::Small, TQIconSet::Normal ); - paint->fillRect(0, 0, 24, 24, colorGroup().background()); + paint->fillRect(0, 0, 24, 24, tqcolorGroup().background()); if (!isOn()) { if (m_position==KMultiTabBar::Right) { - paint->fillRect(0,0,21,21,TQBrush(colorGroup().background())); + paint->fillRect(0,0,21,21,TQBrush(tqcolorGroup().background())); - paint->setPen(colorGroup().background().dark(150)); + paint->setPen(tqcolorGroup().background().dark(150)); paint->drawLine(0,22,23,22); paint->drawPixmap(12-pixmap.width()/2,12-pixmap.height()/2,pixmap); - paint->setPen(colorGroup().shadow()); + paint->setPen(tqcolorGroup().shadow()); paint->drawLine(0,0,0,23); - paint->setPen(colorGroup().background().dark(120)); + paint->setPen(tqcolorGroup().background().dark(120)); paint->drawLine(1,0,1,23); } else if ((m_position==KMultiTabBar::Bottom) || (m_position==KMultiTabBar::Top)) { - paint->fillRect(0,1,23,22,TQBrush(colorGroup().background())); + paint->fillRect(0,1,23,22,TQBrush(tqcolorGroup().background())); paint->drawPixmap(12-pixmap.width()/2,12-pixmap.height()/2,pixmap); - paint->setPen(colorGroup().background().dark(120)); + paint->setPen(tqcolorGroup().background().dark(120)); paint->drawLine(23,0,23,23); - paint->setPen(colorGroup().light()); + paint->setPen(tqcolorGroup().light()); paint->drawLine(0,22,23,22); paint->drawLine(0,23,23,23); - paint->setPen(colorGroup().shadow()); + paint->setPen(tqcolorGroup().shadow()); paint->drawLine(0,0,23,0); - paint->setPen(colorGroup().background().dark(120)); + paint->setPen(tqcolorGroup().background().dark(120)); paint->drawLine(0,1,23,1); } else { - paint->setPen(colorGroup().background().dark(120)); + paint->setPen(tqcolorGroup().background().dark(120)); paint->drawLine(0,23,23,23); - paint->fillRect(0,0,23,21,TQBrush(colorGroup().background())); + paint->fillRect(0,0,23,21,TQBrush(tqcolorGroup().background())); paint->drawPixmap(12-pixmap.width()/2,12-pixmap.height()/2,pixmap); - paint->setPen(colorGroup().light()); + paint->setPen(tqcolorGroup().light()); paint->drawLine(23,0,23,23); paint->drawLine(22,0,22,23); - paint->setPen(colorGroup().shadow()); + paint->setPen(tqcolorGroup().shadow()); paint->drawLine(0,0,0,23); } @@ -740,12 +740,12 @@ void KMultiTabBarTab::drawButtonClassic(TQPainter *paint) { if (m_position==KMultiTabBar::Right) { - paint->setPen(colorGroup().shadow()); + paint->setPen(tqcolorGroup().shadow()); paint->drawLine(0,height()-1,23,height()-1); paint->drawLine(0,height()-2,23,height()-2); paint->drawLine(23,0,23,height()-1); paint->drawLine(22,0,22,height()-1); - paint->fillRect(0,0,21,height()-3,TQBrush(colorGroup().light())); + paint->fillRect(0,0,21,height()-3,TQBrush(tqcolorGroup().light())); paint->drawPixmap(10-pixmap.width()/2,10-pixmap.height()/2,pixmap); if (m_showActiveTabText) @@ -755,9 +755,9 @@ void KMultiTabBarTab::drawButtonClassic(TQPainter *paint) TQPixmap tpixmap(height()-25-3, width()-2); TQPainter painter(&tpixmap); - painter.fillRect(0,0,tpixmap.width(),tpixmap.height(),TQBrush(colorGroup().light())); + painter.fillRect(0,0,tpixmap.width(),tpixmap.height(),TQBrush(tqcolorGroup().light())); - painter.setPen(colorGroup().text()); + painter.setPen(tqcolorGroup().text()); painter.drawText(0,+width()/2+TQFontMetrics(TQFont()).height()/2,m_text); paint->rotate(90); @@ -769,25 +769,25 @@ void KMultiTabBarTab::drawButtonClassic(TQPainter *paint) else if (m_position==KMultiTabBar::Top) { - paint->fillRect(0,0,width()-1,23,TQBrush(colorGroup().light())); + paint->fillRect(0,0,width()-1,23,TQBrush(tqcolorGroup().light())); paint->drawPixmap(10-pixmap.width()/2,10-pixmap.height()/2,pixmap); if (m_showActiveTabText) { - paint->setPen(colorGroup().text()); + paint->setPen(tqcolorGroup().text()); paint->drawText(25,height()/2+TQFontMetrics(TQFont()).height()/2,m_text); } } else if (m_position==KMultiTabBar::Bottom) { - paint->setPen(colorGroup().shadow()); + paint->setPen(tqcolorGroup().shadow()); paint->drawLine(0,23,width()-1,23); paint->drawLine(0,22,width()-1,22); - paint->fillRect(0,0,width()-1,21,TQBrush(colorGroup().light())); + paint->fillRect(0,0,width()-1,21,TQBrush(tqcolorGroup().light())); paint->drawPixmap(10-pixmap.width()/2,10-pixmap.height()/2,pixmap); if (m_showActiveTabText) { - paint->setPen(colorGroup().text()); + paint->setPen(tqcolorGroup().text()); paint->drawText(25,height()/2+TQFontMetrics(TQFont()).height()/2,m_text); } @@ -796,10 +796,10 @@ void KMultiTabBarTab::drawButtonClassic(TQPainter *paint) { - paint->setPen(colorGroup().shadow()); + paint->setPen(tqcolorGroup().shadow()); paint->drawLine(0,height()-1,23,height()-1); paint->drawLine(0,height()-2,23,height()-2); - paint->fillRect(0,0,23,height()-3,TQBrush(colorGroup().light())); + paint->fillRect(0,0,23,height()-3,TQBrush(tqcolorGroup().light())); paint->drawPixmap(10-pixmap.width()/2,10-pixmap.height()/2,pixmap); if (m_showActiveTabText) { @@ -809,9 +809,9 @@ void KMultiTabBarTab::drawButtonClassic(TQPainter *paint) TQPixmap tpixmap(height()-25-3, width()-2); TQPainter painter(&tpixmap); - painter.fillRect(0,0,tpixmap.width(),tpixmap.height(),TQBrush(colorGroup().light())); + painter.fillRect(0,0,tpixmap.width(),tpixmap.height(),TQBrush(tqcolorGroup().light())); - painter.setPen(colorGroup().text()); + painter.setPen(tqcolorGroup().text()); painter.drawText(tpixmap.width()-TQFontMetrics(TQFont()).width(m_text),+width()/2+TQFontMetrics(TQFont()).height()/2,m_text); paint->rotate(-90); @@ -838,13 +838,13 @@ KMultiTabBar::KMultiTabBar(KMultiTabBarMode bm, TQWidget *parent,const char *nam if (bm==Vertical) { m_l=new TQVBoxLayout(this); - setSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Expanding, true); + tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Expanding, true); // setFixedWidth(24); } else { m_l=new TQHBoxLayout(this); - setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed, true); + tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed, true); // setFixedHeight(24); } m_l->setMargin(0); @@ -989,7 +989,7 @@ void KMultiTabBar::fontChange(const TQFont& /* oldFont */) { for (uint i=0;i<tabs()->count();i++) tabs()->at(i)->resize(); - repaint(); + tqrepaint(); } TQPtrList<KMultiTabBarTab>* KMultiTabBar::tabs() {return m_internal->tabs();} |