diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2016-03-25 20:03:28 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2016-03-25 20:03:28 +0100 |
commit | 2ee99ab520931c5efe91123c85ba10064a45e95d (patch) | |
tree | a367666e410de28d0f258aed77b11e17cafb28e4 /style/eventfilter.cpp | |
parent | cfa36e1a95e82492c17225ff376911abb3688f62 (diff) | |
download | tde-style-baghira-2ee99ab520931c5efe91123c85ba10064a45e95d.tar.gz tde-style-baghira-2ee99ab520931c5efe91123c85ba10064a45e95d.zip |
Initial TQt conversion
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'style/eventfilter.cpp')
-rw-r--r-- | style/eventfilter.cpp | 580 |
1 files changed, 290 insertions, 290 deletions
diff --git a/style/eventfilter.cpp b/style/eventfilter.cpp index ada0475..ba09ff6 100644 --- a/style/eventfilter.cpp +++ b/style/eventfilter.cpp @@ -1,45 +1,45 @@ -#include <qcursor.h> +#include <tqcursor.h> #include <kpixmapeffect.h> #include <X11/keysym.h> #include <X11/extensions/XTest.h> #include <fixx11h.h> -bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) +bool LiquidStyle::eventFilter( TQObject *obj, TQEvent *ev ) { -// qWarning("%s, %s <- %s, %s: %d", obj->className(), obj->name(), obj->parent() ? obj->parent()->className() : "none", obj->parent()?obj->parent()->name():"none",ev->type()); +// tqWarning("%s, %s <- %s, %s: %d", obj->className(), obj->name(), obj->parent() ? obj->parent()->className() : "none", obj->parent()?obj->parent()->name():"none",ev->type()); switch (ev->type()) { - case QEvent::None: - case QEvent::Timer: + case TQEvent::None: + case TQEvent::Timer: { // first check if this is one of our fading pushbuttons - return elsewise - if (!(optionHandler->AnimateButton() && ::qt_cast<QPushButton*>(obj))) + if (!(optionHandler->AnimateButton() && ::tqt_cast<TQPushButton*>(obj))) return false; - ButtonFadeInfo *bfi_ = bfi[((QPushButton*)obj)->winId()]; - if (!bfi_ || ((QTimerEvent*)ev)->timerId() != bfi_->timerId) + ButtonFadeInfo *bfi_ = bfi[((TQPushButton*)obj)->winId()]; + if (!bfi_ || ((TQTimerEvent*)ev)->timerId() != bfi_->timerId) return false; // ok, this is one of our fading buttons asking for repaint - ((QPushButton*)obj)->repaint(false); + ((TQPushButton*)obj)->repaint(false); int index = bfi_->fadeIn?bfi_->index + 1:bfi_->index - 1; // handle border cases if (index < 0) // fade-out run has finished, either stop fading stuff, or start fade-in { bfi_->fadeIn=true; - if (((QPushButton*)obj)->isDefault()) + if (((TQPushButton*)obj)->isDefault()) { bfi_->index=0; } else { obj->killTimer(bfi_->timerId); - // qWarning("%u: stopped (%d)", ((QPushButton*)obj)->winId(), bfi_->timerId); + // tqWarning("%u: stopped (%d)", ((TQPushButton*)obj)->winId(), bfi_->timerId); bfi_->timerId=0; - ((QPushButton*)obj)->repaint(false); // must be to clean out button + ((TQPushButton*)obj)->repaint(false); // must be to clean out button } } else if (index > 9) // fade-in run has finished, either stop fading stuff, or start fade-out { - if (((QPushButton*)obj)->isDefault()) + if (((TQPushButton*)obj)->isDefault()) { bfi_->fadeIn=false; bfi_->index=9; @@ -47,20 +47,20 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) else { obj->killTimer(bfi_->timerId); - // qWarning("%u: stopped (%d)", ((QPushButton*)obj)->winId(), bfi_->timerId); + // tqWarning("%u: stopped (%d)", ((TQPushButton*)obj)->winId(), bfi_->timerId); bfi_->timerId=0; } } else bfi_->index = index; } - case QEvent::MouseMove: - if (::qt_cast<QTabBar*>(obj)) + case TQEvent::MouseMove: + if (::tqt_cast<TQTabBar*>(obj)) { - QTabBar *tb = (QTabBar*)obj; - QRect tmpRect; + TQTabBar *tb = (TQTabBar*)obj; + TQRect tmpRect; bool done = false; - QMouseEvent *me = ( QMouseEvent*)ev; + TQMouseEvent *me = ( TQMouseEvent*)ev; int oldTab = hoveredTabIndex; if (hoveredTabIndex == -1) { @@ -107,12 +107,12 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) } return false; } - else if ( ::qt_cast<QHeader*>(obj) ) + else if ( ::tqt_cast<TQHeader*>(obj) ) { - QHeader *hw = (QHeader*)obj; - QMouseEvent * me = ( QMouseEvent * ) ev; + TQHeader *hw = (TQHeader*)obj; + TQMouseEvent * me = ( TQMouseEvent * ) ev; int oldHeader = headerHoverID; - headerHoverID = hw->orientation() == Qt::Horizontal ? hw->sectionAt( me->x() + hw->offset() ) : hw->sectionAt( me->y() + hw->offset() ); + headerHoverID = hw->orientation() == TQt::Horizontal ? hw->sectionAt( me->x() + hw->offset() ) : hw->sectionAt( me->y() + hw->offset() ); if ( oldHeader != headerHoverID ) { // reset old header @@ -126,14 +126,14 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) return false; } return false; - case QEvent::Paint: - if ( ::qt_cast<QToolButton*>(obj) ) + case TQEvent::Paint: + if ( ::tqt_cast<TQToolButton*>(obj) ) { - QToolButton * btn = ( QToolButton * ) obj; + TQToolButton * btn = ( TQToolButton * ) obj; if (!obj->inherits( "TaskContainer" )) { - if (btn->backgroundOrigin() != QWidget::WindowOrigin) - btn->setBackgroundOrigin( QWidget::WindowOrigin ); + if (btn->backgroundOrigin() != TQWidget::WindowOrigin) + btn->setBackgroundOrigin( TQWidget::WindowOrigin ); } else { @@ -145,48 +145,48 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) } return false; } - else if (::qt_cast<QMenuBar*>(obj)) + else if (::tqt_cast<TQMenuBar*>(obj)) { - QWidget *w = (QWidget *)obj; - if(w->backgroundMode() != Qt::PaletteBackground) + TQWidget *w = (TQWidget *)obj; + if(w->backgroundMode() != TQt::PaletteBackground) { w->setBackgroundMode(PaletteBackground); - w->setBackgroundOrigin(QWidget::WindowOrigin); + w->setBackgroundOrigin(TQWidget::WindowOrigin); } return false; } - else if ( ::qt_cast<QHeader*>(obj) ) + else if ( ::tqt_cast<TQHeader*>(obj) ) { - QHeader *hw = (QHeader*)obj; - if (hw->parentWidget() && ::qt_cast<QListView*>(hw->parentWidget())) - headerSortID = ((QListView*)hw->parentWidget())->sortColumn(); + TQHeader *hw = (TQHeader*)obj; + if (hw->parentWidget() && ::tqt_cast<TQListView*>(hw->parentWidget())) + headerSortID = ((TQListView*)hw->parentWidget())->sortColumn(); return false; } - else if ( obj->inherits( "QDockWindow" ) ) + else if ( obj->inherits( "TQDockWindow" ) ) { if (KStyle::eventFilter( obj, ev )) return true; - QWidget * w = ( QWidget * ) obj; - if ( w->backgroundMode() != Qt::PaletteBackground ) + TQWidget * w = ( TQWidget * ) obj; + if ( w->backgroundMode() != TQt::PaletteBackground ) { - w->setBackgroundMode( Qt::PaletteBackground ); - w->setBackgroundOrigin( QWidget::WindowOrigin ); + w->setBackgroundMode( TQt::PaletteBackground ); + w->setBackgroundOrigin( TQWidget::WindowOrigin ); } return false; } - else if ( obj->inherits( "QRadioButton" ) || obj->inherits( "QCheckBox" ) ) + else if ( obj->inherits( "TQRadioButton" ) || obj->inherits( "TQCheckBox" ) ) { - QButton * btn = ( QButton * ) obj; - bool isStatusChild = btn->parent() && ( btn->parent() ->inherits( "QStatusBar" ) || btn->parent() ->inherits( "KonqFrameStatusBar" ) ); - bool isRadio = obj->inherits( "QRadioButton" ); + TQButton * btn = ( TQButton * ) obj; + bool isStatusChild = btn->parent() && ( btn->parent() ->inherits( "TQStatusBar" ) || btn->parent() ->inherits( "KonqFrameStatusBar" ) ); + bool isRadio = obj->inherits( "TQRadioButton" ); btn->erase(); - QPainter p; + TQPainter p; p.begin( btn ); - QFontMetrics fm = btn->fontMetrics(); - QSize lsz = fm.size( ShowPrefix, btn->text() ); - QSize sz = isRadio ? - QSize( pixelMetric( PM_ExclusiveIndicatorWidth ), pixelMetric( PM_ExclusiveIndicatorHeight ) ) : - QSize( pixelMetric( PM_IndicatorWidth ), pixelMetric( PM_IndicatorHeight ) ); + TQFontMetrics fm = btn->fontMetrics(); + TQSize lsz = fm.size( ShowPrefix, btn->text() ); + TQSize sz = isRadio ? + TQSize( pixelMetric( PM_ExclusiveIndicatorWidth ), pixelMetric( PM_ExclusiveIndicatorHeight ) ) : + TQSize( pixelMetric( PM_IndicatorWidth ), pixelMetric( PM_IndicatorHeight ) ); int x = 0; int y = isStatusChild ? 0 : ( btn->height() - lsz.height() + fm.height() - sz.height() ) / 2; SFlags flags = Style_Default; @@ -198,44 +198,44 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) flags |= Style_Down; if ( highlightWidget == btn ) flags |= Style_MouseOver; - if ( btn->state() == QButton::On ) + if ( btn->state() == TQButton::On ) flags |= Style_On; - else if ( btn->state() == QButton::Off ) + else if ( btn->state() == TQButton::Off ) flags |= Style_Off; if ( isRadio ) - drawControl( CE_RadioButton, &p, btn, QRect( x, y, sz.width(), sz.height() ), btn->colorGroup(), flags ); + drawControl( CE_RadioButton, &p, btn, TQRect( x, y, sz.width(), sz.height() ), btn->colorGroup(), flags ); else - drawControl( CE_CheckBox, &p, btn, QRect( x, y, sz.width(), sz.height() ), btn->colorGroup(), flags ); + drawControl( CE_CheckBox, &p, btn, TQRect( x, y, sz.width(), sz.height() ), btn->colorGroup(), flags ); x = sz.width() + 6; y = 0; if ( btn->hasFocus() ) { - QColor tmp( btn->colorGroup().background().dark( 130 ) ); - drawItem( &p, QRect( sz.width() + 6 + 2, 1, btn->width() - ( sz.width() + 6 + 1 ), btn->height() ), AlignLeft | AlignVCenter | ShowPrefix, btn->colorGroup(), btn->isEnabled(), btn->pixmap(), btn->text(), -1, &tmp ); - drawItem( &p, QRect( sz.width() + 6 + 3, 2, btn->width() - ( sz.width() + 6 + 1 ), btn->height() ), AlignLeft | AlignVCenter | ShowPrefix, btn->colorGroup(), btn->isEnabled(), btn->pixmap(), btn->text(), -1, &tmp ); + TQColor tmp( btn->colorGroup().background().dark( 130 ) ); + drawItem( &p, TQRect( sz.width() + 6 + 2, 1, btn->width() - ( sz.width() + 6 + 1 ), btn->height() ), AlignLeft | AlignVCenter | ShowPrefix, btn->colorGroup(), btn->isEnabled(), btn->pixmap(), btn->text(), -1, &tmp ); + drawItem( &p, TQRect( sz.width() + 6 + 3, 2, btn->width() - ( sz.width() + 6 + 1 ), btn->height() ), AlignLeft | AlignVCenter | ShowPrefix, btn->colorGroup(), btn->isEnabled(), btn->pixmap(), btn->text(), -1, &tmp ); } - drawItem( &p, QRect( sz.width() + 6 + 1, 0, btn->width() - ( sz.width() + 6 + 1 ), btn->height() ), AlignLeft | AlignVCenter | ShowPrefix, btn->colorGroup(), btn->isEnabled(), btn->pixmap(), btn->text() ); + drawItem( &p, TQRect( sz.width() + 6 + 1, 0, btn->width() - ( sz.width() + 6 + 1 ), btn->height() ), AlignLeft | AlignVCenter | ShowPrefix, btn->colorGroup(), btn->isEnabled(), btn->pixmap(), btn->text() ); p.end(); return true; } - else if (obj->inherits("KColorGrid") && !(((QWidget*)obj)->width() && ((QWidget*)obj)->height())) + else if (obj->inherits("KColorGrid") && !(((TQWidget*)obj)->width() && ((TQWidget*)obj)->height())) return true; return false; - case QEvent::KeyPress: - case QEvent::KeyRelease: + case TQEvent::KeyPress: + case TQEvent::KeyRelease: return false; - case QEvent::Wheel: - if ( ::qt_cast<QScrollView*>(obj) ) + case TQEvent::Wheel: + if ( ::tqt_cast<TQScrollView*>(obj) ) { optionHandler->setScrollerActive(); return false; } return false; - case QEvent::Enter: - if ( ::qt_cast<QToolButton*>(obj) ) + case TQEvent::Enter: + if ( ::tqt_cast<TQToolButton*>(obj) ) { bool isTask = obj->inherits( "TaskContainer" ); - QToolButton * btn = ( QToolButton * ) obj; + TQToolButton * btn = ( TQToolButton * ) obj; if (isTask) { currentTaskContainer = btn; @@ -249,28 +249,28 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) return false; } } - else if ( ::qt_cast<QPushButton*>(obj) || ::qt_cast<QComboBox*>(obj) || obj->inherits( "QSplitterHandle" ) || obj->inherits( "AppletHandleDrag" ) ) + else if ( ::tqt_cast<TQPushButton*>(obj) || ::tqt_cast<TQComboBox*>(obj) || obj->inherits( "TQSplitterHandle" ) || obj->inherits( "AppletHandleDrag" ) ) { - QWidget * btn = ( QWidget * ) obj; + TQWidget * btn = ( TQWidget * ) obj; if ( btn->isEnabled() ) { highlightWidget = btn; btn->repaint( false ); - if (optionHandler->AnimateButton() && ::qt_cast<QPushButton*>(obj)) - fadeIn((QPushButton*)obj); + if (optionHandler->AnimateButton() && ::tqt_cast<TQPushButton*>(obj)) + fadeIn((TQPushButton*)obj); } return false; } - else if (::qt_cast<KToolBar*>(obj)) + else if (::tqt_cast<KToolBar*>(obj)) { - QObjectList *handlerList = obj->queryList( "QDockWindowHandle" ); + TQObjectList *handlerList = obj->queryList( "TQDockWindowHandle" ); for (uint i= 0; i < handlerList->count(); i++) - ((QWidget*)(handlerList->at(i)))->repaint(false); + ((TQWidget*)(handlerList->at(i)))->repaint(false); return false; } - if ( ::qt_cast<QScrollBar*>(obj) ) + if ( ::tqt_cast<TQScrollBar*>(obj) ) { - QScrollBar * sb = ( QScrollBar * ) obj; + TQScrollBar * sb = ( TQScrollBar * ) obj; if ( !sb->draggingSlider() ) { if ( sb->isEnabled() ) @@ -282,10 +282,10 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) } return false; } - else if ( ::qt_cast<QScrollView*>(obj) ) + else if ( ::tqt_cast<TQScrollView*>(obj) ) { - QScrollView *sv = ( QScrollView * ) obj; - if (sv->vScrollBarMode() == QScrollView::AlwaysOff && sv->hScrollBarMode() == QScrollView::AlwaysOff) + TQScrollView *sv = ( TQScrollView * ) obj; + if (sv->vScrollBarMode() == TQScrollView::AlwaysOff && sv->hScrollBarMode() == TQScrollView::AlwaysOff) return false; optionHandler->setScrollerActive(); if (!(highlightWidget == sv->verticalScrollBar())) @@ -294,38 +294,38 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) sv->horizontalScrollBar()->repaint(false); return false; } - else if ( ::qt_cast<QHeader*>(obj) ) + else if ( ::tqt_cast<TQHeader*>(obj) ) { - currentHeader = (QHeader*)obj; + currentHeader = (TQHeader*)obj; headerHoverID = -1; return false; } - else if (::qt_cast<QTabBar*>(obj)) + else if (::tqt_cast<TQTabBar*>(obj)) { - currentTabBar = (QTabBar*)obj; + currentTabBar = (TQTabBar*)obj; hoveredTabIndex = -1; return false; } else if ( obj->inherits( "KateView" ) || obj->inherits( "TEWidget") || obj->inherits("CHexViewWidget")) { - QObjectList *scrollerList = obj->queryList( "QScrollBar" ); + TQObjectList *scrollerList = obj->queryList( "TQScrollBar" ); optionHandler->setScrollerActive(); for (uint i= 0; i < scrollerList->count(); i++) - ((QWidget*)(scrollerList->at(i)))->repaint(false); + ((TQWidget*)(scrollerList->at(i)))->repaint(false); return false; } else if (obj->inherits("KDockWidgetAbstractHeaderDrag")) { - ((QWidget *)obj)->repaint(); + ((TQWidget *)obj)->repaint(); return false; } else if (obj->inherits( "KAnimWidget" )) { return true; } - else if ( obj->inherits( "QLineEdit" ) && obj->parent() && ::qt_cast<QComboBox*>(obj->parent())) + else if ( obj->inherits( "TQLineEdit" ) && obj->parent() && ::tqt_cast<TQComboBox*>(obj->parent())) { - QWidget * btn = ( QWidget * ) obj->parent(); + TQWidget * btn = ( TQWidget * ) obj->parent(); if ( btn->isEnabled() ) { highlightWidget = btn; @@ -333,22 +333,22 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) } return false; } - else if ( obj->inherits( "QRadioButton" ) || obj->inherits( "QCheckBox" ) ) + else if ( obj->inherits( "TQRadioButton" ) || obj->inherits( "TQCheckBox" ) ) { - QButton * btn = ( QButton * ) obj; + TQButton * btn = ( TQButton * ) obj; if (btn->isEnabled()) { - bool isStatusChild = btn->parent() && ( btn->parent() ->inherits( "QStatusBar" ) || btn->parent() ->inherits( "KonqFrameStatusBar" ) ); - bool isRadio = obj->inherits( "QRadioButton" ); + bool isStatusChild = btn->parent() && ( btn->parent() ->inherits( "TQStatusBar" ) || btn->parent() ->inherits( "KonqFrameStatusBar" ) ); + bool isRadio = obj->inherits( "TQRadioButton" ); highlightWidget = btn; - QFontMetrics fm = btn->fontMetrics(); - QSize lsz = fm.size( ShowPrefix, btn->text() ); - QSize sz = isRadio ? - QSize( pixelMetric( PM_ExclusiveIndicatorWidth ), pixelMetric( PM_ExclusiveIndicatorHeight ) ) : - QSize( pixelMetric( PM_IndicatorWidth ), pixelMetric( PM_IndicatorHeight ) ); + TQFontMetrics fm = btn->fontMetrics(); + TQSize lsz = fm.size( ShowPrefix, btn->text() ); + TQSize sz = isRadio ? + TQSize( pixelMetric( PM_ExclusiveIndicatorWidth ), pixelMetric( PM_ExclusiveIndicatorHeight ) ) : + TQSize( pixelMetric( PM_IndicatorWidth ), pixelMetric( PM_IndicatorHeight ) ); int x = 0; int y = isStatusChild ? 0 : ( btn->height() - lsz.height() + fm.height() - sz.height() ) / 2; - QPainter p; + TQPainter p; p.begin( btn ); SFlags flags = Style_Default; if ( btn->isEnabled() ) @@ -359,23 +359,23 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) flags |= Style_Down; if ( highlightWidget == btn ) flags |= Style_MouseOver; - if ( btn->state() == QButton::On ) + if ( btn->state() == TQButton::On ) flags |= Style_On; - else if ( btn->state() == QButton::Off ) + else if ( btn->state() == TQButton::Off ) flags |= Style_Off; if ( isRadio ) - drawControl( CE_RadioButton, &p, btn, QRect( x, y, sz.width(), sz.height() ), btn->colorGroup(), flags ); + drawControl( CE_RadioButton, &p, btn, TQRect( x, y, sz.width(), sz.height() ), btn->colorGroup(), flags ); else - drawControl( CE_CheckBox, &p, btn, QRect( x, y, sz.width(), sz.height() ), btn->colorGroup(), flags ); + drawControl( CE_CheckBox, &p, btn, TQRect( x, y, sz.width(), sz.height() ), btn->colorGroup(), flags ); p.end(); } return false; } return false; - case QEvent::Leave: - if ( ::qt_cast<QToolButton*>(obj) ) + case TQEvent::Leave: + if ( ::tqt_cast<TQToolButton*>(obj) ) { - QToolButton * btn = ( QToolButton * ) obj; + TQToolButton * btn = ( TQToolButton * ) obj; if (obj->inherits( "TaskContainer" )) { currentTaskContainer = NULL; @@ -389,29 +389,29 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) return false; } } - else if ( ::qt_cast<QPushButton*>(obj) || ::qt_cast<QComboBox*>(obj) || obj->inherits( "QSplitterHandle" ) || obj->inherits( "AppletHandleDrag" ) ) + else if ( ::tqt_cast<TQPushButton*>(obj) || ::tqt_cast<TQComboBox*>(obj) || obj->inherits( "TQSplitterHandle" ) || obj->inherits( "AppletHandleDrag" ) ) { - QWidget * btn = ( QWidget * ) obj; + TQWidget * btn = ( TQWidget * ) obj; if ( btn == highlightWidget ) { highlightWidget = NULL; - if (optionHandler->AnimateButton() && ::qt_cast<QPushButton*>(obj)) - fadeOut((QPushButton*)obj); + if (optionHandler->AnimateButton() && ::tqt_cast<TQPushButton*>(obj)) + fadeOut((TQPushButton*)obj); else btn->repaint( false ); } return false; } - else if (::qt_cast<KToolBar*>(obj)) + else if (::tqt_cast<KToolBar*>(obj)) { - QObjectList *handlerList = obj->queryList( "QDockWindowHandle" ); + TQObjectList *handlerList = obj->queryList( "TQDockWindowHandle" ); for (uint i= 0; i < handlerList->count(); i++) - ((QWidget*)(handlerList->at(i)))->repaint(false); + ((TQWidget*)(handlerList->at(i)))->repaint(false); return false; } - if ( ::qt_cast<QScrollBar*>(obj) ) + if ( ::tqt_cast<TQScrollBar*>(obj) ) { - QScrollBar * sb = ( QScrollBar * ) obj; + TQScrollBar * sb = ( TQScrollBar * ) obj; if ( sb == highlightWidget && !sb->draggingSlider() ) { activeScroller = NULL; @@ -420,12 +420,12 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) } return false; } - else if ( ::qt_cast<QScrollView*>(obj) ) + else if ( ::tqt_cast<TQScrollView*>(obj) ) { - QScrollView *sv = (QScrollView*)obj; -// if (sv->clipRegion().boundingRect().contains(sv->mapFromGlobal(QCursor::pos()))) + TQScrollView *sv = (TQScrollView*)obj; +// if (sv->clipRegion().boundingRect().contains(sv->mapFromGlobal(TQCursor::pos()))) // return false; // mouse is still in the scrollview - if (sv->vScrollBarMode() == QScrollView::AlwaysOff && sv->hScrollBarMode() == QScrollView::AlwaysOff) + if (sv->vScrollBarMode() == TQScrollView::AlwaysOff && sv->hScrollBarMode() == TQScrollView::AlwaysOff) return false; // no sliders available - don't mess up things optionHandler->setScrollerInactive(); if (!(highlightWidget == sv->verticalScrollBar())) @@ -434,22 +434,22 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) sv->horizontalScrollBar()->repaint(false); return false; } - else if ( ::qt_cast<QHeader*>(obj) ) + else if ( ::tqt_cast<TQHeader*>(obj) ) { - QHeader *hw = (QHeader*)obj; + TQHeader *hw = (TQHeader*)obj; currentHeader = NULL; if ( headerHoverID != -1 ) hw->repaint( hw->sectionPos( headerHoverID )-hw->offset(), 0, hw->sectionSize( headerHoverID ), hw->height(), false ); headerHoverID = -1; return false; } - else if (::qt_cast<QTabBar*>(obj)) + else if (::tqt_cast<TQTabBar*>(obj)) { - QTabBar *tb = (QTabBar*)obj; + TQTabBar *tb = (TQTabBar*)obj; currentTabBar = NULL; if ( hoveredTabIndex != -1 ) { - QTab *tmpTab = tb->tabAt(hoveredTabIndex); + TQTab *tmpTab = tb->tabAt(hoveredTabIndex); if (tmpTab) tb->repaint( tmpTab->rect(), false ); } hoveredTabIndex = -1; @@ -457,43 +457,43 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) } else if ( obj->inherits( "KateView" ) || obj->inherits( "TEWidget") || obj->inherits("CHexViewWidget")) { - QObjectList *scrollerList = obj->queryList( "QScrollBar" ); + TQObjectList *scrollerList = obj->queryList( "TQScrollBar" ); optionHandler->setScrollerInactive(); for (uint i= 0; i < scrollerList->count(); i++) - ((QWidget*)(scrollerList->at(i)))->repaint(false); + ((TQWidget*)(scrollerList->at(i)))->repaint(false); return false; } else if (obj->inherits("KDockWidgetAbstractHeaderDrag")) { - ((QWidget *)obj)->repaint(); + ((TQWidget *)obj)->repaint(); return false; } else if (obj->inherits( "KAnimWidget" )){ return true; } - else if ( obj->inherits( "QLineEdit" ) && obj->parent() && ::qt_cast<QComboBox*>(obj->parent())) { - QWidget *btn = (QWidget*)obj->parent(); + else if ( obj->inherits( "TQLineEdit" ) && obj->parent() && ::tqt_cast<TQComboBox*>(obj->parent())) { + TQWidget *btn = (TQWidget*)obj->parent(); if ( btn == highlightWidget ) highlightWidget = NULL; btn->repaint( false ); return false; } - else if ( obj->inherits( "QRadioButton" ) || obj->inherits( "QCheckBox" ) ) + else if ( obj->inherits( "TQRadioButton" ) || obj->inherits( "TQCheckBox" ) ) { - QButton * btn = ( QButton * ) obj; + TQButton * btn = ( TQButton * ) obj; if (btn == highlightWidget) { - bool isRadio = obj->inherits( "QRadioButton" ); - bool isStatusChild = btn->parent() && ( btn->parent() ->inherits( "QStatusBar" ) || btn->parent() ->inherits( "KonqFrameStatusBar" ) ); + bool isRadio = obj->inherits( "TQRadioButton" ); + bool isStatusChild = btn->parent() && ( btn->parent() ->inherits( "TQStatusBar" ) || btn->parent() ->inherits( "KonqFrameStatusBar" ) ); highlightWidget = NULL; - QFontMetrics fm = btn->fontMetrics(); - QSize lsz = fm.size( ShowPrefix, btn->text() ); - QSize sz = isRadio ? - QSize( pixelMetric( PM_ExclusiveIndicatorWidth ), pixelMetric( PM_ExclusiveIndicatorHeight ) ) : - QSize( pixelMetric( PM_IndicatorWidth ), pixelMetric( PM_IndicatorHeight ) ); + TQFontMetrics fm = btn->fontMetrics(); + TQSize lsz = fm.size( ShowPrefix, btn->text() ); + TQSize sz = isRadio ? + TQSize( pixelMetric( PM_ExclusiveIndicatorWidth ), pixelMetric( PM_ExclusiveIndicatorHeight ) ) : + TQSize( pixelMetric( PM_IndicatorWidth ), pixelMetric( PM_IndicatorHeight ) ); int x = 0; int y = isStatusChild ? 0 : ( btn->height() - lsz.height() + fm.height() - sz.height() ) / 2; - QPainter p; + TQPainter p; p.begin( btn ); SFlags flags = Style_Default; if ( btn->isEnabled() ) @@ -504,53 +504,53 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) flags |= Style_Down; if ( highlightWidget == btn ) flags |= Style_MouseOver; - if ( btn->state() == QButton::On ) + if ( btn->state() == TQButton::On ) flags |= Style_On; - else if ( btn->state() == QButton::Off ) + else if ( btn->state() == TQButton::Off ) flags |= Style_Off; if ( isRadio ) - drawControl( CE_RadioButton, &p, btn, QRect( x, y, sz.width(), sz.height() ), btn->colorGroup(), flags ); + drawControl( CE_RadioButton, &p, btn, TQRect( x, y, sz.width(), sz.height() ), btn->colorGroup(), flags ); else - drawControl( CE_CheckBox, &p, btn, QRect( x, y, sz.width(), sz.height() ), btn->colorGroup(), flags ); + drawControl( CE_CheckBox, &p, btn, TQRect( x, y, sz.width(), sz.height() ), btn->colorGroup(), flags ); p.end(); } return false; } return false; - case QEvent::MouseButtonPress: -// qWarning("class: %s, name: %s",obj->className(), obj->name()); - if ( optionHandler->style() > Panther && ::qt_cast<QToolBar*>(obj)) + case TQEvent::MouseButtonPress: +// tqWarning("class: %s, name: %s",obj->className(), obj->name()); + if ( optionHandler->style() > Panther && ::tqt_cast<TQToolBar*>(obj)) { - QMouseEvent *mev = (QMouseEvent *) ev; - if (mev->button() != Qt::LeftButton) + TQMouseEvent *mev = (TQMouseEvent *) ev; + if (mev->button() != TQt::LeftButton) return false; mouseButtonPressed_ = true; cursorPos_ = mev->globalPos(); - QTimer::singleShot(50,this,SLOT(fakeMouse())); + TQTimer::singleShot(50,this,SLOT(fakeMouse())); return true; // fire this event } - if ( ::qt_cast<QScrollBar*>(obj) && ((QMouseEvent*)ev)->button() != Qt::RightButton) + if ( ::tqt_cast<TQScrollBar*>(obj) && ((TQMouseEvent*)ev)->button() != TQt::RightButton) { - QScrollBar * sb = ( QScrollBar * ) obj; + TQScrollBar * sb = ( TQScrollBar * ) obj; activeScroller = NULL; sb->repaint( false ); return false; } else if (obj->inherits( "KAnimWidget" )) { - ((QFrame *)obj)->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); + ((TQFrame *)obj)->setFrameStyle(TQFrame::StyledPanel | TQFrame::Sunken); return false; } return false; - case QEvent::MouseButtonRelease: + case TQEvent::MouseButtonRelease: if ( mouseButtonPressed_ ) { mouseButtonPressed_= false; } - if ( ::qt_cast<QScrollBar*>(obj) ) + if ( ::tqt_cast<TQScrollBar*>(obj) ) { - QScrollBar * sb = ( QScrollBar * ) obj; - QMouseEvent * me = ( QMouseEvent * ) ev; + TQScrollBar * sb = ( TQScrollBar * ) obj; + TQMouseEvent * me = ( TQMouseEvent * ) ev; if ( sb == highlightWidget) { if ( sb->rect().contains( me->pos() ) ) @@ -570,61 +570,61 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) } return false; } - else if ( ::qt_cast<QHeader*>(obj) && obj->parent() && ::qt_cast<QListView*>(obj->parent())) + else if ( ::tqt_cast<TQHeader*>(obj) && obj->parent() && ::tqt_cast<TQListView*>(obj->parent())) { - QMouseEvent * me = ( QMouseEvent * ) ev; - headerSortID = ((QHeader*)obj)->sectionAt( me->x() + ((QHeader*)obj)->offset()); + TQMouseEvent * me = ( TQMouseEvent * ) ev; + headerSortID = ((TQHeader*)obj)->sectionAt( me->x() + ((TQHeader*)obj)->offset()); return false; } else if (obj->inherits( "KAnimWidget" )){ - ((QFrame *)obj)->setFrameShape(QFrame::NoFrame); + ((TQFrame *)obj)->setFrameShape(TQFrame::NoFrame); return false; } return false; - case QEvent::FocusIn: - if (optionHandler->AnimateButton() && ::qt_cast<QPushButton*>(obj)) + case TQEvent::FocusIn: + if (optionHandler->AnimateButton() && ::tqt_cast<TQPushButton*>(obj)) { - fadeIn((QPushButton*)obj); + fadeIn((TQPushButton*)obj); return false; } - if ( obj->inherits( "QLineEdit" ) ) + if ( obj->inherits( "TQLineEdit" ) ) { - QObject *daddy = obj->parent(); - if ( daddy && daddy->inherits( "QSpinWidget" )) - ((QWidget*)daddy)->repaint(false); + TQObject *daddy = obj->parent(); + if ( daddy && daddy->inherits( "TQSpinWidget" )) + ((TQWidget*)daddy)->repaint(false); else - ((QWidget*)obj)->repaint(false); + ((TQWidget*)obj)->repaint(false); return false; } return false; - case QEvent::FocusOut: - if (optionHandler->AnimateButton() && ::qt_cast<QPushButton*>(obj)) + case TQEvent::FocusOut: + if (optionHandler->AnimateButton() && ::tqt_cast<TQPushButton*>(obj)) { - fadeOut((QPushButton*)obj); + fadeOut((TQPushButton*)obj); return false; } - if ( obj->inherits( "QLineEdit" ) ) + if ( obj->inherits( "TQLineEdit" ) ) { - if ( obj->parent() && obj->parent()->inherits( "QSpinWidget" )) - ((QWidget*)obj->parent())->repaint(false); + if ( obj->parent() && obj->parent()->inherits( "TQSpinWidget" )) + ((TQWidget*)obj->parent())->repaint(false); else - ((QWidget*)obj)->repaint(false); + ((TQWidget*)obj)->repaint(false); return false; } return false; - case QEvent::Move: - if ( !(::qt_cast<QToolBar*>(obj) || obj->inherits( "KActiveLabel" ))) + case TQEvent::Move: + if ( !(::tqt_cast<TQToolBar*>(obj) || obj->inherits( "KActiveLabel" ))) return false; - case QEvent::Show: - if (optionHandler->style() == Tiger && ::qt_cast<QToolBar*>(obj)) + case TQEvent::Show: + if (optionHandler->style() == Tiger && ::tqt_cast<TQToolBar*>(obj)) { - QToolBar *tb = (QToolBar*)obj; - QPoint pt = tb->mapTo(tb->topLevelWidget(), QPoint(0,0)); + TQToolBar *tb = (TQToolBar*)obj; + TQPoint pt = tb->mapTo(tb->topLevelWidget(), TQPoint(0,0)); if (pt.y() == 0) { - activeToolbarPix = QPixmap(32,tb->height()); + activeToolbarPix = TQPixmap(32,tb->height()); KPixmapEffect::gradient(activeToolbarPix, optionHandler->aDecoColor1(), optionHandler->aDecoColor2(), KPixmapEffect::VerticalGradient, 0); - QPainter painter(&activeToolbarPix); + TQPainter painter(&activeToolbarPix); painter.setPen( optionHandler->aDecoColor2().dark(130) ); painter.drawLine ( 0, tb->height()-1, 31, tb->height()-1 ); painter.end(); @@ -636,64 +636,64 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) } else { - QPalette pal( tb->palette() ); - pal.setColor( QColorGroup::Background, qApp->palette().color(QPalette::Active, QColorGroup::Background) ); - pal.setBrush ( QColorGroup::Background, qApp->palette().brush(QPalette::Active, QColorGroup::Background) ); + TQPalette pal( tb->palette() ); + pal.setColor( TQColorGroup::Background, tqApp->palette().color(TQPalette::Active, TQColorGroup::Background) ); + pal.setBrush ( TQColorGroup::Background, tqApp->palette().brush(TQPalette::Active, TQColorGroup::Background) ); tb->setPalette( pal ); } tb->removeEventFilter(eventKiller); } else { - QPalette pal( tb->palette() ); - pal.setBrush ( QColorGroup::Background, qApp->palette().brush(QPalette::Active, QColorGroup::Background) ); + TQPalette pal( tb->palette() ); + pal.setBrush ( TQColorGroup::Background, tqApp->palette().brush(TQPalette::Active, TQColorGroup::Background) ); tb->installEventFilter(eventKiller); tb->setPalette( pal ); tb->removeEventFilter(eventKiller); } } - if (optionHandler->AnimateButton() && ::qt_cast<QPushButton*>(obj)) + if (optionHandler->AnimateButton() && ::tqt_cast<TQPushButton*>(obj)) { - ButtonFadeInfo *bfi_ = bfi[((QPushButton*)obj)->winId()]; + ButtonFadeInfo *bfi_ = bfi[((TQPushButton*)obj)->winId()]; if (bfi_) return false; bfi_ = new ButtonFadeInfo(); - bfi.insert(((QPushButton*)obj)->winId(),bfi_); - if (((QPushButton*)obj)->isDefault()) - fadeIn((QPushButton*)obj); + bfi.insert(((TQPushButton*)obj)->winId(),bfi_); + if (((TQPushButton*)obj)->isDefault()) + fadeIn((TQPushButton*)obj); return false; } - if (::qt_cast<QProgressBar*>(obj)) + if (::tqt_cast<TQProgressBar*>(obj)) { - progAnimWidgets[(QWidget*)obj] = 0; + progAnimWidgets[(TQWidget*)obj] = 0; return false; } if ( !qstrcmp(obj->name(), "kde toolbar widget") ) { - QWidget* lb = static_cast<QWidget*>(obj); - if (lb->backgroundMode() == Qt::PaletteButton) - lb->setBackgroundMode(Qt::PaletteBackground); + TQWidget* lb = static_cast<TQWidget*>(obj); + if (lb->backgroundMode() == TQt::PaletteButton) + lb->setBackgroundMode(TQt::PaletteBackground); lb->removeEventFilter(this); return false; } else if ( !obj->inherits( "KActiveLabel" )) return false; - case QEvent::Resize:{ - QResizeEvent* rev = (QResizeEvent*) ev; - if (::qt_cast<QPopupMenu*>(obj) && optionHandler->MenuBackground() == Gradient) + case TQEvent::Resize:{ + TQResizeEvent* rev = (TQResizeEvent*) ev; + if (::tqt_cast<TQPopupMenu*>(obj) && optionHandler->MenuBackground() == Gradient) { - KPixmap tmpPix = QPixmap(rev->size().width(),32); - ((QWidget *)obj)->setPaletteBackgroundPixmap(KPixmapEffect::unbalancedGradient(tmpPix, optionHandler->Color(), optionHandler->Color2(), KPixmapEffect::HorizontalGradient, 100, 100)); + KPixmap tmpPix = TQPixmap(rev->size().width(),32); + ((TQWidget *)obj)->setPaletteBackgroundPixmap(KPixmapEffect::unbalancedGradient(tmpPix, optionHandler->Color(), optionHandler->Color2(), KPixmapEffect::HorizontalGradient, 100, 100)); } - else if (optionHandler->style() == Tiger && ::qt_cast<QToolBar*>(obj) && rev->size().height() != rev->oldSize().height()) + else if (optionHandler->style() == Tiger && ::tqt_cast<TQToolBar*>(obj) && rev->size().height() != rev->oldSize().height()) { - QToolBar *tb = (QToolBar*)obj; - QPoint pt = tb->mapTo(tb->topLevelWidget(), QPoint(0,0)); + TQToolBar *tb = (TQToolBar*)obj; + TQPoint pt = tb->mapTo(tb->topLevelWidget(), TQPoint(0,0)); if (pt.y() == 0) { - activeToolbarPix = QPixmap(32,rev->size().height()); + activeToolbarPix = TQPixmap(32,rev->size().height()); KPixmapEffect::gradient(activeToolbarPix, optionHandler->aDecoColor1(), optionHandler->aDecoColor2(), KPixmapEffect::VerticalGradient, 0); - QPainter painter(&activeToolbarPix); + TQPainter painter(&activeToolbarPix); painter.setPen( optionHandler->aDecoColor2().dark(130) ); painter.drawLine ( 0, rev->size().height()-1, 31, rev->size().height()-1 ); painter.end(); @@ -705,54 +705,54 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) } else { - QPalette pal( tb->palette() ); - pal.setColor( QColorGroup::Background, qApp->palette().color(QPalette::Active, QColorGroup::Background) ); - pal.setBrush ( QColorGroup::Background, qApp->palette().brush(QPalette::Active, QColorGroup::Background) ); + TQPalette pal( tb->palette() ); + pal.setColor( TQColorGroup::Background, tqApp->palette().color(TQPalette::Active, TQColorGroup::Background) ); + pal.setBrush ( TQColorGroup::Background, tqApp->palette().brush(TQPalette::Active, TQColorGroup::Background) ); tb->setPalette( pal ); } tb->removeEventFilter(eventKiller); } else { - QPalette pal( tb->palette() ); - pal.setBrush ( QColorGroup::Background, qApp->palette().brush(QPalette::Active, QColorGroup::Background) ); + TQPalette pal( tb->palette() ); + pal.setBrush ( TQColorGroup::Background, tqApp->palette().brush(TQPalette::Active, TQColorGroup::Background) ); tb->installEventFilter(eventKiller); tb->setPalette( pal ); tb->removeEventFilter(eventKiller); } } /*hmhmhmm... this may break qgroupbox children?!?*/ - else if (::qt_cast<QGroupBox*>(obj)) + else if (::tqt_cast<TQGroupBox*>(obj)) { - QGroupBox* gb = (QGroupBox*)(obj); + TQGroupBox* gb = (TQGroupBox*)(obj); if(gb->title().isEmpty()) return false; - QResizeEvent * e = (QResizeEvent*)ev; + TQResizeEvent * e = (TQResizeEvent*)ev; int fm = gb->fontMetrics().height()+(gb->isCheckable()?4:1); - gb->setFrameRect(QRect(gb->rect().x(), gb->rect().y()+fm, e->size().width(), e->size().height()-fm/*-gb->frameWidth()*/)); + gb->setFrameRect(TQRect(gb->rect().x(), gb->rect().y()+fm, e->size().width(), e->size().height()-fm/*-gb->frameWidth()*/)); if(gb->layout()) - gb->layout()->setGeometry(QRect(gb->rect().x(), gb->rect().y(), e->size().width(), e->size().height())); + gb->layout()->setGeometry(TQRect(gb->rect().x(), gb->rect().y(), e->size().width(), e->size().height())); return true; } else if ( obj->inherits( "KActiveLabel" )) { - QWidget * w = ( QWidget * ) obj; - QPalette pal( w->palette() ); - QPixmap *tile = pal.brush( QPalette::Active, QColorGroup::Background ).pixmap(); + TQWidget * w = ( TQWidget * ) obj; + TQPalette pal( w->palette() ); + TQPixmap *tile = pal.brush( TQPalette::Active, TQColorGroup::Background ).pixmap(); if ( tile ) { - QSize sz( ev->type() == QEvent::Resize ? rev->size() : w->size() ); - QPixmap pix( sz.width(), sz.height() ); - QPainter p; + TQSize sz( ev->type() == TQEvent::Resize ? rev->size() : w->size() ); + TQPixmap pix( sz.width(), sz.height() ); + TQPainter p; if (optionHandler->style() == Brushed) { p.begin( &pix ); // calc brush offsets - QWidget *window = w->topLevelWidget(); + TQWidget *window = w->topLevelWidget(); int leftWidth; int rightWidth; if (window) { - QPoint zero = w->mapTo(window, QPoint(0,0)); + TQPoint zero = w->mapTo(window, TQPoint(0,0)); leftWidth = (window->width()-1024)/2 - zero.x(); rightWidth = pix.width() - (1024 + leftWidth); if (leftWidth > 0) @@ -774,27 +774,27 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) else p.drawTiledPixmap(0, 0, pix.width(), sz.height(), gradBrush, (1024-pix.width())/2, 0); p.end(); - QBrush brush( pal.active().background(), pix ); - pal.setBrush( QColorGroup::Base, brush ); + TQBrush brush( pal.active().background(), pix ); + pal.setBrush( TQColorGroup::Base, brush ); w->setPalette( pal ); } else { p.begin(w); - p.drawTiledPixmap(QRect(0,0,sz.width(),sz.height()), *tile, w->backgroundOffset()); + p.drawTiledPixmap(TQRect(0,0,sz.width(),sz.height()), *tile, w->backgroundOffset()); } } return false; } - else if ((optionHandler->style() == Brushed) && obj->isWidgetType() && ((QWidget*)obj)->isTopLevel() && - !(::qt_cast<QPopupMenu*>(obj) || ::qt_cast<QMenuBar*>(obj) || ((QWidget*)obj)->isDesktop () || ::qt_cast<QListBox*>(obj) || - obj->inherits("QTipLabel") || obj->inherits("AlphaWidget") || obj->inherits("ScrollWidget") ) && (ev->type() == QEvent::Show || + else if ((optionHandler->style() == Brushed) && obj->isWidgetType() && ((TQWidget*)obj)->isTopLevel() && + !(::tqt_cast<TQPopupMenu*>(obj) || ::tqt_cast<TQMenuBar*>(obj) || ((TQWidget*)obj)->isDesktop () || ::tqt_cast<TQListBox*>(obj) || + obj->inherits("TQTipLabel") || obj->inherits("AlphaWidget") || obj->inherits("ScrollWidget") ) && (ev->type() == TQEvent::Show || rev->size().width() != rev->oldSize().width())) { - QWidget* widget = (QWidget*)obj; + TQWidget* widget = (TQWidget*)obj; // create new brushpix - QPixmap tmpBrushPix(ev->type() == QEvent::Show?widget->width():rev->size().width(), plainBrush.height()); - QPainter lightMe(&tmpBrushPix); + TQPixmap tmpBrushPix(ev->type() == TQEvent::Show?widget->width():rev->size().width(), plainBrush.height()); + TQPainter lightMe(&tmpBrushPix); // calc brush offsets int tmpWidth; if ((tmpWidth = tmpBrushPix.width()) > 1024) @@ -809,30 +809,30 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) lightMe.drawPixmap(0, 0, gradBrush, (1024-tmpWidth)/2, 0, tmpWidth); lightMe.end(); //update palette - QPalette pal( qApp->palette()); - QBrush brush( pal.active().background(), tmpBrushPix ); - pal.setBrush ( QColorGroup::Background, brush ); + TQPalette pal( tqApp->palette()); + TQBrush brush( pal.active().background(), tmpBrushPix ); + pal.setBrush ( TQColorGroup::Background, brush ); //reset apps palette - qApp->installEventFilter(eventKiller); // pssst... don't let anyone know... - qApp->setPalette(pal); - pal = QPalette(widget->palette()); - pal.setBrush ( QColorGroup::Background, brush ); + tqApp->installEventFilter(eventKiller); // pssst... don't let anyone know... + tqApp->setPalette(pal); + pal = TQPalette(widget->palette()); + pal.setBrush ( TQColorGroup::Background, brush ); widget->installEventFilter(eventKiller); // pssst... don't let anyone know... widget->setPalette(pal); widget->removeEventFilter(eventKiller); // ...that we just replaced the palette - QObjectList *kids = widget->queryList("QWidget"); //TODO: implement a faster version, depending on ::qt_cast<QWidget*>() + TQObjectList *kids = widget->queryList("TQWidget"); //TODO: implement a faster version, depending on ::tqt_cast<TQWidget*>() for (uint i= 0; i < kids->count(); i++) { - QWidget *kid = (QWidget*)kids->at(i); + TQWidget *kid = (TQWidget*)kids->at(i); if (kid && kid->paletteBackgroundPixmap() && !(kid->isTopLevel() || kid->inherits( "KonqIconViewWidget" ) || kid->inherits( "khtml") || kid->inherits( "KActiveLabel") || qstrcmp( kid->name(), "_B_ALI_HEADER" ) == 0 || (kid->parentWidget() && kid->parentWidget()->inherits("Thumbnail") || kid->parentWidget()->inherits("MarkListItem")) )) { //we can loose those kids anytime - especially if the user plays on konqueror... - if (::qt_cast<KToolBarButton*>(kid)) + if (::tqt_cast<KToolBarButton*>(kid)) kid->setErasePixmap(tmpBrushPix); else { - pal = QPalette(kid->palette()); - pal.setBrush ( QColorGroup::Background, brush ); + pal = TQPalette(kid->palette()); + pal.setBrush ( TQColorGroup::Background, brush ); kid->installEventFilter(eventKiller); // pssst... don't let anyone know... kid->setPalette(pal); kid->removeEventFilter(eventKiller); // ...that we just replaced the palette @@ -840,60 +840,60 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) } } delete kids; - qApp->removeEventFilter(eventKiller); // ...that we just replaced the palette + tqApp->removeEventFilter(eventKiller); // ...that we just replaced the palette return false; } return false; } - case QEvent::Hide: - if (optionHandler->AnimateButton() && ::qt_cast<QPushButton*>(obj)) + case TQEvent::Hide: + if (optionHandler->AnimateButton() && ::tqt_cast<TQPushButton*>(obj)) { - ButtonFadeInfo *bfi_ = bfi[((QPushButton*)obj)->winId()]; + ButtonFadeInfo *bfi_ = bfi[((TQPushButton*)obj)->winId()]; if (bfi_) { obj->killTimer(bfi_->timerId); - // qWarning("%u: stopped (%d)", ((QPushButton*)obj)->winId(), bfi_->timerId); + // tqWarning("%u: stopped (%d)", ((TQPushButton*)obj)->winId(), bfi_->timerId); bfi_->index=0; bfi_->timerId=0; } } - case QEvent::ApplicationPaletteChange: - if ( obj->inherits( "QTipLabel" ) ) + case TQEvent::ApplicationPaletteChange: + if ( obj->inherits( "TQTipLabel" ) ) { - ( ( QWidget* ) obj ) ->setPalette( tooltipPalette ); + ( ( TQWidget* ) obj ) ->setPalette( tooltipPalette ); return true; } return false; - case QEvent::PaletteChange: - if (obj->inherits("QStatusBar")) + case TQEvent::PaletteChange: + if (obj->inherits("TQStatusBar")) { obj->installEventFilter(eventKiller); - ((QWidget*)obj)->setPalette(qApp->palette()); + ((TQWidget*)obj)->setPalette(tqApp->palette()); obj->removeEventFilter(eventKiller); return true; } - if ( obj->inherits( "QTipLabel" ) ) + if ( obj->inherits( "TQTipLabel" ) ) { - ( ( QWidget* ) obj ) ->setPalette( tooltipPalette ); + ( ( TQWidget* ) obj ) ->setPalette( tooltipPalette ); return true; } if (obj->inherits("KCalcButton")) { - QWidget *w = (QWidget*)obj; - QPalette pal( w->palette() ); - pal.setBrush( QColorGroup::Background, qApp->palette().brush(QPalette::Active, QColorGroup::Background)); + TQWidget *w = (TQWidget*)obj; + TQPalette pal( w->palette() ); + pal.setBrush( TQColorGroup::Background, tqApp->palette().brush(TQPalette::Active, TQColorGroup::Background)); w->installEventFilter(eventKiller); w->setPalette( pal ); w->removeEventFilter(eventKiller); - w->setBackgroundOrigin( QWidget::WindowOrigin ); + w->setBackgroundOrigin( TQWidget::WindowOrigin ); return true; } return false; - case QEvent::WindowActivate: - if (optionHandler->style() == Tiger && ::qt_cast<QToolBar*>(obj)) + case TQEvent::WindowActivate: + if (optionHandler->style() == Tiger && ::tqt_cast<TQToolBar*>(obj)) { - QToolBar *tb = (QToolBar*)obj; - QPoint pt = tb->mapTo(tb->topLevelWidget(), QPoint(0,0)); + TQToolBar *tb = (TQToolBar*)obj; + TQPoint pt = tb->mapTo(tb->topLevelWidget(), TQPoint(0,0)); if (pt.y() == 0) { tb->installEventFilter(eventKiller); @@ -903,16 +903,16 @@ bool LiquidStyle::eventFilter( QObject *obj, QEvent *ev ) } } return false; - case QEvent::WindowDeactivate: - if (optionHandler->style() == Tiger && ::qt_cast<QToolBar*>(obj)) + case TQEvent::WindowDeactivate: + if (optionHandler->style() == Tiger && ::tqt_cast<TQToolBar*>(obj)) { - QToolBar *tb = (QToolBar*)obj; - QPoint pt = tb->mapTo(tb->topLevelWidget(), QPoint(0,0)); + TQToolBar *tb = (TQToolBar*)obj; + TQPoint pt = tb->mapTo(tb->topLevelWidget(), TQPoint(0,0)); if (pt.y() == 0) { - QPalette pal( tb->palette() ); - pal.setColor( QColorGroup::Background, qApp->palette().color(QPalette::Active, QColorGroup::Background) ); - pal.setBrush ( QColorGroup::Background, qApp->palette().brush(QPalette::Active, QColorGroup::Background) ); + TQPalette pal( tb->palette() ); + pal.setColor( TQColorGroup::Background, tqApp->palette().color(TQPalette::Active, TQColorGroup::Background) ); + pal.setBrush ( TQColorGroup::Background, tqApp->palette().brush(TQPalette::Active, TQColorGroup::Background) ); tb->installEventFilter(eventKiller); tb->setPalette( pal ); obj->removeEventFilter(eventKiller); @@ -928,16 +928,16 @@ void LiquidStyle::fakeMouse() { if (mouseButtonPressed_) // delayed mousepress for move event { - QCursor::setPos ( cursorPos_ ); - XTestFakeButtonEvent(qt_xdisplay(),1, false, 0); - XTestFakeKeyEvent(qt_xdisplay(),XKeysymToKeycode(qt_xdisplay(), XK_Alt_L), true, 0); - XTestFakeButtonEvent(qt_xdisplay(),1, true, 0); - XTestFakeKeyEvent(qt_xdisplay(),XKeysymToKeycode(qt_xdisplay(), XK_Alt_L), false, 0); - XFlush(qt_xdisplay()); + TQCursor::setPos ( cursorPos_ ); + XTestFakeButtonEvent(tqt_xdisplay(),1, false, 0); + XTestFakeKeyEvent(tqt_xdisplay(),XKeysymToKeycode(tqt_xdisplay(), XK_Alt_L), true, 0); + XTestFakeButtonEvent(tqt_xdisplay(),1, true, 0); + XTestFakeKeyEvent(tqt_xdisplay(),XKeysymToKeycode(tqt_xdisplay(), XK_Alt_L), false, 0); + XFlush(tqt_xdisplay()); } } -void LiquidStyle::fadeIn(QPushButton *button) +void LiquidStyle::fadeIn(TQPushButton *button) { ButtonFadeInfo *bfi_ = bfi[button->winId()]; if (!bfi_) @@ -950,11 +950,11 @@ void LiquidStyle::fadeIn(QPushButton *button) { bfi_->index = 0; bfi_->timerId = button->startTimer(button->isDefault()?100:50); - // qWarning("%u: started (%d)", button->winId(), bfi_->timerId); + // tqWarning("%u: started (%d)", button->winId(), bfi_->timerId); } } -void LiquidStyle::fadeOut(QPushButton *button) +void LiquidStyle::fadeOut(TQPushButton *button) { ButtonFadeInfo *bfi_ = bfi[button->winId()]; if (!bfi_) @@ -967,21 +967,21 @@ void LiquidStyle::fadeOut(QPushButton *button) { bfi_->index = 9; bfi_->timerId = button->startTimer(50); - // qWarning("%u: started (%d)", button->winId(), bfi_->timerId); + // tqWarning("%u: started (%d)", button->winId(), bfi_->timerId); } } -BMShower::BMShower(QObject *parent) : QObject(parent) +BMShower::BMShower(TQObject *parent) : TQObject(parent) { } -bool BMShower::eventFilter( QObject *obj, QEvent *ev ) +bool BMShower::eventFilter( TQObject *obj, TQEvent *ev ) { - if (ev->type() == QEvent::Show && (obj->isWidgetType() && ((QWidget*)obj)->isTopLevel() && - !(::qt_cast<QPopupMenu*>(obj) || ::qt_cast<QMenuBar*>(obj) || ((QWidget*)obj)->isDesktop () || ::qt_cast<QListBox*>(obj) || - obj->inherits("QTipLabel") || obj->inherits("AlphaWidget") || obj->inherits("ScrollWidget") ))) + if (ev->type() == TQEvent::Show && (obj->isWidgetType() && ((TQWidget*)obj)->isTopLevel() && + !(::tqt_cast<TQPopupMenu*>(obj) || ::tqt_cast<TQMenuBar*>(obj) || ((TQWidget*)obj)->isDesktop () || ::tqt_cast<TQListBox*>(obj) || + obj->inherits("TQTipLabel") || obj->inherits("AlphaWidget") || obj->inherits("ScrollWidget") ))) { - QResizeEvent* rev = new QResizeEvent(((QWidget*)obj)->size(), QSize(0,0)); + TQResizeEvent* rev = new TQResizeEvent(((TQWidget*)obj)->size(), TQSize(0,0)); parent()->eventFilter( obj, rev ); obj->removeEventFilter(this); delete rev; |