summaryrefslogtreecommitdiffstats
path: root/src/kbfxplasmacanvasitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kbfxplasmacanvasitem.cpp')
-rw-r--r--src/kbfxplasmacanvasitem.cpp84
1 files changed, 42 insertions, 42 deletions
diff --git a/src/kbfxplasmacanvasitem.cpp b/src/kbfxplasmacanvasitem.cpp
index 4a5824f..98173d2 100644
--- a/src/kbfxplasmacanvasitem.cpp
+++ b/src/kbfxplasmacanvasitem.cpp
@@ -21,18 +21,18 @@
#include "kbfxplasmacanvasitem.h"
-KbfxPlasmaCanvasItem::KbfxPlasmaCanvasItem ( QCanvasPixmapArray * a , QCanvas * canvas ) :KbfxPlasmaCanvasAbstractItem ( a, canvas )
+KbfxPlasmaCanvasItem::KbfxPlasmaCanvasItem ( TQCanvasPixmapArray * a , TQCanvas * canvas ) :KbfxPlasmaCanvasAbstractItem ( a, canvas )
{
this->setItemMode ( 1 );
setAnimated ( false );
m_desktopFile = 0L;
m_isCurrent = false;
// m_pixmapArray = a;
- QPixmap * _img = this->image ( 0 );
+ TQPixmap * _img = this->image ( 0 );
m_commentText ="No Comment Set By Plugin";
m_height =_img->height();
m_width =_img->width();
- connect ( this,SIGNAL ( clicked() ),this,SLOT ( exec() ) );
+ connect ( this,TQT_SIGNAL ( clicked() ),this,TQT_SLOT ( exec() ) );
m_type = OTHER;
// ConfigInit().read();
m_noComments = ConfigInit().m_noComments;
@@ -54,19 +54,19 @@ KbfxPlasmaCanvasItem::~KbfxPlasmaCanvasItem()
setCanvas ( 0L );
}
/*
-QCanvasPixmapArray * KbfxPlasmaCanvasItem::getPixmapArray()
+TQCanvasPixmapArray * KbfxPlasmaCanvasItem::getPixmapArray()
{
return m_pixmapArray;
}
*/
void
-KbfxPlasmaCanvasItem::setLabelText ( QString str )
+KbfxPlasmaCanvasItem::setLabelText ( TQString str )
{
- QFont * _font = new QFont ( m_fontAppNameFont );
+ TQFont * _font = new TQFont ( m_fontAppNameFont );
- QFontMetrics fm ( *_font );
+ TQFontMetrics fm ( *_font );
int _commentWidth = fm.width ( str+"..." );
int _strLen = str.length();
@@ -88,7 +88,7 @@ KbfxPlasmaCanvasItem::setLabelText ( QString str )
bool
-KbfxPlasmaCanvasItem::lookup ( QString str )
+KbfxPlasmaCanvasItem::lookup ( TQString str )
{
if ( str.isNull() )
@@ -97,11 +97,11 @@ KbfxPlasmaCanvasItem::lookup ( QString str )
if ( m_type == SEPARATOR || m_type == INDEX )
return false;
- if ( m_labelText.contains ( str,false ) > 0 )
+ if ( m_labelText.tqcontains ( str,false ) > 0 )
return true;
- if ( m_commentText.contains ( str,false ) > 0 )
+ if ( m_commentText.tqcontains ( str,false ) > 0 )
return true;
- if ( m_exec.contains ( str,false ) >0 )
+ if ( m_exec.tqcontains ( str,false ) >0 )
return true;
@@ -109,7 +109,7 @@ KbfxPlasmaCanvasItem::lookup ( QString str )
}
void
-KbfxPlasmaCanvasItem::setExec ( QString desktopfile )
+KbfxPlasmaCanvasItem::setExec ( TQString desktopfile )
{
m_desktopFile = new KDesktopFile ( desktopfile );
m_desktopFilePath = desktopfile;
@@ -130,12 +130,12 @@ KbfxPlasmaCanvasItem::setExec ( QString desktopfile )
}
void
-KbfxPlasmaCanvasItem::setIconPath ( QString str )
+KbfxPlasmaCanvasItem::setIconPath ( TQString str )
{
KIconLoader *iconload = KGlobal::iconLoader ();
m_iconPath = iconload->iconPath ( str, KIcon::Desktop, false );
// m_icon.load(m_iconPath);
- QImage _img ( m_iconPath );
+ TQImage _img ( m_iconPath );
if ( _img.height() > 128 )
{
@@ -148,7 +148,7 @@ KbfxPlasmaCanvasItem::setIconPath ( QString str )
}
void
-KbfxPlasmaCanvasItem::setIcon ( QPixmap pixmap )
+KbfxPlasmaCanvasItem::setIcon ( TQPixmap pixmap )
{
m_icon = pixmap;
@@ -206,7 +206,7 @@ KbfxPlasmaCanvasItem::setItemMode ( bool mode )
void
-KbfxPlasmaCanvasItem::drawBackDrop ( QPainter * pe,QRect & r )
+KbfxPlasmaCanvasItem::drawBackDrop ( TQPainter * pe,TQRect & r )
{
r = r ;
if ( pe == NULL )
@@ -218,7 +218,7 @@ KbfxPlasmaCanvasItem::drawBackDrop ( QPainter * pe,QRect & r )
/*
void
-KbfxPlasmaCanvasItem::drawText(QPainter * pe,QString str)
+KbfxPlasmaCanvasItem::drawText(TQPainter * pe,TQString str)
{
@@ -226,21 +226,21 @@ KbfxPlasmaCanvasItem::drawText(QPainter * pe,QString str)
*/
void
-KbfxPlasmaCanvasItem::draw ( QPainter & pe )
+KbfxPlasmaCanvasItem::draw ( TQPainter & pe )
{
drawContent ( &pe );
}
-QPixmap
+TQPixmap
KbfxPlasmaCanvasItem::dragPixmap()
{
double _x = x();
double _y = y();
setX ( 0.0 );
setY ( 0.0 );
- QPixmap dragpixmap ( this->width(),this->height() );
- dragpixmap.fill ( QColor ( 255,255,255 ) );
- QPainter p;
+ TQPixmap dragpixmap ( this->width(),this->height() );
+ dragpixmap.fill ( TQColor ( 255,255,255 ) );
+ TQPainter p;
p.begin ( &dragpixmap );
this->drawContent ( &p );
p.end();
@@ -251,7 +251,7 @@ KbfxPlasmaCanvasItem::dragPixmap()
}
void
-KbfxPlasmaCanvasItem::drawContent ( QPainter * pe )
+KbfxPlasmaCanvasItem::drawContent ( TQPainter * pe )
{
if ( m_isCurrent )
{
@@ -262,7 +262,7 @@ KbfxPlasmaCanvasItem::drawContent ( QPainter * pe )
this->setFrame ( 0 );
}
//int _currentFrame =
- QCanvasPixmap *cp = this->image ( this->frame () );
+ TQCanvasPixmap *cp = this->image ( this->frame () );
m_height = cp->height();
m_width = cp->width();
//Draw the Background
@@ -274,9 +274,9 @@ KbfxPlasmaCanvasItem::drawContent ( QPainter * pe )
}
else
{
- pe->setPen ( QColor ( 91,178,62 ) );
+ pe->setPen ( TQColor ( 91,178,62 ) );
pe->drawRect ( this->boundingRect() );
- pe->setPen ( QColor ( 0,10,0 ) );
+ pe->setPen ( TQColor ( 0,10,0 ) );
}
@@ -284,15 +284,15 @@ KbfxPlasmaCanvasItem::drawContent ( QPainter * pe )
We will split the Item box into two
**/
- QRect tmp ( 0,0,0,0 );
+ TQRect tmp ( 0,0,0,0 );
//TODO: Should be read from kbfxconfig.cpp
//
- QRect * rectTop = new QRect ( m_margin, ( int ) y(), cp->width() - m_margin, cp->height() /2 );
- QRect * rectBot = new QRect ( m_margin, ( int ) y() + rectTop->height(), cp->width() - m_margin, cp->height() /2 );
+ TQRect * rectTop = new TQRect ( m_margin, ( int ) y(), cp->width() - m_margin, cp->height() /2 );
+ TQRect * rectBot = new TQRect ( m_margin, ( int ) y() + rectTop->height(), cp->width() - m_margin, cp->height() /2 );
///Draw Icon
@@ -300,15 +300,15 @@ KbfxPlasmaCanvasItem::drawContent ( QPainter * pe )
//TODO::remover hard coded icon size : read from config
if ( !m_isCurrent )
- pe->drawPixmap ( QRect ( ( m_margin-m_iconSize ) /2, ( int ) y() + ( cp->height()-m_iconSize ) /2,m_iconSize,m_iconSize ),m_icon );
+ pe->drawPixmap ( TQRect ( ( m_margin-m_iconSize ) /2, ( int ) y() + ( cp->height()-m_iconSize ) /2,m_iconSize,m_iconSize ),m_icon );
else
- pe->drawPixmap ( QRect ( ( m_margin-m_iconSize ) /2, ( int ) y() + ( cp->height()-m_iconSize ) /2,m_iconSize+2,m_iconSize+2 ),m_icon );
+ pe->drawPixmap ( TQRect ( ( m_margin-m_iconSize ) /2, ( int ) y() + ( cp->height()-m_iconSize ) /2,m_iconSize+2,m_iconSize+2 ),m_icon );
//End of DrawIcon
- QFont * _font = new QFont ( m_fontAppNameFont );
- QFont * _font_comment = new QFont ( m_commentFont );
- QFont * _font_separator = new QFont ( m_sepNameFont );
+ TQFont * _font = new TQFont ( m_fontAppNameFont );
+ TQFont * _font_comment = new TQFont ( m_commentFont );
+ TQFont * _font_separator = new TQFont ( m_sepNameFont );
pe->setFont ( *_font );
if ( this->type() == EXECUTABLE )
@@ -317,17 +317,17 @@ KbfxPlasmaCanvasItem::drawContent ( QPainter * pe )
if ( m_noComments == false )
{
if ( m_isCurrent && m_boldFonts == true ) { _font->setBold ( true );pe->setFont ( *_font ); }
- pe->drawText ( *rectTop, Qt::AlignLeft| Qt::AlignBottom ,QString ( m_labelText ), -1, &tmp,0 );
+ pe->drawText ( *rectTop, TQt::AlignLeft| TQt::AlignBottom ,TQString ( m_labelText ), -1, &tmp );
pe->setPen ( m_lineColor );
pe->drawLine ( m_margin, ( int ) y() + rectTop->height(), ( int ) cp->width() - 2, ( int ) y() + rectTop->height() );
pe->setFont ( *_font_comment );
pe->setPen ( m_commentColor );
- pe->drawText ( *rectBot, Qt::AlignLeft| Qt::AlignTop ,QString ( m_commentText ), -1, &tmp,0 );
+ pe->drawText ( *rectBot, TQt::AlignLeft| TQt::AlignTop ,TQString ( m_commentText ), -1, &tmp );
}
else
{
- pe->drawText ( QRect ( m_margin+1, ( int ) y()+1,cp->width(),cp->height() ), Qt::AlignLeft | Qt::AlignVCenter ,QString ( m_labelText ), -1, &tmp,0 );
-// pe->drawText ( QRect ( m_margin, ( int ) y(),cp->width(),cp->height() ), Qt::AlignLeft | Qt::AlignVCenter ,QString ( m_labelText ), -1, &tmp,0 );
+ pe->drawText ( TQRect ( m_margin+1, ( int ) y()+1,cp->width(),cp->height() ), TQt::AlignLeft | TQt::AlignVCenter ,TQString ( m_labelText ), -1, &tmp );
+// pe->drawText ( TQRect ( m_margin, ( int ) y(),cp->width(),cp->height() ), TQt::AlignLeft | TQt::AlignVCenter ,TQString ( m_labelText ), -1, &tmp );
}
}
else
@@ -341,7 +341,7 @@ KbfxPlasmaCanvasItem::drawContent ( QPainter * pe )
{
pe->setPen ( m_fontAppNameColor );
}
- pe->drawText ( QRect ( ( int ) x(), ( int ) y(),cp->width(),cp->height() ), Qt::AlignCenter ,QString ( m_labelText ), -1, &tmp,0 );
+ pe->drawText ( TQRect ( ( int ) x(), ( int ) y(),cp->width(),cp->height() ), TQt::AlignCenter ,TQString ( m_labelText ), -1, &tmp );
}
@@ -356,13 +356,13 @@ KbfxPlasmaCanvasItem::drawContent ( QPainter * pe )
}
-void::KbfxPlasmaCanvasItem::setComment ( QString str )
+void::KbfxPlasmaCanvasItem::setComment ( TQString str )
{
- QFont * _font = new QFont ( m_commentFont );
+ TQFont * _font = new TQFont ( m_commentFont );
- QFontMetrics fm ( *_font );
+ TQFontMetrics fm ( *_font );
int _commentWidth = fm.width ( str+"..." );
int _strLen = str.length();