diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /kontact/src/iconsidepane.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kontact/src/iconsidepane.cpp')
-rw-r--r-- | kontact/src/iconsidepane.cpp | 152 |
1 files changed, 76 insertions, 76 deletions
diff --git a/kontact/src/iconsidepane.cpp b/kontact/src/iconsidepane.cpp index c7e9c84a0..d56513aeb 100644 --- a/kontact/src/iconsidepane.cpp +++ b/kontact/src/iconsidepane.cpp @@ -19,22 +19,22 @@ Boston, MA 02110-1301, USA. */ -#include <qptrlist.h> -#include <qwidgetstack.h> -#include <qsignal.h> -#include <qobjectlist.h> -#include <qlabel.h> -#include <qimage.h> -#include <qpainter.h> -#include <qbitmap.h> -#include <qfontmetrics.h> -#include <qsignalmapper.h> -#include <qstyle.h> -#include <qframe.h> -#include <qdrawutil.h> -#include <qcursor.h> -#include <qtimer.h> -#include <qtooltip.h> +#include <tqptrlist.h> +#include <tqwidgetstack.h> +#include <tqsignal.h> +#include <tqobjectlist.h> +#include <tqlabel.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqbitmap.h> +#include <tqfontmetrics.h> +#include <tqsignalmapper.h> +#include <tqstyle.h> +#include <tqframe.h> +#include <tqdrawutil.h> +#include <tqcursor.h> +#include <tqtimer.h> +#include <tqtooltip.h> #include <kpopupmenu.h> #include <kapplication.h> @@ -93,7 +93,7 @@ class PluginProxy using namespace Kontact; EntryItem::EntryItem( Navigator *parent, Kontact::Plugin *plugin ) - : QListBoxItem( parent ), + : TQListBoxItem( parent ), mPlugin( plugin ), mHasHover( false ), mPaintActive( false ) @@ -117,7 +117,7 @@ void EntryItem::reloadPixmap() KIcon::DisabledState : KIcon::DefaultState); else - mPixmap = QPixmap(); + mPixmap = TQPixmap(); } Navigator* EntryItem::navigator() const @@ -125,7 +125,7 @@ Navigator* EntryItem::navigator() const return static_cast<Navigator*>( listBox() ); } -int EntryItem::width( const QListBox *listbox ) const +int EntryItem::width( const TQListBox *listbox ) const { int w = 0; if( navigator()->showIcons() ) { @@ -142,7 +142,7 @@ int EntryItem::width( const QListBox *listbox ) const return w + ( KDialog::marginHint() * 2 ); } -int EntryItem::height( const QListBox *listbox ) const +int EntryItem::height( const TQListBox *listbox ) const { int h = 0; if ( navigator()->showIcons() ) @@ -156,11 +156,11 @@ int EntryItem::height( const QListBox *listbox ) const return h; } -void EntryItem::paint( QPainter *p ) +void EntryItem::paint( TQPainter *p ) { reloadPixmap(); - QListBox *box = listBox(); + TQListBox *box = listBox(); bool iconAboveText = ( navigator()->viewMode() > SmallIcons ) && navigator()->showIcons(); int w = box->viewport()->width(); @@ -171,14 +171,14 @@ void EntryItem::paint( QPainter *p ) if ( isCurrent() || isSelected() || mHasHover || mPaintActive ) { int h = height( box ); - QBrush brush; + TQBrush brush; if ( isCurrent() || isSelected() || mPaintActive ) - brush = box->colorGroup().brush( QColorGroup::Highlight ); + brush = box->colorGroup().brush( TQColorGroup::Highlight ); else brush = box->colorGroup().highlight().light( 115 ); p->fillRect( 1, 0, w - 2, h - 1, brush ); - QPen pen = p->pen(); - QPen oldPen = pen; + TQPen pen = p->pen(); + TQPen oldPen = pen; pen.setColor( box->colorGroup().mid() ); p->setPen( pen ); @@ -196,13 +196,13 @@ void EntryItem::paint( QPainter *p ) p->drawPixmap( x, y, mPixmap ); } - QColor shadowColor = listBox()->colorGroup().background().dark(115); + TQColor shadowColor = listBox()->colorGroup().background().dark(115); if ( isCurrent() || isSelected() ) { p->setPen( box->colorGroup().highlightedText() ); } if ( !text().isEmpty() && navigator()->showText() ) { - QFontMetrics fm = p->fontMetrics(); + TQFontMetrics fm = p->fontMetrics(); int x = 0; if ( iconAboveText ) { @@ -226,7 +226,7 @@ void EntryItem::paint( QPainter *p ) p->setPen( box->palette().disabled().text( ) ); } else if ( isCurrent() || isSelected() || mHasHover ) { p->setPen( box->colorGroup().highlight().dark(115) ); - p->drawText( x + ( QApplication::reverseLayout() ? -1 : 1), + p->drawText( x + ( TQApplication::reverseLayout() ? -1 : 1), y + 1, text() ); p->setPen( box->colorGroup().highlightedText() ); } @@ -261,32 +261,32 @@ Navigator::Navigator( SidePaneBase *parent, const char *name ) mShowText = Prefs::self()->sidePaneShowText(); setSelectionMode( KListBox::Single ); viewport()->setBackgroundMode( PaletteBackground ); - setFrameStyle( QFrame::NoFrame ); - setHScrollBarMode( QScrollView::AlwaysOff ); + setFrameStyle( TQFrame::NoFrame ); + setHScrollBarMode( TQScrollView::AlwaysOff ); setAcceptDrops( true ); setFocusPolicy( NoFocus ); - connect( this, SIGNAL( selectionChanged( QListBoxItem* ) ), - SLOT( slotExecuted( QListBoxItem* ) ) ); - connect( this, SIGNAL( rightButtonPressed( QListBoxItem*, const QPoint& ) ), - SLOT( slotShowRMBMenu( QListBoxItem*, const QPoint& ) ) ); - connect( this, SIGNAL( onItem( QListBoxItem * ) ), - SLOT( slotMouseOn( QListBoxItem * ) ) ); - connect( this, SIGNAL( onViewport() ), SLOT( slotMouseOff() ) ); + connect( this, TQT_SIGNAL( selectionChanged( TQListBoxItem* ) ), + TQT_SLOT( slotExecuted( TQListBoxItem* ) ) ); + connect( this, TQT_SIGNAL( rightButtonPressed( TQListBoxItem*, const TQPoint& ) ), + TQT_SLOT( slotShowRMBMenu( TQListBoxItem*, const TQPoint& ) ) ); + connect( this, TQT_SIGNAL( onItem( TQListBoxItem * ) ), + TQT_SLOT( slotMouseOn( TQListBoxItem * ) ) ); + connect( this, TQT_SIGNAL( onViewport() ), TQT_SLOT( slotMouseOff() ) ); - mMapper = new QSignalMapper( this ); - connect( mMapper, SIGNAL( mapped( int ) ), SLOT( shortCutSelected( int ) ) ); + mMapper = new TQSignalMapper( this ); + connect( mMapper, TQT_SIGNAL( mapped( int ) ), TQT_SLOT( shortCutSelected( int ) ) ); - QToolTip::remove( this ); + TQToolTip::remove( this ); if ( !mShowText ) new EntryItemToolTip( this ); } -QSize Navigator::sizeHint() const +TQSize Navigator::sizeHint() const { - return QSize( 100, 100 ); + return TQSize( 100, 100 ); } void Navigator::highlightItem( EntryItem * item ) @@ -295,7 +295,7 @@ void Navigator::highlightItem( EntryItem * item ) setPaintActiveItem( mHighlightItem, true ); - QTimer::singleShot( 2000, this, SLOT( slotStopHighlight() ) ); + TQTimer::singleShot( 2000, this, TQT_SLOT( slotStopHighlight() ) ); } void Navigator::slotStopHighlight() @@ -303,7 +303,7 @@ void Navigator::slotStopHighlight() setPaintActiveItem( mHighlightItem, false ); } -void Navigator::setSelected( QListBoxItem *item, bool selected ) +void Navigator::setSelected( TQListBoxItem *item, bool selected ) { // Reimplemented to avoid the immediate activation of // the item. might turn out it doesn't work, we check that @@ -314,11 +314,11 @@ void Navigator::setSelected( QListBoxItem *item, bool selected ) } } -void Navigator::updatePlugins( QValueList<Kontact::Plugin*> plugins_ ) +void Navigator::updatePlugins( TQValueList<Kontact::Plugin*> plugins_ ) { - QValueList<Kontact::PluginProxy> plugins; - QValueList<Kontact::Plugin*>::ConstIterator end_ = plugins_.end(); - QValueList<Kontact::Plugin*>::ConstIterator it_ = plugins_.begin(); + TQValueList<Kontact::PluginProxy> plugins; + TQValueList<Kontact::Plugin*>::ConstIterator end_ = plugins_.end(); + TQValueList<Kontact::Plugin*>::ConstIterator it_ = plugins_.begin(); for ( ; it_ != end_; ++it_ ) plugins += PluginProxy( *it_ ); @@ -331,8 +331,8 @@ void Navigator::updatePlugins( QValueList<Kontact::Plugin*> plugins_ ) int counter = 0; int minWidth = 0; qBubbleSort( plugins ); - QValueList<Kontact::PluginProxy>::ConstIterator end = plugins.end(); - QValueList<Kontact::PluginProxy>::ConstIterator it = plugins.begin(); + TQValueList<Kontact::PluginProxy>::ConstIterator end = plugins.end(); + TQValueList<Kontact::PluginProxy>::ConstIterator it = plugins.begin(); for ( ; it != end; ++it ) { Kontact::Plugin *plugin = ( *it ).plugin(); if ( !plugin->showInSideBar() ) @@ -344,9 +344,9 @@ void Navigator::updatePlugins( QValueList<Kontact::Plugin*> plugins_ ) if ( item->width( this ) > minWidth ) minWidth = item->width( this ); - QString name = QString( "CTRL+%1" ).arg( counter + 1 ); + TQString name = TQString( "CTRL+%1" ).arg( counter + 1 ); KAction *action = new KAction( plugin->title(), plugin->icon(), KShortcut( name ), - mMapper, SLOT( map() ), + mMapper, TQT_SLOT( map() ), mSidePane->actionCollection(), name.latin1() ); mActions.append( action ); mMapper->setMapping( action, counter ); @@ -356,20 +356,20 @@ void Navigator::updatePlugins( QValueList<Kontact::Plugin*> plugins_ ) parentWidget()->setFixedWidth( minWidth ); } -void Navigator::dragEnterEvent( QDragEnterEvent *event ) +void Navigator::dragEnterEvent( TQDragEnterEvent *event ) { kdDebug(5600) << "Navigator::dragEnterEvent()" << endl; dragMoveEvent( event ); } -void Navigator::dragMoveEvent( QDragMoveEvent *event ) +void Navigator::dragMoveEvent( TQDragMoveEvent *event ) { kdDebug(5600) << "Navigator::dragEnterEvent()" << endl; kdDebug(5600) << " Format: " << event->format() << endl; - QListBoxItem *item = itemAt( event->pos() ); + TQListBoxItem *item = itemAt( event->pos() ); if ( !item ) { event->accept( false ); @@ -383,11 +383,11 @@ void Navigator::dragMoveEvent( QDragMoveEvent *event ) event->accept( entry->plugin()->canDecodeDrag( event ) ); } -void Navigator::dropEvent( QDropEvent *event ) +void Navigator::dropEvent( TQDropEvent *event ) { kdDebug(5600) << "Navigator::dropEvent()" << endl; - QListBoxItem *item = itemAt( event->pos() ); + TQListBoxItem *item = itemAt( event->pos() ); if ( !item ) { return; @@ -400,27 +400,27 @@ void Navigator::dropEvent( QDropEvent *event ) entry->plugin()->processDropEvent( event ); } -void Navigator::resizeEvent( QResizeEvent *event ) +void Navigator::resizeEvent( TQResizeEvent *event ) { - QListBox::resizeEvent( event ); + TQListBox::resizeEvent( event ); triggerUpdate( true ); } -void Navigator::enterEvent( QEvent *event ) +void Navigator::enterEvent( TQEvent *event ) { // work around Qt behaviour: onItem is not emmitted in enterEvent() KListBox::enterEvent( event ); - emit onItem( itemAt( mapFromGlobal( QCursor::pos() ) ) ); + emit onItem( itemAt( mapFromGlobal( TQCursor::pos() ) ) ); } -void Navigator::leaveEvent( QEvent *event ) +void Navigator::leaveEvent( TQEvent *event ) { KListBox::leaveEvent( event ); slotMouseOn( 0 ); mMouseOn = 0; } -void Navigator::slotExecuted( QListBoxItem *item ) +void Navigator::slotExecuted( TQListBoxItem *item ) { if ( !item ) return; @@ -450,7 +450,7 @@ IconViewMode Navigator::sizeIntToEnum(int size) const } } -void Navigator::slotShowRMBMenu( QListBoxItem *, const QPoint &pos ) +void Navigator::slotShowRMBMenu( TQListBoxItem *, const TQPoint &pos ) { KPopupMenu menu; menu.insertTitle( i18n( "Icon Size" ) ); @@ -483,17 +483,17 @@ void Navigator::slotShowRMBMenu( QListBoxItem *, const QPoint &pos ) if ( choice == ShowIcons ) { mShowIcons = !mShowIcons; Prefs::self()->setSidePaneShowIcons( mShowIcons ); - QToolTip::remove( this ); + TQToolTip::remove( this ); if ( !mShowText ) new EntryItemToolTip( this ); } else { mShowText = !mShowText; Prefs::self()->setSidePaneShowText( mShowText ); - QToolTip::remove( this ); + TQToolTip::remove( this ); } } int maxWidth = 0; - QListBoxItem* it = 0; + TQListBoxItem* it = 0; for (int i = 0; (it = item(i)) != 0; ++i) { int width = it->width(this); @@ -510,21 +510,21 @@ void Navigator::shortCutSelected( int pos ) setCurrentItem( pos ); } -void Navigator::setHoverItem( QListBoxItem* item, bool hover ) +void Navigator::setHoverItem( TQListBoxItem* item, bool hover ) { static_cast<EntryItem*>( item )->setHover( hover ); updateItem( item ); } -void Navigator::setPaintActiveItem( QListBoxItem* item, bool paintActive ) +void Navigator::setPaintActiveItem( TQListBoxItem* item, bool paintActive ) { static_cast<EntryItem*>( item )->setPaintActive( paintActive ); updateItem( item ); } -void Navigator::slotMouseOn( QListBoxItem* newItem ) +void Navigator::slotMouseOn( TQListBoxItem* newItem ) { - QListBoxItem* oldItem = mMouseOn; + TQListBoxItem* oldItem = mMouseOn; if ( oldItem == newItem ) return; if ( oldItem && !oldItem->isCurrent() && !oldItem->isSelected() ) @@ -544,12 +544,12 @@ void Navigator::slotMouseOff() slotMouseOn( 0 ); } -IconSidePane::IconSidePane( Core *core, QWidget *parent, const char *name ) +IconSidePane::IconSidePane( Core *core, TQWidget *parent, const char *name ) : SidePaneBase( core, parent, name ) { mNavigator = new Navigator( this ); - connect( mNavigator, SIGNAL( pluginActivated( Kontact::Plugin* ) ), - SIGNAL( pluginSelected( Kontact::Plugin* ) ) ); + connect( mNavigator, TQT_SIGNAL( pluginActivated( Kontact::Plugin* ) ), + TQT_SIGNAL( pluginSelected( Kontact::Plugin* ) ) ); setAcceptDrops( true ); } @@ -579,7 +579,7 @@ void IconSidePane::selectPlugin( Kontact::Plugin *plugin ) blockSignals( blocked ); } -void IconSidePane::selectPlugin( const QString &name ) +void IconSidePane::selectPlugin( const TQString &name ) { bool blocked = signalsBlocked(); blockSignals( true ); |