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 14 years ago
parent a66f7ec245
commit ebff9b8f18

@ -392,18 +392,18 @@ void TQtCKStyle::drawPrimitive( PrimitiveElement pe,
if (pe == PE_DockWindowHandle)
{
// Wild workarounds are here. Beware.
TQWidget *widget, *tqparent;
TQWidget *widget, *parent;
if (p && p->device()->devType() == TQInternal::Widget) {
widget = static_cast<TQWidget*>(p->device());
tqparent = widget->parentWidget();
parent = widget->parentWidget();
} else
return; // Don't paint on non-widgets
// Check if we are a normal toolbar or a hidden dockwidget.
if ( tqparent &&
(tqparent->inherits(TQTOOLBAR_OBJECT_NAME_STRING) || // Normal toolbar
(tqparent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)) )) // Collapsed dock
if ( parent &&
(parent->inherits(TQTOOLBAR_OBJECT_NAME_STRING) || // Normal toolbar
(parent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)) )) // Collapsed dock
// Draw a toolbar handle
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:
{
TQWidget* tqparent = 0;
TQWidget* parent = 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 && (tqparent = widget->parentWidget() )
&& !tqparent->inherits(TQTOOLBAR_OBJECT_NAME_STRING)
&& !tqparent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)
if (widget && (parent = widget->parentWidget() )
&& !parent->inherits(TQTOOLBAR_OBJECT_NAME_STRING)
&& !parent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)
&& widget->inherits(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING) )
return widget->fontMetrics().lineSpacing();
else

@ -745,8 +745,8 @@ static void parseWindowLine(const TQString &line, TQValueList<int> &data)
static bool isCheckBoxOfGroupBox(const TQObject *w)
{
return w && w->tqparent() &&
::tqqt_cast<TQCheckBox *>(w) && ::tqqt_cast<TQGroupBox *>(w->tqparent()) &&
return w && w->parent() &&
::tqqt_cast<TQCheckBox *>(w) && ::tqqt_cast<TQGroupBox *>(w->parent()) &&
!qstrcmp(w->name(), "qt_groupbox_checkbox");
}
@ -1647,7 +1647,7 @@ void TQtCurveStyle::polish(TQWidget *widget)
widget->setBackgroundMode(NoBackground); // PaletteBackground);
else if (widget->inherits("KToolBarSeparator") ||
(widget->inherits("KListViewSearchLineWidget") &&
widget->tqparent() && ::tqqt_cast<TQToolBar *>(widget->tqparent())))
widget->parent() && ::tqqt_cast<TQToolBar *>(widget->parent())))
{
widget->setName(kdeToolbarWidget);
widget->setBackgroundMode(NoBackground);
@ -1666,7 +1666,7 @@ void TQtCurveStyle::polish(TQWidget *widget)
{
if(enableFilter)
widget->installEventFilter(this);
if(widget->tqparent() && ::tqqt_cast<TQToolBar *>(widget->tqparent()))
if(widget->parent() && ::tqqt_cast<TQToolBar *>(widget->parent()))
{
widget->setName(kdeToolbarWidget);
widget->setBackgroundMode(NoBackground); // We paint whole background.
@ -1696,8 +1696,8 @@ void TQtCurveStyle::polish(TQWidget *widget)
}
else if (0==qstrcmp(widget->name(), kdeToolbarWidget))
{
if(!widget->tqparent() ||
0!=qstrcmp(TQT_TQWIDGET(widget->tqparent())->className(),
if(!widget->parent() ||
0!=qstrcmp(TQT_TQWIDGET(widget->parent())->className(),
"KListViewSearchLineWidget") ||
onToolBar(widget))
{
@ -1714,8 +1714,8 @@ void TQtCurveStyle::polish(TQWidget *widget)
else if (TQt::X11ParentRelative!=widget->backgroundMode() &&
(::tqqt_cast<TQLabel *>(widget) || ::tqqt_cast<TQHBox *>(widget) ||
::tqqt_cast<TQVBox *>(widget)) &&
widget->tqparent() &&
( 0==qstrcmp(TQT_TQWIDGET(widget->tqparent())->className(),
widget->parent() &&
( 0==qstrcmp(TQT_TQWIDGET(widget->parent())->className(),
"MainWindow") || onToolBar(widget)))
{
widget->setName(kdeToolbarWidget);
@ -1767,7 +1767,7 @@ void TQtCurveStyle::polish(TQWidget *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!
if( (SKIP_TASKBAR && !dlg->parentWidget()) ||
( (!dlg->parentWidget() || !dlg->parentWidget()->isShown())// &&
@ -1905,7 +1905,7 @@ void TQtCurveStyle::unPolish(TQWidget *widget)
else if (::tqqt_cast<TQSlider *>(widget))
{
widget->removeEventFilter(this);
if(widget->tqparent() && ::tqqt_cast<TQToolBar *>(widget->tqparent()))
if(widget->parent() && ::tqqt_cast<TQToolBar *>(widget->parent()))
widget->setBackgroundMode(PaletteBackground);
}
else if (::tqqt_cast<TQLineEdit*>(widget) || ::tqqt_cast<TQTextEdit*>(widget))
@ -1995,34 +1995,34 @@ bool TQtCurveStyle::eventFilter(TQObject *object, TQEvent *event)
}
#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
// "kde toolbar widget" name.
if(TQEvent::Paint==event->type())
{
TQWidget *widget(TQT_TQWIDGET(object)),
*tqparent(TQT_TQWIDGET(object->tqparent()));
*parent(TQT_TQWIDGET(object->parent()));
if(IS_FLAT(opts.toolbarAppearance))
TQPainter(widget).fillRect(widget->rect(), tqparent->tqcolorGroup().background());
TQPainter(widget).fillRect(widget->rect(), parent->tqcolorGroup().background());
else
{
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();
tqparent = TQT_TQWIDGET(tqparent->tqparent());
y_offset += parent->y();
parent = TQT_TQWIDGET(parent->parent());
}
TQRect r(widget->rect()),
pr(tqparent->rect());
pr(parent->rect());
bool horiz=pr.width() > pr.height();
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)
horiz = Qt::Horizontal==tb->orientation();
@ -2034,7 +2034,7 @@ bool TQtCurveStyle::eventFilter(TQObject *object, TQEvent *event)
else
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) &&
@ -2135,15 +2135,15 @@ bool TQtCurveStyle::eventFilter(TQObject *object, TQEvent *event)
{
TQWidget *widget(TQT_TQWIDGET(object)),
*tqparent(TQT_TQWIDGET(object->tqparent()));
*parent(TQT_TQWIDGET(object->parent()));
TQRect r(widget->rect());
TQPainter p(widget);
int y_offset(widget->y()+tqparent->y());
int y_offset(widget->y()+parent->y());
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;
}
}
@ -2303,7 +2303,7 @@ bool TQtCurveStyle::eventFilter(TQObject *object, TQEvent *event)
}
break;
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
// picture dialog!
if((!dlg->parentWidget() || !dlg->parentWidget()->isShown())) // &&
@ -3168,9 +3168,9 @@ void TQtCurveStyle::tqdrawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const
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;
if(flags&Style_Horizontal)
@ -3426,8 +3426,8 @@ void TQtCurveStyle::tqdrawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const
if (flags&Style_Selected)
{
flags-=Style_Selected;
if(!lv->rootIsDecorated() && !((item->tqparent() && 1==item->tqparent()->rtti() &&
TQCheckListItem::Controller==((TQCheckListItem*)item->tqparent())->type())))
if(!lv->rootIsDecorated() && !((item->parent() && 1==item->parent()->rtti() &&
TQCheckListItem::Controller==((TQCheckListItem*)item->parent())->type())))
{
p->fillRect(0, 0, r.x()+lv->itemMargin()+r.width()+4, item->height(),
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...
TQWidget *widget(dynamic_cast<TQWidget*>(p->device()));
bool view(widget && (dynamic_cast<TQScrollView*>(widget->tqparent()) ||
dynamic_cast<TQListBox*>(widget->tqparent())));
bool view(widget && (dynamic_cast<TQScrollView*>(widget->parent()) ||
dynamic_cast<TQListBox*>(widget->parent())));
if(widget && FOCUS_GLOW==opts.focus &&
(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()),
firstTab(0==tabIndex),
lastTab((tb->count()-1)==tabIndex),
// isFirstKTabCtlTab(firstTab && widget->tqparent()
// ? 0==qstrcmp("KTabCtl", widget->tqparent()->className())
// isFirstKTabCtlTab(firstTab && widget->parent()
// ? 0==qstrcmp("KTabCtl", widget->parent()->className())
// : false),
active(flags & Style_Selected),
itsHover(itsHoverTab && itsHoverTab->isEnabled() && data.tab()==itsHoverTab &&
@ -4502,9 +4502,9 @@ void TQtCurveStyle::tqdrawControl(ControlElement control, TQPainter *p, const TQ
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?
if(tw->cornerWidget(TQt::TopLeft))
@ -5565,17 +5565,17 @@ void TQtCurveStyle::tqdrawComplexControl(ComplexControl control, TQPainter *p, c
!toolbutton->parentWidget()->backgroundPixmap()->isNull())
p->drawTiledPixmap(r, *(toolbutton->parentWidget()->backgroundPixmap()),
toolbutton->pos());
else if(widget->tqparent())
else if(widget->parent())
{
TQToolBar *tb(0L);
if(::tqqt_cast<const TQToolBar *>(widget->tqparent()))
tb=(TQToolBar*)widget->tqparent();
else if(widget->tqparent()->inherits("TQToolBarExtensionWidget"))
if(::tqqt_cast<const TQToolBar *>(widget->parent()))
tb=(TQToolBar*)widget->parent();
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)
@ -6937,7 +6937,7 @@ TQSize TQtCurveStyle::tqsizeFromContents(ContentsType contents, const TQWidget *
return size;
}
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);
default:
break; // Remove compiler warnings...
@ -7062,35 +7062,35 @@ void TQtCurveStyle::drawItem(TQPainter *p, const TQRect &r, int flags, const TQC
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));
pm = pmm;
}
}
else if (pm.depth() == 1) // monochrome pixmap, no tqmask
else if (pm.depth() == 1) // monochrome pixmap, no mask
{
pm.setMask(*((TQBitmap *)&pm));
#ifndef TQT_NO_IMAGE_HEURISTIC_MASK
}
else // color pixmap, no tqmask
else // color pixmap, no mask
{
TQString k;
k.sprintf("$qt-drawitem-%x", pm.serialNumber());
TQPixmap *tqmask = TQPixmapCache::find(k);
TQPixmap *mask = TQPixmapCache::find(k);
bool del=false;
if (!tqmask)
if (!mask)
{
tqmask = new TQPixmap(pm.createHeuristicMask());
tqmask->setMask(*((TQBitmap*)tqmask));
del = !TQPixmapCache::insert(k, tqmask);
mask = new TQPixmap(pm.createHeuristicMask());
mask->setMask(*((TQBitmap*)mask));
del = !TQPixmapCache::insert(k, mask);
}
pm = *tqmask;
pm = *mask;
if (del)
delete tqmask;
delete mask;
#endif
}
p->setPen(cg.text());
@ -8628,7 +8628,7 @@ bool TQtCurveStyle::isWindowDragWidget(TQObject *o, const TQPoint &pos)
// || ((*appType == Hacks::Dragon) && o->inherits(DragonVideoWidget))
// || 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