summaryrefslogtreecommitdiffstats
path: root/src/kbfxplasmacanvasview.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-05 22:07:15 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-05 22:07:15 +0000
commit421b60af92c83b889f8903c2898f2bd07186fcd8 (patch)
treead873a24c9438baed4942fda795430a4c3dc9a9a /src/kbfxplasmacanvasview.cpp
parent39e896bddf25bf34cbf8be814d959181e2c1d1dd (diff)
downloadkbfx-421b60af92c83b889f8903c2898f2bd07186fcd8.tar.gz
kbfx-421b60af92c83b889f8903c2898f2bd07186fcd8.zip
TQt4 port kbfx
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kbfx@1230544 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/kbfxplasmacanvasview.cpp')
-rw-r--r--src/kbfxplasmacanvasview.cpp142
1 files changed, 71 insertions, 71 deletions
diff --git a/src/kbfxplasmacanvasview.cpp b/src/kbfxplasmacanvasview.cpp
index 013458e..b1943db 100644
--- a/src/kbfxplasmacanvasview.cpp
+++ b/src/kbfxplasmacanvasview.cpp
@@ -21,16 +21,16 @@
#include "kbfxplasmacanvasview.h"
-KbfxPlasmaCanvasView::KbfxPlasmaCanvasView ( QWidget * parent,
+KbfxPlasmaCanvasView::KbfxPlasmaCanvasView ( TQWidget * tqparent,
const char *name, WFlags fl ) :
- QCanvasView ( parent, name,fl )
+ TQCanvasView ( tqparent, name,fl )
{
viewport ()->setMouseTracking ( TRUE );
viewport ()->setAcceptDrops ( true );
- this->setVScrollBarMode ( QScrollView::AlwaysOff );
- this->setHScrollBarMode ( QScrollView::AlwaysOff );
- setFrameShape ( QFrame::NoFrame );
+ this->setVScrollBarMode ( TQScrollView::AlwaysOff );
+ this->setHScrollBarMode ( TQScrollView::AlwaysOff );
+ setFrameShape ( TQFrame::NoFrame );
m_currentItem = 0L;
m_stack = 0;
m_currentView = new KbfxPlasmaCanvasGroupView ();
@@ -39,17 +39,17 @@ KbfxPlasmaCanvasView::KbfxPlasmaCanvasView ( QWidget * parent,
m_exeCandidate = 0;
m_findDone = true;
m_selectedItem = 0L;
- m_search = new QCanvas ( this->width (), this->height () );
+ m_search = new TQCanvas ( this->width (), this->height () );
m_scrollbar_top = new KbfxSpinxScrollBar ( this );
m_scrollbar_bot = new KbfxSpinxScrollBar ( this,"bottom",1);
m_scrollbar_top->setType ( KbfxSpinxScrollBar::UP );
m_scrollbar_bot->setType ( KbfxSpinxScrollBar::DOWN );
- connect ( m_scrollbar_top, SIGNAL ( scroll ( int, int ) ), this,
- SLOT ( scrollBy ( int, int ) ) );
- connect ( m_scrollbar_bot, SIGNAL ( scroll ( int, int ) ), this,
- SLOT ( scrollBy ( int, int ) ) );
+ connect ( m_scrollbar_top, TQT_SIGNAL ( scroll ( int, int ) ), this,
+ TQT_SLOT ( scrollBy ( int, int ) ) );
+ connect ( m_scrollbar_bot, TQT_SIGNAL ( scroll ( int, int ) ), this,
+ TQT_SLOT ( scrollBy ( int, int ) ) );
placeScrollBars ();
}
@@ -66,9 +66,9 @@ KbfxPlasmaCanvasView::~KbfxPlasmaCanvasView ()
}
void
-KbfxPlasmaCanvasView::keyPressEvent ( QKeyEvent * ke )
+KbfxPlasmaCanvasView::keyPressEvent ( TQKeyEvent * ke )
{
- qDebug ( "QCanvasView got Key events" );
+ qDebug ( "TQCanvasView got Key events" );
ke->ignore();
}
@@ -89,9 +89,9 @@ KbfxPlasmaCanvasView::clearAllButOne ( KbfxPlasmaCanvasItem * i )
{
i = i;
- QCanvasItemList list = canvas ()->allItems ();
+ TQCanvasItemList list = canvas ()->allItems ();
- QCanvasItemList::Iterator it = list.begin ();
+ TQCanvasItemList::Iterator it = list.begin ();
for ( ; it != list.end (); ++it )
{
if ( *it )
@@ -127,29 +127,29 @@ KbfxPlasmaCanvasView::execAt ( int i )
}
void
-KbfxPlasmaCanvasView::leaveEvent ( QEvent * e )
+KbfxPlasmaCanvasView::leaveEvent ( TQEvent * e )
{
e = e;
clearAllButOne ( m_currentItem );
}
void
-KbfxPlasmaCanvasView::enterEvent ( QEvent * e )
+KbfxPlasmaCanvasView::enterEvent ( TQEvent * e )
{
e = e;
clearAllButOne ( m_currentItem );
}
void
-KbfxPlasmaCanvasView::mouseMoveEvent ( QMouseEvent * me )
+KbfxPlasmaCanvasView::mouseMoveEvent ( TQMouseEvent * me )
{
- QPoint p = inverseWorldMatrix ().map ( viewportToContents ( me->pos () ) );
+ TQPoint p = inverseWorldMatrix ().map ( viewportToContents ( me->pos () ) );
if ( canvas () == NULL )
return;
// KbfxPlasmaCanvasGroup *tmp = 0;
- QCanvasItemList l = canvas ()->collisions ( p );
- for ( QCanvasItemList::Iterator it = l.begin (); it != l.end (); ++it )
+ TQCanvasItemList l = canvas ()->collisions ( p );
+ for ( TQCanvasItemList::Iterator it = l.begin (); it != l.end (); ++it )
{
if ( *it == 0 )
return;
@@ -169,25 +169,25 @@ KbfxPlasmaCanvasView::mouseMoveEvent ( QMouseEvent * me )
}
void
-KbfxPlasmaCanvasView::contentsMouseMoveEvent ( QMouseEvent * me )
+KbfxPlasmaCanvasView::contentsMouseMoveEvent ( TQMouseEvent * me )
{
if ( canvas () == NULL )
return;
- if ( me->state () & LeftButton )
+ if ( me->state () & Qt::LeftButton )
{
int distance = ( me->pos () - m_dragPos ).manhattanLength ();
- if ( distance > QApplication::startDragDistance () )
+ if ( distance > TQApplication::startDragDistance () )
this->startDrag ();
}
- QScrollView::contentsMouseMoveEvent ( me );
+ TQScrollView::contentsMouseMoveEvent ( me );
- QCanvasItemList l = canvas ()->collisions ( me->pos () );
+ TQCanvasItemList l = canvas ()->collisions ( me->pos () );
if ( l.count () <= 0 )
return;
- for ( QCanvasItemList::Iterator it = l.begin (); it != l.end (); ++it )
+ for ( TQCanvasItemList::Iterator it = l.begin (); it != l.end (); ++it )
{
if ( *it == 0 )
return;
@@ -201,7 +201,7 @@ KbfxPlasmaCanvasView::contentsMouseMoveEvent ( QMouseEvent * me )
}
m_currentItem = t;
t->setCurrent ( true );
- this->setCursor ( QCursor ( Qt::PointingHandCursor ) );
+ this->setCursor ( TQCursor ( TQt::PointingHandCursor ) );
}
}
canvas ()->update ();
@@ -209,11 +209,11 @@ KbfxPlasmaCanvasView::contentsMouseMoveEvent ( QMouseEvent * me )
void
-KbfxPlasmaCanvasView::contentsMousePressEvent ( QMouseEvent * me )
+KbfxPlasmaCanvasView::contentsMousePressEvent ( TQMouseEvent * me )
{
KbfxPlasmaCanvasGroup *tmp = 0;
- QCanvasItemList l = canvas ()->collisions ( me->pos () );
- for ( QCanvasItemList::Iterator it = l.begin (); it != l.end (); ++it )
+ TQCanvasItemList l = canvas ()->collisions ( me->pos () );
+ for ( TQCanvasItemList::Iterator it = l.begin (); it != l.end (); ++it )
{
if ( ( *it )->rtti () == CANVASITEM )
{
@@ -227,9 +227,9 @@ KbfxPlasmaCanvasView::contentsMousePressEvent ( QMouseEvent * me )
tmp->shade ();
m_clickPos = me->pos ();
- if ( me->button () == LeftButton )
+ if ( me->button () == Qt::LeftButton )
m_dragPos = me->pos ();
- QScrollView::contentsMousePressEvent ( me );
+ TQScrollView::contentsMousePressEvent ( me );
canvas ()->update ();
}
@@ -245,10 +245,10 @@ KbfxPlasmaCanvasView::startDrag ()
qDebug ( "null source" );
return;
}
- QUriDrag *drag =
- new QUriDrag ( QStrList ( src->contentPath () ), this,
+ TQUriDrag *drag =
+ new TQUriDrag ( TQStrList ( src->contentPath () ), this,
src->name ().ascii () );
- drag->setFileNames ( QStringList ( src->contentPath () ) );
+ drag->setFileNames ( TQStringList ( src->contentPath () ) );
drag->setPixmap ( m_currentItem->dragPixmap () );
drag->drag ();
emit clicked ();
@@ -256,24 +256,24 @@ KbfxPlasmaCanvasView::startDrag ()
}
void
-KbfxPlasmaCanvasView::resizeEvent ( QResizeEvent * )
+KbfxPlasmaCanvasView::resizeEvent ( TQResizeEvent * )
{
placeScrollBars ();
}
/*
void
-KbfxPlasmaCanvasView::enterEvent ( QEvent * e )
+KbfxPlasmaCanvasView::enterEvent ( TQEvent * e )
{
e = e;
if ( canvas () == 0 )
return;
// KbfxPlasmaCanvasGroup *tmp = 0;
- QPoint _mPos = QCursor::pos ();
- QCanvasItemList l = canvas ()->collisions ( this->mapFromGlobal ( _mPos ) );
+ TQPoint _mPos = TQCursor::pos ();
+ TQCanvasItemList l = canvas ()->collisions ( this->mapFromGlobal ( _mPos ) );
- for ( QCanvasItemList::Iterator it = l.begin (); it != l.end (); ++it )
+ for ( TQCanvasItemList::Iterator it = l.begin (); it != l.end (); ++it )
{
if ( *it == 0 )
break;
@@ -301,9 +301,9 @@ KbfxPlasmaCanvasView::clearAll ()
if ( canvas() != m_search )
return ;
- QCanvasItemList list = canvas ()->allItems ();
+ TQCanvasItemList list = canvas ()->allItems ();
- QCanvasItemList::Iterator it = list.begin ();
+ TQCanvasItemList::Iterator it = list.begin ();
for ( ; it != list.end (); ++it )
{
if ( *it )
@@ -318,18 +318,18 @@ KbfxPlasmaCanvasView::clearAll ()
}
void
-KbfxPlasmaCanvasView::setKbfxCanvas ( QCanvas * cnv )
+KbfxPlasmaCanvasView::setKbfxCanvas ( TQCanvas * cnv )
{
m_default = cnv;
setCanvas ( m_default );
// canvas ()->setBackgroundPixmap ( ( *KbfxPlasmaPixmapProvider::pixmap ( "appviewbg" )) );
- QPixmap * pixmap = KbfxPlasmaPixmapProvider::pixmap ( "middleboxbg" );
+ TQPixmap * pixmap = KbfxPlasmaPixmapProvider::pixmap ( "middleboxbg" );
if ( pixmap != NULL )
{
- QImage img = pixmap->convertToImage();
- img = img.smoothScale ( this->width(),pixmap->height(),QImage::ScaleFree );
+ TQImage img = pixmap->convertToImage();
+ img = img.smoothScale ( this->width(),pixmap->height(),TQ_ScaleFree );
pixmap->convertFromImage ( img );
- this->canvas ()->setBackgroundPixmap ( *pixmap );
+ this->canvas ()->tqsetBackgroundPixmap ( *pixmap );
}
}
@@ -347,7 +347,7 @@ KbfxPlasmaCanvasView::expandAll ()
void
KbfxPlasmaCanvasView::handleLoadRequest ( KbfxSignal signal )
{
- QString tm = signal.name ();
+ TQString tm = signal.name ();
KbfxDataStack *_stack = m_dataStack[signal.name () ];
if ( _stack == 0 )
@@ -356,7 +356,7 @@ KbfxPlasmaCanvasView::handleLoadRequest ( KbfxSignal signal )
return;
}
- QString _activateGroup = _stack->getSubGroupName ( signal.id () );
+ TQString _activateGroup = _stack->getSubGroupName ( signal.id () );
KbfxDataGroupList *_dataList = _stack->getStack ( _activateGroup );
KbfxPlasmaCanvasGroupView *gview = new KbfxPlasmaCanvasGroupView ();
@@ -376,7 +376,7 @@ KbfxPlasmaCanvasView::handleLoadRequest ( KbfxSignal signal )
( *it )->hide ();
}
- if ( m_appletMap[signal.name () ]->contains ( _activateGroup ) != true )
+ if ( m_appletMap[signal.name () ]->tqcontains ( _activateGroup ) != true )
{
loadGroup ( _dataList, gview );
m_currentView = gview;
@@ -391,7 +391,7 @@ KbfxPlasmaCanvasView::handleLoadRequest ( KbfxSignal signal )
else
canvas ()->resize ( v_stack->width (), this->visibleHeight () );
canvas()->update();
- repaint();
+ tqrepaint();
// return;
}
else
@@ -408,18 +408,18 @@ KbfxPlasmaCanvasView::handleLoadRequest ( KbfxSignal signal )
canvas ()->resize ( m_appletMap[signal.name () ]->width (),
this->visibleHeight () );
canvas()->update();
- repaint();
+ tqrepaint();
}
}
void
-KbfxPlasmaCanvasView::contentsMouseReleaseEvent ( QMouseEvent * me )
+KbfxPlasmaCanvasView::contentsMouseReleaseEvent ( TQMouseEvent * me )
{
// KbfxPlasmaCanvasGroup *tmp = 0;
- QCanvasItemList l = canvas ()->collisions ( me->pos () );
- for ( QCanvasItemList::Iterator it = l.begin (); it != l.end (); ++it )
+ TQCanvasItemList l = canvas ()->collisions ( me->pos () );
+ for ( TQCanvasItemList::Iterator it = l.begin (); it != l.end (); ++it )
{
if ( ( *it )->rtti () == CANVASITEM )
{
@@ -445,7 +445,7 @@ KbfxPlasmaCanvasView::clearSearch ()
void
-KbfxPlasmaCanvasView::search_R ( const QString name )
+KbfxPlasmaCanvasView::search_R ( const TQString name )
{
gstack = new KbfxPlasmaCanvasStack ();
KbfxPlasmaCanvasGroup *visualGroup = new KbfxPlasmaCanvasGroup ();
@@ -457,16 +457,16 @@ KbfxPlasmaCanvasView::search_R ( const QString name )
this->setCanvas ( m_search );
- QPixmap * pixmap = KbfxPlasmaPixmapProvider::pixmap ( "middleboxbg" );
+ TQPixmap * pixmap = KbfxPlasmaPixmapProvider::pixmap ( "middleboxbg" );
if ( pixmap != NULL )
{
- QImage img = pixmap->convertToImage();
- img = img.smoothScale ( this->width(),pixmap->height(),QImage::ScaleFree );
+ TQImage img = pixmap->convertToImage();
+ img = img.smoothScale ( this->width(),pixmap->height(),TQ_ScaleFree );
pixmap->convertFromImage ( img );
- this->canvas ()->setBackgroundPixmap ( *pixmap );
+ this->canvas ()->tqsetBackgroundPixmap ( *pixmap );
}
- this->setCursor ( QCursor ( Qt::BusyCursor ) );
+ this->setCursor ( TQCursor ( TQt::BusyCursor ) );
clearAll ();
dataStack::Iterator sit;
@@ -516,7 +516,7 @@ KbfxPlasmaCanvasView::search_R ( const QString name )
for ( it = dat.begin(); it != dat.end (); it++ )
{
- qApp->processEvents ();
+ tqApp->processEvents ();
boxwrapper = new KbfxPlasmaCanvasItemWrapper ( m_search );
box =
( KbfxPlasmaCanvasItem * ) boxwrapper->
@@ -541,12 +541,12 @@ KbfxPlasmaCanvasView::search_R ( const QString name )
m_scrollbar_bot->height () );
m_search->update ();
- this->setCursor ( QCursor ( Qt::ArrowCursor ) );
+ this->setCursor ( TQCursor ( TQt::ArrowCursor ) );
}
void
-KbfxPlasmaCanvasView::search ( const QString & str )
+KbfxPlasmaCanvasView::search ( const TQString & str )
{
if ( str.isEmpty () )
return;
@@ -560,9 +560,9 @@ KbfxPlasmaCanvasView::search ( const QString & str )
void
-KbfxPlasmaCanvasView::addStack ( KbfxPlasmaCanvasStack * stak, QString name )
+KbfxPlasmaCanvasView::addStack ( KbfxPlasmaCanvasStack * stak, TQString name )
{
- if ( m_appletMap.contains ( name ) )
+ if ( m_appletMap.tqcontains ( name ) )
{
return;
}
@@ -570,9 +570,9 @@ KbfxPlasmaCanvasView::addStack ( KbfxPlasmaCanvasStack * stak, QString name )
}
void
-KbfxPlasmaCanvasView::addStack ( KbfxDataStack * stak, QString name )
+KbfxPlasmaCanvasView::addStack ( KbfxDataStack * stak, TQString name )
{
- if ( m_dataStack.contains ( name ) )
+ if ( m_dataStack.tqcontains ( name ) )
{
return;
}
@@ -592,7 +592,7 @@ KbfxPlasmaCanvasView::loadGroup ( KbfxDataGroupList * src,
KbfxPlasmaCanvasItem *box = 0;
KbfxPlasmaCanvasItemWrapper *boxwrapper = 0;
KbfxPlasmaCanvasGroup *appGroup = 0; //new KbfxPlasmaCanvasGroup ();
- QString l_lastAdd = "";
+ TQString l_lastAdd = "";
for ( int i = 0; i < src->count (); i++ )
{
if ( list.at ( i ) != 0 )
@@ -651,13 +651,13 @@ KbfxPlasmaCanvasView::loadGroup ( KbfxDataGroupList * src,
void
-KbfxPlasmaCanvasView::contentsDragLeaveEvent ( QDragEnterEvent * event )
+KbfxPlasmaCanvasView::contentsDragLeaveEvent ( TQDragEnterEvent * event )
{
event->accept ( true );
}
void
-KbfxPlasmaCanvasView::contentsDragEnterEvent ( QDragEnterEvent * event )
+KbfxPlasmaCanvasView::contentsDragEnterEvent ( TQDragEnterEvent * event )
{
event->accept ( true );
}