summaryrefslogtreecommitdiffstats
path: root/ksirc/mditoplevel.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
commit47c8a359c5276062c4bc17f0e82410f29081b502 (patch)
tree2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /ksirc/mditoplevel.cpp
parent6f82532777a35e0e60bbd2b290b2e93e646f349b (diff)
downloadtdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz
tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksirc/mditoplevel.cpp')
-rw-r--r--ksirc/mditoplevel.cpp84
1 files changed, 42 insertions, 42 deletions
diff --git a/ksirc/mditoplevel.cpp b/ksirc/mditoplevel.cpp
index 3f35d464..73c464c3 100644
--- a/ksirc/mditoplevel.cpp
+++ b/ksirc/mditoplevel.cpp
@@ -1,7 +1,7 @@
-#include <qguardedptr.h>
+#include <tqguardedptr.h>
-#include <qtabbar.h>
+#include <tqtabbar.h>
#include <kapplication.h>
#include <kiconloader.h>
@@ -17,11 +17,11 @@
#define ID_CLOSE 5
-void KSTabWidget::mousePressEvent(QMouseEvent *e)
+void KSTabWidget::mousePressEvent(TQMouseEvent *e)
{
if(e->button() == RightButton){
- QPoint p = tabBar()->mapFromParent(e->pos());
- QTab *tab = tabBar()->selectTab(p);
+ TQPoint p = tabBar()->mapFromParent(e->pos());
+ TQTab *tab = tabBar()->selectTab(p);
if(tab){
int id = tab->identifier();
emit showContexMenu(page(id), tabBar()->mapToGlobal(p));
@@ -29,32 +29,32 @@ void KSTabWidget::mousePressEvent(QMouseEvent *e)
}
}
-MDITopLevel::MDITopLevel(QWidget *parent, const char *name)
+MDITopLevel::MDITopLevel(TQWidget *parent, const char *name)
: KMainWindow(parent, name)
{
m_closing = false;
m_tab = new KSTabWidget( this );
- m_tab->setTabPosition( QTabWidget::Bottom );
+ m_tab->setTabPosition( TQTabWidget::Bottom );
setCentralWidget( m_tab );
- connect( m_tab, SIGNAL( currentChanged( QWidget * ) ),
- this, SLOT( slotCurrentChanged( QWidget * ) ) );
+ connect( m_tab, TQT_SIGNAL( currentChanged( TQWidget * ) ),
+ this, TQT_SLOT( slotCurrentChanged( TQWidget * ) ) );
- connect( m_tab, SIGNAL( showContexMenu(QWidget *, const QPoint &) ),
- this, SLOT( slotShowContexMenu(QWidget *, const QPoint &) ) );
+ connect( m_tab, TQT_SIGNAL( showContexMenu(TQWidget *, const TQPoint &) ),
+ this, TQT_SLOT( slotShowContexMenu(TQWidget *, const TQPoint &) ) );
KConfig *config = kapp->config();
config->setGroup("MDI");
- QSize s( 600, 360 );
+ TQSize s( 600, 360 );
resize(config->readSizeEntry( "TopLevelSize", &s ));
m_dirtyIcon = UserIcon( "star" );
m_addressedIcon = UserIcon( "info" );
m_pop = new KPopupMenu(m_tab, "");
- m_pop->insertItem( SmallIcon("fileclose"), i18n("Close"), this, SLOT( slotCloseLastWid() ));
+ m_pop->insertItem( SmallIcon("fileclose"), i18n("Close"), this, TQT_SLOT( slotCloseLastWid() ));
}
@@ -67,21 +67,21 @@ MDITopLevel::~MDITopLevel()
config->writeEntry( "TopLevelSize", this->size() );
config->sync();
- QPtrListIterator<QWidget> it( m_tabWidgets );
+ TQPtrListIterator<TQWidget> it( m_tabWidgets );
for (; it.current(); ++it )
it.current()->disconnect( this, 0 );
kdDebug(5008) << "~MDITopLevel out" << endl;
}
-void MDITopLevel::addWidget( QWidget *widget, bool show )
+void MDITopLevel::addWidget( TQWidget *widget, bool show )
{
if ( m_tabWidgets.containsRef( widget ) )
return;
kdDebug(5008) << "In add widget" << endl;
- widget->reparent( m_tab, 0, QPoint( 0, 0 ), show );
+ widget->reparent( m_tab, 0, TQPoint( 0, 0 ), show );
if(show == TRUE){
showWidget(widget);
@@ -89,19 +89,19 @@ void MDITopLevel::addWidget( QWidget *widget, bool show )
m_tabWidgets.append( widget );
- connect( widget, SIGNAL( destroyed() ) ,
- this, SLOT( slotWidgetDestroyed() ) );
+ connect( widget, TQT_SIGNAL( destroyed() ) ,
+ this, TQT_SLOT( slotWidgetDestroyed() ) );
- connect( widget, SIGNAL( changeChannel( const QString &, const QString & ) ),
- this, SLOT( slotChangeChannelName( const QString &, const QString & ) ) );
+ connect( widget, TQT_SIGNAL( changeChannel( const TQString &, const TQString & ) ),
+ this, TQT_SLOT( slotChangeChannelName( const TQString &, const TQString & ) ) );
widget->installEventFilter( this );
- connect( widget, SIGNAL( changed( bool, QString ) ),
- this, SLOT( slotMarkPageDirty( bool ) ) );
+ connect( widget, TQT_SIGNAL( changed( bool, TQString ) ),
+ this, TQT_SLOT( slotMarkPageDirty( bool ) ) );
}
-void MDITopLevel::removeWidget( QWidget *widget )
+void MDITopLevel::removeWidget( TQWidget *widget )
{
if (m_closing)
return;
@@ -112,17 +112,17 @@ void MDITopLevel::removeWidget( QWidget *widget )
widget->disconnect( this, 0 );
}
-void MDITopLevel::hideWidget( QWidget *widget )
+void MDITopLevel::hideWidget( TQWidget *widget )
{
m_tab->removePage( widget );
widget->hide();
}
-void MDITopLevel::showWidget( QWidget *widget )
+void MDITopLevel::showWidget( TQWidget *widget )
{
if(m_tab->indexOf(widget) == -1){
int space = widget->caption().find(" ");
- QString cap = space < 1 ? widget->caption():widget->caption().left(space);
+ TQString cap = space < 1 ? widget->caption():widget->caption().left(space);
m_tab->addTab( widget, cap);
m_tab->showPage( widget );
m_tab->setCurrentPage( m_tab->indexOf(widget) );
@@ -145,7 +145,7 @@ void MDITopLevel::previous()
m_tab->setCurrentPage(m_tab->count() - 1);
}
-void MDITopLevel::closeEvent( QCloseEvent *ev )
+void MDITopLevel::closeEvent( TQCloseEvent *ev )
{
m_closing = true;
// Don't use iterators on a list while deleting elements
@@ -154,11 +154,11 @@ void MDITopLevel::closeEvent( QCloseEvent *ev )
kdDebug(5008) << "Mdi got close event " << endl;
while ( m_tabWidgets.count() && (i++ < 100000)) {
kdDebug(5008) << "MDITopLevel trying to close: " << m_tabWidgets.first()->name() << endl;
- QGuardedPtr<QWidget> w = m_tabWidgets.take(0);
+ TQGuardedPtr<TQWidget> w = m_tabWidgets.take(0);
w->show();
w->close( false );
if(w)
- delete (QWidget *)w;
+ delete (TQWidget *)w;
}
KMainWindow::closeEvent( ev );
@@ -167,18 +167,18 @@ void MDITopLevel::closeEvent( QCloseEvent *ev )
void MDITopLevel::slotWidgetDestroyed()
{
- const QWidget *widget = static_cast<const QWidget *>( sender() );
+ const TQWidget *widget = static_cast<const TQWidget *>( sender() );
m_tabWidgets.removeRef( widget );
removeFromAddressedList( widget );
}
-bool MDITopLevel::eventFilter( QObject *obj, QEvent *ev )
+bool MDITopLevel::eventFilter( TQObject *obj, TQEvent *ev )
{
- if ( ev->type() != QEvent::CaptionChange )
+ if ( ev->type() != TQEvent::CaptionChange )
return false;
- QWidget *widget = dynamic_cast<QWidget *>( obj );
+ TQWidget *widget = dynamic_cast<TQWidget *>( obj );
if ( !widget || !m_tabWidgets.containsRef( widget ) )
return false;
@@ -189,13 +189,13 @@ bool MDITopLevel::eventFilter( QObject *obj, QEvent *ev )
return false;
}
-void MDITopLevel::slotCurrentChanged( QWidget *page )
+void MDITopLevel::slotCurrentChanged( TQWidget *page )
{
- m_tab->setTabIconSet( page, QIconSet() );
+ m_tab->setTabIconSet( page, TQIconSet() );
removeFromAddressedList( page );
- setPlainCaption( page->QWidget::caption() );
+ setPlainCaption( page->TQWidget::caption() );
KSircTopLevel *kst = dynamic_cast<KSircTopLevel *>( page );
if ( !kst )
@@ -207,7 +207,7 @@ void MDITopLevel::slotMarkPageDirty( bool addressed )
{
// This is called when a line appeared in this channel.
// addressed is true if it was addressed to the user
- KMainWindow *window = dynamic_cast<KMainWindow *>( const_cast<QObject *>( sender() ) );
+ KMainWindow *window = dynamic_cast<KMainWindow *>( const_cast<TQObject *>( sender() ) );
if ( !window )
return;
@@ -223,27 +223,27 @@ void MDITopLevel::slotMarkPageDirty( bool addressed )
}
}
-void MDITopLevel::slotChangeChannelName( const QString &, const QString &channelName )
+void MDITopLevel::slotChangeChannelName( const TQString &, const TQString &channelName )
{
- KMainWindow *window = dynamic_cast<KMainWindow *>( const_cast<QObject *>( sender() ) );
+ KMainWindow *window = dynamic_cast<KMainWindow *>( const_cast<TQObject *>( sender() ) );
if ( !window )
return;
- QString esc = channelName;
+ TQString esc = channelName;
esc.replace("&", "&&");
m_tab->setTabLabel( window, esc );
removeFromAddressedList( window );
}
-void MDITopLevel::removeFromAddressedList( const QWidget* w )
+void MDITopLevel::removeFromAddressedList( const TQWidget* w )
{
// If this tab was showing a "you're being talked to" icon, remove it
// and tell the servercontroller (so that it can update the docked icon).
m_addressed.removeRef( w );
}
-void MDITopLevel::slotShowContexMenu(QWidget *w, const QPoint &p)
+void MDITopLevel::slotShowContexMenu(TQWidget *w, const TQPoint &p)
{
m_last_pop_wid = w;
m_pop->popup(p);