summaryrefslogtreecommitdiffstats
path: root/src/komposetaskwidget.cpp
diff options
context:
space:
mode:
authorMavridis Philippe <mavridisf@gmail.com>2021-03-30 14:11:34 +0300
committerMavridis Philippe <mavridisf@gmail.com>2021-03-30 14:11:34 +0300
commitd991b7f387775dc1071fb0c0af78de1c613ca991 (patch)
treeeb7c978130acb1b2c93eeea98be2f647372c6fac /src/komposetaskwidget.cpp
parent1bd3c5b42f1570b2100a4986f638f2723ee37ec4 (diff)
downloadkompose-d991b7f387775dc1071fb0c0af78de1c613ca991.tar.gz
kompose-d991b7f387775dc1071fb0c0af78de1c613ca991.zip
Qt3->TQt conversion.
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
Diffstat (limited to 'src/komposetaskwidget.cpp')
-rw-r--r--src/komposetaskwidget.cpp94
1 files changed, 47 insertions, 47 deletions
diff --git a/src/komposetaskwidget.cpp b/src/komposetaskwidget.cpp
index 3d4abfe..dfba330 100644
--- a/src/komposetaskwidget.cpp
+++ b/src/komposetaskwidget.cpp
@@ -28,16 +28,16 @@
#include "komposeglobal.h"
#include "komposesettings.h"
-#include <qpixmap.h>
-#include <qimage.h>
-#include <qpainter.h>
-#include <qdragobject.h>
-#include <qapplication.h>
-#include <qtooltip.h>
-#include <qiconset.h>
-#include <qtimer.h>
-#include <qcolor.h>
-#include <qfont.h>
+#include <tqpixmap.h>
+#include <tqimage.h>
+#include <tqpainter.h>
+#include <tqdragobject.h>
+#include <tqapplication.h>
+#include <tqtooltip.h>
+#include <tqiconset.h>
+#include <tqtimer.h>
+#include <tqcolor.h>
+#include <tqfont.h>
#include <kcursor.h>
#include <klocale.h>
@@ -50,18 +50,18 @@
#include "komposetaskvisualizer.h"
-KomposeTaskWidget::KomposeTaskWidget(KomposeTask *t, QWidget *parent, KomposeLayout *l, const char *name)
+KomposeTaskWidget::KomposeTaskWidget(KomposeTask *t, TQWidget *parent, KomposeLayout *l, const char *name)
: KomposeWidget(parent, l, name),
highlight(false),
task(t)
{
setWFlags( WStaticContents | WRepaintNoErase | WResizeNoErase ); // avoid redraw errors
- setBackgroundMode( Qt::NoBackground ); // avoid flickering
+ setBackgroundMode( TQt::NoBackground ); // avoid flickering
- QToolTip::add( this, task->visibleNameWithState() );
+ TQToolTip::add( this, task->visibleNameWithState() );
- pm_dbBackground.setOptimization( QPixmap::BestOptim );
- setBackgroundMode( Qt::NoBackground );
+ pm_dbBackground.setOptimization( TQPixmap::BestOptim );
+ setBackgroundMode( TQt::NoBackground );
//setBackgroundPixmap(pm_dbBackground);
initActions();
@@ -81,8 +81,8 @@ KomposeTaskWidget::KomposeTaskWidget(KomposeTask *t, QWidget *parent, KomposeLay
connect( t, SIGNAL( x11DamageNotify() ), this, SLOT( drawWidgetAndRepaint() ) );
}
#endif
- //setFocusPolicy(QWidget::ClickFocus);
- setFocusPolicy(QWidget::StrongFocus);
+ //setFocusPolicy(TQWidget::ClickFocus);
+ setFocusPolicy(TQWidget::StrongFocus);
initFonts();
}
@@ -117,7 +117,7 @@ void KomposeTaskWidget::slotTaskDestroyed()
//if (KomposeViewManager::instance()->hasActiveView())
emit requestRemoval(this);
}
-void KomposeTaskWidget::resizeEvent ( QResizeEvent * e )
+void KomposeTaskWidget::resizeEvent ( TQResizeEvent * e )
{
if ( e->oldSize() != e->size())
{
@@ -128,7 +128,7 @@ void KomposeTaskWidget::resizeEvent ( QResizeEvent * e )
}
-void KomposeTaskWidget::paintEvent ( QPaintEvent * )
+void KomposeTaskWidget::paintEvent ( TQPaintEvent * )
{
if (size().height() < 40 ) // small hack that will prevent drawing on init
return;
@@ -155,7 +155,7 @@ void KomposeTaskWidget::drawWidget()
pm_dbBackground.resize( width(), height() );
//pm_dbBackground.fill(white);
- QPainter p( &pm_dbBackground );
+ TQPainter p( &pm_dbBackground );
int effect = IEFFECT_NONE;
@@ -171,22 +171,22 @@ void KomposeTaskWidget::drawWidget()
task->getVisualizer()->renderOnPixmap(&pm_dbBackground, effect);
// Icon
- QPoint titleTextPos( 6, KomposeSettings::instance()->getWindowTitleFontHeight() + 1);
+ TQPoint titleTextPos( 6, KomposeSettings::instance()->getWindowTitleFontHeight() + 1);
if ( KomposeSettings::instance()->getShowIcons() )
{
- QPixmap icon = task->getIcon( KomposeSettings::instance()->getIconSizePixels() );
+ TQPixmap icon = task->getIcon( KomposeSettings::instance()->getIconSizePixels() );
// Place the icon left or under the text, according to it's size
if ( KomposeSettings::instance()->getIconSize() < 2 || icon.height() < 50 )
{
// Medium sized or tiny Icon
- p.drawPixmap( QPoint(5, 5), icon );
+ p.drawPixmap( TQPoint(5, 5), icon );
titleTextPos.setX(icon.width() + 10);
}
else
{
// Big Icon
- p.drawPixmap( QPoint(5, 5), icon );
+ p.drawPixmap( TQPoint(5, 5), icon );
// titleTextPos.setX(icon.width());
}
}
@@ -201,62 +201,62 @@ void KomposeTaskWidget::drawWidget()
p.drawText( titleTextPos, task->visibleNameWithState() );
}
p.setPen( KomposeSettings::instance()->getWindowTitleFontColor() );
- p.drawText( QPoint( titleTextPos.x()-2, titleTextPos.y()-2 ), task->visibleNameWithState() );
+ p.drawText( TQPoint( titleTextPos.x()-2, titleTextPos.y()-2 ), task->visibleNameWithState() );
}
// Border
if (!highlight)
{
- QPen pen( gray, 1, Qt::SolidLine );
+ TQPen pen( gray, 1, TQt::SolidLine );
p.setPen( pen );
p.drawRect(rect());
}
else
{
- QPen pen( black, 2, Qt::DotLine );
+ TQPen pen( black, 2, TQt::DotLine );
p.setPen( pen );
- p.drawRect( QRect( 1, 1, rect().width()-1, rect().height()-1 ) );
+ p.drawRect( TQRect( 1, 1, rect().width()-1, rect().height()-1 ) );
}
p.end();
}
-void KomposeTaskWidget::mouseReleaseEvent ( QMouseEvent * e )
+void KomposeTaskWidget::mouseReleaseEvent ( TQMouseEvent * e )
{
if ( !rect().contains( e->pos() ) )
return;
KomposeViewManager::instance()->activateTask( task );
}
-void KomposeTaskWidget::mouseMoveEvent ( QMouseEvent * e )
+void KomposeTaskWidget::mouseMoveEvent ( TQMouseEvent * e )
{
- if ( e->state() == Qt::LeftButton )
+ if ( e->state() == TQt::LeftButton )
startDrag();
}
-// void KomposeTaskWidget::mouseDoubleClickEvent ( QMouseEvent * e )
+// void KomposeTaskWidget::mouseDoubleClickEvent ( TQMouseEvent * e )
// {
// if ( !rect().contains( e->pos() ) )
// return;
// KomposeTaskManager::instance()->activateTask( task );
// }
-void KomposeTaskWidget::keyReleaseEvent ( QKeyEvent * e )
+void KomposeTaskWidget::keyReleaseEvent ( TQKeyEvent * e )
{
- if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Space )
+ if ( e->key() == TQt::Key_Return || e->key() == TQt::Key_Space )
{
kdDebug() << "KomposeTaskWidget::keyReleaseEvent - activating Task!" << endl;
e->accept();
KomposeViewManager::instance()->activateTask( task );
return;
}
- else if ( e->key() == Qt::Key_C )
+ else if ( e->key() == TQt::Key_C )
{
kdDebug() << "KomposeTaskWidget::keyReleaseEvent - closing Task!" << endl;
task->close();
e->accept();
}
- else if ( e->key() == Qt::Key_M )
+ else if ( e->key() == TQt::Key_M )
{
kdDebug() << "KomposeTaskWidget::keyReleaseEvent - toggling state!" << endl;
task->minimizeOrRestore();
@@ -270,7 +270,7 @@ void KomposeTaskWidget::keyReleaseEvent ( QKeyEvent * e )
KomposeWidget::keyReleaseEvent(e);
}
-void KomposeTaskWidget::leaveEvent ( QEvent * )
+void KomposeTaskWidget::leaveEvent ( TQEvent * )
{
highlight = false;
unsetCursor();
@@ -281,7 +281,7 @@ void KomposeTaskWidget::leaveEvent ( QEvent * )
parentWidget()->setFocus();
}
-void KomposeTaskWidget::enterEvent ( QEvent * )
+void KomposeTaskWidget::enterEvent ( TQEvent * )
{
setFocus();
setCursor( KCursor::handCursor() );
@@ -291,13 +291,13 @@ void KomposeTaskWidget::enterEvent ( QEvent * )
prefWidget->show();
}
-void KomposeTaskWidget::focusInEvent ( QFocusEvent * )
+void KomposeTaskWidget::focusInEvent ( TQFocusEvent * )
{
highlight = true;
drawWidgetAndRepaint();
}
-void KomposeTaskWidget::focusOutEvent ( QFocusEvent * )
+void KomposeTaskWidget::focusOutEvent ( TQFocusEvent * )
{
highlight = false;
drawWidgetAndRepaint();
@@ -325,11 +325,11 @@ void KomposeTaskWidget::startDrag()
{
// The text is just a dummy
// FIXME: Maybe we should us a "Task"-Mimetype
- QDragObject *d = new QTextDrag( "toDesktop()", this );
+ TQDragObject *d = new TQTextDrag( "toDesktop()", this );
d->dragCopy();
}
-void KomposeTaskWidget::setGeometry( const QRect &rect )
+void KomposeTaskWidget::setGeometry( const TQRect &rect )
{
int width = task->getGeometry().width();
int height = task->getGeometry().height();
@@ -337,10 +337,10 @@ void KomposeTaskWidget::setGeometry( const QRect &rect )
// Don't scale images bigger than they actually are
if ( rect.width() > width || rect.height() > height )
{
- QWidget::setGeometry( QRect( rect.left(), rect.top(), width, height ) );
+ TQWidget::setGeometry( TQRect( rect.left(), rect.top(), width, height ) );
}
else
- QWidget::setGeometry( rect );
+ TQWidget::setGeometry( rect );
}
void KomposeTaskWidget::initActions()
@@ -361,7 +361,7 @@ void KomposeTaskWidget::initMenu()
actMinimizeRestoreTask->plug(menu);
// toDesktop menu
- QPopupMenu* m = new QPopupMenu( this );
+ TQPopupMenu* m = new TQPopupMenu( this );
m->setCheckable( true );
int id = m->insertItem( i18n("&All Desktops"), task, SLOT( toDesktop(int) ) );
@@ -372,7 +372,7 @@ void KomposeTaskWidget::initMenu()
for( int i = 1; i <= KomposeTaskManager::instance()->getNumDesktops(); i++ )
{
- QString name = QString( "&%1 %2" ).arg( i ).arg( KomposeTaskManager::instance()->getDesktopName( i ).replace( '&', "&&" ) );
+ TQString name = TQString( "&%1 %2" ).arg( i ).arg( KomposeTaskManager::instance()->getDesktopName( i ).replace( '&', "&&" ) );
id = m->insertItem( name, task, SLOT( toDesktop(int) ) );
m->setItemParameter( id, i );
m->setItemChecked( id, !task->isOnAllDesktops() && task->onDesktop() == i );
@@ -404,7 +404,7 @@ void KomposeTaskWidget::slotMinimizeRestoreToggled()
task->minimizeOrRestore();
}
-void KomposeTaskWidget::mousePressEvent ( QMouseEvent * e )
+void KomposeTaskWidget::mousePressEvent ( TQMouseEvent * e )
{
if ( !rect().contains( e->pos() ) )
return;