diff options
Diffstat (limited to 'tdeui/tdetoolbar.cpp')
| -rw-r--r-- | tdeui/tdetoolbar.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/tdeui/tdetoolbar.cpp b/tdeui/tdetoolbar.cpp index 7c6902fed..6f93db4fc 100644 --- a/tdeui/tdetoolbar.cpp +++ b/tdeui/tdetoolbar.cpp @@ -149,8 +149,8 @@ TDEToolBarSeparator::TDEToolBarSeparator(Orientation o , bool l, TQToolBar *pare const char* name ) :TQFrame( parent, name ), line( l ) { - connect( parent, TQT_SIGNAL(orientationChanged(Orientation)), - this, TQT_SLOT(setOrientation(Orientation)) ); + connect( parent, TQ_SIGNAL(orientationChanged(Orientation)), + this, TQ_SLOT(setOrientation(Orientation)) ); setOrientation( o ); setBackgroundMode( parent->backgroundMode() ); setBackgroundOrigin( ParentOrigin ); @@ -167,10 +167,10 @@ void TDEToolBarSeparator::drawContents( TQPainter* p ) if ( line ) { TQStyle::SFlags flags = TQStyle::Style_Default; - if ( orientation() == Qt::Horizontal ) + if ( orientation() == TQt::Horizontal ) flags = flags | TQStyle::Style_Horizontal; - style().tqdrawPrimitive(TQStyle::PE_DockWindowSeparator, p, + style().drawPrimitive(TQStyle::PE_DockWindowSeparator, p, contentsRect(), colorGroup(), flags); } else { TQFrame::drawContents(p); @@ -185,7 +185,7 @@ void TDEToolBarSeparator::styleChange( TQStyle& ) TQSize TDEToolBarSeparator::sizeHint() const { int dim = style().pixelMetric( TQStyle::PM_DockWindowSeparatorExtent, this ); - return orientation() == Qt::Vertical ? TQSize( 0, dim ) : TQSize( dim, 0 ); + return orientation() == TQt::Vertical ? TQSize( 0, dim ) : TQSize( dim, 0 ); } TQSizePolicy TDEToolBarSeparator::sizePolicy() const @@ -195,7 +195,7 @@ TQSizePolicy TDEToolBarSeparator::sizePolicy() const TDEToolBar::TDEToolBar( TQWidget *parent, const char *name, bool honorStyle, bool readConfig ) : TQToolBar( TQString::fromLatin1( name ), - tqt_dynamic_cast<TQMainWindow*>(parent), + dynamic_cast<TQMainWindow*>(parent), parent, false, name ? name : "mainToolBar") { @@ -232,16 +232,16 @@ void TDEToolBar::init( bool readConfig, bool honorStyle ) d->m_honorStyle = honorStyle; context = 0; layoutTimer = new TQTimer( this ); - connect( layoutTimer, TQT_SIGNAL( timeout() ), - this, TQT_SLOT( rebuildLayout() ) ); - connect( &(d->repaintTimer), TQT_SIGNAL( timeout() ), - this, TQT_SLOT( slotRepaint() ) ); + connect( layoutTimer, TQ_SIGNAL( timeout() ), + this, TQ_SLOT( rebuildLayout() ) ); + connect( &(d->repaintTimer), TQ_SIGNAL( timeout() ), + this, TQ_SLOT( slotRepaint() ) ); - if ( kapp ) { // may be null when started inside designer - connect(kapp, TQT_SIGNAL(toolbarAppearanceChanged(int)), this, TQT_SLOT(slotAppearanceChanged())); + if ( tdeApp ) { // may be null when started inside designer + connect(tdeApp, TQ_SIGNAL(toolbarAppearanceChanged(int)), this, TQ_SLOT(slotAppearanceChanged())); // request notification of changes in icon style - kapp->addKipcEventMask(KIPC::IconChanged); - connect(kapp, TQT_SIGNAL(iconChanged(int)), this, TQT_SLOT(slotIconChanged(int))); + tdeApp->addKipcEventMask(KIPC::IconChanged); + connect(tdeApp, TQ_SIGNAL(iconChanged(int)), this, TQ_SLOT(slotIconChanged(int))); } // finally, read in our configurable settings @@ -249,11 +249,11 @@ void TDEToolBar::init( bool readConfig, bool honorStyle ) slotReadConfig(); if ( mainWindow() ) - connect( mainWindow(), TQT_SIGNAL( toolBarPositionChanged( TQToolBar * ) ), - this, TQT_SLOT( toolBarPosChanged( TQToolBar * ) ) ); + connect( mainWindow(), TQ_SIGNAL( toolBarPositionChanged( TQToolBar * ) ), + this, TQ_SLOT( toolBarPosChanged( TQToolBar * ) ) ); // Hack to make sure we recalculate our size when we dock. - connect( this, TQT_SIGNAL(placeChanged(TQDockWindow::Place)), TQT_SLOT(rebuildLayout()) ); + connect( this, TQ_SIGNAL(placeChanged(TQDockWindow::Place)), TQ_SLOT(rebuildLayout()) ); } int TDEToolBar::insertButton(const TQString& icon, int id, bool enabled, @@ -422,7 +422,7 @@ int TDEToolBar::insertAnimatedWidget(int id, TQObject *receiver, const char *slo insertWidgetInternal( anim, index, id ); if ( receiver ) - connect( anim, TQT_SIGNAL(clicked()), receiver, slot); + connect( anim, TQ_SIGNAL(clicked()), receiver, slot); return index; } @@ -432,7 +432,7 @@ KAnimWidget *TDEToolBar::animatedWidget( int id ) Id2WidgetMap::Iterator it = id2widget.find( id ); if ( it == id2widget.end() ) return 0; - KAnimWidget *aw = tqt_dynamic_cast<KAnimWidget *>(*it); + KAnimWidget *aw = dynamic_cast<KAnimWidget *>(*it); if ( aw ) return aw; TQObjectList *l = queryList( "KAnimWidget" ); @@ -442,7 +442,7 @@ KAnimWidget *TDEToolBar::animatedWidget( int id ) } for ( TQObject *o = l->first(); o; o = l->next() ) { - KAnimWidget *aw = tqt_dynamic_cast<KAnimWidget *>(o); + KAnimWidget *aw = dynamic_cast<KAnimWidget *>(o); if ( aw ) { delete l; @@ -615,7 +615,7 @@ KComboBox * TDEToolBar::getCombo(int id) Id2WidgetMap::Iterator it = id2widget.find( id ); if ( it == id2widget.end() ) return 0; - return tqt_dynamic_cast<KComboBox *>( *it ); + return dynamic_cast<KComboBox *>( *it ); } @@ -624,7 +624,7 @@ KLineEdit * TDEToolBar::getLined (int id) Id2WidgetMap::Iterator it = id2widget.find( id ); if ( it == id2widget.end() ) return 0; - return tqt_dynamic_cast<KLineEdit *>( *it ); + return dynamic_cast<KLineEdit *>( *it ); } @@ -633,7 +633,7 @@ TDEToolBarButton * TDEToolBar::getButton (int id) Id2WidgetMap::Iterator it = id2widget.find( id ); if ( it == id2widget.end() ) return 0; - return tqt_dynamic_cast<TDEToolBarButton *>( *it ); + return dynamic_cast<TDEToolBarButton *>( *it ); } @@ -947,7 +947,7 @@ void TDEToolBar::setFlat (bool flag) else mainWindow()->moveDockWindow( this, DockTop ); // And remember to save the new look later - TDEMainWindow *kmw = tqt_dynamic_cast<TDEMainWindow *>(mainWindow()); + TDEMainWindow *kmw = dynamic_cast<TDEMainWindow *>(mainWindow()); if ( kmw ) kmw->setSettingsDirty(); } @@ -1093,7 +1093,7 @@ void TDEToolBar::saveSettings(TDEConfig *config, const TQString &_configGroup) // reappear at the same position the next time. // The whole set of indexes has to be saved. //kdDebug(220) << name() << " writing index " << index << endl; - TDEMainWindow *kmw = tqt_dynamic_cast<TDEMainWindow *>(mainWindow()); + TDEMainWindow *kmw = dynamic_cast<TDEMainWindow *>(mainWindow()); // don't save if there's only one toolbar // Don't use kmw->toolBarIterator() because you might @@ -1133,7 +1133,7 @@ void TDEToolBar::setXMLGUIClient( KXMLGUIClient *client ) void TDEToolBar::setText( const TQString & txt ) { - setLabel( txt + " (" + kapp->caption() + ") " ); + setLabel( txt + " (" + tdeApp->caption() + ") " ); } @@ -1145,12 +1145,12 @@ TQString TDEToolBar::text() const void TDEToolBar::doConnections( TDEToolBarButton *button ) { - connect(button, TQT_SIGNAL(clicked(int)), this, TQT_SIGNAL( clicked( int ) ) ); - connect(button, TQT_SIGNAL(doubleClicked(int)), this, TQT_SIGNAL( doubleClicked( int ) ) ); - connect(button, TQT_SIGNAL(released(int)), this, TQT_SIGNAL( released( int ) ) ); - connect(button, TQT_SIGNAL(pressed(int)), this, TQT_SIGNAL( pressed( int ) ) ); - connect(button, TQT_SIGNAL(toggled(int)), this, TQT_SIGNAL( toggled( int ) ) ); - connect(button, TQT_SIGNAL(highlighted(int, bool)), this, TQT_SIGNAL( highlighted( int, bool ) ) ); + connect(button, TQ_SIGNAL(clicked(int)), this, TQ_SIGNAL( clicked( int ) ) ); + connect(button, TQ_SIGNAL(doubleClicked(int)), this, TQ_SIGNAL( doubleClicked( int ) ) ); + connect(button, TQ_SIGNAL(released(int)), this, TQ_SIGNAL( released( int ) ) ); + connect(button, TQ_SIGNAL(pressed(int)), this, TQ_SIGNAL( pressed( int ) ) ); + connect(button, TQ_SIGNAL(toggled(int)), this, TQ_SIGNAL( toggled( int ) ) ); + connect(button, TQ_SIGNAL(highlighted(int, bool)), this, TQ_SIGNAL( highlighted( int, bool ) ) ); } void TDEToolBar::mousePressEvent ( TQMouseEvent *m ) @@ -1159,7 +1159,7 @@ void TDEToolBar::mousePressEvent ( TQMouseEvent *m ) return; TQMainWindow *mw = mainWindow(); if ( mw->toolBarsMovable() && d->m_enableContext ) { - if ( m->button() == Qt::RightButton ) { + if ( m->button() == TQt::RightButton ) { TQGuardedPtr<TDEToolBar> guard( this ); int i = contextMenu()->exec( m->globalPos(), 0 ); // "Configure Toolbars" recreates toolbars, so we might not exist anymore. @@ -1204,7 +1204,7 @@ void TDEToolBar::mousePressEvent ( TQMouseEvent *m ) else return; // assume this was an action handled elsewhere, no need for setSettingsDirty() } - TDEMainWindow *kmw = tqt_dynamic_cast<TDEMainWindow *>(mw); + TDEMainWindow *kmw = dynamic_cast<TDEMainWindow *>(mw); if ( kmw ) kmw->setSettingsDirty(); } @@ -1238,17 +1238,17 @@ void TDEToolBar::rebuildLayout() for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { if ( w == rightAligned ) continue; - TDEToolBarSeparator *ktbs = tqt_dynamic_cast<TDEToolBarSeparator *>(w); + TDEToolBarSeparator *ktbs = dynamic_cast<TDEToolBarSeparator *>(w); if ( ktbs && !ktbs->showLine() ) { - l->addSpacing( orientation() == Qt::Vertical ? w->sizeHint().height() : w->sizeHint().width() ); + l->addSpacing( orientation() == TQt::Vertical ? w->sizeHint().height() : w->sizeHint().width() ); w->hide(); continue; } - if ( tqt_dynamic_cast<TQPopupMenu *>(w) ) // w is a QPopupMenu? + if ( dynamic_cast<TQPopupMenu *>(w) ) // w is a QPopupMenu? continue; l->addWidget( w ); w->show(); - if ((orientation() == Qt::Horizontal) && tqt_dynamic_cast<TQLineEdit *>(w)) // w is TQLineEdit ? + if ((orientation() == TQt::Horizontal) && dynamic_cast<TQLineEdit *>(w)) // w is TQLineEdit ? l->addSpacing(2); // A little bit extra spacing behind it. } if ( rightAligned ) { @@ -1270,14 +1270,14 @@ void TDEToolBar::rebuildLayout() void TDEToolBar::childEvent( TQChildEvent *e ) { if ( e->child()->isWidgetType() ) { - TQWidget * w = tqt_dynamic_cast<TQWidget *>(e->child()); + TQWidget * w = dynamic_cast<TQWidget *>(e->child()); if (!w || !(::qstrcmp( "qt_dockwidget_internal", w->name()))) { TQToolBar::childEvent( e ); return; } if ( e->type() == TQEvent::ChildInserted ) { - if ( !tqt_dynamic_cast<TQPopupMenu *>(w)) { // e->child() is not a QPopupMenu + if ( !dynamic_cast<TQPopupMenu *>(w)) { // e->child() is not a QPopupMenu // prevent items that have been explicitly inserted by insert*() from // being inserted again if ( !widget2id.contains( w ) ) @@ -1309,8 +1309,8 @@ void TDEToolBar::insertWidgetInternal( TQWidget *w, int &index, int id ) // we can't have it in widgets, or something is really wrong //widgets.removeRef( w ); - connect( w, TQT_SIGNAL( destroyed() ), - this, TQT_SLOT( widgetDestroyed() ) ); + connect( w, TQ_SIGNAL( destroyed() ), + this, TQ_SLOT( widgetDestroyed() ) ); if ( index == -1 || index > (int)widgets.count() ) { index = (int)widgets.count(); widgets.append( w ); @@ -1337,7 +1337,7 @@ void TDEToolBar::setStretchableWidget( TQWidget *w ) TQSizePolicy TDEToolBar::sizePolicy() const { - if ( orientation() == Qt::Horizontal ) + if ( orientation() == TQt::Horizontal ) return TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ); else return TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Expanding ); @@ -1350,7 +1350,7 @@ TQSize TDEToolBar::sizeHint() const ncThis->polish(); - int margin = static_cast<TQWidget*>(ncThis)->layout()->margin() + frameWidth(); + int margin = ncThis->layout()->margin() + frameWidth(); switch( barPos() ) { case TDEToolBar::Top: @@ -1367,7 +1367,7 @@ TQSize TDEToolBar::sizeHint() const minSize = minSize.expandedTo(TQSize(0, sh.height())); minSize += TQSize(sh.width()+1, 0); - if (tqt_dynamic_cast<TQLineEdit *>(w)) // w is a TQLineEdit ? + if (dynamic_cast<TQLineEdit *>(w)) // w is a TQLineEdit ? minSize += TQSize(2, 0); // A little bit extra spacing behind it. } @@ -1478,7 +1478,7 @@ void TDEToolBar::slotAppearanceChanged() applyAppearanceSettings(TDEGlobal::config(), TQString::null, true /* lose local settings */ ); // And remember to save the new look later - TDEMainWindow *kmw = tqt_dynamic_cast<TDEMainWindow *>(mainWindow()); + TDEMainWindow *kmw = dynamic_cast<TDEMainWindow *>(mainWindow()); if ( kmw ) kmw->setSettingsDirty(); } @@ -1750,7 +1750,7 @@ void TDEToolBar::toolBarPosChanged( TQToolBar *tb ) if ( d->oldPos == DockMinimized ) rebuildLayout(); d->oldPos = (TQMainWindow::ToolBarDock)barPos(); - TDEMainWindow *kmw = tqt_dynamic_cast<TDEMainWindow *>(mainWindow()); + TDEMainWindow *kmw = dynamic_cast<TDEMainWindow *>(mainWindow()); if ( kmw ) kmw->setSettingsDirty(); } @@ -2125,10 +2125,10 @@ TDEPopupMenu *TDEToolBar::contextMenu() context->setItemChecked(CONTEXT_ICONS, true); context->insertItem( i18n("Icon Size"), size ); - connect( context, TQT_SIGNAL( aboutToShow() ), this, TQT_SLOT( slotContextAboutToShow() ) ); + connect( context, TQ_SIGNAL( aboutToShow() ), this, TQ_SLOT( slotContextAboutToShow() ) ); // Unplugging a submenu from abouttohide leads to the popupmenu floating around // So better simply call that code from after exec() returns (DF) - //connect( context, TQT_SIGNAL( aboutToHide() ), this, TQT_SLOT( slotContextAboutToHide() ) ); + //connect( context, TQ_SIGNAL( aboutToHide() ), this, TQ_SLOT( slotContextAboutToHide() ) ); return context; } @@ -2139,7 +2139,7 @@ void TDEToolBar::slotContextAboutToShow() // and ToolBarHandler::setupActions() deletes it, so better not keep it around. // So we currently plug/unplug the last two actions of the menu. // Another way would be to keep around the actions and plug them all into a (new each time) popupmenu. - TDEMainWindow *kmw = tqt_dynamic_cast<TDEMainWindow *>(mainWindow()); + TDEMainWindow *kmw = dynamic_cast<TDEMainWindow *>(mainWindow()); if ( kmw ) { kmw->setupToolbarMenuActions(); // Only allow hiding a toolbar if the action is also plugged somewhere else (e.g. menubar) @@ -2219,7 +2219,7 @@ void TDEToolBar::slotContextAboutToHide() { // We have to unplug whatever slotContextAboutToShow plugged into the menu. // Unplug the toolbar menu action - TDEMainWindow *kmw = tqt_dynamic_cast<TDEMainWindow *>(mainWindow()); + TDEMainWindow *kmw = dynamic_cast<TDEMainWindow *>(mainWindow()); if ( kmw && kmw->toolBarMenuAction() ) if ( kmw->toolBarMenuAction()->containerCount() > 1 ) kmw->toolBarMenuAction()->unplug(context); @@ -2237,7 +2237,7 @@ void TDEToolBar::slotContextAboutToHide() TQPtrListIterator<TQWidget> it( widgets ); TQWidget *wdg; while ( ( wdg = it.current() ) != 0 ) { - if ( wdg->inherits( TQTOOLBUTTON_OBJECT_NAME_STRING ) ) + if ( wdg->inherits( "TQToolButton" ) ) static_cast<TQToolButton*>( wdg )->setDown( false ); ++it; } |
