summaryrefslogtreecommitdiffstats
path: root/style/qtc_kstyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'style/qtc_kstyle.cpp')
-rw-r--r--style/qtc_kstyle.cpp540
1 files changed, 270 insertions, 270 deletions
diff --git a/style/qtc_kstyle.cpp b/style/qtc_kstyle.cpp
index da7e9e1..88de679 100644
--- a/style/qtc_kstyle.cpp
+++ b/style/qtc_kstyle.cpp
@@ -1,9 +1,9 @@
/*
*
- * QtCKStyle
+ * TQtCKStyle
* Copyright (C) 2001-2002 Karol Szwed <[email protected]>
*
- * QWindowsStyle CC_ListView and style images were kindly donated by TrollTech,
+ * TQWindowsStyle CC_ListView and style images were kindly donated by TrollTech,
* Copyright (C) 1998-2000 TrollTech AS.
*
* Many thanks to Bradley T. Hughes for the 3 button scrollbar code.
@@ -25,25 +25,25 @@
#include "qtc_kstyle.h"
-#include <qapplication.h>
-#include <qbitmap.h>
-#include <qcleanuphandler.h>
-#include <qmap.h>
-#include <qimage.h>
-#include <qlistview.h>
-#include <qmenubar.h>
-#include <qpainter.h>
-#include <qpixmap.h>
-#include <qpopupmenu.h>
-#include <qprogressbar.h>
-#include <qscrollbar.h>
-#include <qsettings.h>
-#include <qslider.h>
-#include <qstylefactory.h>
-#include <qtabbar.h>
-#include <qtoolbar.h>
-
-#ifdef Q_WS_X11
+#include <tqapplication.h>
+#include <tqbitmap.h>
+#include <tqcleanuphandler.h>
+#include <tqmap.h>
+#include <tqimage.h>
+#include <tqlistview.h>
+#include <tqmenubar.h>
+#include <tqpainter.h>
+#include <tqpixmap.h>
+#include <tqpopupmenu.h>
+#include <tqprogressbar.h>
+#include <tqscrollbar.h>
+#include <tqsettings.h>
+#include <tqslider.h>
+#include <tqstylefactory.h>
+#include <tqtabbar.h>
+#include <tqtoolbar.h>
+
+#ifdef TQ_WS_X11
# include <X11/Xlib.h>
# ifdef HAVE_XRENDER
# include <X11/extensions/Xrender.h> // schroder
@@ -56,7 +56,7 @@
#include <limits.h>
-struct QtCKStylePrivate
+struct TQtCKStylePrivate
{
bool highcolor : 1;
bool useFilledFrameWorkaround : 1;
@@ -68,40 +68,40 @@ struct QtCKStylePrivate
int popupMenuDelay;
float menuOpacity;
- QtCKStyle::KStyleScrollBarType scrollbarType;
- QtCKStyle::KStyleFlags flags;
+ TQtCKStyle::KStyleScrollBarType scrollbarType;
+ TQtCKStyle::KStyleFlags flags;
//For KPE_ListViewBranch
- QBitmap *verticalLine;
- QBitmap *horizontalLine;
+ TQBitmap *verticalLine;
+ TQBitmap *horizontalLine;
};
// -----------------------------------------------------------------------------
-QtCKStyle::QtCKStyle( KStyleFlags flags, KStyleScrollBarType sbtype )
- : QCommonStyle(), d(new QtCKStylePrivate)
+TQtCKStyle::TQtCKStyle( KStyleFlags flags, KStyleScrollBarType sbtype )
+ : TQCommonStyle(), d(new TQtCKStylePrivate)
{
d->flags = flags;
d->useFilledFrameWorkaround = (flags & FilledFrameWorkaround);
d->scrollbarType = sbtype;
- d->highcolor = QPixmap::defaultDepth() > 8;
+ d->highcolor = TQPixmap::defaultDepth() > 8;
// Read style settings
- QSettings settings;
- d->popupMenuDelay = settings.readNumEntry ("/QtCKStyle/Settings/PopupMenuDelay", 256);
- d->sloppySubMenus = settings.readBoolEntry("/QtCKStyle/Settings/SloppySubMenus", false);
- d->etchDisabledText = settings.readBoolEntry("/QtCKStyle/Settings/EtchDisabledText", true);
- d->menuAltKeyNavigation = settings.readBoolEntry("/QtCKStyle/Settings/MenuAltKeyNavigation", true);
- d->scrollablePopupmenus = settings.readBoolEntry("/QtCKStyle/Settings/ScrollablePopupMenus", false);
- d->menuDropShadow = settings.readBoolEntry("/QtCKStyle/Settings/MenuDropShadow", false);
+ TQSettings settings;
+ d->popupMenuDelay = settings.readNumEntry ("/TQtCKStyle/Settings/PopupMenuDelay", 256);
+ d->sloppySubMenus = settings.readBoolEntry("/TQtCKStyle/Settings/SloppySubMenus", false);
+ d->etchDisabledText = settings.readBoolEntry("/TQtCKStyle/Settings/EtchDisabledText", true);
+ d->menuAltKeyNavigation = settings.readBoolEntry("/TQtCKStyle/Settings/MenuAltKeyNavigation", true);
+ d->scrollablePopupmenus = settings.readBoolEntry("/TQtCKStyle/Settings/ScrollablePopupMenus", false);
+ d->menuDropShadow = settings.readBoolEntry("/TQtCKStyle/Settings/MenuDropShadow", false);
d->verticalLine = 0;
d->horizontalLine = 0;
}
-QtCKStyle::~QtCKStyle()
+TQtCKStyle::~TQtCKStyle()
{
delete d->verticalLine;
delete d->horizontalLine;
@@ -110,35 +110,35 @@ QtCKStyle::~QtCKStyle()
}
-QString QtCKStyle::defaultStyle()
+TQString TQtCKStyle::defaultStyle()
{
- if (QPixmap::defaultDepth() > 8)
- return QString("plastik");
+ if (TQPixmap::defaultDepth() > 8)
+ return TQString("plastik");
else
- return QString("light, 3rd revision");
+ return TQString("light, 3rd revision");
}
-void QtCKStyle::polish( QWidget* widget )
+void TQtCKStyle::polish( TQWidget* widget )
{
if ( d->useFilledFrameWorkaround )
{
- if ( QFrame *frame = ::qt_cast< QFrame* >( widget ) ) {
- QFrame::Shape shape = frame->frameShape();
- if (shape == QFrame::ToolBarPanel || shape == QFrame::MenuBarPanel)
+ if ( TQFrame *frame = ::tqqt_cast< TQFrame* >( widget ) ) {
+ TQFrame::Shape tqshape = frame->frameShape();
+ if (tqshape == TQFrame::ToolBarPanel || tqshape == TQFrame::MenuBarPanel)
widget->installEventFilter(this);
}
}
}
-void QtCKStyle::unPolish( QWidget* widget )
+void TQtCKStyle::unPolish( TQWidget* widget )
{
if ( d->useFilledFrameWorkaround )
{
- if ( QFrame *frame = ::qt_cast< QFrame* >( widget ) ) {
- QFrame::Shape shape = frame->frameShape();
- if (shape == QFrame::ToolBarPanel || shape == QFrame::MenuBarPanel)
+ if ( TQFrame *frame = ::tqqt_cast< TQFrame* >( widget ) ) {
+ TQFrame::Shape tqshape = frame->frameShape();
+ if (tqshape == TQFrame::ToolBarPanel || tqshape == TQFrame::MenuBarPanel)
widget->removeEventFilter(this);
}
}
@@ -146,7 +146,7 @@ void QtCKStyle::unPolish( QWidget* widget )
// Style changes (should) always re-polish popups.
-void QtCKStyle::polishPopupMenu( QPopupMenu* p )
+void TQtCKStyle::polishPopupMenu( TQPopupMenu* p )
{
if (!p->testWState( WState_Polished ))
p->setCheckable(true);
@@ -154,26 +154,26 @@ void QtCKStyle::polishPopupMenu( QPopupMenu* p )
// -----------------------------------------------------------------------------
-// QtCKStyle extensions
+// TQtCKStyle extensions
// -----------------------------------------------------------------------------
-void QtCKStyle::setScrollBarType(KStyleScrollBarType sbtype)
+void TQtCKStyle::setScrollBarType(KStyleScrollBarType sbtype)
{
d->scrollbarType = sbtype;
}
-QtCKStyle::KStyleFlags QtCKStyle::styleFlags() const
+TQtCKStyle::KStyleFlags TQtCKStyle::styleFlags() const
{
return d->flags;
}
-void QtCKStyle::drawKStylePrimitive( KStylePrimitive kpe,
- QPainter* p,
- const QWidget* widget,
- const QRect &r,
- const QColorGroup &cg,
+void TQtCKStyle::drawKStylePrimitive( KStylePrimitive kpe,
+ TQPainter* p,
+ const TQWidget* widget,
+ const TQRect &r,
+ const TQColorGroup &cg,
SFlags flags,
- const QStyleOption& /* opt */ ) const
+ const TQStyleOption& /* opt */ ) const
{
switch( kpe )
{
@@ -183,7 +183,7 @@ void QtCKStyle::drawKStylePrimitive( KStylePrimitive kpe,
case KPE_DockWindowHandle: {
// Draws a nice DockWindow handle including the dock title.
- QWidget* wid = const_cast<QWidget*>(widget);
+ TQWidget* wid = const_cast<TQWidget*>(widget);
bool horizontal = flags & Style_Horizontal;
int x,y,w,h,x2,y2;
@@ -197,23 +197,23 @@ void QtCKStyle::drawKStylePrimitive( KStylePrimitive kpe,
x2 = x + w - 1;
y2 = y + h - 1;
- QFont fnt;
- fnt = QApplication::font(wid);
+ TQFont fnt;
+ fnt = TQApplication::font(wid);
fnt.setPointSize( fnt.pointSize()-2 );
// Draw the item on an off-screen pixmap
// to preserve Xft antialiasing for
// vertically oriented handles.
- QPixmap pix;
+ TQPixmap pix;
if (horizontal)
pix.resize( h-2, w-2 );
else
pix.resize( w-2, h-2 );
- QString title = wid->parentWidget()->caption();
- QPainter p2;
+ TQString title = wid->tqparentWidget()->caption();
+ TQPainter p2;
p2.begin(&pix);
- p2.fillRect(pix.rect(), cg.brush(QColorGroup::Highlight));
+ p2.fillRect(pix.rect(), cg.brush(TQColorGroup::Highlight));
p2.setPen(cg.highlightedText());
p2.setFont(fnt);
p2.drawText(pix.rect(), AlignCenter, title);
@@ -228,9 +228,9 @@ void QtCKStyle::drawKStylePrimitive( KStylePrimitive kpe,
p->drawLine(x2, y+1, x2, y2);
if (horizontal) {
- QWMatrix m;
+ TQWMatrix m;
m.rotate(-90.0);
- QPixmap vpix = pix.xForm(m);
+ TQPixmap vpix = pix.xForm(m);
bitBlt(wid, r.x()+1, r.y()+1, &vpix);
} else
bitBlt(wid, r.x()+1, r.y()+1, &pix);
@@ -241,7 +241,7 @@ void QtCKStyle::drawKStylePrimitive( KStylePrimitive kpe,
/*
* KPE_ListViewExpander and KPE_ListViewBranch are based on code from
- * QWindowStyle's CC_ListView, kindly donated by TrollTech.
+ * TQWindowStyle's CC_ListView, kindly donated by TrollTech.
* CC_ListView code is Copyright (C) 1998-2000 TrollTech AS.
*/
@@ -271,10 +271,10 @@ void QtCKStyle::drawKStylePrimitive( KStylePrimitive kpe,
{
// make 128*1 and 1*128 bitmaps that can be used for
// drawing the right sort of lines.
- d->verticalLine = new QBitmap( 1, 129, true );
- d->horizontalLine = new QBitmap( 128, 1, true );
- QPointArray a( 64 );
- QPainter p2;
+ d->verticalLine = new TQBitmap( 1, 129, true );
+ d->horizontalLine = new TQBitmap( 128, 1, true );
+ TQPointArray a( 64 );
+ TQPainter p2;
p2.begin( d->verticalLine );
int i;
@@ -283,7 +283,7 @@ void QtCKStyle::drawKStylePrimitive( KStylePrimitive kpe,
p2.setPen( color1 );
p2.drawPoints( a );
p2.end();
- QApplication::flushX();
+ TQApplication::flushX();
d->verticalLine->setMask( *d->verticalLine );
p2.begin( d->horizontalLine );
@@ -292,7 +292,7 @@ void QtCKStyle::drawKStylePrimitive( KStylePrimitive kpe,
p2.setPen( color1 );
p2.drawPoints( a );
p2.end();
- QApplication::flushX();
+ TQApplication::flushX();
d->horizontalLine->setMask( *d->horizontalLine );
}
@@ -347,13 +347,13 @@ void QtCKStyle::drawKStylePrimitive( KStylePrimitive kpe,
break;
default:
- p->fillRect(r, Qt::yellow); // Something really bad happened - highlight.
+ p->fillRect(r, TQt::yellow); // Something really bad happened - highlight.
break;
}
}
-int QtCKStyle::kPixelMetric( KStylePixelMetric kpm, const QWidget* /* widget */) const
+int TQtCKStyle::kPixelMetric( KStylePixelMetric kpm, const TQWidget* /* widget */) const
{
int value;
switch(kpm)
@@ -380,35 +380,35 @@ int QtCKStyle::kPixelMetric( KStylePixelMetric kpm, const QWidget* /* widget */)
// -----------------------------------------------------------------------------
-void QtCKStyle::drawPrimitive( PrimitiveElement pe,
- QPainter* p,
- const QRect &r,
- const QColorGroup &cg,
+void TQtCKStyle::drawPrimitive( PrimitiveElement pe,
+ TQPainter* p,
+ const TQRect &r,
+ const TQColorGroup &cg,
SFlags flags,
- const QStyleOption& opt ) const
+ const TQStyleOption& opt ) const
{
// TOOLBAR/DOCK WINDOW HANDLE
// ------------------------------------------------------------------------
if (pe == PE_DockWindowHandle)
{
// Wild workarounds are here. Beware.
- QWidget *widget, *parent;
+ TQWidget *widget, *tqparent;
- if (p && p->device()->devType() == QInternal::Widget) {
- widget = static_cast<QWidget*>(p->device());
- parent = widget->parentWidget();
+ if (p && p->device()->devType() == TQInternal::Widget) {
+ widget = static_cast<TQWidget*>(p->device());
+ tqparent = widget->tqparentWidget();
} else
return; // Don't paint on non-widgets
// Check if we are a normal toolbar or a hidden dockwidget.
- if ( parent &&
- (parent->inherits("QToolBar") || // Normal toolbar
- (parent->inherits("QMainWindow")) )) // Collapsed dock
+ if ( tqparent &&
+ (tqparent->inherits(TQTOOLBAR_OBJECT_NAME_STRING) || // Normal toolbar
+ (tqparent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)) )) // Collapsed dock
// Draw a toolbar handle
drawKStylePrimitive( KPE_ToolBarHandle, p, widget, r, cg, flags, opt );
- else if ( widget->inherits("QDockWindowHandle") )
+ else if ( widget->inherits(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING) )
// Draw a dock window handle
drawKStylePrimitive( KPE_DockWindowHandle, p, widget, r, cg, flags, opt );
@@ -418,32 +418,32 @@ void QtCKStyle::drawPrimitive( PrimitiveElement pe,
drawKStylePrimitive( KPE_GeneralHandle, p, widget, r, cg, flags, opt );
} else
- QCommonStyle::drawPrimitive( pe, p, r, cg, flags, opt );
+ TQCommonStyle::tqdrawPrimitive( pe, p, r, cg, flags, opt );
}
-void QtCKStyle::drawControl( ControlElement element,
- QPainter* p,
- const QWidget* widget,
- const QRect &r,
- const QColorGroup &cg,
+void TQtCKStyle::tqdrawControl( ControlElement element,
+ TQPainter* p,
+ const TQWidget* widget,
+ const TQRect &r,
+ const TQColorGroup &cg,
SFlags flags,
- const QStyleOption &opt ) const
+ const TQStyleOption &opt ) const
{
switch (element)
{
// TABS
// ------------------------------------------------------------------------
case CE_TabBarTab: {
- const QTabBar* tb = (const QTabBar*) widget;
- QTabBar::Shape tbs = tb->shape();
+ const TQTabBar* tb = (const TQTabBar*) widget;
+ TQTabBar::Shape tbs = tb->tqshape();
bool selected = flags & Style_Selected;
int x = r.x(), y=r.y(), bottom=r.bottom(), right=r.right();
switch (tbs) {
- case QTabBar::RoundedAbove: {
+ case TQTabBar::RoundedAbove: {
if (!selected)
p->translate(0,1);
p->setPen(selected ? cg.light() : cg.shadow());
@@ -476,7 +476,7 @@ void QtCKStyle::drawControl( ControlElement element,
break;
}
- case QTabBar::RoundedBelow: {
+ case TQTabBar::RoundedBelow: {
if (!selected)
p->translate(0,-1);
p->setPen(selected ? cg.light() : cg.shadow());
@@ -510,7 +510,7 @@ void QtCKStyle::drawControl( ControlElement element,
break;
}
- case QTabBar::TriangularAbove: {
+ case TQTabBar::TriangularAbove: {
if (!selected)
p->translate(0,1);
p->setPen(selected ? cg.light() : cg.shadow());
@@ -531,7 +531,7 @@ void QtCKStyle::drawControl( ControlElement element,
p->setPen(cg.mid());
p->drawLine(right-1, y+6, right-1, bottom);
- QPointArray a(6);
+ TQPointArray a(6);
a.setPoint(0, x+2, bottom);
a.setPoint(1, x+2, y+7);
a.setPoint(2, x+7, y+2);
@@ -550,7 +550,7 @@ void QtCKStyle::drawControl( ControlElement element,
break;
}
- default: { // QTabBar::TriangularBelow
+ default: { // TQTabBar::TriangularBelow
if (!selected)
p->translate(0,-1);
p->setPen(selected ? cg.light() : cg.shadow());
@@ -574,7 +574,7 @@ void QtCKStyle::drawControl( ControlElement element,
p->setPen(cg.mid());
p->drawLine(right-1, bottom-6, right-1, y);
- QPointArray a(6);
+ TQPointArray a(6);
a.setPoint(0, x+2, y);
a.setPoint(1, x+2, bottom-7);
a.setPoint(2, x+7, bottom-2);
@@ -601,8 +601,8 @@ void QtCKStyle::drawControl( ControlElement element,
// ------------------------------------------------------------------------
case CE_PopupMenuScroller: {
p->fillRect(r, cg.background());
- drawPrimitive(PE_ButtonTool, p, r, cg, Style_Enabled);
- drawPrimitive((flags & Style_Up) ? PE_ArrowUp : PE_ArrowDown, p, r, cg, Style_Enabled);
+ tqdrawPrimitive(PE_ButtonTool, p, r, cg, Style_Enabled);
+ tqdrawPrimitive((flags & Style_Up) ? PE_ArrowUp : PE_ArrowDown, p, r, cg, Style_Enabled);
break;
}
@@ -610,17 +610,17 @@ void QtCKStyle::drawControl( ControlElement element,
// PROGRESSBAR
// ------------------------------------------------------------------------
case CE_ProgressBarGroove: {
- QRect fr = subRect(SR_ProgressBarGroove, widget);
- drawPrimitive(PE_Panel, p, fr, cg, Style_Sunken, QStyleOption::Default);
+ TQRect fr = subRect(SR_ProgressBarGroove, widget);
+ tqdrawPrimitive(PE_Panel, p, fr, cg, Style_Sunken, TQStyleOption::Default);
break;
}
case CE_ProgressBarContents: {
// ### Take into account totalSteps() for busy indicator
- const QProgressBar* pb = (const QProgressBar*)widget;
- QRect cr = subRect(SR_ProgressBarContents, widget);
+ const TQProgressBar* pb = (const TQProgressBar*)widget;
+ TQRect cr = subRect(SR_ProgressBarContents, widget);
double progress = pb->progress();
- bool reverse = QApplication::reverseLayout();
+ bool reverse = TQApplication::reverseLayout();
int steps = pb->totalSteps();
if (!cr.isValid())
@@ -629,7 +629,7 @@ void QtCKStyle::drawControl( ControlElement element,
// Draw progress bar
if (progress > 0 || steps == 0) {
double pg = (steps == 0) ? 0.1 : progress / steps;
- int width = QMIN(cr.width(), (int)(pg * cr.width()));
+ int width = TQMIN(cr.width(), (int)(pg * cr.width()));
if (steps == 0) { //Busy indicator
if (width < 1) width = 1; //A busy indicator with width 0 is kind of useless
@@ -647,10 +647,10 @@ void QtCKStyle::drawControl( ControlElement element,
if (reverse)
p->fillRect(cr.x() + cr.width() - width - pstep, cr.y(), width, cr.height(),
- cg.brush(QColorGroup::Highlight));
+ cg.brush(TQColorGroup::Highlight));
else
p->fillRect(cr.x() + pstep, cr.y(), width, cr.height(),
- cg.brush(QColorGroup::Highlight));
+ cg.brush(TQColorGroup::Highlight));
return;
}
@@ -658,7 +658,7 @@ void QtCKStyle::drawControl( ControlElement element,
// Do fancy gradient for highcolor displays
// if (d->highcolor) {
-// QColor c(cg.highlight());
+// TQColor c(cg.highlight());
// KPixmap pix;
// pix.resize(cr.width(), cr.height());
// KPixmapEffect::gradient(pix, reverse ? c.light(150) : c.dark(150),
@@ -672,33 +672,33 @@ void QtCKStyle::drawControl( ControlElement element,
// } else
if (reverse)
p->fillRect(cr.x()+(cr.width()-width), cr.y(), width, cr.height(),
- cg.brush(QColorGroup::Highlight));
+ cg.brush(TQColorGroup::Highlight));
else
p->fillRect(cr.x(), cr.y(), width, cr.height(),
- cg.brush(QColorGroup::Highlight));
+ cg.brush(TQColorGroup::Highlight));
}
break;
}
case CE_ProgressBarLabel: {
- const QProgressBar* pb = (const QProgressBar*)widget;
- QRect cr = subRect(SR_ProgressBarContents, widget);
+ const TQProgressBar* pb = (const TQProgressBar*)widget;
+ TQRect cr = subRect(SR_ProgressBarContents, widget);
double progress = pb->progress();
- bool reverse = QApplication::reverseLayout();
+ bool reverse = TQApplication::reverseLayout();
int steps = pb->totalSteps();
if (!cr.isValid())
return;
- QFont font = p->font();
+ TQFont font = p->font();
font.setBold(true);
p->setFont(font);
// Draw label
if (progress > 0 || steps == 0) {
double pg = (steps == 0) ? 1.0 : progress / steps;
- int width = QMIN(cr.width(), (int)(pg * cr.width()));
- QRect crect;
+ int width = TQMIN(cr.width(), (int)(pg * cr.width()));
+ TQRect crect;
if (reverse)
crect.setRect(cr.x()+(cr.width()-width), cr.y(), cr.width(), cr.height());
else
@@ -721,12 +721,12 @@ void QtCKStyle::drawControl( ControlElement element,
}
default:
- QCommonStyle::drawControl(element, p, widget, r, cg, flags, opt);
+ TQCommonStyle::tqdrawControl(element, p, widget, r, cg, flags, opt);
}
}
-QRect QtCKStyle::subRect(SubRect r, const QWidget* widget) const
+TQRect TQtCKStyle::subRect(SubRect r, const TQWidget* widget) const
{
switch(r)
{
@@ -738,17 +738,17 @@ QRect QtCKStyle::subRect(SubRect r, const QWidget* widget) const
case SR_ProgressBarContents:
case SR_ProgressBarLabel: {
// ### take into account indicatorFollowsStyle()
- QRect rt = widget->rect();
- return QRect(rt.x()+2, rt.y()+2, rt.width()-4, rt.height()-4);
+ TQRect rt = widget->rect();
+ return TQRect(rt.x()+2, rt.y()+2, rt.width()-4, rt.height()-4);
}
default:
- return QCommonStyle::subRect(r, widget);
+ return TQCommonStyle::subRect(r, widget);
}
}
-int QtCKStyle::pixelMetric(PixelMetric m, const QWidget* widget) const
+int TQtCKStyle::tqpixelMetric(PixelMetric m, const TQWidget* widget) const
{
switch(m)
{
@@ -760,16 +760,16 @@ int QtCKStyle::pixelMetric(PixelMetric m, const QWidget* widget) const
case PM_DockWindowHandleExtent:
{
- QWidget* parent = 0;
+ TQWidget* tqparent = 0;
// Check that we are not a normal toolbar or a hidden dockwidget,
// in which case we need to adjust the height for font size
- if (widget && (parent = widget->parentWidget() )
- && !parent->inherits("QToolBar")
- && !parent->inherits("QMainWindow")
- && widget->inherits("QDockWindowHandle") )
+ if (widget && (tqparent = widget->tqparentWidget() )
+ && !tqparent->inherits(TQTOOLBAR_OBJECT_NAME_STRING)
+ && !tqparent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)
+ && widget->inherits(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING) )
return widget->fontMetrics().lineSpacing();
else
- return QCommonStyle::pixelMetric(m, widget);
+ return TQCommonStyle::tqpixelMetric(m, widget);
}
// TABS
@@ -778,20 +778,20 @@ int QtCKStyle::pixelMetric(PixelMetric m, const QWidget* widget) const
return 24;
case PM_TabBarTabVSpace: {
- const QTabBar * tb = (const QTabBar *) widget;
- if ( tb->shape() == QTabBar::RoundedAbove ||
- tb->shape() == QTabBar::RoundedBelow )
+ const TQTabBar * tb = (const TQTabBar *) widget;
+ if ( tb->tqshape() == TQTabBar::RoundedAbove ||
+ tb->tqshape() == TQTabBar::RoundedBelow )
return 10;
else
return 4;
}
case PM_TabBarTabOverlap: {
- const QTabBar* tb = (const QTabBar*)widget;
- QTabBar::Shape tbs = tb->shape();
+ const TQTabBar* tb = (const TQTabBar*)widget;
+ TQTabBar::Shape tbs = tb->tqshape();
- if ( (tbs == QTabBar::RoundedAbove) ||
- (tbs == QTabBar::RoundedBelow) )
+ if ( (tbs == TQTabBar::RoundedAbove) ||
+ (tbs == TQTabBar::RoundedBelow) )
return 0;
else
return 2;
@@ -808,14 +808,14 @@ int QtCKStyle::pixelMetric(PixelMetric m, const QWidget* widget) const
// Determines how much space to leave for the actual non-tickmark
// portion of the slider.
case PM_SliderControlThickness: {
- const QSlider* slider = (const QSlider*)widget;
- QSlider::TickSetting ts = slider->tickmarks();
- int thickness = (slider->orientation() == Horizontal) ?
+ const TQSlider* slider = (const TQSlider*)widget;
+ TQSlider::TickSetting ts = slider->tickmarks();
+ int thickness = (slider->orientation() == Qt::Horizontal) ?
slider->height() : slider->width();
switch (ts) {
- case QSlider::NoMarks: // Use total area.
+ case TQSlider::NoMarks: // Use total area.
break;
- case QSlider::Both:
+ case TQSlider::Both:
thickness = (thickness/2) + 3; // Use approx. 1/2 of area.
break;
default: // Use approx. 2/3 of area
@@ -828,7 +828,7 @@ int QtCKStyle::pixelMetric(PixelMetric m, const QWidget* widget) const
// SPLITTER
// ------------------------------------------------------------------------
case PM_SplitterWidth:
- if (widget && widget->inherits("QDockWindowResizeHandle"))
+ if (widget && widget->inherits("TQDockWindowResizeHandle"))
return 8; // ### why do we need 2pix extra?
else
return 6;
@@ -853,17 +853,17 @@ int QtCKStyle::pixelMetric(PixelMetric m, const QWidget* widget) const
return 0;
case PM_PopupMenuScrollerHeight:
- return pixelMetric( PM_ScrollBarExtent, 0);
+ return tqpixelMetric( PM_ScrollBarExtent, 0);
default:
- return QCommonStyle::pixelMetric( m, widget );
+ return TQCommonStyle::tqpixelMetric( m, widget );
}
}
//Helper to find the next sibling that's not hidden
-static QListViewItem* nextVisibleSibling(QListViewItem* item)
+static TQListViewItem* nextVisibleSibling(TQListViewItem* item)
{
- QListViewItem* sibling = item;
+ TQListViewItem* sibling = item;
do
{
sibling = sibling->nextSibling();
@@ -873,15 +873,15 @@ static QListViewItem* nextVisibleSibling(QListViewItem* item)
return sibling;
}
-void QtCKStyle::drawComplexControl( ComplexControl control,
- QPainter* p,
- const QWidget* widget,
- const QRect &r,
- const QColorGroup &cg,
+void TQtCKStyle::tqdrawComplexControl( ComplexControl control,
+ TQPainter* p,
+ const TQWidget* widget,
+ const TQRect &r,
+ const TQColorGroup &cg,
SFlags flags,
SCFlags controls,
SCFlags active,
- const QStyleOption &opt ) const
+ const TQStyleOption &opt ) const
{
switch(control)
{
@@ -891,13 +891,13 @@ void QtCKStyle::drawComplexControl( ComplexControl control,
// Many thanks to Brad Hughes for contributing this code.
bool useThreeButtonScrollBar = (d->scrollbarType & ThreeButtonScrollBar);
- const QScrollBar *sb = (const QScrollBar*)widget;
+ const TQScrollBar *sb = (const TQScrollBar*)widget;
bool maxedOut = (sb->minValue() == sb->maxValue());
bool horizontal = (sb->orientation() == Qt::Horizontal);
SFlags sflags = ((horizontal ? Style_Horizontal : Style_Default) |
(maxedOut ? Style_Default : Style_Enabled));
- QRect addline, subline, subline2, addpage, subpage, slider, first, last;
+ TQRect addline, subline, subline2, addpage, subpage, slider, first, last;
subline = querySubControlMetrics(control, widget, SC_ScrollBarSubLine, opt);
addline = querySubControlMetrics(control, widget, SC_ScrollBarAddLine, opt);
subpage = querySubControlMetrics(control, widget, SC_ScrollBarSubPage, opt);
@@ -915,50 +915,50 @@ void QtCKStyle::drawComplexControl( ComplexControl control,
// Draw the up/left button set
if ((controls & SC_ScrollBarSubLine) && subline.isValid()) {
- drawPrimitive(PE_ScrollBarSubLine, p, subline, cg,
+ tqdrawPrimitive(PE_ScrollBarSubLine, p, subline, cg,
sflags | (active == SC_ScrollBarSubLine ?
Style_Down : Style_Default));
if (useThreeButtonScrollBar && subline2.isValid())
- drawPrimitive(PE_ScrollBarSubLine, p, subline2, cg,
+ tqdrawPrimitive(PE_ScrollBarSubLine, p, subline2, cg,
sflags | (active == SC_ScrollBarSubLine ?
Style_Down : Style_Default));
}
if ((controls & SC_ScrollBarAddLine) && addline.isValid())
- drawPrimitive(PE_ScrollBarAddLine, p, addline, cg,
+ tqdrawPrimitive(PE_ScrollBarAddLine, p, addline, cg,
sflags | ((active == SC_ScrollBarAddLine) ?
Style_Down : Style_Default));
if ((controls & SC_ScrollBarSubPage) && subpage.isValid())
- drawPrimitive(PE_ScrollBarSubPage, p, subpage, cg,
+ tqdrawPrimitive(PE_ScrollBarSubPage, p, subpage, cg,
sflags | ((active == SC_ScrollBarSubPage) ?
Style_Down : Style_Default));
if ((controls & SC_ScrollBarAddPage) && addpage.isValid())
- drawPrimitive(PE_ScrollBarAddPage, p, addpage, cg,
+ tqdrawPrimitive(PE_ScrollBarAddPage, p, addpage, cg,
sflags | ((active == SC_ScrollBarAddPage) ?
Style_Down : Style_Default));
if ((controls & SC_ScrollBarFirst) && first.isValid())
- drawPrimitive(PE_ScrollBarFirst, p, first, cg,
+ tqdrawPrimitive(PE_ScrollBarFirst, p, first, cg,
sflags | ((active == SC_ScrollBarFirst) ?
Style_Down : Style_Default));
if ((controls & SC_ScrollBarLast) && last.isValid())
- drawPrimitive(PE_ScrollBarLast, p, last, cg,
+ tqdrawPrimitive(PE_ScrollBarLast, p, last, cg,
sflags | ((active == SC_ScrollBarLast) ?
Style_Down : Style_Default));
if ((controls & SC_ScrollBarSlider) && slider.isValid()) {
- drawPrimitive(PE_ScrollBarSlider, p, slider, cg,
+ tqdrawPrimitive(PE_ScrollBarSlider, p, slider, cg,
sflags | ((active == SC_ScrollBarSlider) ?
Style_Down : Style_Default));
// Draw focus rect
if (sb->hasFocus()) {
- QRect fr(slider.x() + 2, slider.y() + 2,
+ TQRect fr(slider.x() + 2, slider.y() + 2,
slider.width() - 5, slider.height() - 5);
- drawPrimitive(PE_FocusRect, p, fr, cg, Style_Default);
+ tqdrawPrimitive(PE_FocusRect, p, fr, cg, Style_Default);
}
}
break;
@@ -968,19 +968,19 @@ void QtCKStyle::drawComplexControl( ComplexControl control,
// SLIDER
// -------------------------------------------------------------------
case CC_Slider: {
- const QSlider* slider = (const QSlider*)widget;
- QRect groove = querySubControlMetrics(CC_Slider, widget, SC_SliderGroove, opt);
- QRect handle = querySubControlMetrics(CC_Slider, widget, SC_SliderHandle, opt);
+ const TQSlider* slider = (const TQSlider*)widget;
+ TQRect groove = querySubControlMetrics(CC_Slider, widget, SC_SliderGroove, opt);
+ TQRect handle = querySubControlMetrics(CC_Slider, widget, SC_SliderHandle, opt);
// Double-buffer slider for no flicker
- QPixmap pix(widget->size());
- QPainter p2;
+ TQPixmap pix(widget->size());
+ TQPainter p2;
p2.begin(&pix);
- if ( slider->parentWidget() &&
- slider->parentWidget()->backgroundPixmap() &&
- !slider->parentWidget()->backgroundPixmap()->isNull() ) {
- QPixmap pixmap = *(slider->parentWidget()->backgroundPixmap());
+ if ( slider->tqparentWidget() &&
+ slider->tqparentWidget()->backgroundPixmap() &&
+ !slider->tqparentWidget()->backgroundPixmap()->isNull() ) {
+ TQPixmap pixmap = *(slider->tqparentWidget()->backgroundPixmap());
p2.drawTiledPixmap(r, pixmap, slider->pos());
} else
pix.fill(cg.background());
@@ -991,12 +991,12 @@ void QtCKStyle::drawComplexControl( ComplexControl control,
// Draw the focus rect around the groove
if (slider->hasFocus())
- drawPrimitive(PE_FocusRect, &p2, groove, cg);
+ tqdrawPrimitive(PE_FocusRect, &p2, groove, cg);
}
// Draw the tickmarks
if (controls & SC_SliderTickmarks)
- QCommonStyle::drawComplexControl(control, &p2, widget,
+ TQCommonStyle::tqdrawComplexControl(control, &p2, widget,
r, cg, flags, SC_SliderTickmarks, active, opt);
// Draw the slider handle
@@ -1007,7 +1007,7 @@ void QtCKStyle::drawComplexControl( ComplexControl control,
}
p2.end();
- bitBlt((QWidget*)widget, r.x(), r.y(), &pix);
+ bitBlt((TQWidget*)widget, r.x(), r.y(), &pix);
break;
}
@@ -1016,13 +1016,13 @@ void QtCKStyle::drawComplexControl( ComplexControl control,
case CC_ListView: {
/*
- * Many thanks to TrollTech AS for donating CC_ListView from QWindowsStyle.
+ * Many thanks to TrollTech AS for donating CC_ListView from TQWindowsStyle.
* CC_ListView code is Copyright (C) 1998-2000 TrollTech AS.
*/
// Paint the icon and text.
if ( controls & SC_ListView )
- QCommonStyle::drawComplexControl( control, p, widget, r, cg, flags, controls, active, opt );
+ TQCommonStyle::tqdrawComplexControl( control, p, widget, r, cg, flags, controls, active, opt );
// If we're have a branch or are expanded...
if ( controls & (SC_ListViewBranch | SC_ListViewExpand) )
@@ -1031,20 +1031,20 @@ void QtCKStyle::drawComplexControl( ComplexControl control,
if (opt.isDefault())
break;
- QListViewItem *item = opt.listViewItem();
- QListViewItem *child = item->firstChild();
+ TQListViewItem *item = opt.listViewItem();
+ TQListViewItem *child = item->firstChild();
int y = r.y();
int c; // dotline vertice count
int dotoffset = 0;
- QPointArray dotlines;
+ TQPointArray dotlines;
if ( active == SC_All && controls == SC_ListViewExpand ) {
// We only need to draw a vertical line
c = 2;
dotlines.resize(2);
- dotlines[0] = QPoint( r.right(), r.top() );
- dotlines[1] = QPoint( r.right(), r.bottom() );
+ dotlines[0] = TQPoint( r.right(), r.top() );
+ dotlines[1] = TQPoint( r.right(), r.bottom() );
} else {
@@ -1064,15 +1064,15 @@ void QtCKStyle::drawComplexControl( ComplexControl control,
int bx = r.width() / 2;
// paint stuff in the magical area
- QListView* v = item->listView();
- int lh = QMAX( p->fontMetrics().height() + 2 * v->itemMargin(),
- QApplication::globalStrut().height() );
+ TQListView* v = item->listView();
+ int lh = TQMAX( p->fontMetrics().height() + 2 * v->itemMargin(),
+ TQApplication::globalStrut().height() );
if ( lh % 2 > 0 )
lh++;
// Draw all the expand/close boxes...
- QRect boxrect;
- QStyle::StyleFlags boxflags;
+ TQRect boxrect;
+ TQStyle::StyleFlags boxflags;
while ( child && y < r.height() )
{
linebot = y + lh/2;
@@ -1080,23 +1080,23 @@ void QtCKStyle::drawComplexControl( ComplexControl control,
(child->height() > 0) )
{
// The primitive requires a rect.
- boxrect = QRect( bx-4, linebot-4, 9, 9 );
- boxflags = child->isOpen() ? QStyle::Style_Off : QStyle::Style_On;
+ boxrect = TQRect( bx-4, linebot-4, 9, 9 );
+ boxflags = child->isOpen() ? TQStyle::Style_Off : TQStyle::Style_On;
- // QtCKStyle extension: Draw the box and expand/collapse indicator
+ // TQtCKStyle extension: Draw the box and expand/collapse indicator
drawKStylePrimitive( KPE_ListViewExpander, p, NULL, boxrect, cg, boxflags, opt );
// dotlinery
p->setPen( cg.mid() );
- dotlines[c++] = QPoint( bx, linetop );
- dotlines[c++] = QPoint( bx, linebot - 5 );
- dotlines[c++] = QPoint( bx + 5, linebot );
- dotlines[c++] = QPoint( r.width(), linebot );
+ dotlines[c++] = TQPoint( bx, linetop );
+ dotlines[c++] = TQPoint( bx, linebot - 5 );
+ dotlines[c++] = TQPoint( bx + 5, linebot );
+ dotlines[c++] = TQPoint( r.width(), linebot );
linetop = linebot + 5;
} else {
// just dotlinery
- dotlines[c++] = QPoint( bx+1, linebot );
- dotlines[c++] = QPoint( r.width(), linebot );
+ dotlines[c++] = TQPoint( bx+1, linebot );
+ dotlines[c++] = TQPoint( r.width(), linebot );
}
y += child->totalHeight();
@@ -1108,16 +1108,16 @@ void QtCKStyle::drawComplexControl( ComplexControl control,
if ( linetop < linebot )
{
- dotlines[c++] = QPoint( bx, linetop );
- dotlines[c++] = QPoint( bx, linebot );
+ dotlines[c++] = TQPoint( bx, linetop );
+ dotlines[c++] = TQPoint( bx, linebot );
}
}
// Draw all the branches...
static int thickness = kPixelMetric( KPM_ListViewBranchThickness );
int line; // index into dotlines
- QRect branchrect;
- QStyle::StyleFlags branchflags;
+ TQRect branchrect;
+ TQStyle::StyleFlags branchflags;
for( line = 0; line < c; line += 2 )
{
// assumptions here: lines are horizontal or vertical.
@@ -1134,10 +1134,10 @@ void QtCKStyle::drawComplexControl( ComplexControl control,
int point = dotlines[line].x();
int other = dotlines[line].y();
- branchrect = QRect( point, other-(thickness/2), end-point, thickness );
- branchflags = QStyle::Style_Horizontal;
+ branchrect = TQRect( point, other-(thickness/2), end-point, thickness );
+ branchflags = TQStyle::Style_Horizontal;
- // QtCKStyle extension: Draw the horizontal branch
+ // TQtCKStyle extension: Draw the horizontal branch
drawKStylePrimitive( KPE_ListViewBranch, p, NULL, branchrect, cg, branchflags, opt );
} else {
@@ -1147,13 +1147,13 @@ void QtCKStyle::drawComplexControl( ComplexControl control,
int other = dotlines[line].x();
int pixmapoffset = ((point & 1) != dotoffset ) ? 1 : 0;
- branchrect = QRect( other-(thickness/2), point, thickness, end-point );
+ branchrect = TQRect( other-(thickness/2), point, thickness, end-point );
if (!pixmapoffset) // ### Hackish - used to hint the offset
- branchflags = QStyle::Style_NoChange;
+ branchflags = TQStyle::Style_NoChange;
else
- branchflags = QStyle::Style_Default;
+ branchflags = TQStyle::Style_Default;
- // QtCKStyle extension: Draw the vertical branch
+ // TQtCKStyle extension: Draw the vertical branch
drawKStylePrimitive( KPE_ListViewBranch, p, NULL, branchrect, cg, branchflags, opt );
}
}
@@ -1162,19 +1162,19 @@ void QtCKStyle::drawComplexControl( ComplexControl control,
}
default:
- QCommonStyle::drawComplexControl( control, p, widget, r, cg,
+ TQCommonStyle::tqdrawComplexControl( control, p, widget, r, cg,
flags, controls, active, opt );
break;
}
}
-QStyle::SubControl QtCKStyle::querySubControl( ComplexControl control,
- const QWidget* widget,
- const QPoint &pos,
- const QStyleOption &opt ) const
+TQStyle::SubControl TQtCKStyle::querySubControl( ComplexControl control,
+ const TQWidget* widget,
+ const TQPoint &pos,
+ const TQStyleOption &opt ) const
{
- QStyle::SubControl ret = QCommonStyle::querySubControl(control, widget, pos, opt);
+ TQStyle::SubControl ret = TQCommonStyle::querySubControl(control, widget, pos, opt);
if (d->scrollbarType == ThreeButtonScrollBar) {
// Enable third button
@@ -1185,12 +1185,12 @@ QStyle::SubControl QtCKStyle::querySubControl( ComplexControl control,
}
-QRect QtCKStyle::querySubControlMetrics( ComplexControl control,
- const QWidget* widget,
+TQRect TQtCKStyle::querySubControlMetrics( ComplexControl control,
+ const TQWidget* widget,
SubControl sc,
- const QStyleOption &opt ) const
+ const TQStyleOption &opt ) const
{
- QRect ret;
+ TQRect ret;
if (control == CC_ScrollBar)
{
@@ -1198,10 +1198,10 @@ QRect QtCKStyle::querySubControlMetrics( ComplexControl control,
bool platinumScrollBar = d->scrollbarType & PlatinumStyleScrollBar;
bool nextScrollBar = d->scrollbarType & NextStyleScrollBar;
- const QScrollBar *sb = (const QScrollBar*)widget;
+ const TQScrollBar *sb = (const TQScrollBar*)widget;
bool horizontal = sb->orientation() == Qt::Horizontal;
int sliderstart = sb->sliderStart();
- int sbextent = pixelMetric(PM_ScrollBarExtent, widget);
+ int sbextent = tqpixelMetric(PM_ScrollBarExtent, widget);
int maxlen = (horizontal ? sb->width() : sb->height())
- (sbextent * (threeButtonScrollBar ? 3 : 2));
int sliderlen;
@@ -1212,7 +1212,7 @@ QRect QtCKStyle::querySubControlMetrics( ComplexControl control,
uint range = sb->maxValue() - sb->minValue();
sliderlen = (sb->pageStep() * maxlen) / (range + sb->pageStep());
- int slidermin = pixelMetric( PM_ScrollBarSliderMin, widget );
+ int slidermin = tqpixelMetric( PM_ScrollBarSliderMin, widget );
if ( sliderlen < slidermin || range > INT_MAX / 2 )
sliderlen = slidermin;
if ( sliderlen > maxlen )
@@ -1319,11 +1319,11 @@ QRect QtCKStyle::querySubControlMetrics( ComplexControl control,
}
default:
- ret = QCommonStyle::querySubControlMetrics(control, widget, sc, opt);
+ ret = TQCommonStyle::querySubControlMetrics(control, widget, sc, opt);
break;
}
} else
- ret = QCommonStyle::querySubControlMetrics(control, widget, sc, opt);
+ ret = TQCommonStyle::querySubControlMetrics(control, widget, sc, opt);
return ret;
}
@@ -1570,40 +1570,40 @@ static const char* const critical_xpm[]={
"...........aaaaaaaaaaa..........",
".............aaaaaaa............"};
-QPixmap QtCKStyle::stylePixmap( StylePixmap stylepixmap,
- const QWidget* widget,
- const QStyleOption& opt) const
+TQPixmap TQtCKStyle::stylePixmap( StylePixmap stylepixmap,
+ const TQWidget* widget,
+ const TQStyleOption& opt) const
{
switch (stylepixmap) {
case SP_TitleBarShadeButton:
- return QPixmap(const_cast<const char**>(kstyle_shade_xpm));
+ return TQPixmap(const_cast<const char**>(kstyle_shade_xpm));
case SP_TitleBarUnshadeButton:
- return QPixmap(const_cast<const char**>(kstyle_unshade_xpm));
+ return TQPixmap(const_cast<const char**>(kstyle_unshade_xpm));
case SP_TitleBarNormalButton:
- return QPixmap(const_cast<const char**>(kstyle_normalizeup_xpm));
+ return TQPixmap(const_cast<const char**>(kstyle_normalizeup_xpm));
case SP_TitleBarMinButton:
- return QPixmap(const_cast<const char**>(kstyle_minimize_xpm));
+ return TQPixmap(const_cast<const char**>(kstyle_minimize_xpm));
case SP_TitleBarMaxButton:
- return QPixmap(const_cast<const char**>(kstyle_maximize_xpm));
+ return TQPixmap(const_cast<const char**>(kstyle_maximize_xpm));
case SP_TitleBarCloseButton:
- return QPixmap(const_cast<const char**>(kstyle_close_xpm));
+ return TQPixmap(const_cast<const char**>(kstyle_close_xpm));
case SP_DockWindowCloseButton:
- return QPixmap(const_cast<const char**>(dock_window_close_xpm ));
+ return TQPixmap(const_cast<const char**>(dock_window_close_xpm ));
case SP_MessageBoxInformation:
- return QPixmap(const_cast<const char**>(information_xpm));
+ return TQPixmap(const_cast<const char**>(information_xpm));
case SP_MessageBoxWarning:
- return QPixmap(const_cast<const char**>(warning_xpm));
+ return TQPixmap(const_cast<const char**>(warning_xpm));
case SP_MessageBoxCritical:
- return QPixmap(const_cast<const char**>(critical_xpm));
+ return TQPixmap(const_cast<const char**>(critical_xpm));
default:
break;
}
- return QCommonStyle::stylePixmap(stylepixmap, widget, opt);
+ return TQCommonStyle::stylePixmap(stylepixmap, widget, opt);
}
-int QtCKStyle::styleHint( StyleHint sh, const QWidget* w,
- const QStyleOption &opt, QStyleHintReturn* shr) const
+int TQtCKStyle::tqstyleHint( StyleHint sh, const TQWidget* w,
+ const TQStyleOption &opt, TQStyleHintReturn* shr) const
{
switch (sh)
{
@@ -1617,8 +1617,8 @@ int QtCKStyle::styleHint( StyleHint sh, const QWidget* w,
return d->menuAltKeyNavigation ? 1 : 0;
case SH_PopupMenu_SubMenuPopupDelay:
- if ( styleHint( SH_PopupMenu_SloppySubMenus, w ) )
- return QMIN( 100, d->popupMenuDelay );
+ if ( tqstyleHint( SH_PopupMenu_SloppySubMenus, w ) )
+ return TQMIN( 100, d->popupMenuDelay );
else
return d->popupMenuDelay;
@@ -1642,10 +1642,10 @@ int QtCKStyle::styleHint( StyleHint sh, const QWidget* w,
case SH_LineEdit_PasswordCharacter:
{
if (w) {
- const QFontMetrics &fm = w->fontMetrics();
- if (fm.inFont(QChar(0x25CF))) {
+ const TQFontMetrics &fm = w->fontMetrics();
+ if (fm.inFont(TQChar(0x25CF))) {
return 0x25CF;
- } else if (fm.inFont(QChar(0x2022))) {
+ } else if (fm.inFont(TQChar(0x2022))) {
return 0x2022;
}
}
@@ -1653,51 +1653,51 @@ int QtCKStyle::styleHint( StyleHint sh, const QWidget* w,
}
default:
- return QCommonStyle::styleHint(sh, w, opt, shr);
+ return TQCommonStyle::tqstyleHint(sh, w, opt, shr);
}
}
-bool QtCKStyle::eventFilter( QObject* object, QEvent* event )
+bool TQtCKStyle::eventFilter( TQObject* object, TQEvent* event )
{
if ( d->useFilledFrameWorkaround )
{
- // Make the QMenuBar/QToolBar paintEvent() cover a larger area to
+ // Make the TQMenuBar/TQToolBar paintEvent() cover a larger area to
// ensure that the filled frame contents are properly painted.
// We essentially modify the paintEvent's rect to include the
// panel border, which also paints the widget's interior.
- // This is nasty, but I see no other way to properly repaint
- // filled frames in all QMenuBars and QToolBars.
+ // This is nasty, but I see no other way to properly tqrepaint
+ // filled frames in all TQMenuBars and TQToolBars.
// -- Karol.
- QFrame *frame = 0;
- if ( event->type() == QEvent::Paint
- && (frame = ::qt_cast<QFrame*>(object)) )
+ TQFrame *frame = 0;
+ if ( event->type() == TQEvent::Paint
+ && (frame = ::tqqt_cast<TQFrame*>(object)) )
{
- if (frame->frameShape() != QFrame::ToolBarPanel && frame->frameShape() != QFrame::MenuBarPanel)
+ if (frame->frameShape() != TQFrame::ToolBarPanel && frame->frameShape() != TQFrame::MenuBarPanel)
return false;
bool horizontal = true;
- QPaintEvent* pe = (QPaintEvent*)event;
- QToolBar *toolbar = ::qt_cast< QToolBar *>( frame );
- QRect r = pe->rect();
+ TQPaintEvent* pe = (TQPaintEvent*)event;
+ TQToolBar *toolbar = ::tqqt_cast< TQToolBar *>( frame );
+ TQRect r = pe->rect();
if (toolbar && toolbar->orientation() == Qt::Vertical)
horizontal = false;
if (horizontal) {
if ( r.height() == frame->height() )
- return false; // Let QFrame handle the painting now.
+ return false; // Let TQFrame handle the painting now.
// Else, send a new paint event with an updated paint rect.
- QPaintEvent dummyPE( QRect( r.x(), 0, r.width(), frame->height()) );
- QApplication::sendEvent( frame, &dummyPE );
+ TQPaintEvent dummyPE( TQRect( r.x(), 0, r.width(), frame->height()) );
+ TQApplication::sendEvent( frame, &dummyPE );
}
else { // Vertical
if ( r.width() == frame->width() )
return false;
- QPaintEvent dummyPE( QRect( 0, r.y(), frame->width(), r.height()) );
- QApplication::sendEvent( frame, &dummyPE );
+ TQPaintEvent dummyPE( TQRect( 0, r.y(), frame->width(), r.height()) );
+ TQApplication::sendEvent( frame, &dummyPE );
}
// Discard this event as we sent a new paintEvent.
@@ -1708,10 +1708,10 @@ bool QtCKStyle::eventFilter( QObject* object, QEvent* event )
return false;
}
-void QtCKStyle::virtual_hook( int, void* )
+void TQtCKStyle::virtual_hook( int, void* )
{ /*BASE::virtual_hook( id, data );*/ }
// vim: set noet ts=4 sw=4:
-// kate: indent-width 4; replace-tabs off; tab-width 4; space-indent off;
+// kate: indent-width 4; tqreplace-tabs off; tab-width 4; space-indent off;
#include "qtc_kstyle.moc"