rename the following methods:

tqparent parent
tqmask mask


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kde-style-qtcurve@1246260 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent a66f7ec245
commit ebff9b8f18

@ -392,18 +392,18 @@ void TQtCKStyle::drawPrimitive( PrimitiveElement pe,
if (pe == PE_DockWindowHandle) if (pe == PE_DockWindowHandle)
{ {
// Wild workarounds are here. Beware. // Wild workarounds are here. Beware.
TQWidget *widget, *tqparent; TQWidget *widget, *parent;
if (p && p->device()->devType() == TQInternal::Widget) { if (p && p->device()->devType() == TQInternal::Widget) {
widget = static_cast<TQWidget*>(p->device()); widget = static_cast<TQWidget*>(p->device());
tqparent = widget->parentWidget(); parent = widget->parentWidget();
} else } else
return; // Don't paint on non-widgets return; // Don't paint on non-widgets
// Check if we are a normal toolbar or a hidden dockwidget. // Check if we are a normal toolbar or a hidden dockwidget.
if ( tqparent && if ( parent &&
(tqparent->inherits(TQTOOLBAR_OBJECT_NAME_STRING) || // Normal toolbar (parent->inherits(TQTOOLBAR_OBJECT_NAME_STRING) || // Normal toolbar
(tqparent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)) )) // Collapsed dock (parent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)) )) // Collapsed dock
// Draw a toolbar handle // Draw a toolbar handle
drawKStylePrimitive( KPE_ToolBarHandle, p, widget, r, cg, flags, opt ); drawKStylePrimitive( KPE_ToolBarHandle, p, widget, r, cg, flags, opt );
@ -760,12 +760,12 @@ int TQtCKStyle::tqpixelMetric(PixelMetric m, const TQWidget* widget) const
case PM_DockWindowHandleExtent: case PM_DockWindowHandleExtent:
{ {
TQWidget* tqparent = 0; TQWidget* parent = 0;
// Check that we are not a normal toolbar or a hidden dockwidget, // Check that we are not a normal toolbar or a hidden dockwidget,
// in which case we need to adjust the height for font size // in which case we need to adjust the height for font size
if (widget && (tqparent = widget->parentWidget() ) if (widget && (parent = widget->parentWidget() )
&& !tqparent->inherits(TQTOOLBAR_OBJECT_NAME_STRING) && !parent->inherits(TQTOOLBAR_OBJECT_NAME_STRING)
&& !tqparent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING) && !parent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)
&& widget->inherits(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING) ) && widget->inherits(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING) )
return widget->fontMetrics().lineSpacing(); return widget->fontMetrics().lineSpacing();
else else

@ -745,8 +745,8 @@ static void parseWindowLine(const TQString &line, TQValueList<int> &data)
static bool isCheckBoxOfGroupBox(const TQObject *w) static bool isCheckBoxOfGroupBox(const TQObject *w)
{ {
return w && w->tqparent() && return w && w->parent() &&
::tqqt_cast<TQCheckBox *>(w) && ::tqqt_cast<TQGroupBox *>(w->tqparent()) && ::tqqt_cast<TQCheckBox *>(w) && ::tqqt_cast<TQGroupBox *>(w->parent()) &&
!qstrcmp(w->name(), "qt_groupbox_checkbox"); !qstrcmp(w->name(), "qt_groupbox_checkbox");
} }
@ -1647,7 +1647,7 @@ void TQtCurveStyle::polish(TQWidget *widget)
widget->setBackgroundMode(NoBackground); // PaletteBackground); widget->setBackgroundMode(NoBackground); // PaletteBackground);
else if (widget->inherits("KToolBarSeparator") || else if (widget->inherits("KToolBarSeparator") ||
(widget->inherits("KListViewSearchLineWidget") && (widget->inherits("KListViewSearchLineWidget") &&
widget->tqparent() && ::tqqt_cast<TQToolBar *>(widget->tqparent()))) widget->parent() && ::tqqt_cast<TQToolBar *>(widget->parent())))
{ {
widget->setName(kdeToolbarWidget); widget->setName(kdeToolbarWidget);
widget->setBackgroundMode(NoBackground); widget->setBackgroundMode(NoBackground);
@ -1666,7 +1666,7 @@ void TQtCurveStyle::polish(TQWidget *widget)
{ {
if(enableFilter) if(enableFilter)
widget->installEventFilter(this); widget->installEventFilter(this);
if(widget->tqparent() && ::tqqt_cast<TQToolBar *>(widget->tqparent())) if(widget->parent() && ::tqqt_cast<TQToolBar *>(widget->parent()))
{ {
widget->setName(kdeToolbarWidget); widget->setName(kdeToolbarWidget);
widget->setBackgroundMode(NoBackground); // We paint whole background. widget->setBackgroundMode(NoBackground); // We paint whole background.
@ -1696,8 +1696,8 @@ void TQtCurveStyle::polish(TQWidget *widget)
} }
else if (0==qstrcmp(widget->name(), kdeToolbarWidget)) else if (0==qstrcmp(widget->name(), kdeToolbarWidget))
{ {
if(!widget->tqparent() || if(!widget->parent() ||
0!=qstrcmp(TQT_TQWIDGET(widget->tqparent())->className(), 0!=qstrcmp(TQT_TQWIDGET(widget->parent())->className(),
"KListViewSearchLineWidget") || "KListViewSearchLineWidget") ||
onToolBar(widget)) onToolBar(widget))
{ {
@ -1714,8 +1714,8 @@ void TQtCurveStyle::polish(TQWidget *widget)
else if (TQt::X11ParentRelative!=widget->backgroundMode() && else if (TQt::X11ParentRelative!=widget->backgroundMode() &&
(::tqqt_cast<TQLabel *>(widget) || ::tqqt_cast<TQHBox *>(widget) || (::tqqt_cast<TQLabel *>(widget) || ::tqqt_cast<TQHBox *>(widget) ||
::tqqt_cast<TQVBox *>(widget)) && ::tqqt_cast<TQVBox *>(widget)) &&
widget->tqparent() && widget->parent() &&
( 0==qstrcmp(TQT_TQWIDGET(widget->tqparent())->className(), ( 0==qstrcmp(TQT_TQWIDGET(widget->parent())->className(),
"MainWindow") || onToolBar(widget))) "MainWindow") || onToolBar(widget)))
{ {
widget->setName(kdeToolbarWidget); widget->setName(kdeToolbarWidget);
@ -1767,7 +1767,7 @@ void TQtCurveStyle::polish(TQWidget *widget)
{ {
TQDialog *dlg=(TQDialog *)widget; TQDialog *dlg=(TQDialog *)widget;
// The tqparent->isShown is needed for KWord. It's insert picure file dialog is a child of // The parent->isShown is needed for KWord. It's insert picure file dialog is a child of
// the insert picture dialog - but the file dialog is shown *before* the picture dialog! // the insert picture dialog - but the file dialog is shown *before* the picture dialog!
if( (SKIP_TASKBAR && !dlg->parentWidget()) || if( (SKIP_TASKBAR && !dlg->parentWidget()) ||
( (!dlg->parentWidget() || !dlg->parentWidget()->isShown())// && ( (!dlg->parentWidget() || !dlg->parentWidget()->isShown())// &&
@ -1905,7 +1905,7 @@ void TQtCurveStyle::unPolish(TQWidget *widget)
else if (::tqqt_cast<TQSlider *>(widget)) else if (::tqqt_cast<TQSlider *>(widget))
{ {
widget->removeEventFilter(this); widget->removeEventFilter(this);
if(widget->tqparent() && ::tqqt_cast<TQToolBar *>(widget->tqparent())) if(widget->parent() && ::tqqt_cast<TQToolBar *>(widget->parent()))
widget->setBackgroundMode(PaletteBackground); widget->setBackgroundMode(PaletteBackground);
} }
else if (::tqqt_cast<TQLineEdit*>(widget) || ::tqqt_cast<TQTextEdit*>(widget)) else if (::tqqt_cast<TQLineEdit*>(widget) || ::tqqt_cast<TQTextEdit*>(widget))
@ -1995,34 +1995,34 @@ bool TQtCurveStyle::eventFilter(TQObject *object, TQEvent *event)
} }
#endif #endif
if(object->tqparent() && 0==qstrcmp(object->name(), kdeToolbarWidget)) if(object->parent() && 0==qstrcmp(object->name(), kdeToolbarWidget))
{ {
// Draw background for custom widgets in the toolbar that have specified a // Draw background for custom widgets in the toolbar that have specified a
// "kde toolbar widget" name. // "kde toolbar widget" name.
if(TQEvent::Paint==event->type()) if(TQEvent::Paint==event->type())
{ {
TQWidget *widget(TQT_TQWIDGET(object)), TQWidget *widget(TQT_TQWIDGET(object)),
*tqparent(TQT_TQWIDGET(object->tqparent())); *parent(TQT_TQWIDGET(object->parent()));
if(IS_FLAT(opts.toolbarAppearance)) if(IS_FLAT(opts.toolbarAppearance))
TQPainter(widget).fillRect(widget->rect(), tqparent->tqcolorGroup().background()); TQPainter(widget).fillRect(widget->rect(), parent->tqcolorGroup().background());
else else
{ {
int y_offset(widget->y()); int y_offset(widget->y());
while(tqparent && tqparent->tqparent() && 0==qstrcmp(tqparent->name(), kdeToolbarWidget)) while(parent && parent->parent() && 0==qstrcmp(parent->name(), kdeToolbarWidget))
{ {
y_offset += tqparent->y(); y_offset += parent->y();
tqparent = TQT_TQWIDGET(tqparent->tqparent()); parent = TQT_TQWIDGET(parent->parent());
} }
TQRect r(widget->rect()), TQRect r(widget->rect()),
pr(tqparent->rect()); pr(parent->rect());
bool horiz=pr.width() > pr.height(); bool horiz=pr.width() > pr.height();
TQPainter p(widget); TQPainter p(widget);
TQToolBar *tb(::tqqt_cast<TQToolBar*>(tqparent)); TQToolBar *tb(::tqqt_cast<TQToolBar*>(parent));
// If tqparent is a TQToolbar use its orientation, else just base on width>height. // If parent is a TQToolbar use its orientation, else just base on width>height.
if (tb) if (tb)
horiz = Qt::Horizontal==tb->orientation(); horiz = Qt::Horizontal==tb->orientation();
@ -2034,7 +2034,7 @@ bool TQtCurveStyle::eventFilter(TQObject *object, TQEvent *event)
else else
bgndRect.addCoords(-1, 0, 1, 0); bgndRect.addCoords(-1, 0, 1, 0);
drawMenuOrToolBarBackground(&p, bgndRect, tqparent->tqcolorGroup(), false, horiz); drawMenuOrToolBarBackground(&p, bgndRect, parent->tqcolorGroup(), false, horiz);
} }
if(!::tqqt_cast<TQLineEdit*>(object) && !::tqqt_cast<TQTextEdit*>(object) && if(!::tqqt_cast<TQLineEdit*>(object) && !::tqqt_cast<TQTextEdit*>(object) &&
@ -2135,15 +2135,15 @@ bool TQtCurveStyle::eventFilter(TQObject *object, TQEvent *event)
{ {
TQWidget *widget(TQT_TQWIDGET(object)), TQWidget *widget(TQT_TQWIDGET(object)),
*tqparent(TQT_TQWIDGET(object->tqparent())); *parent(TQT_TQWIDGET(object->parent()));
TQRect r(widget->rect()); TQRect r(widget->rect());
TQPainter p(widget); TQPainter p(widget);
int y_offset(widget->y()+tqparent->y()); int y_offset(widget->y()+parent->y());
r.setY(r.y()-y_offset); r.setY(r.y()-y_offset);
r.setHeight(tqparent->rect().height()); r.setHeight(parent->rect().height());
drawMenuOrToolBarBackground(&p, r, tqparent->tqcolorGroup()); drawMenuOrToolBarBackground(&p, r, parent->tqcolorGroup());
return true; return true;
} }
} }
@ -2303,7 +2303,7 @@ bool TQtCurveStyle::eventFilter(TQObject *object, TQEvent *event)
} }
break; break;
case TQEvent::Show: case TQEvent::Show:
// The tqparent->isShown is needed for KWord. It's insert picure file dialog is a // The parent->isShown is needed for KWord. It's insert picure file dialog is a
// child of the insert picture dialog - but the file dialog is shown *before* the // child of the insert picture dialog - but the file dialog is shown *before* the
// picture dialog! // picture dialog!
if((!dlg->parentWidget() || !dlg->parentWidget()->isShown())) // && if((!dlg->parentWidget() || !dlg->parentWidget()->isShown())) // &&
@ -3168,9 +3168,9 @@ void TQtCurveStyle::tqdrawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const
if (header) if (header)
{ {
if(header->tqparent() && ::tqqt_cast<const TQTable *>(header->tqparent())) if(header->parent() && ::tqqt_cast<const TQTable *>(header->parent()))
{ {
TQTable *tbl((TQTable *)(header->tqparent())); TQTable *tbl((TQTable *)(header->parent()));
isTable=true; isTable=true;
if(flags&Style_Horizontal) if(flags&Style_Horizontal)
@ -3426,8 +3426,8 @@ void TQtCurveStyle::tqdrawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const
if (flags&Style_Selected) if (flags&Style_Selected)
{ {
flags-=Style_Selected; flags-=Style_Selected;
if(!lv->rootIsDecorated() && !((item->tqparent() && 1==item->tqparent()->rtti() && if(!lv->rootIsDecorated() && !((item->parent() && 1==item->parent()->rtti() &&
TQCheckListItem::Controller==((TQCheckListItem*)item->tqparent())->type()))) TQCheckListItem::Controller==((TQCheckListItem*)item->parent())->type())))
{ {
p->fillRect(0, 0, r.x()+lv->itemMargin()+r.width()+4, item->height(), p->fillRect(0, 0, r.x()+lv->itemMargin()+r.width()+4, item->height(),
cg.brush(TQColorGroup::Highlight)); cg.brush(TQColorGroup::Highlight));
@ -4106,8 +4106,8 @@ void TQtCurveStyle::tqdrawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const
{ {
//Figuring out in what beast we are painting... //Figuring out in what beast we are painting...
TQWidget *widget(dynamic_cast<TQWidget*>(p->device())); TQWidget *widget(dynamic_cast<TQWidget*>(p->device()));
bool view(widget && (dynamic_cast<TQScrollView*>(widget->tqparent()) || bool view(widget && (dynamic_cast<TQScrollView*>(widget->parent()) ||
dynamic_cast<TQListBox*>(widget->tqparent()))); dynamic_cast<TQListBox*>(widget->parent())));
if(widget && FOCUS_GLOW==opts.focus && if(widget && FOCUS_GLOW==opts.focus &&
(dynamic_cast<const TQButton *>(widget) || dynamic_cast<const TQComboBox *>(widget))) (dynamic_cast<const TQButton *>(widget) || dynamic_cast<const TQComboBox *>(widget)))
@ -4476,8 +4476,8 @@ void TQtCurveStyle::tqdrawControl(ControlElement control, TQPainter *p, const TQ
reverse(TQApplication::reverseLayout()), reverse(TQApplication::reverseLayout()),
firstTab(0==tabIndex), firstTab(0==tabIndex),
lastTab((tb->count()-1)==tabIndex), lastTab((tb->count()-1)==tabIndex),
// isFirstKTabCtlTab(firstTab && widget->tqparent() // isFirstKTabCtlTab(firstTab && widget->parent()
// ? 0==qstrcmp("KTabCtl", widget->tqparent()->className()) // ? 0==qstrcmp("KTabCtl", widget->parent()->className())
// : false), // : false),
active(flags & Style_Selected), active(flags & Style_Selected),
itsHover(itsHoverTab && itsHoverTab->isEnabled() && data.tab()==itsHoverTab && itsHover(itsHoverTab && itsHoverTab->isEnabled() && data.tab()==itsHoverTab &&
@ -4502,9 +4502,9 @@ void TQtCurveStyle::tqdrawControl(ControlElement control, TQPainter *p, const TQ
firstTab=oldLast; firstTab=oldLast;
} }
if(::tqqt_cast<const TQTabWidget *>(tb->tqparent())) if(::tqqt_cast<const TQTabWidget *>(tb->parent()))
{ {
const TQTabWidget *tw((const TQTabWidget*)tb->tqparent()); const TQTabWidget *tw((const TQTabWidget*)tb->parent());
// is there a corner widget in the (top) left edge? // is there a corner widget in the (top) left edge?
if(tw->cornerWidget(TQt::TopLeft)) if(tw->cornerWidget(TQt::TopLeft))
@ -5565,17 +5565,17 @@ void TQtCurveStyle::tqdrawComplexControl(ComplexControl control, TQPainter *p, c
!toolbutton->parentWidget()->backgroundPixmap()->isNull()) !toolbutton->parentWidget()->backgroundPixmap()->isNull())
p->drawTiledPixmap(r, *(toolbutton->parentWidget()->backgroundPixmap()), p->drawTiledPixmap(r, *(toolbutton->parentWidget()->backgroundPixmap()),
toolbutton->pos()); toolbutton->pos());
else if(widget->tqparent()) else if(widget->parent())
{ {
TQToolBar *tb(0L); TQToolBar *tb(0L);
if(::tqqt_cast<const TQToolBar *>(widget->tqparent())) if(::tqqt_cast<const TQToolBar *>(widget->parent()))
tb=(TQToolBar*)widget->tqparent(); tb=(TQToolBar*)widget->parent();
else if(widget->tqparent()->inherits("TQToolBarExtensionWidget")) else if(widget->parent()->inherits("TQToolBarExtensionWidget"))
{ {
TQWidget *tqparent=(TQWidget*)widget->tqparent(); TQWidget *parent=(TQWidget*)widget->parent();
tb=(TQToolBar*)tqparent->tqparent(); tb=(TQToolBar*)parent->parent();
} }
if(tb) if(tb)
@ -6937,7 +6937,7 @@ TQSize TQtCurveStyle::tqsizeFromContents(ContentsType contents, const TQWidget *
return size; return size;
} }
case CT_ToolButton: case CT_ToolButton:
if(widget->tqparent() && ::tqqt_cast<TQToolBar *>(widget->tqparent())) if(widget->parent() && ::tqqt_cast<TQToolBar *>(widget->parent()))
return TQSize(contentsSize.width()+8, contentsSize.height()+8); return TQSize(contentsSize.width()+8, contentsSize.height()+8);
default: default:
break; // Remove compiler warnings... break; // Remove compiler warnings...
@ -7062,35 +7062,35 @@ void TQtCurveStyle::drawItem(TQPainter *p, const TQRect &r, int flags, const TQC
if (!enabled) if (!enabled)
{ {
if (pm.tqmask()) // pixmap with a tqmask if (pm.mask()) // pixmap with a mask
{ {
if (!pm.selfMask()) // tqmask is not pixmap itself if (!pm.selfMask()) // mask is not pixmap itself
{ {
TQPixmap pmm(*pm.tqmask()); TQPixmap pmm(*pm.mask());
pmm.setMask(*((TQBitmap *)&pmm)); pmm.setMask(*((TQBitmap *)&pmm));
pm = pmm; pm = pmm;
} }
} }
else if (pm.depth() == 1) // monochrome pixmap, no tqmask else if (pm.depth() == 1) // monochrome pixmap, no mask
{ {
pm.setMask(*((TQBitmap *)&pm)); pm.setMask(*((TQBitmap *)&pm));
#ifndef TQT_NO_IMAGE_HEURISTIC_MASK #ifndef TQT_NO_IMAGE_HEURISTIC_MASK
} }
else // color pixmap, no tqmask else // color pixmap, no mask
{ {
TQString k; TQString k;
k.sprintf("$qt-drawitem-%x", pm.serialNumber()); k.sprintf("$qt-drawitem-%x", pm.serialNumber());
TQPixmap *tqmask = TQPixmapCache::find(k); TQPixmap *mask = TQPixmapCache::find(k);
bool del=false; bool del=false;
if (!tqmask) if (!mask)
{ {
tqmask = new TQPixmap(pm.createHeuristicMask()); mask = new TQPixmap(pm.createHeuristicMask());
tqmask->setMask(*((TQBitmap*)tqmask)); mask->setMask(*((TQBitmap*)mask));
del = !TQPixmapCache::insert(k, tqmask); del = !TQPixmapCache::insert(k, mask);
} }
pm = *tqmask; pm = *mask;
if (del) if (del)
delete tqmask; delete mask;
#endif #endif
} }
p->setPen(cg.text()); p->setPen(cg.text());
@ -8628,7 +8628,7 @@ bool TQtCurveStyle::isWindowDragWidget(TQObject *o, const TQPoint &pos)
// || ((*appType == Hacks::Dragon) && o->inherits(DragonVideoWidget)) // || ((*appType == Hacks::Dragon) && o->inherits(DragonVideoWidget))
// || o->inherits("TQStatusBar") // || o->inherits("TQStatusBar")
// || (o->inherits(TQLABEL_OBJECT_NAME_STRING) && o->tqparent() && o->tqparent()->inherits("TQStatusBar")) // || (o->inherits(TQLABEL_OBJECT_NAME_STRING) && o->parent() && o->parent()->inherits("TQStatusBar"))
); );
} }

Loading…
Cancel
Save