Replace _OBJECT_NAME_STRING defines with actual strings. This relates to the merging of tqtinterface with tqt3.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/4/head
Michele Calgaro 1 year ago
parent 19a904f882
commit cd1f0752e8
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -121,7 +121,7 @@ TQString TQtCTDEStyle::defaultStyle()
void TQtCTDEStyle::polish( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr ) void TQtCTDEStyle::polish( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr )
{ {
if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) { if (ceData.widgetObjectTypes.contains("TQWidget")) {
TQWidget *widget = reinterpret_cast<TQWidget*>(ptr); TQWidget *widget = reinterpret_cast<TQWidget*>(ptr);
if ( d->useFilledFrameWorkaround ) if ( d->useFilledFrameWorkaround )
@ -138,7 +138,7 @@ void TQtCTDEStyle::polish( TQStyleControlElementData ceData, ControlElementFlags
void TQtCTDEStyle::unPolish( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr ) void TQtCTDEStyle::unPolish( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr )
{ {
if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) { if (ceData.widgetObjectTypes.contains("TQWidget")) {
TQWidget *widget = reinterpret_cast<TQWidget*>(ptr); TQWidget *widget = reinterpret_cast<TQWidget*>(ptr);
if ( d->useFilledFrameWorkaround ) if ( d->useFilledFrameWorkaround )
@ -415,13 +415,13 @@ void TQtCTDEStyle::drawPrimitive( PrimitiveElement pe,
// Check if we are a normal toolbar or a hidden dockwidget. // Check if we are a normal toolbar or a hidden dockwidget.
if ( parent && if ( parent &&
(parent->inherits(TQTOOLBAR_OBJECT_NAME_STRING) || // Normal toolbar (parent->inherits("TQToolBar") || // Normal toolbar
(parent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)) )) // Collapsed dock (parent->inherits("TQMainWindow")) )) // Collapsed dock
// Draw a toolbar handle // Draw a toolbar handle
drawTDEStylePrimitive( KPE_ToolBarHandle, p, ceData, elementFlags, r, cg, flags, opt, widget ); drawTDEStylePrimitive( KPE_ToolBarHandle, p, ceData, elementFlags, r, cg, flags, opt, widget );
else if ( widget->inherits(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING) ) else if ( widget->inherits("TQDockWindowHandle") )
// Draw a dock window handle // Draw a dock window handle
drawTDEStylePrimitive( KPE_DockWindowHandle, p, ceData, elementFlags, r, cg, flags, opt, widget ); drawTDEStylePrimitive( KPE_DockWindowHandle, p, ceData, elementFlags, r, cg, flags, opt, widget );
@ -779,9 +779,9 @@ int TQtCTDEStyle::pixelMetric(PixelMetric m, TQStyleControlElementData ceData, C
// 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 && (parent = widget->parentWidget() ) if (widget && (parent = widget->parentWidget() )
&& !parent->inherits(TQTOOLBAR_OBJECT_NAME_STRING) && !parent->inherits("TQToolBar")
&& !parent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING) && !parent->inherits("TQMainWindow")
&& widget->inherits(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING) ) && widget->inherits("TQDockWindowHandle") )
return widget->fontMetrics().lineSpacing(); return widget->fontMetrics().lineSpacing();
else else
return TQCommonStyle::pixelMetric(m, ceData, elementFlags, widget); return TQCommonStyle::pixelMetric(m, ceData, elementFlags, widget);
@ -1682,7 +1682,7 @@ int TQtCTDEStyle::styleHint( StyleHint sh, TQStyleControlElementData ceData, Con
bool TQtCTDEStyle::objectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQEvent *event ) bool TQtCTDEStyle::objectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQEvent *event )
{ {
if (ceData.widgetObjectTypes.contains(TQOBJECT_OBJECT_NAME_STRING)) { if (ceData.widgetObjectTypes.contains("TQObject")) {
TQObject* object = reinterpret_cast<TQObject*>(source); TQObject* object = reinterpret_cast<TQObject*>(source);
if ( d->useFilledFrameWorkaround ) if ( d->useFilledFrameWorkaround )

@ -717,7 +717,7 @@ static void drawDots(TQPainter *p, const TQRect &r, bool horiz, int nLines, int
static bool onToolBar(TQWidget *widget, int l=0) static bool onToolBar(TQWidget *widget, int l=0)
{ {
return l<3 && widget && widget->parentWidget() return l<3 && widget && widget->parentWidget()
? widget->parentWidget()->inherits(TQTOOLBAR_OBJECT_NAME_STRING) || ? widget->parentWidget()->inherits("TQToolBar") ||
onToolBar(widget->parentWidget(), ++l) onToolBar(widget->parentWidget(), ++l)
: false; : false;
} }
@ -1206,7 +1206,7 @@ inline void addEventFilter(TQObject *object, TQObject *filter)
void QtCurveStyle::applicationPolish(const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr) void QtCurveStyle::applicationPolish(const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr)
{ {
if (ceData.widgetObjectTypes.contains(TQAPPLICATION_OBJECT_NAME_STRING)) { if (ceData.widgetObjectTypes.contains("TQApplication")) {
TQApplication *app = reinterpret_cast<TQApplication*>(ptr); TQApplication *app = reinterpret_cast<TQApplication*>(ptr);
TQString appName(getFile(app->argv()[0])); TQString appName(getFile(app->argv()[0]));
@ -1304,7 +1304,7 @@ void QtCurveStyle::applicationPolish(const TQStyleControlElementData &ceData, Co
void QtCurveStyle::applicationUnPolish(const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr) void QtCurveStyle::applicationUnPolish(const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr)
{ {
if (ceData.widgetObjectTypes.contains(TQAPPLICATION_OBJECT_NAME_STRING)) { if (ceData.widgetObjectTypes.contains("TQApplication")) {
TQApplication *app = reinterpret_cast<TQApplication*>(ptr); TQApplication *app = reinterpret_cast<TQApplication*>(ptr);
if(opts.hideShortcutUnderline) if(opts.hideShortcutUnderline)
app->removeEventFilter(itsShortcutHandler); app->removeEventFilter(itsShortcutHandler);
@ -1552,7 +1552,7 @@ static const char * kdeToolbarWidget="tde toolbar widget";
void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr) void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr)
{ {
if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) { if (ceData.widgetObjectTypes.contains("TQWidget")) {
TQWidget *widget = reinterpret_cast<TQWidget*>(ptr); TQWidget *widget = reinterpret_cast<TQWidget*>(ptr);
bool enableFilter(opts.highlightFactor || opts.coloredMouseOver); bool enableFilter(opts.highlightFactor || opts.coloredMouseOver);
@ -1771,7 +1771,7 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
::tqqt_cast<TQFrame *>(widget)) ::tqqt_cast<TQFrame *>(widget))
((TQFrame *)widget)->setLineWidth(0); ((TQFrame *)widget)->setLineWidth(0);
} }
else if (ceData.widgetObjectTypes.contains(TQSPLITTERHANDLE_OBJECT_NAME_STRING) || ceData.widgetObjectTypes.contains(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING) || ceData.widgetObjectTypes.contains("TQDockWindowResizeHandle")) else if (ceData.widgetObjectTypes.contains("TQSplitterHandle") || ceData.widgetObjectTypes.contains("TQDockWindowHandle") || ceData.widgetObjectTypes.contains("TQDockWindowResizeHandle"))
{ {
if(enableFilter) if(enableFilter)
installObjectEventHandler(ceData, elementFlags, ptr, this); installObjectEventHandler(ceData, elementFlags, ptr, this);
@ -1788,7 +1788,7 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
} }
} }
if (widget->parentWidget() && ::tqqt_cast<TQMenuBar *>(widget->parentWidget()) && !qstrcmp(widget->className(), TQFRAME_OBJECT_NAME_STRING)) if (widget->parentWidget() && ::tqqt_cast<TQMenuBar *>(widget->parentWidget()) && !qstrcmp(widget->className(), "TQFrame"))
{ {
installObjectEventHandler(ceData, elementFlags, ptr, this); installObjectEventHandler(ceData, elementFlags, ptr, this);
widget->setBackgroundMode(NoBackground); // We paint whole background. widget->setBackgroundMode(NoBackground); // We paint whole background.
@ -1909,7 +1909,7 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
void QtCurveStyle::unPolish(const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr) void QtCurveStyle::unPolish(const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr)
{ {
if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) { if (ceData.widgetObjectTypes.contains("TQWidget")) {
TQWidget *widget = reinterpret_cast<TQWidget*>(ptr); TQWidget *widget = reinterpret_cast<TQWidget*>(ptr);
if(isFormWidget(widget)) if(isFormWidget(widget))
@ -1998,7 +1998,7 @@ void QtCurveStyle::unPolish(const TQStyleControlElementData &ceData, ControlElem
} }
else if (::tqqt_cast<TQLineEdit*>(widget) || ::tqqt_cast<TQTextEdit*>(widget)) else if (::tqqt_cast<TQLineEdit*>(widget) || ::tqqt_cast<TQTextEdit*>(widget))
removeObjectEventHandler(ceData, elementFlags, ptr, this); removeObjectEventHandler(ceData, elementFlags, ptr, this);
else if (ceData.widgetObjectTypes.contains(TQSPLITTERHANDLE_OBJECT_NAME_STRING) || ceData.widgetObjectTypes.contains(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING) || ceData.widgetObjectTypes.contains("TQDockWindowResizeHandle")) else if (ceData.widgetObjectTypes.contains("TQSplitterHandle") || ceData.widgetObjectTypes.contains("TQDockWindowHandle") || ceData.widgetObjectTypes.contains("TQDockWindowResizeHandle"))
removeObjectEventHandler(ceData, elementFlags, ptr, this); removeObjectEventHandler(ceData, elementFlags, ptr, this);
else if (::tqqt_cast<TQProgressBar*>(widget)) else if (::tqqt_cast<TQProgressBar*>(widget))
{ {
@ -2012,7 +2012,7 @@ void QtCurveStyle::unPolish(const TQStyleControlElementData &ceData, ControlElem
removeObjectEventHandler(ceData, elementFlags, ptr, this); removeObjectEventHandler(ceData, elementFlags, ptr, this);
widget->setBackgroundMode(PaletteBackground); widget->setBackgroundMode(PaletteBackground);
} }
if (widget->parentWidget() && ::tqqt_cast<TQMenuBar *>(widget->parentWidget()) && !qstrcmp(widget->className(), TQFRAME_OBJECT_NAME_STRING)) if (widget->parentWidget() && ::tqqt_cast<TQMenuBar *>(widget->parentWidget()) && !qstrcmp(widget->className(), "TQFrame"))
{ {
removeObjectEventHandler(ceData, elementFlags, ptr, this); removeObjectEventHandler(ceData, elementFlags, ptr, this);
widget->setBackgroundMode(PaletteBackground); // We paint whole background. widget->setBackgroundMode(PaletteBackground); // We paint whole background.
@ -2065,7 +2065,7 @@ bool QtCurveStyle::appIsNotEmbedded(TQDialog *dlg)
bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQEvent *event ) bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQEvent *event )
{ {
if (ceData.widgetObjectTypes.contains(TQOBJECT_OBJECT_NAME_STRING)) { if (ceData.widgetObjectTypes.contains("TQObject")) {
TQObject* object = reinterpret_cast<TQObject*>(source); TQObject* object = reinterpret_cast<TQObject*>(source);
if(itsHoverWidget && TQT_BASE_OBJECT(object)==TQT_BASE_OBJECT(itsHoverWidget) && (TQEvent::Destroy==event->type() || TQEvent::Hide==event->type())) if(itsHoverWidget && TQT_BASE_OBJECT(object)==TQT_BASE_OBJECT(itsHoverWidget) && (TQEvent::Destroy==event->type() || TQEvent::Hide==event->type()))
@ -5347,7 +5347,7 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
drawMenuOrToolBarBackground(p, r, cg); drawMenuOrToolBarBackground(p, r, cg);
break; break;
case CE_DockWindowEmptyArea: case CE_DockWindowEmptyArea:
if(widget && ceData.widgetObjectTypes.contains(TQTOOLBAR_OBJECT_NAME_STRING)) if(widget && ceData.widgetObjectTypes.contains("TQToolBar"))
{ {
drawMenuOrToolBarBackground(p, r, cg, false, TQt::Horizontal==ceData.orientation); drawMenuOrToolBarBackground(p, r, cg, false, TQt::Horizontal==ceData.orientation);
} }
@ -5767,7 +5767,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, TQPainter *p, cons
::tqqt_cast<TQToolBar *>(widget->parentWidget()->parentWidget())), ::tqqt_cast<TQToolBar *>(widget->parentWidget()->parentWidget())),
isDWClose(!tb && !onExtender && isDWClose(!tb && !onExtender &&
(elementFlags & CEF_HasParentWidget) && (elementFlags & CEF_HasParentWidget) &&
ceData.parentWidgetData.widgetObjectTypes.contains( TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING)); ceData.parentWidgetData.widgetObjectTypes.contains( "TQDockWindowHandle"));
if(isDWClose) if(isDWClose)
{ {
@ -6146,7 +6146,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, TQPainter *p, cons
flags-=Style_MouseOver; flags-=Style_MouseOver;
if(opts.unifySpin) if(opts.unifySpin)
drawEntryField(p, all, cg, flags, ceData.widgetObjectTypes.contains(TQSPINWIDGET_OBJECT_NAME_STRING) && flags&Style_Enabled drawEntryField(p, all, cg, flags, ceData.widgetObjectTypes.contains("TQSpinWidget") && flags&Style_Enabled
? flags&Style_MouseOver || hw ? flags&Style_MouseOver || hw
? ENTRY_MOUSE_OVER ? ENTRY_MOUSE_OVER
: flags&Style_HasFocus || (elementFlags & CEF_HasFocus) : flags&Style_HasFocus || (elementFlags & CEF_HasFocus)
@ -6161,7 +6161,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, TQPainter *p, cons
frame.setWidth(frame.width()+1); frame.setWidth(frame.width()+1);
drawEntryField(p, frame, cg, flags, drawEntryField(p, frame, cg, flags,
ceData.widgetObjectTypes.contains(TQSPINWIDGET_OBJECT_NAME_STRING) && flags&Style_Enabled ceData.widgetObjectTypes.contains("TQSpinWidget") && flags&Style_Enabled
? flags&Style_MouseOver || hw ? flags&Style_MouseOver || hw
? ENTRY_MOUSE_OVER ? ENTRY_MOUSE_OVER
: flags&Style_HasFocus || (elementFlags & CEF_HasFocus) : flags&Style_HasFocus || (elementFlags & CEF_HasFocus)
@ -6208,7 +6208,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, TQPainter *p, cons
pe=PE_SpinWidgetPlus; pe=PE_SpinWidgetPlus;
if(!ceData.spinWidgetData.upEnabled) if(!ceData.spinWidgetData.upEnabled)
upflags&=~Style_Enabled; upflags&=~Style_Enabled;
drawPrimitive(pe, p, ceData, elementFlags, up, !(upflags&Style_Enabled) && ceData.widgetObjectTypes.contains(TQSPINWIDGET_OBJECT_NAME_STRING) ? ceData.palette.disabled() : cg, drawPrimitive(pe, p, ceData, elementFlags, up, !(upflags&Style_Enabled) && ceData.widgetObjectTypes.contains("TQSpinWidget") ? ceData.palette.disabled() : cg,
upflags |((active==SC_SpinWidgetUp) upflags |((active==SC_SpinWidgetUp)
? Style_On | Style_Sunken : Style_Raised)); ? Style_On | Style_Sunken : Style_Raised));
} }
@ -6224,7 +6224,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, TQPainter *p, cons
pe=PE_SpinWidgetMinus; pe=PE_SpinWidgetMinus;
if(!ceData.spinWidgetData.downEnabled) if(!ceData.spinWidgetData.downEnabled)
downflags&=~Style_Enabled; downflags&=~Style_Enabled;
drawPrimitive(pe, p, ceData, elementFlags, down, !(downflags&Style_Enabled) && ceData.widgetObjectTypes.contains(TQSPINWIDGET_OBJECT_NAME_STRING) ? ceData.palette.disabled() : cg, drawPrimitive(pe, p, ceData, elementFlags, down, !(downflags&Style_Enabled) && ceData.widgetObjectTypes.contains("TQSpinWidget") ? ceData.palette.disabled() : cg,
downflags |((active==SC_SpinWidgetDown) downflags |((active==SC_SpinWidgetDown)
? Style_On | Style_Sunken : Style_Raised)); ? Style_On | Style_Sunken : Style_Raised));
} }
@ -6235,7 +6235,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, TQPainter *p, cons
{ {
frame.setWidth(frame.width()+1); frame.setWidth(frame.width()+1);
drawEntryField(p, frame, cg, flags, drawEntryField(p, frame, cg, flags,
ceData.widgetObjectTypes.contains(TQSPINWIDGET_OBJECT_NAME_STRING) && flags&Style_Enabled ceData.widgetObjectTypes.contains("TQSpinWidget") && flags&Style_Enabled
? flags&Style_MouseOver || hw ? flags&Style_MouseOver || hw
? ENTRY_MOUSE_OVER ? ENTRY_MOUSE_OVER
: flags&Style_HasFocus || (elementFlags & CEF_HasFocus) : flags&Style_HasFocus || (elementFlags & CEF_HasFocus)
@ -6246,7 +6246,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, TQPainter *p, cons
} }
if(doEtch) if(doEtch)
drawEtch(p, ceData.widgetObjectTypes.contains(TQSPINWIDGET_OBJECT_NAME_STRING) ? TQT_TQRECT_OBJECT(ceData.rect) : r, cg, false, (opts.square&SQUARE_ENTRY)); drawEtch(p, ceData.widgetObjectTypes.contains("TQSpinWidget") ? TQT_TQRECT_OBJECT(ceData.rect) : r, cg, false, (opts.square&SQUARE_ENTRY));
} }
itsFormMode=false; itsFormMode=false;
break; break;
@ -6943,7 +6943,7 @@ int QtCurveStyle::pixelMetric(PixelMetric metric, const TQStyleControlElementDat
return 3; return 3;
case PM_TabBarTabShiftVertical: case PM_TabBarTabShiftVertical:
{ {
return (ceData.widgetObjectTypes.contains(TQTABBAR_OBJECT_NAME_STRING)) return (ceData.widgetObjectTypes.contains("TQTabBar"))
? TQTabBar::RoundedAbove==ceData.tabBarData.shape || TQTabBar::TriangularAbove==ceData.tabBarData.shape ? TQTabBar::RoundedAbove==ceData.tabBarData.shape || TQTabBar::TriangularAbove==ceData.tabBarData.shape
? 1 ? 1
: -1 : -1
@ -7134,7 +7134,7 @@ TQSize QtCurveStyle::sizeFromContents(ContentsType contents, const TQStyleContro
return size; return size;
} }
case CT_ToolButton: case CT_ToolButton:
if(ceData.parentWidgetData.widgetObjectTypes.contains(TQTOOLBAR_OBJECT_NAME_STRING)) if(ceData.parentWidgetData.widgetObjectTypes.contains("TQToolBar"))
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...
@ -8892,7 +8892,7 @@ bool QtCurveStyle::isWindowDragWidget(TQObject *o, const TQPoint &pos)
(//qobject_cast<TQDialog*>(o) || (//qobject_cast<TQDialog*>(o) ||
(::tqqt_cast<TQMenuBar*>(o) && (pos.isNull() || !((TQtcMenuBar *)o)->itemUnderPos(pos))) (::tqqt_cast<TQMenuBar*>(o) && (pos.isNull() || !((TQtcMenuBar *)o)->itemUnderPos(pos)))
//|| qobject_cast<TQGroupBox*>(o) //|| qobject_cast<TQGroupBox*>(o)
//|| (o->inherits(TQTOOLBUTTON_OBJECT_NAME_STRING) && !TQT_TQWIDGET(o)->isEnabled()) //|| (o->inherits("TQToolButton") && !TQT_TQWIDGET(o)->isEnabled())
// || qobject_cast<TQToolBar*>(o) // || qobject_cast<TQToolBar*>(o)
//|| qobject_cast<TQDockWidget*>(o) //|| qobject_cast<TQDockWidget*>(o)
@ -8900,7 +8900,7 @@ bool QtCurveStyle::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->parent() && o->parent()->inherits("TQStatusBar")) // || (o->inherits("TQLabel") && o->parent() && o->parent()->inherits("TQStatusBar"))
); );
} }

Loading…
Cancel
Save