Browse Source

Change most kdelibs inherits() functions to use the new object name define system

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1226839 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
tags/v3.5.13
tpearson 9 years ago
parent
commit
b5fb39eb73
20 changed files with 111 additions and 111 deletions
  1. +22
    -22
      kdecore/kconfigdialogmanager.cpp
  2. +1
    -1
      kdeui/kactionselector.cpp
  3. +1
    -1
      kdeui/kcompletionbox.cpp
  4. +2
    -2
      kdeui/kdockwidget.cpp
  5. +1
    -1
      kdeui/ktoolbar.cpp
  6. +1
    -1
      kdeui/ktoolbarbutton.cpp
  7. +1
    -1
      khtml/html/html_formimpl.cpp
  8. +8
    -8
      khtml/khtml_ext.cpp
  9. +2
    -2
      khtml/khtml_part.cpp
  10. +2
    -2
      khtml/rendering/render_frames.cpp
  11. +2
    -2
      kmdi/kmdichildfrm.cpp
  12. +1
    -1
      kparts/partmanager.cpp
  13. +6
    -6
      kstyles/highcolor/highcolor.cpp
  14. +15
    -15
      kstyles/highcontrast/highcontrast.cpp
  15. +16
    -16
      kstyles/keramik/keramik.cpp
  16. +21
    -21
      kstyles/klegacy/klegacystyle.cpp
  17. +1
    -1
      kstyles/light/lightstyle-v2.cpp
  18. +1
    -1
      kstyles/light/lightstyle-v3.cpp
  19. +3
    -3
      kstyles/plastik/plastik.cpp
  20. +4
    -4
      kstyles/web/webstyle.cpp

+ 22
- 22
kdecore/kconfigdialogmanager.cpp View File

@@ -69,29 +69,29 @@ void KConfigDialogManager::init(bool trackChanges)
if(trackChanges)
{
// QT
changedMap.insert("QButton", TQT_SIGNAL(stateChanged(int)));
changedMap.insert("QCheckBox", TQT_SIGNAL(stateChanged(int)));
changedMap.insert("QPushButton", TQT_SIGNAL(stateChanged(int)));
changedMap.insert("QRadioButton", TQT_SIGNAL(stateChanged(int)));
changedMap.insert(TQBUTTON_OBJECT_NAME_STRING, TQT_SIGNAL(stateChanged(int)));
changedMap.insert(TQCHECKBOX_OBJECT_NAME_STRING, TQT_SIGNAL(stateChanged(int)));
changedMap.insert(TQPUSHBUTTON_OBJECT_NAME_STRING, TQT_SIGNAL(stateChanged(int)));
changedMap.insert(TQRADIOBUTTON_OBJECT_NAME_STRING, TQT_SIGNAL(stateChanged(int)));
// We can only store one thing, so you can't have
// a ButtonGroup that is checkable.
changedMap.insert("QButtonGroup", TQT_SIGNAL(clicked(int)));
changedMap.insert("QGroupBox", TQT_SIGNAL(toggled(bool)));
changedMap.insert("QComboBox", TQT_SIGNAL(activated (int)));
changedMap.insert(TQBUTTONGROUP_OBJECT_NAME_STRING, TQT_SIGNAL(clicked(int)));
changedMap.insert(TQGROUPBOX_OBJECT_NAME_STRING, TQT_SIGNAL(toggled(bool)));
changedMap.insert(TQCOMBOBOX_OBJECT_NAME_STRING, TQT_SIGNAL(activated (int)));
//qsqlproperty map doesn't store the text, but the value!
//changedMap.insert("QComboBox", TQT_SIGNAL(textChanged(const TQString &)));
changedMap.insert("QDateEdit", TQT_SIGNAL(valueChanged(const TQDate &)));
changedMap.insert("QDateTimeEdit", TQT_SIGNAL(valueChanged(const TQDateTime &)));
changedMap.insert("QDial", TQT_SIGNAL(valueChanged (int)));
changedMap.insert("QLineEdit", TQT_SIGNAL(textChanged(const TQString &)));
changedMap.insert("QSlider", TQT_SIGNAL(valueChanged(int)));
changedMap.insert("QSpinBox", TQT_SIGNAL(valueChanged(int)));
changedMap.insert("QTimeEdit", TQT_SIGNAL(valueChanged(const TQTime &)));
changedMap.insert("QTextEdit", TQT_SIGNAL(textChanged()));
changedMap.insert("QTextBrowser", TQT_SIGNAL(sourceChanged(const TQString &)));
changedMap.insert("QMultiLineEdit", TQT_SIGNAL(textChanged()));
changedMap.insert("QListBox", TQT_SIGNAL(selectionChanged()));
changedMap.insert("QTabWidget", TQT_SIGNAL(currentChanged(TQWidget *)));
changedMap.insert(TQDATEEDIT_OBJECT_NAME_STRING, TQT_SIGNAL(valueChanged(const TQDate &)));
changedMap.insert(TQDATETIMEEDIT_OBJECT_NAME_STRING, TQT_SIGNAL(valueChanged(const TQDateTime &)));
changedMap.insert(TQDIAL_OBJECT_NAME_STRING, TQT_SIGNAL(valueChanged (int)));
changedMap.insert(TQLINEEDIT_OBJECT_NAME_STRING, TQT_SIGNAL(textChanged(const TQString &)));
changedMap.insert(TQSLIDER_OBJECT_NAME_STRING, TQT_SIGNAL(valueChanged(int)));
changedMap.insert(TQSPINBOX_OBJECT_NAME_STRING, TQT_SIGNAL(valueChanged(int)));
changedMap.insert(TQTIMEEDIT_OBJECT_NAME_STRING, TQT_SIGNAL(valueChanged(const TQTime &)));
changedMap.insert(TQTEXTEDIT_OBJECT_NAME_STRING, TQT_SIGNAL(textChanged()));
changedMap.insert(TQTEXTBROWSER_OBJECT_NAME_STRING, TQT_SIGNAL(sourceChanged(const TQString &)));
changedMap.insert(TQMULTILINEEDIT_OBJECT_NAME_STRING, TQT_SIGNAL(textChanged()));
changedMap.insert(TQLISTBOX_OBJECT_NAME_STRING, TQT_SIGNAL(selectionChanged()));
changedMap.insert(TQTABWIDGET_OBJECT_NAME_STRING, TQT_SIGNAL(currentChanged(TQWidget *)));

// KDE
changedMap.insert( "KComboBox", TQT_SIGNAL(activated (int)));
@@ -218,7 +218,7 @@ bool KConfigDialogManager::parseChildren(const TQWidget *widget, bool trackChang
kdWarning(178) << "A widget named '" << widgetName << "' was found but there is no setting named '" << configId << "'" << endl;
}
}
else if (childWidget->inherits("QLabel"))
else if (childWidget->inherits(TQLABEL_OBJECT_NAME_STRING))
{
TQLabel *label = static_cast<TQLabel *>(childWidget);
TQWidget *buddy = label->buddy();
@@ -238,8 +238,8 @@ bool KConfigDialogManager::parseChildren(const TQWidget *widget, bool trackChang
TQMap<TQString, TQCString>::const_iterator changedIt = changedMap.tqfind(childWidget->className());
if (changedIt != changedMap.end())
{
if ((!d->insideGroupBox || !childWidget->inherits("QRadioButton")) &&
!childWidget->inherits("QGroupBox"))
if ((!d->insideGroupBox || !childWidget->inherits(TQRADIOBUTTON_OBJECT_NAME_STRING)) &&
!childWidget->inherits(TQGROUPBOX_OBJECT_NAME_STRING))
kdDebug(178) << "Widget '" << widgetName << "' (" << childWidget->className() << ") remains unmanaged." << endl;
}
}


+ 1
- 1
kdeui/kactionselector.cpp View File

@@ -392,7 +392,7 @@ bool KActionSelector::eventFilter( TQObject *o, TQEvent *e )
}
return true;
}
else if ( o->inherits( "QListBox" ) )
else if ( o->inherits( TQLISTBOX_OBJECT_NAME_STRING ) )
{
switch ( ((TQKeyEvent*)e)->key() )
{


+ 1
- 1
kdeui/kcompletionbox.cpp View File

@@ -343,7 +343,7 @@ TQRect KCompletionBox::calculateGeometry() const
// to adjust it. Do that here as well, for consistency
const TQObject* combo;
if ( d->m_parent && (combo = d->m_parent->tqparent() ) &&
combo->inherits("QComboBox") )
combo->inherits(TQCOMBOBOX_OBJECT_NAME_STRING) )
{
const TQComboBox* cb = static_cast<const TQComboBox*>(TQT_TQWIDGET_CONST(combo));



+ 2
- 2
kdeui/kdockwidget.cpp View File

@@ -1699,7 +1699,7 @@ void KDockManager::activate()
obj->show();
}
}
if ( !main->inherits("QDialog") ) main->show();
if ( !main->inherits(TQDIALOG_OBJECT_NAME_STRING) ) main->show();
}

bool KDockManager::eventFilter( TQObject *obj, TQEvent *event )
@@ -3105,7 +3105,7 @@ void KDockArea::resizeEvent(TQResizeEvent *rsize)
#ifndef NO_KDE2
// kdDebug(282)<<"KDockArea::resize"<<endl;
#endif
TQObjectList *list=queryList("QWidget",0,false);
TQObjectList *list=queryList(TQWIDGET_OBJECT_NAME_STRING,0,false);

TQObjectListIt it( *list ); // iterate over the buttons
TQObject *obj;


+ 1
- 1
kdeui/ktoolbar.cpp View File

@@ -2236,7 +2236,7 @@ void KToolBar::slotContextAboutToHide()
TQPtrListIterator<TQWidget> it( widgets );
TQWidget *wdg;
while ( ( wdg = it.current() ) != 0 ) {
if ( wdg->inherits( "QToolButton" ) )
if ( wdg->inherits( TQTOOLBUTTON_OBJECT_NAME_STRING ) )
static_cast<TQToolButton*>( wdg )->setDown( false );
++it;
}


+ 1
- 1
kdeui/ktoolbarbutton.cpp View File

@@ -298,7 +298,7 @@ void KToolBarButton::setIconSet( const TQIconSet &iconset )
// remove?
void KToolBarButton::setPixmap( const TQPixmap &pixmap )
{
if( pixmap.isNull()) // called by QToolButton
if( pixmap.isNull()) // called by TQToolButton
{
TQToolButton::setPixmap( pixmap );
return;


+ 1
- 1
khtml/html/html_formimpl.cpp View File

@@ -964,7 +964,7 @@ class FocusHandleWidget : public TQWidget
{
public:
void focusNextPrev(bool n) {
if (!focusNextPrevChild(n) && inherits("QTextEdit"))
if (!focusNextPrevChild(n) && inherits(TQTEXTEDIT_OBJECT_NAME_STRING))
TQWidget::focusNextPrevChild(n);
}
};


+ 8
- 8
khtml/khtml_ext.cpp View File

@@ -115,7 +115,7 @@ void KHTMLPartBrowserExtension::editableWidgetFocused( TQWidget *widget )
connect( TQApplication::tqclipboard(), TQT_SIGNAL( dataChanged() ),
this, TQT_SLOT( updateEditActions() ) );

if ( m_editableFormWidget->inherits( "QLineEdit" ) || m_editableFormWidget->inherits( "QTextEdit" ) )
if ( m_editableFormWidget->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) || m_editableFormWidget->inherits( TQTEXTEDIT_OBJECT_NAME_STRING ) )
connect( m_editableFormWidget, TQT_SIGNAL( selectionChanged() ),
this, TQT_SLOT( updateEditActions() ) );

@@ -140,7 +140,7 @@ void KHTMLPartBrowserExtension::editableWidgetBlurred( TQWidget * /*widget*/ )

if ( oldWidget )
{
if ( oldWidget->inherits( "QLineEdit" ) || oldWidget->inherits( "QTextEdit" ) )
if ( oldWidget->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) || oldWidget->inherits( TQTEXTEDIT_OBJECT_NAME_STRING ) )
disconnect( oldWidget, TQT_SIGNAL( selectionChanged() ),
this, TQT_SLOT( updateEditActions() ) );
}
@@ -201,9 +201,9 @@ void KHTMLPartBrowserExtension::cut()
if ( !m_editableFormWidget )
return;

if ( m_editableFormWidget->inherits( "QLineEdit" ) )
if ( m_editableFormWidget->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) )
static_cast<TQLineEdit *>( &(*m_editableFormWidget) )->cut();
else if ( m_editableFormWidget->inherits( "QTextEdit" ) )
else if ( m_editableFormWidget->inherits( TQTEXTEDIT_OBJECT_NAME_STRING ) )
static_cast<TQTextEdit *>( &(*m_editableFormWidget) )->cut();
}

@@ -254,9 +254,9 @@ void KHTMLPartBrowserExtension::copy()
}
else
{
if ( m_editableFormWidget->inherits( "QLineEdit" ) )
if ( m_editableFormWidget->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) )
static_cast<TQLineEdit *>( &(*m_editableFormWidget) )->copy();
else if ( m_editableFormWidget->inherits( "QTextEdit" ) )
else if ( m_editableFormWidget->inherits( TQTEXTEDIT_OBJECT_NAME_STRING ) )
static_cast<TQTextEdit *>( &(*m_editableFormWidget) )->copy();
}
}
@@ -304,9 +304,9 @@ void KHTMLPartBrowserExtension::paste()
if ( !m_editableFormWidget )
return;

if ( m_editableFormWidget->inherits( "QLineEdit" ) )
if ( m_editableFormWidget->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) )
static_cast<TQLineEdit *>( &(*m_editableFormWidget) )->paste();
else if ( m_editableFormWidget->inherits( "QTextEdit" ) )
else if ( m_editableFormWidget->inherits( TQTEXTEDIT_OBJECT_NAME_STRING ) )
static_cast<TQTextEdit *>( &(*m_editableFormWidget) )->paste();
}



+ 2
- 2
khtml/khtml_part.cpp View File

@@ -6871,7 +6871,7 @@ void KHTMLPart::slotActiveFrameChanged( KParts::Part *part )
return;
}
// kdDebug(6050) << "KHTMLPart::slotActiveFrameChanged d->m_activeFrame=" << d->m_activeFrame << endl;
if ( d->m_activeFrame && d->m_activeFrame->widget() && d->m_activeFrame->widget()->inherits( "QFrame" ) )
if ( d->m_activeFrame && d->m_activeFrame->widget() && d->m_activeFrame->widget()->inherits( TQFRAME_OBJECT_NAME_STRING ) )
{
TQFrame *frame = static_cast<TQFrame *>( d->m_activeFrame->widget() );
if (frame->frameStyle() != TQFrame::NoFrame)
@@ -6899,7 +6899,7 @@ void KHTMLPart::slotActiveFrameChanged( KParts::Part *part )

d->m_activeFrame = part;

if ( d->m_activeFrame && d->m_activeFrame->widget()->inherits( "QFrame" ) )
if ( d->m_activeFrame && d->m_activeFrame->widget()->inherits( TQFRAME_OBJECT_NAME_STRING ) )
{
TQFrame *frame = static_cast<TQFrame *>( d->m_activeFrame->widget() );
if (frame->frameStyle() != TQFrame::NoFrame)


+ 2
- 2
khtml/rendering/render_frames.cpp View File

@@ -674,7 +674,7 @@ RenderFrame::RenderFrame( DOM::HTMLFrameElementImpl *frame )

void RenderFrame::slotViewCleared()
{
if(m_widget->inherits("QScrollView")) {
if(m_widget->inherits(TQSCROLLVIEW_OBJECT_NAME_STRING)) {
#ifdef DEBUG_LAYOUT
kdDebug(6031) << "frame is a scrollview!" << endl;
#endif
@@ -989,7 +989,7 @@ void RenderPartObject::layout( )

void RenderPartObject::slotViewCleared()
{
if(m_widget->inherits("QScrollView") ) {
if(m_widget->inherits(TQSCROLLVIEW_OBJECT_NAME_STRING) ) {
#ifdef DEBUG_LAYOUT
kdDebug(6031) << "iframe is a scrollview!" << endl;
#endif


+ 2
- 2
kmdi/kmdichildfrm.cpp View File

@@ -899,7 +899,7 @@ void KMdiChildFrm::linkChildren( TQDict<TQ_FocusPolicy>* pFocPolDict )
if ( pFocPol != 0 )
widg->setFocusPolicy( *pFocPol );
if ( !( widg->inherits( "QPopupMenu" ) ) )
if ( !( widg->inherits( TQPOPUPMENU_OBJECT_NAME_STRING ) ) )
widg->installEventFilter( this );

}
@@ -1155,7 +1155,7 @@ bool KMdiChildFrm::eventFilter( TQObject *obj, TQEvent *e )
// if we lost a child we uninstall ourself as event filter for the lost
// child and its children
TQObject* pLostChild = TQT_TQOBJECT(( ( TQChildEvent* ) e )->child());
if ( ( pLostChild != 0L ) /*&& (pLostChild->inherits("QWidget"))*/ )
if ( ( pLostChild != 0L ) /*&& (pLostChild->inherits(TQWIDGET_OBJECT_NAME_STRING))*/ )
{
TQObjectList* list = pLostChild->queryList();
list->insert( 0, pLostChild ); // add the lost child to the list too, just to save code


+ 1
- 1
kparts/partmanager.cpp View File

@@ -209,7 +209,7 @@ bool PartManager::eventFilter( TQObject *obj, TQEvent *ev )
if ( !d->m_managedTopLevelWidgets.tqcontainsRef( w->tqtopLevelWidget() ) )
return false;

if ( d->m_bIgnoreScrollBars && w->inherits( "QScrollBar" ) )
if ( d->m_bIgnoreScrollBars && w->inherits( TQSCROLLBAR_OBJECT_NAME_STRING ) )
return false;

if ( mev ) // mouse press or mouse double-click event


+ 6
- 6
kstyles/highcolor/highcolor.cpp View File

@@ -192,16 +192,16 @@ HighColorStyle::~HighColorStyle()
void HighColorStyle::polish(TQWidget* widget)
{
// Put in order of highest occurrence to maximise hit rate
if (widget->inherits("QPushButton")) {
if (widget->inherits(TQPUSHBUTTON_OBJECT_NAME_STRING)) {
widget->installEventFilter(this);
} else if (widget->inherits("QMenuBar") || widget->inherits("QPopupMenu")) {
} else if (widget->inherits(TQMENUBAR_OBJECT_NAME_STRING) || widget->inherits(TQPOPUPMENU_OBJECT_NAME_STRING)) {
widget->setBackgroundMode(TQWidget::NoBackground);
} else if (type == HighColor && widget->inherits("QToolBarExtensionWidget")) {
widget->installEventFilter(this);
} else if ( !qstrcmp( widget->name(), kdeToolbarWidget) ) {
widget->setBackgroundMode( NoBackground ); // We paint the whole background.
widget->installEventFilter(this);
} else if (widget->inherits("QToolBoxButton")) {
} else if (widget->inherits(TQTOOLBOXBUTTON_OBJECT_NAME_STRING)) {
TQFont font = widget->font();
font.setBold(true);
widget->setFont(font);
@@ -213,10 +213,10 @@ void HighColorStyle::polish(TQWidget* widget)

void HighColorStyle::unPolish(TQWidget* widget)
{
if (widget->inherits("QPushButton")) {
if (widget->inherits(TQPUSHBUTTON_OBJECT_NAME_STRING)) {
widget->removeEventFilter(this);
}
else if (widget->inherits("QMenuBar") || widget->inherits("QPopupMenu")) {
else if (widget->inherits(TQMENUBAR_OBJECT_NAME_STRING) || widget->inherits(TQPOPUPMENU_OBJECT_NAME_STRING)) {
widget->setBackgroundMode(TQWidget::PaletteBackground);
} else if (type == HighColor && widget->inherits("QToolBarExtensionWidget")) {
widget->removeEventFilter(this);
@@ -1651,7 +1651,7 @@ void HighColorStyle::tqdrawComplexControl( TQ_ComplexControl control,
}
else if (widget->parent())
{
if (widget->parent()->inherits("QToolBar"))
if (widget->parent()->inherits(TQTOOLBAR_OBJECT_NAME_STRING))
{
TQToolBar* parent = (TQToolBar*)widget->parent();
TQRect pr = parent->rect();


+ 15
- 15
kstyles/highcontrast/highcontrast.cpp View File

@@ -155,11 +155,11 @@ void HighContrastStyle::polish( TQPalette& pal )

void HighContrastStyle::polish (TQWidget* widget)
{
if (widget->inherits ("QButton")
|| widget->inherits ("QComboBox")
|| widget->inherits ("QSpinWidget")
|| widget->inherits ("QLineEdit")
|| widget->inherits ("QTextEdit"))
if (widget->inherits (TQBUTTON_OBJECT_NAME_STRING)
|| widget->inherits (TQCOMBOBOX_OBJECT_NAME_STRING)
|| widget->inherits (TQSPINWIDGET_OBJECT_NAME_STRING)
|| widget->inherits (TQLINEEDIT_OBJECT_NAME_STRING)
|| widget->inherits (TQTEXTEDIT_OBJECT_NAME_STRING))
{
widget->installEventFilter (this);

@@ -174,7 +174,7 @@ void HighContrastStyle::polish (TQWidget* widget)

void HighContrastStyle::unPolish (TQWidget* widget)
{
if (widget->inherits ("QWidget") || widget->inherits ("QComboBox") || widget->inherits ("QSpinWidget") || widget->inherits ("QLineEdit") || widget->inherits ("QTextEdit"))
if (widget->inherits (TQWIDGET_OBJECT_NAME_STRING) || widget->inherits (TQCOMBOBOX_OBJECT_NAME_STRING) || widget->inherits (TQSPINWIDGET_OBJECT_NAME_STRING) || widget->inherits (TQLINEEDIT_OBJECT_NAME_STRING) || widget->inherits (TQTEXTEDIT_OBJECT_NAME_STRING))
widget->removeEventFilter (this);
KStyle::unPolish (widget);
}
@@ -1595,7 +1595,7 @@ int HighContrastStyle::tqpixelMetric(PixelMetric m, const TQWidget *widget) cons
}

case PM_DefaultFrameWidth: {
if (widget && (widget->inherits ("QLineEdit") || widget->inherits ("QTextEdit")))
if (widget && (widget->inherits (TQLINEEDIT_OBJECT_NAME_STRING) || widget->inherits (TQTEXTEDIT_OBJECT_NAME_STRING)))
return 2*basicLineWidth;
else
return basicLineWidth;
@@ -1805,17 +1805,17 @@ bool HighContrastStyle::eventFilter (TQObject *object, TQEvent *event)
{
// Handle hover effects.
if (event->type() == TQEvent::Enter
&& (widget->inherits ("QButton")
|| widget->inherits ("QComboBox")
|| widget->inherits ("QSpinWidget")))
&& (widget->inherits (TQBUTTON_OBJECT_NAME_STRING)
|| widget->inherits (TQCOMBOBOX_OBJECT_NAME_STRING)
|| widget->inherits (TQSPINWIDGET_OBJECT_NAME_STRING)))
{
hoverWidget = widget;
widget->tqrepaint (false);
}
else if (event->type() == TQEvent::Leave
&& (widget->inherits ("QButton")
|| widget->inherits ("QComboBox")
|| widget->inherits ("QSpinWidget")))
&& (widget->inherits (TQBUTTON_OBJECT_NAME_STRING)
|| widget->inherits (TQCOMBOBOX_OBJECT_NAME_STRING)
|| widget->inherits (TQSPINWIDGET_OBJECT_NAME_STRING)))
{
if (TQT_BASE_OBJECT(object) == TQT_BASE_OBJECT(hoverWidget))
hoverWidget = 0L;
@@ -1826,8 +1826,8 @@ bool HighContrastStyle::eventFilter (TQObject *object, TQEvent *event)
{
TQWidget* widgetparent = dynamic_cast<TQWidget*>(widget->parent());
while (widgetparent
&& ! widgetparent->inherits ("QComboBox")
&& ! widgetparent->inherits ("QSpinWidget"))
&& ! widgetparent->inherits (TQCOMBOBOX_OBJECT_NAME_STRING)
&& ! widgetparent->inherits (TQSPINWIDGET_OBJECT_NAME_STRING))
{
widgetparent = dynamic_cast<TQWidget*>(widgetparent->parent());
}


+ 16
- 16
kstyles/keramik/keramik.cpp View File

@@ -338,17 +338,17 @@ void KeramikStyle::polish(TQApplication* app)
void KeramikStyle::polish(TQWidget* widget)
{
// Put in order of highest occurrence to maximise hit rate
if ( widget->inherits( "QPushButton" ) || widget->inherits( "QComboBox" ) || widget->inherits("QToolButton") )
if ( widget->inherits( TQPUSHBUTTON_OBJECT_NAME_STRING ) || widget->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) || widget->inherits(TQTOOLBUTTON_OBJECT_NAME_STRING) )
{
widget->installEventFilter(this);
if ( widget->inherits( "QComboBox" ) )
if ( widget->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) )
widget->setBackgroundMode( NoBackground );
}
else if ( widget->inherits( "QMenuBar" ) || widget->inherits( "QPopupMenu" ) )
else if ( widget->inherits( TQMENUBAR_OBJECT_NAME_STRING ) || widget->inherits( TQPOPUPMENU_OBJECT_NAME_STRING ) )
widget->setBackgroundMode( NoBackground );

else if ( widget->tqparentWidget() &&
( ( widget->inherits( "QListBox" ) && widget->tqparentWidget()->inherits( "QComboBox" ) ) ||
( ( widget->inherits( TQLISTBOX_OBJECT_NAME_STRING ) && widget->tqparentWidget()->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) ) ||
widget->inherits( "KCompletionBox" ) ) ) {
TQListBox* listbox = (TQListBox*) widget;
listbox->setLineWidth( 4 );
@@ -379,17 +379,17 @@ void KeramikStyle::polish(TQWidget* widget)
void KeramikStyle::unPolish(TQWidget* widget)
{
//### TODO: This needs major cleanup (and so does polish() )
if ( widget->inherits( "QPushButton" ) || widget->inherits( "QComboBox" ) )
if ( widget->inherits( TQPUSHBUTTON_OBJECT_NAME_STRING ) || widget->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) )
{
if ( widget->inherits( "QComboBox" ) )
if ( widget->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) )
widget->setBackgroundMode( PaletteButton );
widget->removeEventFilter(this);
}
else if ( widget->inherits( "QMenuBar" ) || widget->inherits( "QPopupMenu" ) )
else if ( widget->inherits( TQMENUBAR_OBJECT_NAME_STRING ) || widget->inherits( TQPOPUPMENU_OBJECT_NAME_STRING ) )
widget->setBackgroundMode( PaletteBackground );

else if ( widget->tqparentWidget() &&
( ( widget->inherits( "QListBox" ) && widget->tqparentWidget()->inherits( "QComboBox" ) ) ||
( ( widget->inherits( TQLISTBOX_OBJECT_NAME_STRING ) && widget->tqparentWidget()->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) ) ||
widget->inherits( "KCompletionBox" ) ) ) {
TQListBox* listbox = (TQListBox*) widget;
listbox->setLineWidth( 1 );
@@ -1231,7 +1231,7 @@ void KeramikStyle::drawKStylePrimitive( KStylePrimitive kpe,
TQToolBar* parent = 0;
if (widget && widget->parent() && widget->parent()->inherits("QToolBar"))
if (widget && widget->parent() && widget->parent()->inherits(TQTOOLBAR_OBJECT_NAME_STRING))
parent = static_cast<TQToolBar*>(widget->parent());
renderToolbarEntryBackground(p, parent, r, cg, (flags & Style_Horizontal));
@@ -1359,7 +1359,7 @@ void KeramikStyle::tqdrawControl( TQ_ControlElement element,
}
else
{
if (widget->parent() && widget->parent()->inherits("QToolBar"))
if (widget->parent() && widget->parent()->inherits(TQTOOLBAR_OBJECT_NAME_STRING))
toolbarBlendWidget = widget;

tqdrawPrimitive( PE_ButtonCommand, p, r, cg, flags );
@@ -1466,7 +1466,7 @@ void KeramikStyle::tqdrawControl( TQ_ControlElement element,
case CE_ToolButtonLabel:
{
//const TQToolButton *toolbutton = static_cast<const TQToolButton * >(widget);
bool onToolbar = widget->tqparentWidget() && widget->tqparentWidget()->inherits( "QToolBar" );
bool onToolbar = widget->tqparentWidget() && widget->tqparentWidget()->inherits( TQTOOLBAR_OBJECT_NAME_STRING );
TQRect nr = r;

if (!onToolbar)
@@ -1537,7 +1537,7 @@ void KeramikStyle::tqdrawControl( TQ_ControlElement element,
case CE_DockWindowEmptyArea:
{
TQRect pr = r;
if (widget && widget->inherits("QToolBar"))
if (widget && widget->inherits(TQTOOLBAR_OBJECT_NAME_STRING))
{
const TQToolBar* tb = static_cast<const TQToolBar*>(widget);
if (tb->place() == TQDockWindow::OutsideDock)
@@ -1976,7 +1976,7 @@ void KeramikStyle::tqdrawComplexControl( TQ_ComplexControl control,
{
//Double-buffer only when we are in the slower full-blend mode
if (widget->parent() &&
( widget->tqparent()->inherits("QToolBar")|| !qstrcmp(widget->tqparent()->name(), kdeToolbarWidget) ) )
( widget->tqparent()->inherits(TQTOOLBAR_OBJECT_NAME_STRING)|| !qstrcmp(widget->tqparent()->name(), kdeToolbarWidget) ) )
{
buf = new TQPixmap( r.width(), r.height() );
br.setX(0);
@@ -2209,10 +2209,10 @@ void KeramikStyle::tqdrawComplexControl( TQ_ComplexControl control,
// -------------------------------------------------------------------
case CC_ToolButton: {
const TQToolButton *toolbutton = (const TQToolButton *) widget;
bool onToolbar = widget->tqparentWidget() && widget->tqparentWidget()->inherits( "QToolBar" );
bool onToolbar = widget->tqparentWidget() && widget->tqparentWidget()->inherits( TQTOOLBAR_OBJECT_NAME_STRING );
bool onExtender = !onToolbar &&
widget->tqparentWidget() && widget->tqparentWidget()->inherits( "QToolBarExtensionWidget") &&
widget->tqparentWidget()->tqparentWidget()->inherits( "QToolBar" );
widget->tqparentWidget()->tqparentWidget()->inherits( TQTOOLBAR_OBJECT_NAME_STRING );

bool onControlButtons = false;
if (!onToolbar && !onExtender && widget->tqparentWidget() &&
@@ -2441,7 +2441,7 @@ TQSize KeramikStyle::tqsizeFromContents( ContentsType contents,

case CT_ToolButton:
{
bool onToolbar = widget->tqparentWidget() && widget->tqparentWidget()->inherits( "QToolBar" );
bool onToolbar = widget->tqparentWidget() && widget->tqparentWidget()->inherits( TQTOOLBAR_OBJECT_NAME_STRING );
if (!onToolbar) //Behaves like a button, so scale appropriately to the border
{
int w = contentSize.width();


+ 21
- 21
kstyles/klegacy/klegacystyle.cpp View File

@@ -1898,23 +1898,23 @@ void KLegacyStyle::polish(TQWidget *widget) {
bool immediateRender = false;
bool bgPixmap = false;

if (widget->inherits("QButton")) {
if (widget->inherits(TQBUTTON_OBJECT_NAME_STRING)) {
metaobject = TQButton::staticMetaObject();
eventFilter = true;
}

if (widget->inherits("QComboBox")) {
if (widget->inherits(TQCOMBOBOX_OBJECT_NAME_STRING)) {
metaobject = TQComboBox::staticMetaObject();
eventFilter = true;
}

if (widget->inherits("QScrollBar")) {
if (widget->inherits(TQSCROLLBAR_OBJECT_NAME_STRING)) {
metaobject = TQScrollBar::staticMetaObject();
eventFilter = true;
mouseTrack = true;
}

if (widget->inherits("QMenuBar")) {
if (widget->inherits(TQMENUBAR_OBJECT_NAME_STRING)) {
eventFilter = true;
immediateRender = true;

@@ -1930,7 +1930,7 @@ void KLegacyStyle::polish(TQWidget *widget) {
widget->setBackgroundMode(TQWidget::PaletteBackground);
}

if (widget->inherits("QToolBar")) {
if (widget->inherits(TQTOOLBAR_OBJECT_NAME_STRING)) {
metaobject = TQToolBar::staticMetaObject();

eventFilter = true;
@@ -1944,7 +1944,7 @@ void KLegacyStyle::polish(TQWidget *widget) {
widget->setBackgroundMode(TQWidget::PaletteBackground);
}

if (widget->inherits("QLineEdit")) {
if (widget->inherits(TQLINEEDIT_OBJECT_NAME_STRING)) {
metaobject = TQLineEdit::staticMetaObject();

eventFilter = true;
@@ -1968,7 +1968,7 @@ void KLegacyStyle::polish(TQWidget *widget) {
detail = "base";
}

if (widget->inherits("QPopupMenu")) {
if (widget->inherits(TQPOPUPMENU_OBJECT_NAME_STRING)) {
qDebug("polishing popup '%s'", widget->className());
metaobject = TQPopupMenu::staticMetaObject();
widget->setBackgroundMode(TQWidget::PaletteBackground);
@@ -2544,7 +2544,7 @@ void KLegacyStyle::drawComboButton(TQPainter *p, int x, int y, int w, int h,
key.data.state = KLegacy::Normal;
key.data.shadow = KLegacy::Out;

if (priv->lastWidget && priv->lastWidget->inherits("QComboBox"))
if (priv->lastWidget && priv->lastWidget->inherits(TQCOMBOBOX_OBJECT_NAME_STRING))
key.data.state = KLegacy::Prelight;

TQPixmap *pix = gobj->draw(key, w, h, "optionmenu");
@@ -3081,7 +3081,7 @@ bool KLegacyStyle::eventFilter(TQObject *obj, TQEvent *e) {
{
TQWidget *w = (TQWidget *) obj;

if (w->inherits("QPopupMenu") && w->width() < 700) {
if (w->inherits(TQPOPUPMENU_OBJECT_NAME_STRING) && w->width() < 700) {
GtkObject *gobj = priv->gtkDict.tqfind(TQPopupMenu::staticMetaObject());

if (gobj) {
@@ -3151,7 +3151,7 @@ bool KLegacyStyle::eventFilter(TQObject *obj, TQEvent *e) {
if (p && (! p->isNull()))
w->setBackgroundPixmap(*p);
}
} else if (w->inherits("QLineEdit")) {
} else if (w->inherits(TQLINEEDIT_OBJECT_NAME_STRING)) {
GtkObject *gobj = priv->gtkDict.tqfind(TQLineEdit::staticMetaObject());

if (gobj) {
@@ -3191,8 +3191,8 @@ bool KLegacyStyle::eventFilter(TQObject *obj, TQEvent *e) {
w->setPalette(pal);
}
}
} else if (w->inherits("QMenuBar") ||
w->inherits("QToolBar")) {
} else if (w->inherits(TQMENUBAR_OBJECT_NAME_STRING) ||
w->inherits(TQTOOLBAR_OBJECT_NAME_STRING)) {
GtkObject *gobj = priv->gtkDict.tqfind(TQMenuBar::staticMetaObject());

if (gobj) {
@@ -3256,13 +3256,13 @@ bool KLegacyStyle::eventFilter(TQObject *obj, TQEvent *e) {

case TQEvent::Enter:
{
if (obj->inherits("QPushButton") ||
obj->inherits("QComboBox") ||
obj->inherits("QSlider") ||
obj->inherits("QScrollbar")) {
if (obj->inherits(TQPUSHBUTTON_OBJECT_NAME_STRING) ||
obj->inherits(TQCOMBOBOX_OBJECT_NAME_STRING) ||
obj->inherits(TQSLIDER_OBJECT_NAME_STRING) ||
obj->inherits(TQSCROLLBAR_OBJECT_NAME_STRING)) {
priv->lastWidget = (TQWidget *) obj;
priv->lastWidget->tqrepaint(false);
} else if (obj->inherits("QRadioButton")) {
} else if (obj->inherits(TQRADIOBUTTON_OBJECT_NAME_STRING)) {
TQWidget *w = (TQWidget *) obj;

if (! w->isTopLevel() && w->isEnabled()) {
@@ -3290,7 +3290,7 @@ bool KLegacyStyle::eventFilter(TQObject *obj, TQEvent *e) {
}
}
}
} else if (obj->inherits("QCheckBox")) {
} else if (obj->inherits(TQCHECKBOX_OBJECT_NAME_STRING)) {
TQWidget *w = (TQWidget *) obj;

if (! w->isTopLevel() && w->isEnabled()) {
@@ -3328,8 +3328,8 @@ bool KLegacyStyle::eventFilter(TQObject *obj, TQEvent *e) {
if (obj == priv->lastWidget) {
priv->lastWidget = 0;
((TQWidget *) obj)->tqrepaint(false);
} else if (obj->inherits("QRadioButton") ||
obj->inherits("QCheckBox")) {
} else if (obj->inherits(TQRADIOBUTTON_OBJECT_NAME_STRING) ||
obj->inherits(TQCHECKBOX_OBJECT_NAME_STRING)) {
TQWidget *w = (TQWidget *) obj;

if (! w->isTopLevel()) {
@@ -3346,7 +3346,7 @@ bool KLegacyStyle::eventFilter(TQObject *obj, TQEvent *e) {
{
TQMouseEvent *me = (TQMouseEvent *) e;
priv->mousePos = me->pos();
if (obj->inherits("QScrollBar") &&
if (obj->inherits(TQSCROLLBAR_OBJECT_NAME_STRING) &&
(! (me->state() & (LeftButton | MidButton | RightButton)))) {
priv->hovering = true;
((TQWidget *) obj)->tqrepaint(false);


+ 1
- 1
kstyles/light/lightstyle-v2.cpp View File

@@ -295,7 +295,7 @@ void LightStyleV2::tqdrawPrimitive( TQ_PrimitiveElement pe,
if ( p && p->device()->devType() == TQInternal::Widget ) {
TQWidget *w = (TQWidget *) p->device();
TQWidget *p = w->tqparentWidget();
if (p->inherits("QDockWindow") && ! p->inherits("QToolBar")) {
if (p->inherits(TQDOCKWINDOW_OBJECT_NAME_STRING) && ! p->inherits(TQTOOLBAR_OBJECT_NAME_STRING)) {
drawTitle = true;
title = p->caption();
}


+ 1
- 1
kstyles/light/lightstyle-v3.cpp View File

@@ -427,7 +427,7 @@ void LightStyleV3::tqdrawPrimitive( TQ_PrimitiveElement pe,
if ( p && p->device()->devType() == TQInternal::Widget ) {
TQWidget *w = (TQWidget *) p->device();
TQWidget *p = w->tqparentWidget();
if (p->inherits("QDockWindow") && ! p->inherits("QToolBar")) {
if (p->inherits(TQDOCKWINDOW_OBJECT_NAME_STRING) && ! p->inherits(TQTOOLBAR_OBJECT_NAME_STRING)) {
drawTitle = true;
title = p->caption();
}


+ 3
- 3
kstyles/plastik/plastik.cpp View File

@@ -247,7 +247,7 @@ void PlastikStyle::polish(TQWidget* widget)
if ( ::tqqt_cast<TQPushButton*>(widget) || ::tqqt_cast<TQComboBox*>(widget) ||
::tqqt_cast<TQSpinWidget*>(widget) || ::tqqt_cast<TQSlider*>(widget) ||
::tqqt_cast<TQCheckBox*>(widget) || ::tqqt_cast<TQRadioButton*>(widget) ||
::tqqt_cast<TQToolButton*>(widget) || widget->inherits("QSplitterHandle") )
::tqqt_cast<TQToolButton*>(widget) || widget->inherits(TQSPLITTERHANDLE_OBJECT_NAME_STRING) )
{
// widget->setBackgroundMode(PaletteBackground);
widget->installEventFilter(this);
@@ -285,7 +285,7 @@ void PlastikStyle::unPolish(TQWidget* widget)
::tqqt_cast<TQSpinWidget*>(widget) || ::tqqt_cast<TQSlider*>(widget) ||
::tqqt_cast<TQCheckBox*>(widget) || ::tqqt_cast<TQRadioButton*>(widget) ||
::tqqt_cast<TQToolButton*>(widget) || ::tqqt_cast<TQLineEdit*>(widget) ||
widget->inherits("QSplitterHandle") )
widget->inherits(TQSPLITTERHANDLE_OBJECT_NAME_STRING) )
{
widget->removeEventFilter(this);
}
@@ -3478,7 +3478,7 @@ bool PlastikStyle::eventFilter(TQObject *obj, TQEvent *ev)
//Hover highlight... use tqqt_cast to check if the widget inheits one of the classes.
if ( ::tqqt_cast<TQPushButton*>(obj) || ::tqqt_cast<TQComboBox*>(obj) ||
::tqqt_cast<TQSpinWidget*>(obj) || ::tqqt_cast<TQCheckBox*>(obj) ||
::tqqt_cast<TQRadioButton*>(obj) || ::tqqt_cast<TQToolButton*>(obj) || obj->inherits("QSplitterHandle") )
::tqqt_cast<TQRadioButton*>(obj) || ::tqqt_cast<TQToolButton*>(obj) || obj->inherits(TQSPLITTERHANDLE_OBJECT_NAME_STRING) )
{
if ((ev->type() == TQEvent::Enter) && TQT_TQWIDGET(obj)->isEnabled())
{


+ 4
- 4
kstyles/web/webstyle.cpp View File

@@ -250,10 +250,10 @@ WebStyle::unPolish(TQApplication *)
void
WebStyle::polish(TQWidget * w)
{
if (w->inherits("QPushButton"))
if (w->inherits(TQPUSHBUTTON_OBJECT_NAME_STRING))
w->installEventFilter(this);

else if (w->inherits("QGroupBox") || w->inherits("QFrame"))
else if (w->inherits(TQGROUPBOX_OBJECT_NAME_STRING) || w->inherits(TQFRAME_OBJECT_NAME_STRING))
{
TQFrame * f(static_cast<TQFrame *>(w));

@@ -282,7 +282,7 @@ WebStyle::polish(TQWidget * w)
void
WebStyle::unPolish(TQWidget * w)
{
if (w->inherits("QPushButton"))
if (w->inherits(TQPUSHBUTTON_OBJECT_NAME_STRING))
w->removeEventFilter(this);

else if (w == _currentFrame)
@@ -1046,7 +1046,7 @@ WebStyle::drawKToolBarButton
{
bool toggleAndOn = false;

if (button->inherits("QButton"))
if (button->inherits(TQBUTTON_OBJECT_NAME_STRING))
{
TQButton * b = static_cast<TQButton *>(button);
toggleAndOn = b->isToggleButton() && b->isOn();


Loading…
Cancel
Save