diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2021-03-30 14:11:34 +0300 |
---|---|---|
committer | Mavridis Philippe <mavridisf@gmail.com> | 2021-03-30 14:11:34 +0300 |
commit | d991b7f387775dc1071fb0c0af78de1c613ca991 (patch) | |
tree | eb7c978130acb1b2c93eeea98be2f647372c6fac /src/komposedesktopwidget.cpp | |
parent | 1bd3c5b42f1570b2100a4986f638f2723ee37ec4 (diff) | |
download | kompose-d991b7f387775dc1071fb0c0af78de1c613ca991.tar.gz kompose-d991b7f387775dc1071fb0c0af78de1c613ca991.zip |
Qt3->TQt conversion.
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
Diffstat (limited to 'src/komposedesktopwidget.cpp')
-rw-r--r-- | src/komposedesktopwidget.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/src/komposedesktopwidget.cpp b/src/komposedesktopwidget.cpp index 952366c..f010f6d 100644 --- a/src/komposedesktopwidget.cpp +++ b/src/komposedesktopwidget.cpp @@ -26,12 +26,12 @@ #include "komposesettings.h" #include "komposeglobal.h" -#include <qdesktopwidget.h> -#include <qcolor.h> -#include <qpainter.h> -#include <qapplication.h> -#include <qdragobject.h> -#include <qtooltip.h> +#include <tqdesktopwidget.h> +#include <tqcolor.h> +#include <tqpainter.h> +#include <tqapplication.h> +#include <tqdragobject.h> +#include <tqtooltip.h> #include <klocale.h> #include <kwin.h> @@ -42,23 +42,23 @@ #include <kdebug.h> -KomposeDesktopWidget::KomposeDesktopWidget(int desktop, QWidget *parent, KomposeLayout *l, const char *name) +KomposeDesktopWidget::KomposeDesktopWidget(int desktop, TQWidget *parent, KomposeLayout *l, const char *name) : KomposeTaskContainerWidget( desktop, parent, l, name ), highlight(false) { // Retrieve geometry - // QDesktopWidget *deskwidget = new QDesktopWidget(); + // TQDesktopWidget *deskwidget = new TQDesktopWidget(); // deskRect = deskwidget->screenGeometry(); // delete deskwidget; initFonts(); // Set Desktop background as our background - setBackgroundMode( Qt::NoBackground ); + setBackgroundMode( TQt::NoBackground ); KWinModule kwinmodule( this, 1 ); deskName = kwinmodule.desktopName(desktop+1); - QToolTip::add( this, i18n("Desktop %1 - %2").arg(desktop).arg(deskName) ); + TQToolTip::add( this, i18n("Desktop %1 - %2").arg(desktop).arg(deskName) ); rootpix = new KRootPixmap (this); rootpix->start(); @@ -68,7 +68,7 @@ KomposeDesktopWidget::KomposeDesktopWidget(int desktop, QWidget *parent, Kompose connect( KomposeTaskManager::instance(), SIGNAL( newTask( KomposeTask* ) ), this, SLOT( createTaskWidget( KomposeTask* ) ) ); - setFocusPolicy(QWidget::ClickFocus); + setFocusPolicy(TQWidget::ClickFocus); } @@ -103,22 +103,22 @@ void KomposeDesktopWidget::initFonts() // } -void KomposeDesktopWidget::leaveEvent ( QEvent * ) +void KomposeDesktopWidget::leaveEvent ( TQEvent * ) { // Unset highlight if cursor moves out of our rect // but not if it enters a child widget - QRect deskRect; - deskRect.setTopLeft(mapToGlobal( QPoint(0,0) )); + TQRect deskRect; + deskRect.setTopLeft(mapToGlobal( TQPoint(0,0) )); deskRect.setWidth(width()); deskRect.setHeight(height()); - if ( !deskRect.contains( QCursor::pos() ) ) + if ( !deskRect.contains( TQCursor::pos() ) ) highlight = false; unsetCursor(); repaint(); } -void KomposeDesktopWidget::enterEvent ( QEvent * ) +void KomposeDesktopWidget::enterEvent ( TQEvent * ) { setFocus(); setCursor( KCursor::handCursor() ); @@ -126,27 +126,27 @@ void KomposeDesktopWidget::enterEvent ( QEvent * ) repaint(); } -void KomposeDesktopWidget::focusInEvent ( QFocusEvent * ) +void KomposeDesktopWidget::focusInEvent ( TQFocusEvent * ) { highlight = true; repaint(); } -void KomposeDesktopWidget::focusOutEvent ( QFocusEvent * ) +void KomposeDesktopWidget::focusOutEvent ( TQFocusEvent * ) { // Unset highlight if cursor moves out of our rect // but not if it enters a child widget - QRect deskRect; - deskRect.setTopLeft(mapToGlobal( QPoint(0,0) )); + TQRect deskRect; + deskRect.setTopLeft(mapToGlobal( TQPoint(0,0) )); deskRect.setWidth(width()); deskRect.setHeight(height()); - if ( !deskRect.contains( QCursor::pos() ) ) + if ( !deskRect.contains( TQCursor::pos() ) ) highlight = false; repaint(); } -void KomposeDesktopWidget::mouseReleaseEvent ( QMouseEvent * e ) +void KomposeDesktopWidget::mouseReleaseEvent ( TQMouseEvent * e ) { if ( !rect().contains( e->pos() ) ) return; @@ -154,7 +154,7 @@ void KomposeDesktopWidget::mouseReleaseEvent ( QMouseEvent * e ) } -void KomposeDesktopWidget::mouseDoubleClickEvent ( QMouseEvent * e ) +void KomposeDesktopWidget::mouseDoubleClickEvent ( TQMouseEvent * e ) { if ( !rect().contains( e->pos() ) ) return; @@ -162,12 +162,12 @@ void KomposeDesktopWidget::mouseDoubleClickEvent ( QMouseEvent * e ) } -void KomposeDesktopWidget::paintEvent ( QPaintEvent * ) +void KomposeDesktopWidget::paintEvent ( TQPaintEvent * ) { // KomposeWidget::paintEvent(e); - QPainter p; + TQPainter p; p.begin( this ); -// QPoint tl = mapToGlobal(QPoint(0,0)); +// TQPoint tl = mapToGlobal(TQPoint(0,0)); // p.drawPixmap(0,0, *KomposeGlobal::instance()->getDesktopBgPixmap(), // tl.x(), tl.y(), width(), height()); @@ -183,45 +183,45 @@ void KomposeDesktopWidget::paintEvent ( QPaintEvent * ) // paint the Desktop num & name (centered if empty, bottom right if not) if ( layout->getNumofChilds() == 0 ) - p.drawText(QRect(QPoint(0,0), size()), Qt::AlignCenter, QString("Desktop %1 - %2").arg(desktop+1).arg(deskName)); + p.drawText(TQRect(TQPoint(0,0), size()), TQt::AlignCenter, TQString("Desktop %1 - %2").arg(desktop+1).arg(deskName)); else - p.drawText(QRect(QPoint(0,0), size()), Qt::AlignRight | Qt::AlignBottom, QString("Desktop %1 - %2").arg(desktop+1).arg(deskName)); + p.drawText(TQRect(TQPoint(0,0), size()), TQt::AlignRight | TQt::AlignBottom, TQString("Desktop %1 - %2").arg(desktop+1).arg(deskName)); p.end(); } -void KomposeDesktopWidget::dragEnterEvent( QDragEnterEvent* e ) +void KomposeDesktopWidget::dragEnterEvent( TQDragEnterEvent* e ) { kdDebug() << "KomposeDesktopWidget::dragEnterEvent" << endl; - e->accept( QTextDrag::canDecode(e) ); + e->accept( TQTextDrag::canDecode(e) ); } -void KomposeDesktopWidget::dropEvent ( QDropEvent * e ) +void KomposeDesktopWidget::dropEvent ( TQDropEvent * e ) { - QString text; - if ( QTextDrag::decode(e, text) ) + TQString text; + if ( TQTextDrag::decode(e, text) ) { kdDebug() << "KomposeDesktopWidget::dropEvent - Received Task drop" << endl; KomposeTaskWidget* dropWidget = dynamic_cast<KomposeTaskWidget*>(e->source()); dropWidget->getTask()->toDesktop( desktop + 1); //if ( dropWidget->parentWidget() != this) - // dropWidget->reparent( this, QPoint(0,0), true ); + // dropWidget->reparent( this, TQPoint(0,0), true ); e->accept(); } } -void KomposeDesktopWidget::childEvent ( QChildEvent * ce) +void KomposeDesktopWidget::childEvent ( TQChildEvent * ce) { KomposeWidget::childEvent( ce ); emit contentsChanged(); } -void KomposeDesktopWidget::keyReleaseEvent ( QKeyEvent * e ) +void KomposeDesktopWidget::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() << "KomposeDesktopWidget::keyReleaseEvent - Switching to Desktop!" << endl; KomposeViewManager::instance()->setCurrentDesktop(desktop); |