diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kofficeui/KoKoolBar.cpp | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kofficeui/KoKoolBar.cpp')
-rw-r--r-- | lib/kofficeui/KoKoolBar.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/lib/kofficeui/KoKoolBar.cpp b/lib/kofficeui/KoKoolBar.cpp index 9715ce5e..5f42caae 100644 --- a/lib/kofficeui/KoKoolBar.cpp +++ b/lib/kofficeui/KoKoolBar.cpp @@ -20,19 +20,19 @@ #include <KoKoolBar.h> #include <kiconloader.h> -#include <qpainter.h> -#include <qpushbutton.h> +#include <tqpainter.h> +#include <tqpushbutton.h> static int g_koKoolBarId = 0; -KoKoolBar::KoKoolBar( QWidget *_parent, const char *_name ) : - QWidget( _parent, _name ), m_iActiveGroup( -1 ) +KoKoolBar::KoKoolBar( TQWidget *_parent, const char *_name ) : + TQWidget( _parent, _name ), m_iActiveGroup( -1 ) { m_mapGroups.setAutoDelete( true ); m_pBox = new KoKoolBarBox( this ); } -int KoKoolBar::insertGroup( const QString& _text ) +int KoKoolBar::insertGroup( const TQString& _text ) { KoKoolBarGroup *p = new KoKoolBarGroup( this, _text ); m_mapGroups.insert( p->id(), p ); @@ -44,8 +44,8 @@ int KoKoolBar::insertGroup( const QString& _text ) return p->id(); } -int KoKoolBar::insertItem( int _grp, const QPixmap& _pix, const QString& _text, - QObject *_obj, const char *_slot ) +int KoKoolBar::insertItem( int _grp, const TQPixmap& _pix, const TQString& _text, + TQObject *_obj, const char *_slot ) { KoKoolBarGroup* g = m_mapGroups[ _grp ]; if ( !g ) @@ -53,7 +53,7 @@ int KoKoolBar::insertItem( int _grp, const QPixmap& _pix, const QString& _text, KoKoolBarItem *item = new KoKoolBarItem( g, _pix, _text ); if ( _obj != 0L && _slot != 0L ) - connect( item, SIGNAL( pressed( int, int ) ), _obj, _slot ); + connect( item, TQT_SIGNAL( pressed( int, int ) ), _obj, _slot ); g->append( item ); if ( g->id() == m_iActiveGroup ) @@ -79,7 +79,7 @@ void KoKoolBar::removeGroup( int _grp ) } else { - QIntDictIterator<KoKoolBarGroup> it( m_mapGroups ); + TQIntDictIterator<KoKoolBarGroup> it( m_mapGroups ); g = it.current(); m_iActiveGroup = g->id(); m_pBox->setActiveGroup( g ); @@ -101,7 +101,7 @@ void KoKoolBar::removeItem( int _grp, int _id ) m_pBox->update(); } -void KoKoolBar::renameItem( int _grp, int _id, const QString & _text ) +void KoKoolBar::renameItem( int _grp, int _id, const TQString & _text ) { KoKoolBarGroup* g = m_mapGroups[ _grp ]; if ( !g ) @@ -129,7 +129,7 @@ void KoKoolBar::setActiveGroup( int _grp ) resizeEvent( 0L ); } -void KoKoolBar::resizeEvent( QResizeEvent * ev ) +void KoKoolBar::resizeEvent( TQResizeEvent * ev ) { if ( m_iActiveGroup == -1 ) return; @@ -141,16 +141,16 @@ void KoKoolBar::resizeEvent( QResizeEvent * ev ) return; // Go behind g - QIntDictIterator<KoKoolBarGroup> it( m_mapGroups ); + TQIntDictIterator<KoKoolBarGroup> it( m_mapGroups ); while( it.current() != g ) ++it; // Position of g - QIntDictIterator<KoKoolBarGroup> pos = it; + TQIntDictIterator<KoKoolBarGroup> pos = it; ++it; // How many left ? int result = 0; - QIntDictIterator<KoKoolBarGroup> i = it; + TQIntDictIterator<KoKoolBarGroup> i = it; while( i.current() ) { ++result; @@ -208,7 +208,7 @@ void KoKoolBar::enableGroup( int _grp, bool _enable ) } KoKoolBarBox::KoKoolBarBox( KoKoolBar *_bar ) : - QFrame( _bar ), m_pBar( _bar ), + TQFrame( _bar ), m_pBar( _bar ), m_pButtonUp( 0L ), m_pButtonDown( 0L ) { m_iYOffset = 0; @@ -218,7 +218,7 @@ KoKoolBarBox::KoKoolBarBox( KoKoolBar *_bar ) : setFrameShape( StyledPanel ); setFrameShadow( Sunken ); // setBackgroundMode( PaletteBase ); - setBackgroundColor( colorGroup().background() ); + setBackgroundColor( tqcolorGroup().background() ); } void KoKoolBarBox::setActiveGroup( KoKoolBarGroup *_grp ) @@ -237,21 +237,21 @@ bool KoKoolBarBox::needsScrolling() const return ( maxHeight() > height() ); } -void KoKoolBarBox::resizeEvent( QResizeEvent * ) +void KoKoolBarBox::resizeEvent( TQResizeEvent * ) { if ( needsScrolling() ) { if ( m_pButtonUp == 0L ) { - m_pButtonUp = new QPushButton( this ); - m_pButtonUp->setPixmap( QPixmap( UserIcon( "koKoolBarUp" ) ) ); - connect( m_pButtonUp, SIGNAL( clicked() ), this, SLOT( scrollUp() ) ); + m_pButtonUp = new TQPushButton( this ); + m_pButtonUp->setPixmap( TQPixmap( UserIcon( "koKoolBarUp" ) ) ); + connect( m_pButtonUp, TQT_SIGNAL( clicked() ), this, TQT_SLOT( scrollUp() ) ); } if ( m_pButtonDown == 0L ) { - m_pButtonDown = new QPushButton( this ); - m_pButtonDown->setPixmap( QPixmap( UserIcon( "koKoolBarDown" ) ) ); - connect( m_pButtonDown, SIGNAL( clicked() ), this, SLOT( scrollDown() ) ); + m_pButtonDown = new TQPushButton( this ); + m_pButtonDown->setPixmap( TQPixmap( UserIcon( "koKoolBarDown" ) ) ); + connect( m_pButtonDown, TQT_SIGNAL( clicked() ), this, TQT_SLOT( scrollDown() ) ); } m_pButtonUp->show(); m_pButtonUp->raise(); @@ -275,7 +275,7 @@ KoKoolBarItem* KoKoolBarBox::findByPos( int _abs_y ) const int y = 0; - QIntDictIterator<KoKoolBarItem> it = m_pGroup->iterator(); + TQIntDictIterator<KoKoolBarItem> it = m_pGroup->iterator(); for ( ; it.current(); ++it ) { int dy = it.current()->height(); @@ -291,7 +291,7 @@ int KoKoolBarBox::maxHeight() const { int y = 0; - QIntDictIterator<KoKoolBarItem> it = m_pGroup->iterator(); + TQIntDictIterator<KoKoolBarItem> it = m_pGroup->iterator(); for ( ; it.current(); ++it ) y += it.current()->height(); @@ -324,7 +324,7 @@ void KoKoolBarBox::scrollUp() int i = 0; m_iYIcon--; - QIntDictIterator<KoKoolBarItem> it = m_pGroup->iterator(); + TQIntDictIterator<KoKoolBarItem> it = m_pGroup->iterator(); for ( ; i < m_iYIcon && it.current(); ++it ) { y += it.current()->height(); @@ -334,7 +334,7 @@ void KoKoolBarBox::scrollUp() int old = m_iYOffset; m_iYOffset = y; - QWidget::scroll( 0, old - m_iYOffset, contentsRect() ); + TQWidget::scroll( 0, old - m_iYOffset, contentsRect() ); updateScrollButtons(); } @@ -347,7 +347,7 @@ void KoKoolBarBox::scrollDown() int i = 0; m_iYIcon++; - QIntDictIterator<KoKoolBarItem> it = m_pGroup->iterator(); + TQIntDictIterator<KoKoolBarItem> it = m_pGroup->iterator(); for ( ; i < m_iYIcon && it.current(); ++it ) { y += it.current()->height(); @@ -360,7 +360,7 @@ void KoKoolBarBox::scrollDown() int old = m_iYOffset; m_iYOffset = y; - QWidget::scroll( 0, old - m_iYOffset, contentsRect() ); + TQWidget::scroll( 0, old - m_iYOffset, contentsRect() ); updateScrollButtons(); } @@ -381,14 +381,14 @@ void KoKoolBarBox::updateScrollButtons() m_pButtonDown->setGeometry( width() - bs, height() - bs, bs, bs ); } -void KoKoolBarBox::drawContents( QPainter * painter ) +void KoKoolBarBox::drawContents( TQPainter * painter ) { if ( m_pGroup == 0L ) return; int y = -m_iYOffset; - QIntDictIterator<KoKoolBarItem> it = m_pGroup->iterator(); + TQIntDictIterator<KoKoolBarItem> it = m_pGroup->iterator(); for ( ; it.current(); ++it ) { if ( y + it.current()->height() >= 0 && y <= height() ) // visible ? @@ -406,16 +406,16 @@ void KoKoolBarBox::drawContents( QPainter * painter ) } } -KoKoolBarGroup::KoKoolBarGroup( KoKoolBar *_bar, const QString& _text ) : +KoKoolBarGroup::KoKoolBarGroup( KoKoolBar *_bar, const TQString& _text ) : m_pBar( _bar ) { m_mapItems.setAutoDelete( true ); - m_pButton = new QPushButton( _text, _bar ); + m_pButton = new TQPushButton( _text, _bar ); m_bEnabled = true; - connect( m_pButton, SIGNAL( clicked() ), this, SLOT( pressed() ) ); + connect( m_pButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( pressed() ) ); m_id = g_koKoolBarId++; } @@ -434,7 +434,7 @@ void KoKoolBarGroup::pressed() m_pBar->setActiveGroup( m_id ); } -KoKoolBarItem::KoKoolBarItem( KoKoolBarGroup *_grp, const QPixmap& _pix, const QString&_text ) +KoKoolBarItem::KoKoolBarItem( KoKoolBarGroup *_grp, const TQPixmap& _pix, const TQString&_text ) : m_pGroup( _grp ) { m_pixmap = _pix; @@ -444,7 +444,7 @@ KoKoolBarItem::KoKoolBarItem( KoKoolBarGroup *_grp, const QPixmap& _pix, const Q calc( _grp->bar() ); } -void KoKoolBarItem::calc( QWidget *_widget ) +void KoKoolBarItem::calc( TQWidget *_widget ) { m_iHeight = pixmap().height() + 8; @@ -465,7 +465,7 @@ int main( int argc, char **argv ) KApplication app( argc, argv ); KoKoolBar bar; int file = bar.insertGroup("File"); - QPixmap pix; + TQPixmap pix; pix.load( "/opt/kde/share/icons/image.xpm" ); bar.insertItem( file, pix ); pix.load( "/opt/kde/share/icons/html.xpm" ); |