diff options
Diffstat (limited to 'kolourpaint/tools')
35 files changed, 968 insertions, 968 deletions
diff --git a/kolourpaint/tools/kptoolaction.cpp b/kolourpaint/tools/kptoolaction.cpp index ef5c8510..d45acb30 100644 --- a/kolourpaint/tools/kptoolaction.cpp +++ b/kolourpaint/tools/kptoolaction.cpp @@ -31,10 +31,10 @@ #include <kptool.h> -kpToolAction::kpToolAction (const QString &text, - const QString &pic, const KShortcut &shortcut, - const QObject *receiver, const char *slot, - QObject *parent, const char *name) +kpToolAction::kpToolAction (const TQString &text, + const TQString &pic, const KShortcut &shortcut, + const TQObject *receiver, const char *slot, + TQObject *parent, const char *name) : KToggleAction (text, pic, shortcut, receiver, slot, @@ -51,7 +51,7 @@ kpToolAction::~kpToolAction () // protected void kpToolAction::updateToolTip () { - const QString newToolTip = + const TQString newToolTip = kpTool::toolTipForTextAndShortcut (text (), shortcut ()); if (newToolTip == toolTip ()) return; @@ -66,7 +66,7 @@ void kpToolAction::updateToolTip () // // public slot virtual [base KAction] -void kpToolAction::setText (const QString &text) +void kpToolAction::setText (const TQString &text) { KToggleAction::setText (text); updateToolTip (); diff --git a/kolourpaint/tools/kptoolaction.h b/kolourpaint/tools/kptoolaction.h index df4e407e..bf3257c2 100644 --- a/kolourpaint/tools/kptoolaction.h +++ b/kolourpaint/tools/kptoolaction.h @@ -40,16 +40,16 @@ class kpToolAction : public KToggleAction, Q_OBJECT public: - kpToolAction (const QString &text, - const QString &pic, const KShortcut &shortcut, - const QObject *receiver, const char *slot, - QObject *parent, const char *name); + kpToolAction (const TQString &text, + const TQString &pic, const KShortcut &shortcut, + const TQObject *receiver, const char *slot, + TQObject *parent, const char *name); virtual ~kpToolAction (); signals: // Not emitted when toolTip is manually overriden by setToolTip() - void toolTipChanged (const QString &string); + void toolTipChanged (const TQString &string); protected: void updateToolTip (); @@ -60,7 +60,7 @@ protected: // public slots: - virtual void setText (const QString &text); + virtual void setText (const TQString &text); virtual bool setShortcut (const KShortcut &shortcut); diff --git a/kolourpaint/tools/kptoolairspray.cpp b/kolourpaint/tools/kptoolairspray.cpp index 43f8bef3..7f9a2b04 100644 --- a/kolourpaint/tools/kptoolairspray.cpp +++ b/kolourpaint/tools/kptoolairspray.cpp @@ -30,14 +30,14 @@ #include <stdlib.h> -#include <qbitmap.h> -#include <qpainter.h> -#include <qpen.h> -#include <qpixmap.h> -#include <qpoint.h> -#include <qpointarray.h> -#include <qrect.h> -#include <qtimer.h> +#include <tqbitmap.h> +#include <tqpainter.h> +#include <tqpen.h> +#include <tqpixmap.h> +#include <tqpoint.h> +#include <tqpointarray.h> +#include <tqrect.h> +#include <tqtimer.h> #include <kdebug.h> #include <klocale.h> @@ -64,8 +64,8 @@ kpToolAirSpray::kpToolAirSpray (kpMainWindow *mainWindow) mainWindow, "tool_spraycan"), m_currentCommand (0) { - m_timer = new QTimer (this); - connect (m_timer, SIGNAL (timeout ()), this, SLOT (actuallyDraw ())); + m_timer = new TQTimer (this); + connect (m_timer, TQT_SIGNAL (timeout ()), this, TQT_SLOT (actuallyDraw ())); } kpToolAirSpray::~kpToolAirSpray () @@ -75,7 +75,7 @@ kpToolAirSpray::~kpToolAirSpray () // private -QString kpToolAirSpray::haventBegunDrawUserMessage () const +TQString kpToolAirSpray::haventBegunDrawUserMessage () const { return i18n ("Click or drag to spray graffiti."); } @@ -95,8 +95,8 @@ void kpToolAirSpray::begin () if (m_toolWidgetSpraycanSize) { m_size = m_toolWidgetSpraycanSize->spraycanSize (); - connect (m_toolWidgetSpraycanSize, SIGNAL (spraycanSizeChanged (int)), - this, SLOT (slotSpraycanSizeChanged (int))); + connect (m_toolWidgetSpraycanSize, TQT_SIGNAL (spraycanSizeChanged (int)), + this, TQT_SLOT (slotSpraycanSizeChanged (int))); m_toolWidgetSpraycanSize->show (); } @@ -110,8 +110,8 @@ void kpToolAirSpray::end () { if (m_toolWidgetSpraycanSize) { - disconnect (m_toolWidgetSpraycanSize, SIGNAL (spraycanSizeChanged (int)), - this, SLOT (slotSpraycanSizeChanged (int))); + disconnect (m_toolWidgetSpraycanSize, TQT_SIGNAL (spraycanSizeChanged (int)), + this, TQT_SLOT (slotSpraycanSizeChanged (int))); m_toolWidgetSpraycanSize = 0; } @@ -141,7 +141,7 @@ void kpToolAirSpray::beginDraw () setUserMessage (cancelUserMessage ()); } -void kpToolAirSpray::draw (const QPoint &thisPoint, const QPoint &, const QRect &) +void kpToolAirSpray::draw (const TQPoint &thisPoint, const TQPoint &, const TQRect &) { // if the user is moving the spray, make the spray line continuous if (thisPoint != m_lastPoint) @@ -155,10 +155,10 @@ void kpToolAirSpray::draw (const QPoint &thisPoint, const QPoint &, const QRect void kpToolAirSpray::actuallyDraw () { - QPointArray pArray (10); + TQPointArray pArray (10); int numPoints = 0; - QPoint p = m_currentPoint; + TQPoint p = m_currentPoint; #if DEBUG_KP_TOOL_SPRAYCAN kdDebug () << "kpToolAirSpray::actuallyDraw() currentPoint=" << p @@ -178,7 +178,7 @@ void kpToolAirSpray::actuallyDraw () // make it look circular // OPT: can be done better if (dx * dx + dy * dy <= radius * radius) - pArray [numPoints++] = QPoint (p.x () + dx, p.y () + dy); + pArray [numPoints++] = TQPoint (p.x () + dx, p.y () + dy); } pArray.resize (numPoints); @@ -194,7 +194,7 @@ void kpToolAirSpray::actuallyDraw () void kpToolAirSpray::cancelShape () { #if 0 - endDraw (QPoint (), QRect ()); + endDraw (TQPoint (), TQRect ()); mainWindow ()->commandHistory ()->undo (); #else m_timer->stop (); @@ -215,7 +215,7 @@ void kpToolAirSpray::releasedAllButtons () } // virtual -void kpToolAirSpray::endDraw (const QPoint &, const QRect &) +void kpToolAirSpray::endDraw (const TQPoint &, const TQRect &) { m_timer->stop (); @@ -250,7 +250,7 @@ kpToolAirSprayCommand::~kpToolAirSprayCommand () // public virtual [base kpCommand] -QString kpToolAirSprayCommand::name () const +TQString kpToolAirSprayCommand::name () const { return i18n ("Spraycan"); } @@ -289,7 +289,7 @@ void kpToolAirSprayCommand::unexecute () if (!m_newPixmapPtr) { // the ultimate in laziness - figure out Redo info only if we Undo - m_newPixmapPtr = new QPixmap (m_boundingRect.width (), m_boundingRect.height ()); + m_newPixmapPtr = new TQPixmap (m_boundingRect.width (), m_boundingRect.height ()); *m_newPixmapPtr = document ()->getPixmapAt (m_boundingRect); } else @@ -300,9 +300,9 @@ void kpToolAirSprayCommand::unexecute () // public -void kpToolAirSprayCommand::addPoints (const QPointArray &points) +void kpToolAirSprayCommand::addPoints (const TQPointArray &points) { - QRect docRect = points.boundingRect (); + TQRect docRect = points.boundingRect (); #if DEBUG_KP_TOOL_SPRAYCAN kdDebug () << "kpToolAirSprayCommand::addPoints() docRect=" << docRect @@ -311,10 +311,10 @@ void kpToolAirSprayCommand::addPoints (const QPointArray &points) kdDebug () << "\t" << i << ": " << points [i] << endl; #endif - QPixmap pixmap = document ()->getPixmapAt (docRect); - QBitmap mask; + TQPixmap pixmap = document ()->getPixmapAt (docRect); + TQBitmap mask; - QPainter painter, maskPainter; + TQPainter painter, maskPainter; if (m_color.isOpaque ()) { @@ -331,7 +331,7 @@ void kpToolAirSprayCommand::addPoints (const QPointArray &points) for (int i = 0; i < (int) points.count (); i++) { - QPoint pt (points [i].x () - docRect.x (), + TQPoint pt (points [i].x () - docRect.x (), points [i].y () - docRect.y ()); if (painter.isActive ()) diff --git a/kolourpaint/tools/kptoolairspray.h b/kolourpaint/tools/kptoolairspray.h index 24f02787..ed983980 100644 --- a/kolourpaint/tools/kptoolairspray.h +++ b/kolourpaint/tools/kptoolairspray.h @@ -33,11 +33,11 @@ #include <kpcolor.h> #include <kptool.h> -class QPixmap; -class QPoint; -class QRect; -class QString; -class QTimer; +class TQPixmap; +class TQPoint; +class TQRect; +class TQString; +class TQTimer; class kpMainWindow; class kpToolAirSprayCommand; @@ -53,7 +53,7 @@ public: virtual ~kpToolAirSpray (); private: - QString haventBegunDrawUserMessage () const; + TQString haventBegunDrawUserMessage () const; public: virtual void begin (); @@ -64,10 +64,10 @@ private slots: public: virtual void beginDraw (); - virtual void draw (const QPoint &thisPoint, const QPoint &, const QRect &); + virtual void draw (const TQPoint &thisPoint, const TQPoint &, const TQRect &); virtual void cancelShape (); virtual void releasedAllButtons (); - virtual void endDraw (const QPoint &, const QRect &); + virtual void endDraw (const TQPoint &, const TQRect &); public slots: void actuallyDraw (); @@ -75,7 +75,7 @@ public slots: private: kpToolWidgetSpraycanSize *m_toolWidgetSpraycanSize; kpToolAirSprayCommand *m_currentCommand; - QTimer *m_timer; + TQTimer *m_timer; int m_size; }; @@ -86,7 +86,7 @@ public: kpMainWindow *mainWindow); virtual ~kpToolAirSprayCommand (); - virtual QString name () const; + virtual TQString name () const; virtual int size () const; @@ -94,7 +94,7 @@ public: virtual void unexecute (); // interface for KToolAirSpray - void addPoints (const QPointArray &points); + void addPoints (const TQPointArray &points); void finalize (); void cancel (); @@ -102,9 +102,9 @@ private: kpColor m_color; int m_size; - QPixmap *m_newPixmapPtr; - QPixmap m_oldPixmap; - QRect m_boundingRect; + TQPixmap *m_newPixmapPtr; + TQPixmap m_oldPixmap; + TQRect m_boundingRect; }; #endif // __kptoolairspray_h__ diff --git a/kolourpaint/tools/kptoolautocrop.cpp b/kolourpaint/tools/kptoolautocrop.cpp index 244c192d..f0284116 100644 --- a/kolourpaint/tools/kptoolautocrop.cpp +++ b/kolourpaint/tools/kptoolautocrop.cpp @@ -46,10 +46,10 @@ #include <kptoolautocrop.h> -#include <qapplication.h> -#include <qbitmap.h> -#include <qimage.h> -#include <qpainter.h> +#include <tqapplication.h> +#include <tqbitmap.h> +#include <tqimage.h> +#include <tqpainter.h> #include <kdebug.h> #include <klocale.h> @@ -65,7 +65,7 @@ #include <kpviewmanager.h> -kpToolAutoCropBorder::kpToolAutoCropBorder (const QPixmap *pixmapPtr, +kpToolAutoCropBorder::kpToolAutoCropBorder (const TQPixmap *pixmapPtr, int processedColorSimilarity) : m_pixmapPtr (pixmapPtr), m_processedColorSimilarity (processedColorSimilarity) @@ -82,7 +82,7 @@ int kpToolAutoCropBorder::size () const // public -const QPixmap *kpToolAutoCropBorder::pixmap () const +const TQPixmap *kpToolAutoCropBorder::pixmap () const { return m_pixmapPtr; } @@ -94,7 +94,7 @@ int kpToolAutoCropBorder::processedColorSimilarity () const } // public -QRect kpToolAutoCropBorder::rect () const +TQRect kpToolAutoCropBorder::rect () const { return m_rect; } @@ -169,10 +169,10 @@ bool kpToolAutoCropBorder::calculate (int isX, int dir) int maxX = m_pixmapPtr->width () - 1; int maxY = m_pixmapPtr->height () - 1; - QImage image = kpPixmapFX::convertToImage (*m_pixmapPtr); + TQImage image = kpPixmapFX::convertToImage (*m_pixmapPtr); if (image.isNull ()) { - kdError () << "Border::calculate() could not convert to QImage" << endl; + kdError () << "Border::calculate() could not convert to TQImage" << endl; return false; } @@ -202,8 +202,8 @@ bool kpToolAutoCropBorder::calculate (int isX, int dir) if (numCols) { - m_rect = QRect (QPoint (startX, 0), - QPoint (startX + (numCols - 1) * dir, maxY)).normalize (); + m_rect = TQRect (TQPoint (startX, 0), + TQPoint (startX + (numCols - 1) * dir, maxY)).normalize (); m_referenceColor = col; } } @@ -232,8 +232,8 @@ bool kpToolAutoCropBorder::calculate (int isX, int dir) if (numRows) { - m_rect = QRect (QPoint (0, startY), - QPoint (maxX, startY + (numRows - 1) * dir)).normalize (); + m_rect = TQRect (TQPoint (0, startY), + TQPoint (maxX, startY + (numRows - 1) * dir)).normalize (); m_referenceColor = col; } } @@ -282,7 +282,7 @@ bool kpToolAutoCropBorder::exists () const // public void kpToolAutoCropBorder::invalidate () { - m_rect = QRect (); + m_rect = TQRect (); m_referenceColor = kpColor::invalid; m_redSum = m_greenSum = m_blueSum = 0; m_isSingleColor = false; @@ -292,14 +292,14 @@ void kpToolAutoCropBorder::invalidate () class kpSetOverrideCursorSaver { public: - kpSetOverrideCursorSaver (const QCursor &cursor) + kpSetOverrideCursorSaver (const TQCursor &cursor) { - QApplication::setOverrideCursor (cursor); + TQApplication::setOverrideCursor (cursor); } ~kpSetOverrideCursorSaver () { - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } }; @@ -346,7 +346,7 @@ bool kpToolAutoCrop (kpMainWindow *mainWindow) } // OPT: if already pulled selection pixmap, no need to do it again here - QPixmap pixmap = doc->selection () ? doc->getSelectedPixmap () : *doc->pixmap (); + TQPixmap pixmap = doc->selection () ? doc->getSelectedPixmap () : *doc->pixmap (); if (pixmap.isNull ()) { kdError () << "kptoolAutoCrop() pased NULL pixmap" << endl; @@ -508,7 +508,7 @@ kpToolAutoCropCommand::~kpToolAutoCropCommand () // public static -QString kpToolAutoCropCommand::name (bool actOnSelection, int options) +TQString kpToolAutoCropCommand::name (bool actOnSelection, int options) { if (actOnSelection) { @@ -543,7 +543,7 @@ int kpToolAutoCropCommand::size () const // private -void kpToolAutoCropCommand::getUndoPixmap (const kpToolAutoCropBorder &border, QPixmap **pixmap) +void kpToolAutoCropCommand::getUndoPixmap (const kpToolAutoCropBorder &border, TQPixmap **pixmap) { kpDocument *doc = document (); @@ -568,7 +568,7 @@ void kpToolAutoCropCommand::getUndoPixmap (const kpToolAutoCropBorder &border, Q delete *pixmap; } - *pixmap = new QPixmap ( + *pixmap = new TQPixmap ( kpPixmapFX::getPixmapAt (*doc->pixmap (m_actOnSelection), border.rect ())); } @@ -613,7 +613,7 @@ void kpToolAutoCropCommand::execute () return; - QPixmap pixmapWithoutBorder = + TQPixmap pixmapWithoutBorder = kpTool::neededPixmap (*doc->pixmap (m_actOnSelection), m_contentsRect); @@ -623,11 +623,11 @@ void kpToolAutoCropCommand::execute () else { m_oldSelection = *doc->selection (); - m_oldSelection.setPixmap (QPixmap ()); + m_oldSelection.setPixmap (TQPixmap ()); // m_contentsRect is relative to the top of the sel // while sel is relative to the top of the doc - QRect rect = m_contentsRect; + TQRect rect = m_contentsRect; rect.moveBy (m_oldSelection.x (), m_oldSelection.y ()); kpSelection sel (kpSelection::Rectangle, @@ -653,8 +653,8 @@ void kpToolAutoCropCommand::unexecute () if (!doc) return; - QPixmap pixmap (m_oldWidth, m_oldHeight); - QBitmap maskBitmap; + TQPixmap pixmap (m_oldWidth, m_oldHeight); + TQBitmap maskBitmap; // restore the position of the centre image kpPixmapFX::setPixmapAt (&pixmap, m_contentsRect, @@ -662,8 +662,8 @@ void kpToolAutoCropCommand::unexecute () // draw the borders - QPainter painter (&pixmap); - QPainter maskPainter; + TQPainter painter (&pixmap); + TQPainter maskPainter; const kpToolAutoCropBorder *borders [] = { @@ -672,14 +672,14 @@ void kpToolAutoCropCommand::unexecute () 0 }; - const QPixmap *pixmaps [] = + const TQPixmap *pixmaps [] = { m_leftPixmap, m_rightPixmap, m_topPixmap, m_botPixmap, 0 }; - const QPixmap **p = pixmaps; + const TQPixmap **p = pixmaps; for (const kpToolAutoCropBorder **b = borders; *b; b++, p++) { if (!(*b)->exists ()) @@ -759,22 +759,22 @@ void kpToolAutoCropCommand::unexecute () // private -QRect kpToolAutoCropCommand::contentsRect () const +TQRect kpToolAutoCropCommand::contentsRect () const { - const QPixmap *pixmap = document ()->pixmap (m_actOnSelection); + const TQPixmap *pixmap = document ()->pixmap (m_actOnSelection); - QPoint topLeft (m_leftBorder.exists () ? + TQPoint topLeft (m_leftBorder.exists () ? m_leftBorder.rect ().right () + 1 : 0, m_topBorder.exists () ? m_topBorder.rect ().bottom () + 1 : 0); - QPoint botRight (m_rightBorder.exists () ? + TQPoint botRight (m_rightBorder.exists () ? m_rightBorder.rect ().left () - 1 : pixmap->width () - 1, m_botBorder.exists () ? m_botBorder.rect ().top () - 1 : pixmap->height () - 1); - return QRect (topLeft, botRight); + return TQRect (topLeft, botRight); } diff --git a/kolourpaint/tools/kptoolautocrop.h b/kolourpaint/tools/kptoolautocrop.h index 4d016a1d..bb1a5d4a 100644 --- a/kolourpaint/tools/kptoolautocrop.h +++ b/kolourpaint/tools/kptoolautocrop.h @@ -29,14 +29,14 @@ #ifndef __kptoolautocrop_h__ #define __kptoolautocrop_h__ -#include <qrect.h> +#include <tqrect.h> #include <kpcommandhistory.h> #include <kpcolor.h> #include <kpselection.h> -class QPixmap; +class TQPixmap; class kpDocument; class kpMainWindow; class kpViewManager; @@ -49,13 +49,13 @@ bool kpToolAutoCrop (kpMainWindow *mainWindow); class kpToolAutoCropBorder { public: - kpToolAutoCropBorder (const QPixmap *pixmapPtr, int processedColorSimilarity); + kpToolAutoCropBorder (const TQPixmap *pixmapPtr, int processedColorSimilarity); int size () const; - const QPixmap *pixmap () const; + const TQPixmap *pixmap () const; int processedColorSimilarity () const; - QRect rect () const; + TQRect rect () const; int left () const; int right () const; int top () const; @@ -72,10 +72,10 @@ public: void invalidate (); private: - const QPixmap *m_pixmapPtr; + const TQPixmap *m_pixmapPtr; int m_processedColorSimilarity; - QRect m_rect; + TQRect m_rect; kpColor m_referenceColor; int m_redSum, m_greenSum, m_blueSum; bool m_isSingleColor; @@ -99,12 +99,12 @@ public: ShowAccel = 1 }; - static QString name (bool actOnSelection, int options); + static TQString name (bool actOnSelection, int options); virtual int size () const; private: - void getUndoPixmap (const kpToolAutoCropBorder &border, QPixmap **pixmap); + void getUndoPixmap (const kpToolAutoCropBorder &border, TQPixmap **pixmap); void getUndoPixmaps (); void deleteUndoPixmaps (); @@ -113,13 +113,13 @@ public: virtual void unexecute (); private: - QRect contentsRect () const; + TQRect contentsRect () const; bool m_actOnSelection; kpToolAutoCropBorder m_leftBorder, m_rightBorder, m_topBorder, m_botBorder; - QPixmap *m_leftPixmap, *m_rightPixmap, *m_topPixmap, *m_botPixmap; + TQPixmap *m_leftPixmap, *m_rightPixmap, *m_topPixmap, *m_botPixmap; - QRect m_contentsRect; + TQRect m_contentsRect; int m_oldWidth, m_oldHeight; kpSelection m_oldSelection; }; diff --git a/kolourpaint/tools/kptoolclear.cpp b/kolourpaint/tools/kptoolclear.cpp index 230e54a3..7b1a775b 100644 --- a/kolourpaint/tools/kptoolclear.cpp +++ b/kolourpaint/tools/kptoolclear.cpp @@ -28,7 +28,7 @@ #include <kptoolclear.h> -#include <qpixmap.h> +#include <tqpixmap.h> #include <kdebug.h> #include <klocale.h> @@ -66,9 +66,9 @@ kpToolClearCommand::~kpToolClearCommand () // public virtual [base kpCommand] -QString kpToolClearCommand::name () const +TQString kpToolClearCommand::name () const { - QString opName = i18n ("Clear"); + TQString opName = i18n ("Clear"); if (m_actOnSelection) return i18n ("Selection: %1").arg (opName); @@ -95,7 +95,7 @@ void kpToolClearCommand::execute () } - m_oldPixmapPtr = new QPixmap (); + m_oldPixmapPtr = new TQPixmap (); *m_oldPixmapPtr = *doc->pixmap (m_actOnSelection); @@ -104,7 +104,7 @@ void kpToolClearCommand::execute () // OPT: could just edit pixmap directly and signal change kpSelection *sel = doc->selection (); - QPixmap newPixmap (sel->width (), sel->height ()); + TQPixmap newPixmap (sel->width (), sel->height ()); kpPixmapFX::fill (&newPixmap, m_newColor); // TODO: maybe disable Image/Clear if transparent colour if (m_newColor.isOpaque ()) diff --git a/kolourpaint/tools/kptoolclear.h b/kolourpaint/tools/kptoolclear.h index ccf3697f..6d73006f 100644 --- a/kolourpaint/tools/kptoolclear.h +++ b/kolourpaint/tools/kptoolclear.h @@ -33,8 +33,8 @@ #include <kpcolor.h> -class QPixmap; -class QString; +class TQPixmap; +class TQString; class kpDocument; class kpMainWindow; @@ -50,7 +50,7 @@ public: kpMainWindow *mainWindow); virtual ~kpToolClearCommand (); - virtual QString name () const; + virtual TQString name () const; virtual int size () const; @@ -61,7 +61,7 @@ private: bool m_actOnSelection; kpColor m_newColor; - QPixmap *m_oldPixmapPtr; + TQPixmap *m_oldPixmapPtr; }; diff --git a/kolourpaint/tools/kptoolcolorpicker.cpp b/kolourpaint/tools/kptoolcolorpicker.cpp index 1050b1cf..615012cd 100644 --- a/kolourpaint/tools/kptoolcolorpicker.cpp +++ b/kolourpaint/tools/kptoolcolorpicker.cpp @@ -31,9 +31,9 @@ #include <kptoolcolorpicker.h> -#include <qimage.h> -#include <qpixmap.h> -#include <qpoint.h> +#include <tqimage.h> +#include <tqpixmap.h> +#include <tqpoint.h> #include <kdebug.h> #include <klocale.h> @@ -61,7 +61,7 @@ kpToolColorPicker::~kpToolColorPicker () { } -kpColor kpToolColorPicker::colorAtPixel (const QPoint &p) +kpColor kpToolColorPicker::colorAtPixel (const TQPoint &p) { #if DEBUG_KP_TOOL_COLOR_PICKER && 0 kdDebug () << "kpToolColorPicker::colorAtPixel" << p << endl; @@ -71,7 +71,7 @@ kpColor kpToolColorPicker::colorAtPixel (const QPoint &p) } -QString kpToolColorPicker::haventBegunDrawUserMessage () const +TQString kpToolColorPicker::haventBegunDrawUserMessage () const { return i18n ("Click to select a color."); } @@ -90,7 +90,7 @@ void kpToolColorPicker::beginDraw () } // virtual -void kpToolColorPicker::draw (const QPoint &thisPoint, const QPoint &, const QRect &) +void kpToolColorPicker::draw (const TQPoint &thisPoint, const TQPoint &, const TQRect &) { const kpColor color = colorAtPixel (thisPoint); @@ -121,7 +121,7 @@ void kpToolColorPicker::releasedAllButtons () } // virtual -void kpToolColorPicker::endDraw (const QPoint &thisPoint, const QRect &) +void kpToolColorPicker::endDraw (const TQPoint &thisPoint, const TQRect &) { const kpColor color = colorAtPixel (thisPoint); @@ -162,7 +162,7 @@ kpToolColorPickerCommand::~kpToolColorPickerCommand () // public virtual [base kpCommand] -QString kpToolColorPickerCommand::name () const +TQString kpToolColorPickerCommand::name () const { return i18n ("Color Picker"); } diff --git a/kolourpaint/tools/kptoolcolorpicker.h b/kolourpaint/tools/kptoolcolorpicker.h index 46fc94be..6ebaa6d7 100644 --- a/kolourpaint/tools/kptoolcolorpicker.h +++ b/kolourpaint/tools/kptoolcolorpicker.h @@ -34,8 +34,8 @@ #include <kpcolor.h> #include <kptool.h> -class QPoint; -class QRect; +class TQPoint; +class TQRect; class kpColorToolBar; @@ -52,18 +52,18 @@ public: virtual bool returnToPreviousToolAfterEndDraw () const { return true; } private: - QString haventBegunDrawUserMessage () const; + TQString haventBegunDrawUserMessage () const; public: virtual void begin (); virtual void beginDraw (); - virtual void draw (const QPoint &thisPoint, const QPoint &, const QRect &); + virtual void draw (const TQPoint &thisPoint, const TQPoint &, const TQRect &); virtual void cancelShape (); virtual void releasedAllButtons (); - virtual void endDraw (const QPoint &thisPoint, const QRect &); + virtual void endDraw (const TQPoint &thisPoint, const TQRect &); private: - kpColor colorAtPixel (const QPoint &p); + kpColor colorAtPixel (const TQPoint &p); kpColor m_oldColor; }; @@ -76,7 +76,7 @@ public: kpMainWindow *mainWindow); virtual ~kpToolColorPickerCommand (); - virtual QString name () const; + virtual TQString name () const; virtual int size () const; diff --git a/kolourpaint/tools/kptoolconverttograyscale.cpp b/kolourpaint/tools/kptoolconverttograyscale.cpp index a80ef8fa..524e3e6d 100644 --- a/kolourpaint/tools/kptoolconverttograyscale.cpp +++ b/kolourpaint/tools/kptoolconverttograyscale.cpp @@ -26,8 +26,8 @@ */ -#include <qapplication.h> -#include <qpixmap.h> +#include <tqapplication.h> +#include <tqpixmap.h> #include <klocale.h> @@ -54,9 +54,9 @@ kpToolConvertToGrayscaleCommand::~kpToolConvertToGrayscaleCommand () // public virtual [base kpCommand] -QString kpToolConvertToGrayscaleCommand::name () const +TQString kpToolConvertToGrayscaleCommand::name () const { - QString opName = i18n ("Reduce to Grayscale"); + TQString opName = i18n ("Reduce to Grayscale"); if (m_actOnSelection) return i18n ("Selection: %1").arg (opName); @@ -79,16 +79,16 @@ void kpToolConvertToGrayscaleCommand::execute () if (!doc) return; - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); - m_oldPixmapPtr = new QPixmap (); + m_oldPixmapPtr = new TQPixmap (); *m_oldPixmapPtr = *doc->pixmap (m_actOnSelection); - QPixmap newPixmap = kpPixmapFX::convertToGrayscale (*doc->pixmap (m_actOnSelection)); + TQPixmap newPixmap = kpPixmapFX::convertToGrayscale (*doc->pixmap (m_actOnSelection)); doc->setPixmap (m_actOnSelection, newPixmap); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } // public virtual [base kpCommand] diff --git a/kolourpaint/tools/kptoolconverttograyscale.h b/kolourpaint/tools/kptoolconverttograyscale.h index 6ea5e515..c5ae3aa8 100644 --- a/kolourpaint/tools/kptoolconverttograyscale.h +++ b/kolourpaint/tools/kptoolconverttograyscale.h @@ -31,8 +31,8 @@ #include <kpcommandhistory.h> -class QPixmap; -class QString; +class TQPixmap; +class TQString; class kpMainWindow; @@ -43,7 +43,7 @@ public: kpMainWindow *mainWindow); virtual ~kpToolConvertToGrayscaleCommand (); - virtual QString name () const; + virtual TQString name () const; virtual int size () const; virtual void execute (); @@ -51,7 +51,7 @@ public: private: bool m_actOnSelection; - QPixmap *m_oldPixmapPtr; + TQPixmap *m_oldPixmapPtr; }; #endif // __kptoolconverttograyscale_h__ diff --git a/kolourpaint/tools/kptoolcrop.cpp b/kolourpaint/tools/kptoolcrop.cpp index 8cc6e880..f1e530ca 100644 --- a/kolourpaint/tools/kptoolcrop.cpp +++ b/kolourpaint/tools/kptoolcrop.cpp @@ -30,7 +30,7 @@ #include <kptoolcrop.h> -#include <qpixmap.h> +#include <tqpixmap.h> #include <kdebug.h> #include <klocale.h> @@ -50,8 +50,8 @@ kpSelection selectionBorderAndMovedTo0_0 (const kpSelection &sel) { kpSelection borderSel = sel; - borderSel.setPixmap (QPixmap ()); // only interested in border - borderSel.moveTo (QPoint (0, 0)); + borderSel.setPixmap (TQPixmap ()); // only interested in border + borderSel.moveTo (TQPoint (0, 0)); return borderSel; } @@ -68,7 +68,7 @@ public: virtual ~kpToolCropSetImageCommand (); /* (uninteresting child of macro cmd) */ - virtual QString name () const { return QString::null; } + virtual TQString name () const { return TQString::null; } virtual int size () const { @@ -82,9 +82,9 @@ public: protected: kpColor m_backgroundColor; - QPixmap m_oldPixmap; + TQPixmap m_oldPixmap; kpSelection m_fromSelection; - QPixmap m_pixmapIfFromSelectionDoesntHaveOne; + TQPixmap m_pixmapIfFromSelectionDoesntHaveOne; }; @@ -94,7 +94,7 @@ kpToolCropSetImageCommand::kpToolCropSetImageCommand (kpMainWindow *mainWindow) m_fromSelection (*mainWindow->document ()->selection ()), m_pixmapIfFromSelectionDoesntHaveOne ( m_fromSelection.pixmap () ? - QPixmap () : + TQPixmap () : mainWindow->document ()->getSelectedPixmap ()) { } @@ -114,7 +114,7 @@ void kpToolCropSetImageCommand::execute () viewManager ()->setQueueUpdates (); { m_oldPixmap = kpPixmapFX::getPixmapAt (*document ()->pixmap (), - QRect (0, 0, m_fromSelection.width (), m_fromSelection.height ())); + TQRect (0, 0, m_fromSelection.width (), m_fromSelection.height ())); // @@ -136,7 +136,7 @@ void kpToolCropSetImageCommand::execute () // any transparent pixels. // - QPixmap newDocPixmap (m_fromSelection.width (), m_fromSelection.height ()); + TQPixmap newDocPixmap (m_fromSelection.width (), m_fromSelection.height ()); kpPixmapFX::fill (&newDocPixmap, m_backgroundColor); #if DEBUG_KP_TOOL_CROP @@ -144,7 +144,7 @@ void kpToolCropSetImageCommand::execute () << " pm=" << m_fromSelection.pixmap () << endl; #endif - QPixmap selTransparentPixmap; + TQPixmap selTransparentPixmap; if (m_fromSelection.pixmap ()) { @@ -166,15 +166,15 @@ void kpToolCropSetImageCommand::execute () } kpPixmapFX::paintMaskTransparentWithBrush (&newDocPixmap, - QPoint (0, 0), + TQPoint (0, 0), m_fromSelection.maskForOwnType ()); kpPixmapFX::paintPixmapAt (&newDocPixmap, - QPoint (0, 0), + TQPoint (0, 0), selTransparentPixmap); - document ()->setPixmapAt (newDocPixmap, QPoint (0, 0)); + document ()->setPixmapAt (newDocPixmap, TQPoint (0, 0)); document ()->selectionDelete (); @@ -193,7 +193,7 @@ void kpToolCropSetImageCommand::unexecute () viewManager ()->setQueueUpdates (); { - document ()->setPixmapAt (m_oldPixmap, QPoint (0, 0)); + document ()->setPixmapAt (m_oldPixmap, TQPoint (0, 0)); m_oldPixmap.resize (0, 0); #if DEBUG_KP_TOOL_CROP @@ -274,9 +274,9 @@ kpToolCropCommand::kpToolCropCommand (kpMainWindow *mainWindow) #endif kpToolSelectionMoveCommand *moveCmd = new kpToolSelectionMoveCommand ( - QString::null/*uninteresting child of macro cmd*/, + TQString::null/*uninteresting child of macro cmd*/, mainWindow); - moveCmd->moveTo (QPoint (0, 0), true/*move on exec, not now*/); + moveCmd->moveTo (TQPoint (0, 0), true/*move on exec, not now*/); moveCmd->finalize (); addCommand (moveCmd); } @@ -291,7 +291,7 @@ kpToolCropCommand::kpToolCropCommand (kpMainWindow *mainWindow) #if 0 addCommand ( new kpToolSelectionCreateCommand ( - QString::null/*uninteresting child of macro cmd*/, + TQString::null/*uninteresting child of macro cmd*/, selectionBorderAndMovedTo0_0 (*sel), mainWindow)); #endif diff --git a/kolourpaint/tools/kptoolflip.cpp b/kolourpaint/tools/kptoolflip.cpp index 58eeb66d..146b639f 100644 --- a/kolourpaint/tools/kptoolflip.cpp +++ b/kolourpaint/tools/kptoolflip.cpp @@ -28,10 +28,10 @@ #include <kptoolflip.h> -#include <qapplication.h> -#include <qradiobutton.h> -#include <qvbox.h> -#include <qvbuttongroup.h> +#include <tqapplication.h> +#include <tqradiobutton.h> +#include <tqvbox.h> +#include <tqvbuttongroup.h> #include <kdebug.h> #include <klocale.h> @@ -63,9 +63,9 @@ kpToolFlipCommand::~kpToolFlipCommand () // public virtual [base kpCommand] -QString kpToolFlipCommand::name () const +TQString kpToolFlipCommand::name () const { - QString opName; + TQString opName; #if 1 @@ -80,7 +80,7 @@ QString kpToolFlipCommand::name () const else { kdError () << "kpToolFlipCommand::name() not asked to flip" << endl; - return QString::null; + return TQString::null; } #endif @@ -120,7 +120,7 @@ void kpToolFlipCommand::flip () return; - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); if (m_actOnSelection) @@ -131,13 +131,13 @@ void kpToolFlipCommand::flip () } else { - QPixmap newPixmap = kpPixmapFX::flip (*doc->pixmap (), m_horiz, m_vert); + TQPixmap newPixmap = kpPixmapFX::flip (*doc->pixmap (), m_horiz, m_vert); doc->setPixmap (newPixmap); } - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } @@ -149,12 +149,12 @@ void kpToolFlipCommand::flip () bool kpToolFlipDialog::s_lastIsVerticalFlip = true; -kpToolFlipDialog::kpToolFlipDialog (bool actOnSelection, QWidget *parent) +kpToolFlipDialog::kpToolFlipDialog (bool actOnSelection, TQWidget *parent) : KDialogBase (parent, 0/*name*/, true/*modal*/, actOnSelection ? i18n ("Flip Selection") : i18n ("Flip Image"), KDialogBase::Ok | KDialogBase::Cancel) { - QVBox *vbox = makeVBoxMainWidget (); + TQVBox *vbox = makeVBoxMainWidget (); if (!vbox) { @@ -162,19 +162,19 @@ kpToolFlipDialog::kpToolFlipDialog (bool actOnSelection, QWidget *parent) } else { - QVButtonGroup *buttonGroup = new QVButtonGroup (i18n ("Direction"), vbox); + TQVButtonGroup *buttonGroup = new TQVButtonGroup (i18n ("Direction"), vbox); // I'm sure vert flipping is much more common than horiz flipping so make it come first - m_verticalFlipRadioButton = new QRadioButton (i18n ("&Vertical (upside-down)"), buttonGroup); - m_horizontalFlipRadioButton = new QRadioButton (i18n ("&Horizontal"), buttonGroup); + m_verticalFlipRadioButton = new TQRadioButton (i18n ("&Vertical (upside-down)"), buttonGroup); + m_horizontalFlipRadioButton = new TQRadioButton (i18n ("&Horizontal"), buttonGroup); m_verticalFlipRadioButton->setChecked (s_lastIsVerticalFlip); m_horizontalFlipRadioButton->setChecked (!s_lastIsVerticalFlip); - connect (m_verticalFlipRadioButton, SIGNAL (toggled (bool)), - this, SLOT (slotIsVerticalFlipChanged ())); - connect (m_horizontalFlipRadioButton, SIGNAL (toggled (bool)), - this, SLOT (slotIsVerticalFlipChanged ())); + connect (m_verticalFlipRadioButton, TQT_SIGNAL (toggled (bool)), + this, TQT_SLOT (slotIsVerticalFlipChanged ())); + connect (m_horizontalFlipRadioButton, TQT_SIGNAL (toggled (bool)), + this, TQT_SLOT (slotIsVerticalFlipChanged ())); } } diff --git a/kolourpaint/tools/kptoolflip.h b/kolourpaint/tools/kptoolflip.h index c287c320..8399cf40 100644 --- a/kolourpaint/tools/kptoolflip.h +++ b/kolourpaint/tools/kptoolflip.h @@ -32,8 +32,8 @@ #include <kpcommandhistory.h> #include <kdialogbase.h> -class QRadioButton; -class QString; +class TQRadioButton; +class TQString; class kpDocument; class kpMainWindow; @@ -47,7 +47,7 @@ public: kpMainWindow *mainWindow); virtual ~kpToolFlipCommand (); - virtual QString name () const; + virtual TQString name () const; virtual int size () const; @@ -67,7 +67,7 @@ class kpToolFlipDialog : public KDialogBase Q_OBJECT public: - kpToolFlipDialog (bool actOnSelection, QWidget *parent); + kpToolFlipDialog (bool actOnSelection, TQWidget *parent); ~kpToolFlipDialog (); private: @@ -82,7 +82,7 @@ public: bool isNoOp () const; private: - QRadioButton *m_horizontalFlipRadioButton, *m_verticalFlipRadioButton; + TQRadioButton *m_horizontalFlipRadioButton, *m_verticalFlipRadioButton; }; #endif // __kptoolflip_h__ diff --git a/kolourpaint/tools/kptoolfloodfill.cpp b/kolourpaint/tools/kptoolfloodfill.cpp index bb17d701..518820ba 100644 --- a/kolourpaint/tools/kptoolfloodfill.cpp +++ b/kolourpaint/tools/kptoolfloodfill.cpp @@ -31,10 +31,10 @@ #include <kptoolfloodfill.h> -#include <qapplication.h> -#include <qcursor.h> -#include <qpainter.h> -#include <qpixmap.h> +#include <tqapplication.h> +#include <tqcursor.h> +#include <tqpainter.h> +#include <tqpixmap.h> #include <kdebug.h> #include <klocale.h> @@ -63,7 +63,7 @@ kpToolFloodFill::~kpToolFloodFill () { } -QString kpToolFloodFill::haventBegunDrawUserMessage () const +TQString kpToolFloodFill::haventBegunDrawUserMessage () const { return i18n ("Click to fill a region."); } @@ -80,7 +80,7 @@ void kpToolFloodFill::beginDraw () kdDebug () << "kpToolFloodFill::beginDraw()" << endl; #endif - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); // Flood Fill is an expensive CPU operation so we only fill at a // mouse click (beginDraw ()), not on mouse move (virtually draw()) @@ -112,13 +112,13 @@ void kpToolFloodFill::beginDraw () kdError () << "kpToolFloodFill::beginDraw() could not prepareColorToChange!" << endl; } - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); setUserMessage (cancelUserMessage ()); } // virtual -void kpToolFloodFill::draw (const QPoint &thisPoint, const QPoint &, const QRect &) +void kpToolFloodFill::draw (const TQPoint &thisPoint, const TQPoint &, const TQRect &) { setUserShapePoints (thisPoint); } @@ -127,7 +127,7 @@ void kpToolFloodFill::draw (const QPoint &thisPoint, const QPoint &, const QRect void kpToolFloodFill::cancelShape () { #if 0 - endDraw (QPoint (), QRect ()); + endDraw (TQPoint (), TQRect ()); mainWindow ()->commandHistory ()->undo (); #else m_currentCommand->unexecute (); @@ -145,7 +145,7 @@ void kpToolFloodFill::releasedAllButtons () } // virtual -void kpToolFloodFill::endDraw (const QPoint &, const QRect &) +void kpToolFloodFill::endDraw (const TQPoint &, const TQRect &) { mainWindow ()->commandHistory ()->addCommand (m_currentCommand, false /* no exec - we already did it up there */); @@ -175,7 +175,7 @@ kpToolFloodFillCommand::~kpToolFloodFillCommand () // public virtual [base kpCommand] -QString kpToolFloodFillCommand::name () const +TQString kpToolFloodFillCommand::name () const { return i18n ("Flood Fill"); } @@ -211,17 +211,17 @@ void kpToolFloodFillCommand::execute () } else { - QRect rect = kpFloodFill::boundingRect (); + TQRect rect = kpFloodFill::boundingRect (); if (rect.isValid ()) { - QApplication::setOverrideCursor (QCursor::waitCursor); + TQApplication::setOverrideCursor (TQCursor::waitCursor); m_oldPixmap = doc->getPixmapAt (rect); kpFloodFill::fill (); doc->slotContentsChanged (rect); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } else { @@ -246,7 +246,7 @@ void kpToolFloodFillCommand::unexecute () } else { - QRect rect = kpFloodFill::boundingRect (); + TQRect rect = kpFloodFill::boundingRect (); if (rect.isValid ()) { doc->setPixmapAt (m_oldPixmap, rect.topLeft ()); diff --git a/kolourpaint/tools/kptoolfloodfill.h b/kolourpaint/tools/kptoolfloodfill.h index a2eeaa5a..73f5aae2 100644 --- a/kolourpaint/tools/kptoolfloodfill.h +++ b/kolourpaint/tools/kptoolfloodfill.h @@ -29,7 +29,7 @@ #ifndef __kptoolfloodfill_h__ #define __kptoolfloodfill_h__ -#include <qpixmap.h> +#include <tqpixmap.h> #include <kpcommandhistory.h> @@ -37,7 +37,7 @@ #include <kptool.h> -class QString; +class TQString; class kpColor; @@ -54,15 +54,15 @@ public: virtual ~kpToolFloodFill (); private: - QString haventBegunDrawUserMessage () const; + TQString haventBegunDrawUserMessage () const; public: virtual void begin (); virtual void beginDraw (); - virtual void draw (const QPoint &thisPoint, const QPoint &, const QRect &); + virtual void draw (const TQPoint &thisPoint, const TQPoint &, const TQRect &); virtual void cancelShape (); virtual void releasedAllButtons (); - virtual void endDraw (const QPoint &, const QRect &); + virtual void endDraw (const TQPoint &, const TQRect &); private: kpToolFloodFillCommand *m_currentCommand; @@ -77,7 +77,7 @@ public: kpMainWindow *mainWindow); virtual ~kpToolFloodFillCommand (); - virtual QString name () const; + virtual TQString name () const; virtual int size () const; @@ -87,7 +87,7 @@ public: virtual void unexecute (); private: - QPixmap m_oldPixmap; + TQPixmap m_oldPixmap; bool m_fillEntirePixmap; }; diff --git a/kolourpaint/tools/kptoolpen.cpp b/kolourpaint/tools/kptoolpen.cpp index eb731ceb..b738060c 100644 --- a/kolourpaint/tools/kptoolpen.cpp +++ b/kolourpaint/tools/kptoolpen.cpp @@ -28,13 +28,13 @@ #define DEBUG_KP_TOOL_PEN 0 -#include <qapplication.h> -#include <qbitmap.h> -#include <qcursor.h> -#include <qimage.h> -#include <qpainter.h> +#include <tqapplication.h> +#include <tqbitmap.h> +#include <tqcursor.h> +#include <tqimage.h> +#include <tqpainter.h> #if DEBUG_KP_TOOL_PEN - #include <qdatetime.h> + #include <tqdatetime.h> #endif #include <kdebug.h> @@ -60,7 +60,7 @@ */ kpToolPen::kpToolPen (Mode mode, - const QString &text, const QString &description, + const TQString &text, const TQString &description, int key, kpMainWindow *mainWindow, const char *name) : kpTool (text, description, key, mainWindow, name), @@ -103,7 +103,7 @@ kpToolPen::~kpToolPen () // private -QString kpToolPen::haventBegunDrawUserMessage () const +TQString kpToolPen::haventBegunDrawUserMessage () const { switch (m_mode) { @@ -116,7 +116,7 @@ QString kpToolPen::haventBegunDrawUserMessage () const case ColorWasher: return i18n ("Click or drag to erase pixels of the foreground color."); default: - return QString::null; + return TQString::null; } } @@ -133,8 +133,8 @@ void kpToolPen::begin () if (m_mode & SquareBrushes) { m_toolWidgetEraserSize = tb->toolWidgetEraserSize (); - connect (m_toolWidgetEraserSize, SIGNAL (eraserSizeChanged (int)), - this, SLOT (slotEraserSizeChanged (int))); + connect (m_toolWidgetEraserSize, TQT_SIGNAL (eraserSizeChanged (int)), + this, TQT_SLOT (slotEraserSizeChanged (int))); m_toolWidgetEraserSize->show (); slotEraserSizeChanged (m_toolWidgetEraserSize->eraserSize ()); @@ -145,8 +145,8 @@ void kpToolPen::begin () if (m_mode & DiverseBrushes) { m_toolWidgetBrush = tb->toolWidgetBrush (); - connect (m_toolWidgetBrush, SIGNAL (brushChanged (const QPixmap &, bool)), - this, SLOT (slotBrushChanged (const QPixmap &, bool))); + connect (m_toolWidgetBrush, TQT_SIGNAL (brushChanged (const TQPixmap &, bool)), + this, TQT_SLOT (slotBrushChanged (const TQPixmap &, bool))); m_toolWidgetBrush->show (); slotBrushChanged (m_toolWidgetBrush->brush (), @@ -163,15 +163,15 @@ void kpToolPen::end () { if (m_toolWidgetEraserSize) { - disconnect (m_toolWidgetEraserSize, SIGNAL (eraserSizeChanged (int)), - this, SLOT (slotEraserSizeChanged (int))); + disconnect (m_toolWidgetEraserSize, TQT_SIGNAL (eraserSizeChanged (int)), + this, TQT_SLOT (slotEraserSizeChanged (int))); m_toolWidgetEraserSize = 0; } if (m_toolWidgetBrush) { - disconnect (m_toolWidgetBrush, SIGNAL (brushChanged (const QPixmap &, bool)), - this, SLOT (slotBrushChanged (const QPixmap &, bool))); + disconnect (m_toolWidgetBrush, TQT_SIGNAL (brushChanged (const TQPixmap &, bool)), + this, TQT_SLOT (slotBrushChanged (const TQPixmap &, bool))); m_toolWidgetBrush = 0; } @@ -224,7 +224,7 @@ void kpToolPen::beginDraw () } // virtual -void kpToolPen::hover (const QPoint &point) +void kpToolPen::hover (const TQPoint &point) { #if DEBUG_KP_TOOL_PEN && 0 kdDebug () << "kpToolPen::hover(" << point << ")" @@ -239,7 +239,7 @@ void kpToolPen::hover (const QPoint &point) m_mouseButton = 0; kpTempPixmap::RenderMode renderMode; - QPixmap cursorPixmapForTempPixmap = m_cursorPixmap; + TQPixmap cursorPixmapForTempPixmap = m_cursorPixmap; if (m_mode & SquareBrushes) renderMode = kpTempPixmap::SetPixmap; @@ -268,7 +268,7 @@ void kpToolPen::hover (const QPoint &point) #if DEBUG_KP_TOOL_PEN && 0 if (document ()->rect ().contains (point)) { - QImage image = kpPixmapFX::convertToImage (*document ()->pixmap ()); + TQImage image = kpPixmapFX::convertToImage (*document ()->pixmap ()); QRgb v = image.pixel (point.x (), point.y ()); kdDebug () << "(" << point << "): r=" << qRed (v) @@ -282,18 +282,18 @@ void kpToolPen::hover (const QPoint &point) setUserShapePoints (point); } -bool kpToolPen::wash (QPainter *painter, QPainter *maskPainter, - const QImage &image, +bool kpToolPen::wash (TQPainter *painter, TQPainter *maskPainter, + const TQImage &image, const kpColor &colorToReplace, - const QRect &imageRect, int plotx, int ploty) + const TQRect &imageRect, int plotx, int ploty) { return wash (painter, maskPainter, image, colorToReplace, imageRect, hotRect (plotx, ploty)); } -bool kpToolPen::wash (QPainter *painter, QPainter *maskPainter, - const QImage &image, +bool kpToolPen::wash (TQPainter *painter, TQPainter *maskPainter, + const TQImage &image, const kpColor &colorToReplace, - const QRect &imageRect, const QRect &drawRect) + const TQRect &imageRect, const TQRect &drawRect) { bool didSomething = false; @@ -331,10 +331,10 @@ bool kpToolPen::wash (QPainter *painter, QPainter *maskPainter, #if DEBUG_KP_TOOL_PEN && 0 fprintf (stderr, "y=%i x=%i colorAtPixel=%08X colorToReplace=%08X ... ", y, x, - kpPixmapFX::getColorAtPixel (image, QPoint (x, y)).toQRgb (), + kpPixmapFX::getColorAtPixel (image, TQPoint (x, y)).toQRgb (), colorToReplace.toQRgb ()); #endif - if (kpPixmapFX::getColorAtPixel (image, QPoint (x, y)).isSimilarTo (colorToReplace, processedColorSimilarity ())) + if (kpPixmapFX::getColorAtPixel (image, TQPoint (x, y)).isSimilarTo (colorToReplace, processedColorSimilarity ())) { #if DEBUG_KP_TOOL_PEN && 0 fprintf (stderr, "similar\n"); @@ -383,13 +383,13 @@ void kpToolPen::globalDraw () if (foregroundColor () == backgroundColor () && processedColorSimilarity () == 0) return; - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); kpToolPenCommand *cmd = new kpToolPenCommand ( i18n ("Color Eraser"), mainWindow ()); - QPainter painter, maskPainter; - QBitmap maskBitmap; + TQPainter painter, maskPainter; + TQBitmap maskBitmap; if (backgroundColor ().isOpaque ()) { @@ -406,8 +406,8 @@ void kpToolPen::globalDraw () maskPainter.setPen (backgroundColor ().maskColor ()); } - const QImage image = kpPixmapFX::convertToImage (*document ()->pixmap ()); - QRect rect = document ()->rect (); + const TQImage image = kpPixmapFX::convertToImage (*document ()->pixmap ()); + TQRect rect = document ()->rect (); const bool didSomething = wash (&painter, &maskPainter, image, foregroundColor ()/*replace foreground*/, @@ -446,13 +446,13 @@ void kpToolPen::globalDraw () cmd = 0; } - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } } // virtual // TODO: refactor! -void kpToolPen::draw (const QPoint &thisPoint, const QPoint &lastPoint, const QRect &) +void kpToolPen::draw (const TQPoint &thisPoint, const TQPoint &lastPoint, const TQRect &) { if ((m_mode & WashesPixmaps) && (foregroundColor () == backgroundColor ()) && processedColorSimilarity () == 0) return; @@ -464,7 +464,7 @@ void kpToolPen::draw (const QPoint &thisPoint, const QPoint &lastPoint, const QR { if (m_mode & DrawsPixels) { - QPixmap pixmap (1, 1); + TQPixmap pixmap (1, 1); const kpColor c = color (m_mouseButton); @@ -475,7 +475,7 @@ void kpToolPen::draw (const QPoint &thisPoint, const QPoint &lastPoint, const QR } else { - QBitmap mask (1, 1); + TQBitmap mask (1, 1); mask.fill (Qt::color0/*transparent*/); pixmap.setMask (mask); @@ -505,22 +505,22 @@ void kpToolPen::draw (const QPoint &thisPoint, const QPoint &lastPoint, const QR { #if DEBUG_KP_TOOL_PEN kdDebug () << "Washing pixmap (immediate)" << endl; - QTime timer; + TQTime timer; #endif - QRect rect = hotRect (); + TQRect rect = hotRect (); #if DEBUG_KP_TOOL_PEN timer.start (); #endif - QPixmap pixmap = document ()->getPixmapAt (rect); + TQPixmap pixmap = document ()->getPixmapAt (rect); #if DEBUG_KP_TOOL_PEN kdDebug () << "\tget from doc: " << timer.restart () << "ms" << endl; #endif - const QImage image = kpPixmapFX::convertToImage (pixmap); + const TQImage image = kpPixmapFX::convertToImage (pixmap); #if DEBUG_KP_TOOL_PEN kdDebug () << "\tconvert to image: " << timer.restart () << "ms" << endl; #endif - QPainter painter, maskPainter; - QBitmap maskBitmap; + TQPainter painter, maskPainter; + TQBitmap maskBitmap; if (color (m_mouseButton).isOpaque ()) { @@ -576,7 +576,7 @@ void kpToolPen::draw (const QPoint &thisPoint, const QPoint &lastPoint, const QR else { // find bounding rectangle - QRect rect = QRect (thisPoint, lastPoint).normalize (); + TQRect rect = TQRect (thisPoint, lastPoint).normalize (); if (m_mode != DrawsPixels) rect = neededRect (rect, m_brushPixmap [m_mouseButton].width ()); @@ -586,17 +586,17 @@ void kpToolPen::draw (const QPoint &thisPoint, const QPoint &lastPoint, const QR kdDebug () << "Washing pixmap (w=" << rect.width () << ",h=" << rect.height () << ")" << endl; } - QTime timer; + TQTime timer; int convAndWashTime; #endif const kpColor c = color (m_mouseButton); bool transparent = c.isTransparent (); - QPixmap pixmap = document ()->getPixmapAt (rect); - QBitmap maskBitmap; + TQPixmap pixmap = document ()->getPixmapAt (rect); + TQBitmap maskBitmap; - QPainter painter, maskPainter; + TQPainter painter, maskPainter; if (m_mode & (DrawsPixels | WashesPixmaps)) { @@ -614,7 +614,7 @@ void kpToolPen::draw (const QPoint &thisPoint, const QPoint &lastPoint, const QR } } - QImage image; + TQImage image; if (m_mode & WashesPixmaps) { #if DEBUG_KP_TOOL_PEN @@ -631,7 +631,7 @@ void kpToolPen::draw (const QPoint &thisPoint, const QPoint &lastPoint, const QR if (m_mode & DrawsPixels) { - QPoint sp = lastPoint - rect.topLeft (), ep = thisPoint - rect.topLeft (); + TQPoint sp = lastPoint - rect.topLeft (), ep = thisPoint - rect.topLeft (); if (painter.isActive ()) painter.drawLine (sp, ep); @@ -884,7 +884,7 @@ void kpToolPen::releasedAllButtons () } // virtual -void kpToolPen::endDraw (const QPoint &, const QRect &) +void kpToolPen::endDraw (const TQPoint &, const TQRect &) { m_currentCommand->finalize (); mainWindow ()->commandHistory ()->addCommand (m_currentCommand, false /* don't exec */); @@ -939,7 +939,7 @@ void kpToolPen::slotBackgroundColorChanged (const kpColor &col) } // private slot -void kpToolPen::slotBrushChanged (const QPixmap &pixmap, bool isDiagonalLine) +void kpToolPen::slotBrushChanged (const TQPixmap &pixmap, bool isDiagonalLine) { #if DEBUG_KP_TOOL_PEN kdDebug () << "kpToolPen::slotBrushChanged()" << endl; @@ -984,17 +984,17 @@ void kpToolPen::slotEraserSizeChanged (int size) updateBrushCursor (); } -QPoint kpToolPen::hotPoint () const +TQPoint kpToolPen::hotPoint () const { return hotPoint (m_currentPoint); } -QPoint kpToolPen::hotPoint (int x, int y) const +TQPoint kpToolPen::hotPoint (int x, int y) const { - return hotPoint (QPoint (x, y)); + return hotPoint (TQPoint (x, y)); } -QPoint kpToolPen::hotPoint (const QPoint &point) const +TQPoint kpToolPen::hotPoint (const TQPoint &point) const { /* * e.g. @@ -1005,24 +1005,24 @@ QPoint kpToolPen::hotPoint (const QPoint &point) const * Center */ return point - - QPoint (m_brushPixmap [m_mouseButton].width () / 2, + TQPoint (m_brushPixmap [m_mouseButton].width () / 2, m_brushPixmap [m_mouseButton].height () / 2); } -QRect kpToolPen::hotRect () const +TQRect kpToolPen::hotRect () const { return hotRect (m_currentPoint); } -QRect kpToolPen::hotRect (int x, int y) const +TQRect kpToolPen::hotRect (int x, int y) const { - return hotRect (QPoint (x, y)); + return hotRect (TQPoint (x, y)); } -QRect kpToolPen::hotRect (const QPoint &point) const +TQRect kpToolPen::hotRect (const TQPoint &point) const { - QPoint topLeft = hotPoint (point); - return QRect (topLeft.x (), + TQPoint topLeft = hotPoint (point); + return TQRect (topLeft.x (), topLeft.y (), m_brushPixmap [m_mouseButton].width (), m_brushPixmap [m_mouseButton].height ()); @@ -1051,7 +1051,7 @@ void kpToolPen::updateBrushCursor (bool recalc) * kpToolPenCommand */ -kpToolPenCommand::kpToolPenCommand (const QString &name, kpMainWindow *mainWindow) +kpToolPenCommand::kpToolPenCommand (const TQString &name, kpMainWindow *mainWindow) : kpNamedCommand (name, mainWindow), m_pixmap (*document ()->pixmap ()) { @@ -1087,7 +1087,7 @@ void kpToolPenCommand::swapOldAndNew () { if (m_boundingRect.isValid ()) { - QPixmap oldPixmap = document ()->getPixmapAt (m_boundingRect); + TQPixmap oldPixmap = document ()->getPixmapAt (m_boundingRect); document ()->setPixmapAt (m_pixmap, m_boundingRect.topLeft ()); @@ -1096,13 +1096,13 @@ void kpToolPenCommand::swapOldAndNew () } // public -void kpToolPenCommand::updateBoundingRect (const QPoint &point) +void kpToolPenCommand::updateBoundingRect (const TQPoint &point) { - updateBoundingRect (QRect (point, point)); + updateBoundingRect (TQRect (point, point)); } // public -void kpToolPenCommand::updateBoundingRect (const QRect &rect) +void kpToolPenCommand::updateBoundingRect (const TQRect &rect) { #if DEBUG_KP_TOOL_PEN & 0 kdDebug () << "kpToolPenCommand::updateBoundingRect() existing=" diff --git a/kolourpaint/tools/kptoolpen.h b/kolourpaint/tools/kptoolpen.h index f57eb367..6bf8976a 100644 --- a/kolourpaint/tools/kptoolpen.h +++ b/kolourpaint/tools/kptoolpen.h @@ -29,14 +29,14 @@ #ifndef __kptoolpen_h__ #define __kptoolpen_h__ -#include <qpixmap.h> -#include <qrect.h> +#include <tqpixmap.h> +#include <tqrect.h> #include <kpcommandhistory.h> #include <kptool.h> -class QPoint; -class QString; +class TQPoint; +class TQString; class kpColor; class kpMainWindow; @@ -71,7 +71,7 @@ public: ColorWasher = WashesPixmaps | SquareBrushes | SwappedColors }; - kpToolPen (Mode mode, const QString &text, const QString &description, + kpToolPen (Mode mode, const TQString &text, const TQString &description, int key, kpMainWindow *mainWindow, const char *name); kpToolPen (kpMainWindow *mainWindow); @@ -80,45 +80,45 @@ public: void setMode (Mode mode); private: - QString haventBegunDrawUserMessage () const; + TQString haventBegunDrawUserMessage () const; public: virtual void begin (); virtual void end (); virtual void beginDraw (); - virtual void hover (const QPoint &point); + virtual void hover (const TQPoint &point); virtual void globalDraw (); - virtual void draw (const QPoint &thisPoint, const QPoint &lastPoint, const QRect &); + virtual void draw (const TQPoint &thisPoint, const TQPoint &lastPoint, const TQRect &); virtual void cancelShape (); virtual void releasedAllButtons (); - virtual void endDraw (const QPoint &, const QRect &); + virtual void endDraw (const TQPoint &, const TQRect &); private slots: virtual void slotForegroundColorChanged (const kpColor &col); virtual void slotBackgroundColorChanged (const kpColor &col); - void slotBrushChanged (const QPixmap &pixmap, bool isDiagonalLine); + void slotBrushChanged (const TQPixmap &pixmap, bool isDiagonalLine); void slotEraserSizeChanged (int size); private: - bool wash (QPainter *painter, QPainter *maskPainter, - const QImage &image, + bool wash (TQPainter *painter, TQPainter *maskPainter, + const TQImage &image, const kpColor &colorToReplace, - const QRect &imageRect, int plotx, int ploty); - bool wash (QPainter *painter, QPainter *maskPainter, - const QImage &image, + const TQRect &imageRect, int plotx, int ploty); + bool wash (TQPainter *painter, TQPainter *maskPainter, + const TQImage &image, const kpColor &colorToReplace, - const QRect &imageRect, const QRect &drawRect); + const TQRect &imageRect, const TQRect &drawRect); kpColor color (int which); - QPoint hotPoint () const; - QPoint hotPoint (int x, int y) const; - QPoint hotPoint (const QPoint &point) const; - QRect hotRect () const; - QRect hotRect (int x, int y) const; - QRect hotRect (const QPoint &point) const; + TQPoint hotPoint () const; + TQPoint hotPoint (int x, int y) const; + TQPoint hotPoint (const TQPoint &point) const; + TQRect hotRect () const; + TQRect hotRect (int x, int y) const; + TQRect hotRect (const TQPoint &point) const; Mode m_mode; @@ -126,8 +126,8 @@ private: kpToolWidgetBrush *m_toolWidgetBrush; kpToolWidgetEraserSize *m_toolWidgetEraserSize; - QPixmap m_brushPixmap [2]; - QPixmap m_cursorPixmap; + TQPixmap m_brushPixmap [2]; + TQPixmap m_cursorPixmap; bool m_brushIsDiagonalLine; kpToolPenCommand *m_currentCommand; @@ -136,7 +136,7 @@ private: class kpToolPenCommand : public kpNamedCommand { public: - kpToolPenCommand (const QString &name, kpMainWindow *mainWindow); + kpToolPenCommand (const TQString &name, kpMainWindow *mainWindow); virtual ~kpToolPenCommand (); virtual int size () const; @@ -145,16 +145,16 @@ public: virtual void unexecute (); // interface for KToolPen - void updateBoundingRect (const QPoint &point); - void updateBoundingRect (const QRect &rect); + void updateBoundingRect (const TQPoint &point); + void updateBoundingRect (const TQRect &rect); void finalize (); void cancel (); private: void swapOldAndNew (); - QPixmap m_pixmap; - QRect m_boundingRect; + TQPixmap m_pixmap; + TQRect m_boundingRect; }; #endif // __kptoolpen_h__ diff --git a/kolourpaint/tools/kptoolpolygon.cpp b/kolourpaint/tools/kptoolpolygon.cpp index fb68745c..56c7941d 100644 --- a/kolourpaint/tools/kptoolpolygon.cpp +++ b/kolourpaint/tools/kptoolpolygon.cpp @@ -33,15 +33,15 @@ #include <float.h> #include <math.h> -#include <qbitmap.h> -#include <qcursor.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qpoint.h> -#include <qpushbutton.h> -#include <qrect.h> -#include <qtooltip.h> -#include <qvbuttongroup.h> +#include <tqbitmap.h> +#include <tqcursor.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqpoint.h> +#include <tqpushbutton.h> +#include <tqrect.h> +#include <tqtooltip.h> +#include <tqvbuttongroup.h> #include <kdebug.h> #include <klocale.h> @@ -58,16 +58,16 @@ #if DEBUG_KP_TOOL_POLYGON -static const char *pointArrayToString (const QPointArray &pointArray) +static const char *pointArrayToString (const TQPointArray &pointArray) { static char string [1000]; string [0] = '\0'; - for (QPointArray::ConstIterator it = pointArray.begin (); + for (TQPointArray::ConstIterator it = pointArray.begin (); it != pointArray.end (); it++) { - QString ps = QString (" (%1, %2)").arg ((*it).x ()).arg ((*it).y ()); + TQString ps = TQString (" (%1, %2)").arg ((*it).x ()).arg ((*it).y ()); const char *pss = ps.latin1 (); if (strlen (string) + strlen (pss) + 1 > sizeof (string) / sizeof (string [0])) break; @@ -79,18 +79,18 @@ static const char *pointArrayToString (const QPointArray &pointArray) #endif -static QPen makeMaskPen (const kpColor &color, int lineWidth, Qt::PenStyle lineStyle) +static TQPen makeMaskPen (const kpColor &color, int lineWidth, Qt::PenStyle lineStyle) { - return QPen (color.maskColor (), + return TQPen (color.maskColor (), lineWidth == 1 ? 0/*closer to looking width 1*/ : lineWidth, lineStyle, Qt::RoundCap, Qt::RoundJoin); } -static QPen makePen (const kpColor &color, int lineWidth, Qt::PenStyle lineStyle) +static TQPen makePen (const kpColor &color, int lineWidth, Qt::PenStyle lineStyle) { if (color.isOpaque ()) { - return QPen (color.toQColor (), + return TQPen (color.toQColor (), lineWidth == 1 ? 0/*closer to looking width 1*/ : lineWidth, lineStyle, Qt::RoundCap, Qt::RoundJoin); } @@ -98,7 +98,7 @@ static QPen makePen (const kpColor &color, int lineWidth, Qt::PenStyle lineStyle return Qt::NoPen; } -static QBrush makeMaskBrush (const kpColor &foregroundColor, +static TQBrush makeMaskBrush (const kpColor &foregroundColor, const kpColor &backgroundColor, kpToolWidgetFillStyle *toolWidgetFillStyle) { @@ -108,7 +108,7 @@ static QBrush makeMaskBrush (const kpColor &foregroundColor, return Qt::NoBrush; } -static QBrush makeBrush (const kpColor &foregroundColor, +static TQBrush makeBrush (const kpColor &foregroundColor, const kpColor &backgroundColor, kpToolWidgetFillStyle *toolWidgetFillStyle) { @@ -118,7 +118,7 @@ static QBrush makeBrush (const kpColor &foregroundColor, return Qt::NoBrush; } -static bool only1PixelInPointArray (const QPointArray &points) +static bool only1PixelInPointArray (const TQPointArray &points) { if (points.count () == 0) return false; @@ -132,8 +132,8 @@ static bool only1PixelInPointArray (const QPointArray &points) return true; } -static QPixmap pixmap (const QPixmap &oldPixmap, - const QPointArray &points, const QRect &rect, +static TQPixmap pixmap (const TQPixmap &oldPixmap, + const TQPointArray &points, const TQRect &rect, const kpColor &foregroundColor, kpColor backgroundColor, int lineWidth, Qt::PenStyle lineStyle, kpToolWidgetFillStyle *toolWidgetFillStyle, @@ -142,7 +142,7 @@ static QPixmap pixmap (const QPixmap &oldPixmap, // // figure out points to draw relative to topLeft of oldPixmap - QPointArray pointsInRect = points; + TQPointArray pointsInRect = points; pointsInRect.detach (); pointsInRect.translate (-rect.x (), -rect.y ()); @@ -154,15 +154,15 @@ static QPixmap pixmap (const QPixmap &oldPixmap, // // draw - QPen pen = makePen (foregroundColor, lineWidth, lineStyle), + TQPen pen = makePen (foregroundColor, lineWidth, lineStyle), maskPen = makeMaskPen (foregroundColor, lineWidth, lineStyle); - QBrush brush = makeBrush (foregroundColor, backgroundColor, toolWidgetFillStyle), + TQBrush brush = makeBrush (foregroundColor, backgroundColor, toolWidgetFillStyle), maskBrush = makeMaskBrush (foregroundColor, backgroundColor, toolWidgetFillStyle); - QPixmap pixmap = oldPixmap; - QBitmap maskBitmap; + TQPixmap pixmap = oldPixmap; + TQBitmap maskBitmap; - QPainter painter, maskPainter; + TQPainter painter, maskPainter; if (pixmap.mask () || (maskPen.style () != Qt::NoPen && @@ -233,7 +233,7 @@ static QPixmap pixmap (const QPixmap &oldPixmap, { if (painter.isActive ()) { - QPen XORpen = painter.pen (); + TQPen XORpen = painter.pen (); XORpen.setColor (Qt::white); painter.setPen (XORpen); @@ -242,7 +242,7 @@ static QPixmap pixmap (const QPixmap &oldPixmap, if (maskPainter.isActive ()) { - QPen XORpen = maskPainter.pen (); + TQPen XORpen = maskPainter.pen (); // TODO??? #if 0 @@ -261,7 +261,7 @@ static QPixmap pixmap (const QPixmap &oldPixmap, break; case kpToolPolygon::Curve: int numPoints = pointsInRect.count (); - QPointArray pa (4); + TQPointArray pa (4); pa [0] = pointsInRect [0]; pa [3] = pointsInRect [1]; @@ -303,7 +303,7 @@ static QPixmap pixmap (const QPixmap &oldPixmap, */ kpToolPolygon::kpToolPolygon (Mode mode, - const QString &text, const QString &description, + const TQString &text, const TQString &description, int key, kpMainWindow *mainWindow, const char *name) : kpTool (text, description, key, mainWindow, name), @@ -334,7 +334,7 @@ void kpToolPolygon::setMode (Mode m) // private -QString kpToolPolygon::haventBegunShapeUserMessage () const +TQString kpToolPolygon::haventBegunShapeUserMessage () const { switch (m_mode) { @@ -346,7 +346,7 @@ QString kpToolPolygon::haventBegunShapeUserMessage () const case Curve: return i18n ("Drag out the start and end points."); default: - return QString::null; + return TQString::null; } } @@ -370,11 +370,11 @@ void kpToolPolygon::begin () if (m_toolWidgetFillStyle) { - connect (m_toolWidgetFillStyle, SIGNAL (fillStyleChanged (kpToolWidgetFillStyle::FillStyle)), - this, SLOT (slotFillStyleChanged (kpToolWidgetFillStyle::FillStyle))); + connect (m_toolWidgetFillStyle, TQT_SIGNAL (fillStyleChanged (kpToolWidgetFillStyle::FillStyle)), + this, TQT_SLOT (slotFillStyleChanged (kpToolWidgetFillStyle::FillStyle))); } - connect (m_toolWidgetLineWidth, SIGNAL (lineWidthChanged (int)), - this, SLOT (slotLineWidthChanged (int))); + connect (m_toolWidgetLineWidth, TQT_SIGNAL (lineWidthChanged (int)), + this, TQT_SLOT (slotLineWidthChanged (int))); if (m_toolWidgetFillStyle) m_toolWidgetFillStyle->show (); @@ -390,7 +390,7 @@ void kpToolPolygon::begin () m_lineWidth = 1; } - viewManager ()->setCursor (QCursor (CrossCursor)); + viewManager ()->setCursor (TQCursor (CrossCursor)); m_originatingMouseButton = -1; @@ -404,15 +404,15 @@ void kpToolPolygon::end () if (m_toolWidgetFillStyle) { - disconnect (m_toolWidgetFillStyle, SIGNAL (fillStyleChanged (kpToolWidgetFillStyle::FillStyle)), - this, SLOT (slotFillStyleChanged (kpToolWidgetFillStyle::FillStyle))); + disconnect (m_toolWidgetFillStyle, TQT_SIGNAL (fillStyleChanged (kpToolWidgetFillStyle::FillStyle)), + this, TQT_SLOT (slotFillStyleChanged (kpToolWidgetFillStyle::FillStyle))); m_toolWidgetFillStyle = 0; } if (m_toolWidgetLineWidth) { - disconnect (m_toolWidgetLineWidth, SIGNAL (lineWidthChanged (int)), - this, SLOT (slotLineWidthChanged (int))); + disconnect (m_toolWidgetLineWidth, TQT_SIGNAL (lineWidthChanged (int)), + this, TQT_SLOT (slotLineWidthChanged (int))); m_toolWidgetLineWidth = 0; } @@ -549,13 +549,13 @@ void kpToolPolygon::applyModifiers () if (fabs (KP_RADIANS_TO_DEGREES (angle) - 0) < kpPixmapFX::AngleInDegreesEpsilon) { - m_toolLineEndPoint = QPoint (m_toolLineEndPoint.x (), m_toolLineStartPoint.y ()); + m_toolLineEndPoint = TQPoint (m_toolLineEndPoint.x (), m_toolLineStartPoint.y ()); } // vertical (dist from start !maintained) else if (fabs (KP_RADIANS_TO_DEGREES (angle) - 90) < kpPixmapFX::AngleInDegreesEpsilon) { - m_toolLineEndPoint = QPoint (m_toolLineStartPoint.x (), m_toolLineEndPoint.y ()); + m_toolLineEndPoint = TQPoint (m_toolLineStartPoint.x (), m_toolLineEndPoint.y ()); } // diagonal (dist from start maintained) else @@ -569,7 +569,7 @@ void kpToolPolygon::applyModifiers () const int newdy = qRound (dist * sin (angle) * sgn (diffy)); #undef sgn - m_toolLineEndPoint = QPoint (m_toolLineStartPoint.x () + newdx, + m_toolLineEndPoint = TQPoint (m_toolLineStartPoint.x () + newdx, m_toolLineStartPoint.y () + newdy); #if DEBUG_KP_TOOL_POLYGON && 1 @@ -597,12 +597,12 @@ void kpToolPolygon::applyModifiers () m_points [count - 2] = m_toolLineStartPoint; m_points [count - 1] = m_toolLineEndPoint; - m_toolLineRect = kpTool::neededRect (QRect (m_toolLineStartPoint, m_toolLineEndPoint).normalize (), + m_toolLineRect = kpTool::neededRect (TQRect (m_toolLineStartPoint, m_toolLineEndPoint).normalize (), m_lineWidth); } // virtual -void kpToolPolygon::draw (const QPoint &, const QPoint &, const QRect &) +void kpToolPolygon::draw (const TQPoint &, const TQPoint &, const TQRect &) { if (m_points.count () == 0) return; @@ -638,7 +638,7 @@ void kpToolPolygon::updateShape () if (m_points.count () == 0) return; - QRect boundingRect = kpTool::neededRect (m_points.boundingRect (), m_lineWidth); + TQRect boundingRect = kpTool::neededRect (m_points.boundingRect (), m_lineWidth); #if DEBUG_KP_TOOL_POLYGON kdDebug () << "kpToolPolygon::updateShape() boundingRect=" @@ -648,8 +648,8 @@ void kpToolPolygon::updateShape () << endl; #endif - QPixmap oldPixmap = document ()->getPixmapAt (boundingRect); - QPixmap newPixmap = pixmap (oldPixmap, + TQPixmap oldPixmap = document ()->getPixmapAt (boundingRect); + TQPixmap newPixmap = pixmap (oldPixmap, m_points, boundingRect, color (m_mouseButton), color (1 - m_mouseButton), m_lineWidth, Qt::SolidLine, @@ -668,7 +668,7 @@ void kpToolPolygon::updateShape () void kpToolPolygon::cancelShape () { #if 0 - endDraw (QPoint (), QRect ()); + endDraw (TQPoint (), TQRect ()); commandHistory ()->undo (); #else viewManager ()->invalidateTempPixmap (); @@ -687,7 +687,7 @@ void kpToolPolygon::releasedAllButtons () } // virtual -void kpToolPolygon::endDraw (const QPoint &, const QRect &) +void kpToolPolygon::endDraw (const TQPoint &, const TQRect &) { #if DEBUG_KP_TOOL_POLYGON kdDebug () << "kpToolPolygon::endDraw() m_points=" << pointArrayToString (m_points) << endl; @@ -772,7 +772,7 @@ void kpToolPolygon::endDraw (const QPoint &, const QRect &) } // public virtual -void kpToolPolygon::endShape (const QPoint &, const QRect &) +void kpToolPolygon::endShape (const TQPoint &, const TQRect &) { #if DEBUG_KP_TOOL_POLYGON kdDebug () << "kpToolPolygon::endShape() m_points=" << pointArrayToString (m_points) << endl; @@ -783,7 +783,7 @@ void kpToolPolygon::endShape (const QPoint &, const QRect &) viewManager ()->invalidateTempPixmap (); - QRect boundingRect = kpTool::neededRect (m_points.boundingRect (), m_lineWidth); + TQRect boundingRect = kpTool::neededRect (m_points.boundingRect (), m_lineWidth); kpToolPolygonCommand *lineCommand = new kpToolPolygonCommand @@ -840,13 +840,13 @@ void kpToolPolygon::slotBackgroundColorChanged (const kpColor &) * kpToolPolygonCommand */ -kpToolPolygonCommand::kpToolPolygonCommand (const QString &name, - const QPointArray &points, - const QRect &normalizedRect, +kpToolPolygonCommand::kpToolPolygonCommand (const TQString &name, + const TQPointArray &points, + const TQRect &normalizedRect, const kpColor &foregroundColor, const kpColor &backgroundColor, int lineWidth, Qt::PenStyle lineStyle, kpToolWidgetFillStyle *toolWidgetFillStyle, - const QPixmap &originalArea, + const TQPixmap &originalArea, enum kpToolPolygon::Mode mode, kpMainWindow *mainWindow) : kpNamedCommand (name, mainWindow), @@ -877,7 +877,7 @@ int kpToolPolygonCommand::size () const // public virtual [base kpCommand] void kpToolPolygonCommand::execute () { - QPixmap p = pixmap (m_originalArea, + TQPixmap p = pixmap (m_originalArea, m_points, m_normalizedRect, m_foregroundColor, m_backgroundColor, m_lineWidth, m_lineStyle, diff --git a/kolourpaint/tools/kptoolpolygon.h b/kolourpaint/tools/kptoolpolygon.h index 456dc4c0..289fb9ab 100644 --- a/kolourpaint/tools/kptoolpolygon.h +++ b/kolourpaint/tools/kptoolpolygon.h @@ -29,13 +29,13 @@ #ifndef __kptoolpolygon_h__ #define __kptoolpolygon_h__ -#include <qbrush.h> -#include <qpen.h> -#include <qobject.h> -#include <qpixmap.h> -#include <qpoint.h> -#include <qpointarray.h> -#include <qrect.h> +#include <tqbrush.h> +#include <tqpen.h> +#include <tqobject.h> +#include <tqpixmap.h> +#include <tqpoint.h> +#include <tqpointarray.h> +#include <tqrect.h> #include <kpcommandhistory.h> @@ -43,11 +43,11 @@ #include <kptool.h> #include <kptoolwidgetfillstyle.h> -class QMouseEvent; -class QPen; -class QPoint; -class QRect; -class QString; +class TQMouseEvent; +class TQPen; +class TQPoint; +class TQRect; +class TQString; class kpView; class kpDocument; @@ -67,7 +67,7 @@ public: Polygon, Polyline, Line, Curve }; - kpToolPolygon (Mode mode, const QString &text, const QString &description, + kpToolPolygon (Mode mode, const TQString &text, const TQString &description, int key, kpMainWindow *mainWindow, const char *name); kpToolPolygon (kpMainWindow *mainWindow); @@ -78,18 +78,18 @@ public: virtual bool careAboutModifierState () const { return true; } private: - QString haventBegunShapeUserMessage () const; + TQString haventBegunShapeUserMessage () const; public: virtual void begin (); virtual void end (); virtual void beginDraw (); - virtual void draw (const QPoint &, const QPoint &, const QRect &); + virtual void draw (const TQPoint &, const TQPoint &, const TQRect &); virtual void cancelShape (); virtual void releasedAllButtons (); - virtual void endDraw (const QPoint &, const QRect &); - virtual void endShape (const QPoint & = QPoint (), const QRect & = QRect ()); + virtual void endDraw (const TQPoint &, const TQRect &); + virtual void endShape (const TQPoint & = TQPoint (), const TQRect & = TQRect ()); virtual bool hasBegunShape () const; @@ -116,22 +116,22 @@ private: void applyModifiers (); - QPoint m_toolLineStartPoint, m_toolLineEndPoint; - QRect m_toolLineRect; + TQPoint m_toolLineStartPoint, m_toolLineEndPoint; + TQRect m_toolLineRect; - QPointArray m_points; + TQPointArray m_points; }; class kpToolPolygonCommand : public kpNamedCommand { public: - kpToolPolygonCommand (const QString &name, - const QPointArray &points, - const QRect &normalizedRect, + kpToolPolygonCommand (const TQString &name, + const TQPointArray &points, + const TQRect &normalizedRect, const kpColor &foregroundColor, const kpColor &backgroundColor, int lineWidth, Qt::PenStyle lineStyle, kpToolWidgetFillStyle *toolWidgetFillStyle, - const QPixmap &originalArea, + const TQPixmap &originalArea, kpToolPolygon::Mode mode, kpMainWindow *mainWindow); virtual ~kpToolPolygonCommand (); @@ -142,15 +142,15 @@ public: virtual void unexecute (); private: - QPointArray m_points; - QRect m_normalizedRect; + TQPointArray m_points; + TQRect m_normalizedRect; kpColor m_foregroundColor, m_backgroundColor; int m_lineWidth; Qt::PenStyle m_lineStyle; kpToolWidgetFillStyle *m_toolWidgetFillStyle; - QPixmap m_originalArea; + TQPixmap m_originalArea; kpToolPolygon::Mode m_mode; }; diff --git a/kolourpaint/tools/kptoolpreviewdialog.cpp b/kolourpaint/tools/kptoolpreviewdialog.cpp index 23149232..5149664b 100644 --- a/kolourpaint/tools/kptoolpreviewdialog.cpp +++ b/kolourpaint/tools/kptoolpreviewdialog.cpp @@ -29,11 +29,11 @@ #include <kptoolpreviewdialog.h> -#include <qapplication.h> -#include <qlayout.h> -#include <qgroupbox.h> -#include <qlabel.h> -#include <qpushbutton.h> +#include <tqapplication.h> +#include <tqlayout.h> +#include <tqgroupbox.h> +#include <tqlabel.h> +#include <tqpushbutton.h> #include <kdebug.h> #include <klocale.h> @@ -48,8 +48,8 @@ kpToolPreviewDialog::kpToolPreviewDialog (Features features, bool reserveTopRow, - const QString &caption, - const QString &afterActionText, + const TQString &caption, + const TQString &afterActionText, bool actOnSelection, kpMainWindow *parent, const char *name) @@ -65,7 +65,7 @@ kpToolPreviewDialog::kpToolPreviewDialog (Features features, m_previewPixmapLabel (0), m_gridLayout (0) { - QWidget *baseWidget = new QWidget (this); + TQWidget *baseWidget = new TQWidget (this); setMainWidget (baseWidget); @@ -87,7 +87,7 @@ kpToolPreviewDialog::kpToolPreviewDialog (Features features, createPreviewGroupBox (); - m_gridLayout = new QGridLayout (baseWidget, 4, 2, + m_gridLayout = new TQGridLayout (baseWidget, 4, 2, 0/*margin*/, spacingHint ()); m_gridNumRows = reserveTopRow ? 1 : 0; if (m_dimensionsGroupBox || m_previewGroupBox) @@ -123,10 +123,10 @@ kpToolPreviewDialog::~kpToolPreviewDialog () // private void kpToolPreviewDialog::createDimensionsGroupBox () { - m_dimensionsGroupBox = new QGroupBox (i18n ("Dimensions"), mainWidget ()); + m_dimensionsGroupBox = new TQGroupBox (i18n ("Dimensions"), mainWidget ()); - QLabel *originalLabel = new QLabel (i18n ("Original:"), m_dimensionsGroupBox); - QString originalDimensions; + TQLabel *originalLabel = new TQLabel (i18n ("Original:"), m_dimensionsGroupBox); + TQString originalDimensions; if (document ()) { originalDimensions = i18n ("%1 x %2") @@ -134,18 +134,18 @@ void kpToolPreviewDialog::createDimensionsGroupBox () .arg (m_oldHeight); // Stop the Dimensions Group Box from resizing so often - const QString minimumLengthString ("100000 x 100000"); + const TQString minimumLengthString ("100000 x 100000"); const int padLength = minimumLengthString.length (); for (int i = originalDimensions.length (); i < padLength; i++) originalDimensions += " "; } - QLabel *originalDimensionsLabel = new QLabel (originalDimensions, m_dimensionsGroupBox); + TQLabel *originalDimensionsLabel = new TQLabel (originalDimensions, m_dimensionsGroupBox); - QLabel *afterTransformLabel = new QLabel (m_afterActionText, m_dimensionsGroupBox); - m_afterTransformDimensionsLabel = new QLabel (m_dimensionsGroupBox); + TQLabel *afterTransformLabel = new TQLabel (m_afterActionText, m_dimensionsGroupBox); + m_afterTransformDimensionsLabel = new TQLabel (m_dimensionsGroupBox); - QGridLayout *dimensionsLayout = new QGridLayout (m_dimensionsGroupBox, + TQGridLayout *dimensionsLayout = new TQGridLayout (m_dimensionsGroupBox, 2, 2, marginHint () * 2, spacingHint ()); @@ -158,20 +158,20 @@ void kpToolPreviewDialog::createDimensionsGroupBox () // private void kpToolPreviewDialog::createPreviewGroupBox () { - m_previewGroupBox = new QGroupBox (i18n ("Preview"), mainWidget ()); + m_previewGroupBox = new TQGroupBox (i18n ("Preview"), mainWidget ()); m_previewPixmapLabel = new kpResizeSignallingLabel (m_previewGroupBox); m_previewPixmapLabel->setMinimumSize (150, 110); - connect (m_previewPixmapLabel, SIGNAL (resized ()), - this, SLOT (updatePreview ())); + connect (m_previewPixmapLabel, TQT_SIGNAL (resized ()), + this, TQT_SLOT (updatePreview ())); - QPushButton *updatePushButton = new QPushButton (i18n ("&Update"), + TQPushButton *updatePushButton = new TQPushButton (i18n ("&Update"), m_previewGroupBox); - connect (updatePushButton, SIGNAL (clicked ()), - this, SLOT (slotUpdateWithWaitCursor ())); + connect (updatePushButton, TQT_SIGNAL (clicked ()), + this, TQT_SLOT (slotUpdateWithWaitCursor ())); - QVBoxLayout *previewLayout = new QVBoxLayout (m_previewGroupBox, + TQVBoxLayout *previewLayout = new TQVBoxLayout (m_previewGroupBox, marginHint () * 2, QMAX (1, spacingHint () / 2)); @@ -188,13 +188,13 @@ kpDocument *kpToolPreviewDialog::document () const // protected -void kpToolPreviewDialog::addCustomWidgetToFront (QWidget *w) +void kpToolPreviewDialog::addCustomWidgetToFront (TQWidget *w) { m_gridLayout->addMultiCellWidget (w, 0, 0, 0, 1); } // protected -void kpToolPreviewDialog::addCustomWidget (QWidget *w) +void kpToolPreviewDialog::addCustomWidget (TQWidget *w) { m_gridLayout->addMultiCellWidget (w, m_gridNumRows, m_gridNumRows, 0, 1); m_gridNumRows++; @@ -211,12 +211,12 @@ void kpToolPreviewDialog::updateDimensions () if (!doc) return; - QSize newDim = newDimensions (); + TQSize newDim = newDimensions (); #if DEBUG_KP_TOOL_PREVIEW_DIALOG kdDebug () << "kpToolPreviewDialog::updateDimensions(): newDim=" << newDim << endl; #endif - QString newDimString = i18n ("%1 x %2") + TQString newDimString = i18n ("%1 x %2") .arg (newDim.width ()) .arg (newDim.height ()); m_afterTransformDimensionsLabel->setText (newDimString); @@ -283,7 +283,7 @@ void kpToolPreviewDialog::updateShrukenDocumentPixmap () m_oldWidth, m_oldHeight); - QPixmap pixmap; + TQPixmap pixmap; if (m_actOnSelection) { @@ -337,7 +337,7 @@ void kpToolPreviewDialog::updatePreview () if (!m_shrunkenDocumentPixmap.isNull ()) { - QSize newDim = newDimensions (); + TQSize newDim = newDimensions (); double keepsAspectScale = aspectScale (m_previewPixmapLabel->width (), m_previewPixmapLabel->height (), newDim.width (), @@ -352,12 +352,12 @@ void kpToolPreviewDialog::updatePreview () 1, // min m_previewPixmapLabel->height ()); // max - // TODO: Some effects work directly on QImage; so could cache the - // QImage so that transformPixmap() is faster - QPixmap transformedShrunkenDocumentPixmap = + // TODO: Some effects work directly on TQImage; so could cache the + // TQImage so that transformPixmap() is faster + TQPixmap transformedShrunkenDocumentPixmap = transformPixmap (m_shrunkenDocumentPixmap, targetWidth, targetHeight); - QPixmap previewPixmap (m_previewPixmapLabel->width (), + TQPixmap previewPixmap (m_previewPixmapLabel->width (), m_previewPixmapLabel->height ()); kpPixmapFX::fill (&previewPixmap, kpColor::transparent); kpPixmapFX::setPixmapAt (&previewPixmap, @@ -392,7 +392,7 @@ void kpToolPreviewDialog::updatePreview () m_previewPixmapLabel->repaint (false/*no erase*/); #if DEBUG_KP_TOOL_PREVIEW_DIALOG - kdDebug () << "\tafter QLabel::setPixmap() previewPixmapLabel: w=" + kdDebug () << "\tafter TQLabel::setPixmap() previewPixmapLabel: w=" << m_previewPixmapLabel->width () << " h=" << m_previewPixmapLabel->height () @@ -420,11 +420,11 @@ void kpToolPreviewDialog::slotUpdateWithWaitCursor () << endl; #endif - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); slotUpdate (); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } diff --git a/kolourpaint/tools/kptoolpreviewdialog.h b/kolourpaint/tools/kptoolpreviewdialog.h index 35efdc38..074a03ec 100644 --- a/kolourpaint/tools/kptoolpreviewdialog.h +++ b/kolourpaint/tools/kptoolpreviewdialog.h @@ -29,14 +29,14 @@ #define __kp_tool_preview_dialog_h__ -#include <qpixmap.h> +#include <tqpixmap.h> #include <kdialogbase.h> -class QLabel; -class QGridLayout; -class QGroupBox; +class TQLabel; +class TQGridLayout; +class TQGroupBox; class kpDocument; class kpMainWindow; @@ -58,9 +58,9 @@ public: kpToolPreviewDialog (Features features, bool reserveTopRow, // e.g. "Skew (Image|Selection)" - const QString &caption, + const TQString &caption, // (in the Dimensions Group Box) e.g. "After Skew:" - const QString &afterActionText, + const TQString &afterActionText, bool actOnSelection, kpMainWindow *parent, const char *name = 0); @@ -77,15 +77,15 @@ protected: kpDocument *document () const; // All widgets must have mainWidget() as their parent - void addCustomWidgetToFront (QWidget *w); // see <reserveTopRow> in ctor - void addCustomWidget (QWidget *w); - void addCustomWidgetToBack (QWidget *w) + void addCustomWidgetToFront (TQWidget *w); // see <reserveTopRow> in ctor + void addCustomWidget (TQWidget *w); + void addCustomWidgetToBack (TQWidget *w) { addCustomWidget (w); } - virtual QSize newDimensions () const = 0; - virtual QPixmap transformPixmap (const QPixmap &pixmap, + virtual TQSize newDimensions () const = 0; + virtual TQPixmap transformPixmap (const TQPixmap &pixmap, int targetWidth, int targetHeight) const = 0; private: @@ -109,21 +109,21 @@ protected slots: virtual void slotUpdateWithWaitCursor (); protected: - QString m_afterActionText; + TQString m_afterActionText; bool m_actOnSelection; kpMainWindow *m_mainWindow; int m_oldWidth, m_oldHeight; - QGroupBox *m_dimensionsGroupBox; - QLabel *m_afterTransformDimensionsLabel; + TQGroupBox *m_dimensionsGroupBox; + TQLabel *m_afterTransformDimensionsLabel; - QGroupBox *m_previewGroupBox; + TQGroupBox *m_previewGroupBox; kpResizeSignallingLabel *m_previewPixmapLabel; - QSize m_previewPixmapLabelSizeWhenUpdatedPixmap; - QPixmap m_shrunkenDocumentPixmap; + TQSize m_previewPixmapLabelSizeWhenUpdatedPixmap; + TQPixmap m_shrunkenDocumentPixmap; - QGridLayout *m_gridLayout; + TQGridLayout *m_gridLayout; int m_gridNumRows; }; diff --git a/kolourpaint/tools/kptoolrectangle.cpp b/kolourpaint/tools/kptoolrectangle.cpp index 275db667..2c717fee 100644 --- a/kolourpaint/tools/kptoolrectangle.cpp +++ b/kolourpaint/tools/kptoolrectangle.cpp @@ -28,10 +28,10 @@ #define DEBUG_KP_TOOL_RECTANGLE 0 -#include <qbitmap.h> -#include <qcursor.h> -#include <qevent.h> -#include <qpainter.h> +#include <tqbitmap.h> +#include <tqcursor.h> +#include <tqevent.h> +#include <tqpainter.h> #include <kdebug.h> #include <klocale.h> @@ -50,16 +50,16 @@ #include <kpview.h> #include <kpviewmanager.h> -static QPixmap pixmap (const kpToolRectangle::Mode mode, - kpDocument *document, const QRect &rect, - const QPoint &startPoint, const QPoint &endPoint, - const QPen &pen, const QPen &maskPen, - const QBrush &brush, const QBrush &maskBrush) +static TQPixmap pixmap (const kpToolRectangle::Mode mode, + kpDocument *document, const TQRect &rect, + const TQPoint &startPoint, const TQPoint &endPoint, + const TQPen &pen, const TQPen &maskPen, + const TQBrush &brush, const TQBrush &maskBrush) { - QPixmap pixmap = document->getPixmapAt (rect); - QBitmap maskBitmap; + TQPixmap pixmap = document->getPixmapAt (rect); + TQBitmap maskBitmap; - QPainter painter, maskPainter; + TQPainter painter, maskPainter; #if DEBUG_KP_TOOL_RECTANGLE && 1 kdDebug () << "pixmap: rect=" << rect @@ -116,13 +116,13 @@ static QPixmap pixmap (const kpToolRectangle::Mode mode, switch (mode) { case kpToolRectangle::Rectangle: - PAINTER_CALL (drawRect (QRect (startPoint - rect.topLeft (), endPoint - rect.topLeft ()))); + PAINTER_CALL (drawRect (TQRect (startPoint - rect.topLeft (), endPoint - rect.topLeft ()))); break; case kpToolRectangle::RoundedRectangle: - PAINTER_CALL (drawRoundRect (QRect (startPoint - rect.topLeft (), endPoint - rect.topLeft ()))); + PAINTER_CALL (drawRoundRect (TQRect (startPoint - rect.topLeft (), endPoint - rect.topLeft ()))); break; case kpToolRectangle::Ellipse: - PAINTER_CALL (drawEllipse (QRect (startPoint - rect.topLeft (), endPoint - rect.topLeft ()))); + PAINTER_CALL (drawEllipse (TQRect (startPoint - rect.topLeft (), endPoint - rect.topLeft ()))); break; default: kdError () << "kptoolrectangle.cpp::pixmap() passed unknown mode: " << int (mode) << endl; @@ -159,8 +159,8 @@ static QPixmap pixmap (const kpToolRectangle::Mode mode, */ kpToolRectangle::kpToolRectangle (Mode mode, - const QString &text, - const QString &description, + const TQString &text, + const TQString &description, int key, kpMainWindow *mainWindow, const char *name) @@ -231,27 +231,27 @@ void kpToolRectangle::slotBackgroundColorChanged (const kpColor &) // private void kpToolRectangle::updatePen (int mouseButton) { - QColor maskPenColor = color (mouseButton).maskColor (); + TQColor maskPenColor = color (mouseButton).maskColor (); if (!m_toolWidgetLineWidth) { if (color (mouseButton).isOpaque ()) - m_pen [mouseButton] = QPen (color (mouseButton).toQColor ()); + m_pen [mouseButton] = TQPen (color (mouseButton).toQColor ()); else m_pen [mouseButton] = Qt::NoPen; - m_maskPen [mouseButton] = QPen (maskPenColor); + m_maskPen [mouseButton] = TQPen (maskPenColor); } else { if (color (mouseButton).isOpaque ()) { - m_pen [mouseButton] = QPen (color (mouseButton).toQColor (), + m_pen [mouseButton] = TQPen (color (mouseButton).toQColor (), m_toolWidgetLineWidth->lineWidth (), Qt::SolidLine); } else m_pen [mouseButton] = Qt::NoPen; - m_maskPen [mouseButton] = QPen (maskPenColor, + m_maskPen [mouseButton] = TQPen (maskPenColor, m_toolWidgetLineWidth->lineWidth (), Qt::SolidLine); } @@ -302,7 +302,7 @@ void kpToolRectangle::slotFillStyleChanged () // private -QString kpToolRectangle::haventBegunDrawUserMessage () const +TQString kpToolRectangle::haventBegunDrawUserMessage () const { return i18n ("Drag to draw."); } @@ -323,16 +323,16 @@ void kpToolRectangle::begin () if (tb) { m_toolWidgetLineWidth = tb->toolWidgetLineWidth (); - connect (m_toolWidgetLineWidth, SIGNAL (lineWidthChanged (int)), - this, SLOT (slotLineWidthChanged ())); + connect (m_toolWidgetLineWidth, TQT_SIGNAL (lineWidthChanged (int)), + this, TQT_SLOT (slotLineWidthChanged ())); m_toolWidgetLineWidth->show (); updatePens (); m_toolWidgetFillStyle = tb->toolWidgetFillStyle (); - connect (m_toolWidgetFillStyle, SIGNAL (fillStyleChanged (kpToolWidgetFillStyle::FillStyle)), - this, SLOT (slotFillStyleChanged ())); + connect (m_toolWidgetFillStyle, TQT_SIGNAL (fillStyleChanged (kpToolWidgetFillStyle::FillStyle)), + this, TQT_SLOT (slotFillStyleChanged ())); m_toolWidgetFillStyle->show (); updateBrushes (); @@ -342,7 +342,7 @@ void kpToolRectangle::begin () kdDebug () << "\t\tm_toolWidgetFillStyle=" << m_toolWidgetFillStyle << endl; #endif - viewManager ()->setCursor (QCursor (CrossCursor)); + viewManager ()->setCursor (TQCursor (CrossCursor)); setUserMessage (haventBegunDrawUserMessage ()); } @@ -356,15 +356,15 @@ void kpToolRectangle::end () if (m_toolWidgetLineWidth) { - disconnect (m_toolWidgetLineWidth, SIGNAL (lineWidthChanged (int)), - this, SLOT (slotLineWidthChanged ())); + disconnect (m_toolWidgetLineWidth, TQT_SIGNAL (lineWidthChanged (int)), + this, TQT_SLOT (slotLineWidthChanged ())); m_toolWidgetLineWidth = 0; } if (m_toolWidgetFillStyle) { - disconnect (m_toolWidgetFillStyle, SIGNAL (fillStyleChanged (kpToolWidgetFillStyle::FillStyle)), - this, SLOT (slotFillStyleChanged ())); + disconnect (m_toolWidgetFillStyle, TQT_SIGNAL (fillStyleChanged (kpToolWidgetFillStyle::FillStyle)), + this, TQT_SLOT (slotFillStyleChanged ())); m_toolWidgetFillStyle = 0; } @@ -373,7 +373,7 @@ void kpToolRectangle::end () void kpToolRectangle::applyModifiers () { - QRect rect = QRect (m_startPoint, m_currentPoint).normalize (); + TQRect rect = TQRect (m_startPoint, m_currentPoint).normalize (); #if DEBUG_KP_TOOL_RECTANGLE kdDebug () << "kpToolRectangle::applyModifiers(" << rect @@ -387,7 +387,7 @@ void kpToolRectangle::applyModifiers () { int xdiff = kAbs (m_startPoint.x () - m_currentPoint.x ()); int ydiff = kAbs (m_startPoint.y () - m_currentPoint.y ()); - rect = QRect (m_startPoint.x () - xdiff, m_startPoint.y () - ydiff, + rect = TQRect (m_startPoint.x () - xdiff, m_startPoint.y () - ydiff, xdiff * 2 + 1, ydiff * 2 + 1); } @@ -419,13 +419,13 @@ void kpToolRectangle::applyModifiers () { if (rect.width () < rect.height ()) { - QPoint center = rect.center (); + TQPoint center = rect.center (); rect.setHeight (rect.width ()); rect.moveCenter (center); } else { - QPoint center = rect.center (); + TQPoint center = rect.center (); rect.setWidth (rect.height ()); rect.moveCenter (center); } @@ -449,7 +449,7 @@ void kpToolRectangle::updateShape () { viewManager ()->setFastUpdates (); - QPixmap newPixmap = pixmap (m_mode, document (), m_toolRectangleRect, + TQPixmap newPixmap = pixmap (m_mode, document (), m_toolRectangleRect, m_toolRectangleStartPoint, m_toolRectangleEndPoint, m_pen [m_mouseButton], m_maskPen [m_mouseButton], m_brush [m_mouseButton], m_maskBrush [m_mouseButton]); @@ -462,7 +462,7 @@ void kpToolRectangle::updateShape () viewManager ()->restoreFastUpdates (); } -void kpToolRectangle::draw (const QPoint &, const QPoint &, const QRect &) +void kpToolRectangle::draw (const TQPoint &, const TQPoint &, const TQRect &) { applyModifiers (); @@ -508,7 +508,7 @@ void kpToolRectangle::draw (const QPoint &, const QPoint &, const QRect &) void kpToolRectangle::cancelShape () { #if 0 - endDraw (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + endDraw (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); mainWindow ()->commandHistory ()->undo (); #else viewManager ()->invalidateTempPixmap (); @@ -522,7 +522,7 @@ void kpToolRectangle::releasedAllButtons () setUserMessage (haventBegunDrawUserMessage ()); } -void kpToolRectangle::endDraw (const QPoint &, const QRect &) +void kpToolRectangle::endDraw (const TQPoint &, const TQRect &) { applyModifiers (); @@ -546,10 +546,10 @@ void kpToolRectangle::endDraw (const QPoint &, const QRect &) */ kpToolRectangleCommand::kpToolRectangleCommand (kpToolRectangle::Mode mode, - const QPen &pen, const QPen &maskPen, - const QBrush &brush, const QBrush &maskBrush, - const QRect &rect, - const QPoint &startPoint, const QPoint &endPoint, + const TQPen &pen, const TQPen &maskPen, + const TQBrush &brush, const TQBrush &maskBrush, + const TQRect &rect, + const TQPoint &startPoint, const TQPoint &endPoint, kpMainWindow *mainWindow) : kpCommand (mainWindow), m_mode (mode), @@ -569,7 +569,7 @@ kpToolRectangleCommand::~kpToolRectangleCommand () // public virtual [base kpCommand] -QString kpToolRectangleCommand::name () const +TQString kpToolRectangleCommand::name () const { switch (m_mode) { @@ -581,7 +581,7 @@ QString kpToolRectangleCommand::name () const return i18n ("Ellipse"); default: kdError () << "kpToolRectangleCommand::name() passed unknown mode: " << int (m_mode) << endl; - return QString::null; + return TQString::null; } } @@ -604,7 +604,7 @@ void kpToolRectangleCommand::execute () if (!m_oldPixmapPtr) { // OPT: I can do better with no brush - m_oldPixmapPtr = new QPixmap (); + m_oldPixmapPtr = new TQPixmap (); *m_oldPixmapPtr = doc->getPixmapAt (m_rect); } else diff --git a/kolourpaint/tools/kptoolrectangle.h b/kolourpaint/tools/kptoolrectangle.h index 0fcf5ff4..a412a475 100644 --- a/kolourpaint/tools/kptoolrectangle.h +++ b/kolourpaint/tools/kptoolrectangle.h @@ -29,17 +29,17 @@ #ifndef __kptoolrectangle_h__ #define __kptoolrectangle_h__ -#include <qbrush.h> -#include <qpen.h> -#include <qpixmap.h> -#include <qpoint.h> -#include <qrect.h> +#include <tqbrush.h> +#include <tqpen.h> +#include <tqpixmap.h> +#include <tqpoint.h> +#include <tqrect.h> #include <kpcommandhistory.h> #include <kptool.h> -class QString; +class TQString; class kpColor; class kpMainWindow; @@ -58,7 +58,7 @@ public: enum Mode {Rectangle, RoundedRectangle, Ellipse}; kpToolRectangle (Mode mode, - const QString &text, const QString &description, + const TQString &text, const TQString &description, int key, kpMainWindow *mainWindow, const char *name); @@ -70,7 +70,7 @@ public: virtual bool careAboutModifierState () const { return true; } private: - QString haventBegunDrawUserMessage () const; + TQString haventBegunDrawUserMessage () const; public: virtual void begin (); @@ -80,10 +80,10 @@ public: private: void updateShape (); public: - virtual void draw (const QPoint &, const QPoint &, const QRect &); + virtual void draw (const TQPoint &, const TQPoint &, const TQRect &); virtual void cancelShape (); virtual void releasedAllButtons (); - virtual void endDraw (const QPoint &, const QRect &); + virtual void endDraw (const TQPoint &, const TQRect &); private slots: void updatePens (); @@ -102,28 +102,28 @@ private: kpToolWidgetFillStyle *m_toolWidgetFillStyle; void updatePen (int mouseButton); - QPen m_pen [2], m_maskPen [2]; + TQPen m_pen [2], m_maskPen [2]; void updateBrush (int mouseButton); - QBrush m_brush [2], m_maskBrush [2]; + TQBrush m_brush [2], m_maskBrush [2]; void applyModifiers (); - QPoint m_toolRectangleStartPoint, m_toolRectangleEndPoint; - QRect m_toolRectangleRectWithoutLineWidth, m_toolRectangleRect; + TQPoint m_toolRectangleStartPoint, m_toolRectangleEndPoint; + TQRect m_toolRectangleRectWithoutLineWidth, m_toolRectangleRect; }; class kpToolRectangleCommand : public kpCommand { public: kpToolRectangleCommand (kpToolRectangle::Mode mode, - const QPen &pen, const QPen &maskPen, - const QBrush &brush, const QBrush &maskBrush, - const QRect &rect, - const QPoint &startPoint, const QPoint &endPoint, + const TQPen &pen, const TQPen &maskPen, + const TQBrush &brush, const TQBrush &maskBrush, + const TQRect &rect, + const TQPoint &startPoint, const TQPoint &endPoint, kpMainWindow *mainWindow); virtual ~kpToolRectangleCommand (); - virtual QString name () const; + virtual TQString name () const; virtual int size () const; @@ -132,11 +132,11 @@ public: private: kpToolRectangle::Mode m_mode; - QPen m_pen, m_maskPen; - QBrush m_brush, m_maskBrush; - QRect m_rect; - QPoint m_startPoint, m_endPoint; - QPixmap *m_oldPixmapPtr; + TQPen m_pen, m_maskPen; + TQBrush m_brush, m_maskBrush; + TQRect m_rect; + TQPoint m_startPoint, m_endPoint; + TQPixmap *m_oldPixmapPtr; }; #endif // __kptoolrectangle_h__ diff --git a/kolourpaint/tools/kptoolresizescale.cpp b/kolourpaint/tools/kptoolresizescale.cpp index ce9c9059..e7f14c5d 100644 --- a/kolourpaint/tools/kptoolresizescale.cpp +++ b/kolourpaint/tools/kptoolresizescale.cpp @@ -33,22 +33,22 @@ #include <math.h> -#include <qaccel.h> -#include <qapplication.h> -#include <qbuttongroup.h> -#include <qcheckbox.h> -#include <qgroupbox.h> -#include <qhbox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpoint.h> -#include <qpointarray.h> -#include <qpushbutton.h> -#include <qrect.h> -#include <qsize.h> -#include <qtoolbutton.h> -#include <qwhatsthis.h> -#include <qwmatrix.h> +#include <tqaccel.h> +#include <tqapplication.h> +#include <tqbuttongroup.h> +#include <tqcheckbox.h> +#include <tqgroupbox.h> +#include <tqhbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpoint.h> +#include <tqpointarray.h> +#include <tqpushbutton.h> +#include <tqrect.h> +#include <tqsize.h> +#include <tqtoolbutton.h> +#include <tqwhatsthis.h> +#include <tqwmatrix.h> #include <kapplication.h> #include <kcombobox.h> @@ -108,7 +108,7 @@ kpToolResizeScaleCommand::~kpToolResizeScaleCommand () // public virtual [base kpCommand] -QString kpToolResizeScaleCommand::name () const +TQString kpToolResizeScaleCommand::name () const { if (m_actOnSelection) { @@ -138,7 +138,7 @@ QString kpToolResizeScaleCommand::name () const } } - return QString::null; + return TQString::null; } // public virtual [base kpCommand] @@ -178,9 +178,9 @@ void kpToolResizeScaleCommand::setNewHeight (int height) // public -QSize kpToolResizeScaleCommand::newSize () const +TQSize kpToolResizeScaleCommand::newSize () const { - return QSize (newWidth (), newHeight ()); + return TQSize (newWidth (), newHeight ()); } // public virtual @@ -232,14 +232,14 @@ void kpToolResizeScaleCommand::scaleSelectionRegionWithDocument () const int newY = (int) (m_oldSelection->y () * vertScale); - QPointArray currentPoints = m_oldSelection->points (); + TQPointArray currentPoints = m_oldSelection->points (); currentPoints.detach (); currentPoints.translate (-currentPoints.boundingRect ().x (), -currentPoints.boundingRect ().y ()); // TODO: refactor into kpPixmapFX - QWMatrix scaleMatrix; + TQWMatrix scaleMatrix; scaleMatrix.scale (horizScale, vertScale); currentPoints = scaleMatrix.map (currentPoints); @@ -247,7 +247,7 @@ void kpToolResizeScaleCommand::scaleSelectionRegionWithDocument () -currentPoints.boundingRect ().x () + newX, -currentPoints.boundingRect ().y () + newY); - document ()->setSelection (kpSelection (currentPoints, QPixmap (), + document ()->setSelection (kpSelection (currentPoints, TQPixmap (), m_oldSelection->transparency ())); @@ -283,25 +283,25 @@ void kpToolResizeScaleCommand::execute () } else { - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); document ()->selection ()->textResize (m_newWidth, m_newHeight); if (m_mainWindow->tool ()) m_mainWindow->tool ()->somethingBelowTheCursorChanged (); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } } else { - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); if (m_newWidth < m_oldWidth) { m_oldRightPixmap = kpPixmapFX::getPixmapAt ( *document ()->pixmap (), - QRect (m_newWidth, 0, + TQRect (m_newWidth, 0, m_oldWidth - m_newWidth, m_oldHeight)); } @@ -309,27 +309,27 @@ void kpToolResizeScaleCommand::execute () { m_oldBottomPixmap = kpPixmapFX::getPixmapAt ( *document ()->pixmap (), - QRect (0, m_newHeight, + TQRect (0, m_newHeight, m_newWidth, m_oldHeight - m_newHeight)); } document ()->resize (m_newWidth, m_newHeight, m_backgroundColor); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } } else { - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); - QPixmap oldPixmap = *document ()->pixmap (m_actOnSelection); + TQPixmap oldPixmap = *document ()->pixmap (m_actOnSelection); if (!m_isLosslessScale) m_oldPixmap = oldPixmap; - QPixmap newPixmap = kpPixmapFX::scale (oldPixmap, m_newWidth, m_newHeight, + TQPixmap newPixmap = kpPixmapFX::scale (oldPixmap, m_newWidth, m_newHeight, m_type == SmoothScale); @@ -337,12 +337,12 @@ void kpToolResizeScaleCommand::execute () { // Save sel border m_oldSelection = new kpSelection (*document ()->selection ()); - m_oldSelection->setPixmap (QPixmap ()); + m_oldSelection->setPixmap (TQPixmap ()); } if (m_actOnSelection) { - QRect newRect = QRect (m_oldSelection->x (), m_oldSelection->y (), + TQRect newRect = TQRect (m_oldSelection->x (), m_oldSelection->y (), newPixmap.width (), newPixmap.height ()); // Not possible to retain non-rectangular selection borders on scale @@ -365,7 +365,7 @@ void kpToolResizeScaleCommand::execute () } - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } } @@ -395,51 +395,51 @@ void kpToolResizeScaleCommand::unexecute () } else { - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); document ()->selection ()->textResize (m_oldWidth, m_oldHeight); if (m_mainWindow->tool ()) m_mainWindow->tool ()->somethingBelowTheCursorChanged (); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } } else { - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); - QPixmap newPixmap (m_oldWidth, m_oldHeight); + TQPixmap newPixmap (m_oldWidth, m_oldHeight); - kpPixmapFX::setPixmapAt (&newPixmap, QPoint (0, 0), + kpPixmapFX::setPixmapAt (&newPixmap, TQPoint (0, 0), *doc->pixmap ()); if (m_newWidth < m_oldWidth) { kpPixmapFX::setPixmapAt (&newPixmap, - QPoint (m_newWidth, 0), + TQPoint (m_newWidth, 0), m_oldRightPixmap); } if (m_newHeight < m_oldHeight) { kpPixmapFX::setPixmapAt (&newPixmap, - QPoint (0, m_newHeight), + TQPoint (0, m_newHeight), m_oldBottomPixmap); } doc->setPixmap (newPixmap); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } } else { - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); - QPixmap oldPixmap; + TQPixmap oldPixmap; if (!m_isLosslessScale) oldPixmap = m_oldPixmap; @@ -471,7 +471,7 @@ void kpToolResizeScaleCommand::unexecute () } - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } } @@ -505,7 +505,7 @@ double kpToolResizeScaleDialog::s_lastPercentWidth = 100, kpToolResizeScaleDialog::kpToolResizeScaleDialog (kpMainWindow *mainWindow) - : KDialogBase ((QWidget *) mainWindow, + : KDialogBase ((TQWidget *) mainWindow, 0/*name*/, true/*modal*/, i18n ("Resize / Scale")/*caption*/, @@ -517,7 +517,7 @@ kpToolResizeScaleDialog::kpToolResizeScaleDialog (kpMainWindow *mainWindow) s_lastPercentWidth = 100, s_lastPercentHeight = 100; - QWidget *baseWidget = new QWidget (this); + TQWidget *baseWidget = new TQWidget (this); setMainWidget (baseWidget); @@ -526,7 +526,7 @@ kpToolResizeScaleDialog::kpToolResizeScaleDialog (kpMainWindow *mainWindow) createDimensionsGroupBox (baseWidget); - QVBoxLayout *baseLayout = new QVBoxLayout (baseWidget, 0/*margin*/, spacingHint ()); + TQVBoxLayout *baseLayout = new TQVBoxLayout (baseWidget, 0/*margin*/, spacingHint ()); baseLayout->addWidget (m_actOnBox); baseLayout->addWidget (m_operationGroupBox); baseLayout->addWidget (m_dimensionsGroupBox); @@ -558,13 +558,13 @@ kpSelection *kpToolResizeScaleDialog::selection () const // private -void kpToolResizeScaleDialog::createActOnBox (QWidget *baseWidget) +void kpToolResizeScaleDialog::createActOnBox (TQWidget *baseWidget) { - m_actOnBox = new QHBox (baseWidget); + m_actOnBox = new TQHBox (baseWidget); m_actOnBox->setSpacing (spacingHint () * 2); - m_actOnLabel = new QLabel (i18n ("Ac&t on:"), m_actOnBox); + m_actOnLabel = new TQLabel (i18n ("Ac&t on:"), m_actOnBox); m_actOnCombo = new KComboBox (m_actOnBox); @@ -573,7 +573,7 @@ void kpToolResizeScaleDialog::createActOnBox (QWidget *baseWidget) m_actOnCombo->insertItem (i18n ("Entire Image"), Image); if (selection ()) { - QString selName = i18n ("Selection"); + TQString selName = i18n ("Selection"); if (selection ()->isText ()) selName = i18n ("Text Box"); @@ -591,29 +591,29 @@ void kpToolResizeScaleDialog::createActOnBox (QWidget *baseWidget) m_actOnBox->setStretchFactor (m_actOnCombo, 1); - connect (m_actOnCombo, SIGNAL (activated (int)), - this, SLOT (slotActOnChanged ())); + connect (m_actOnCombo, TQT_SIGNAL (activated (int)), + this, TQT_SLOT (slotActOnChanged ())); } -static QIconSet toolButtonIconSet (const QString &iconName) +static TQIconSet toolButtonIconSet (const TQString &iconName) { - QIconSet iconSet = UserIconSet (iconName); + TQIconSet iconSet = UserIconSet (iconName); // No "disabled" pixmap is generated by UserIconSet() so generate it // ourselves: - QPixmap disabledIcon = KGlobal::iconLoader ()->iconEffect ()->apply ( + TQPixmap disabledIcon = KGlobal::iconLoader ()->iconEffect ()->apply ( UserIcon (iconName), KIcon::Toolbar, KIcon::DisabledState); - const QPixmap iconSetNormalIcon = iconSet.pixmap (QIconSet::Small, - QIconSet::Normal); + const TQPixmap iconSetNormalIcon = iconSet.pixmap (TQIconSet::Small, + TQIconSet::Normal); // I bet past or future versions of KIconEffect::apply() resize the // disabled icon if we claim it's in group KIcon::Toolbar. So resize - // it to match the QIconSet::Normal icon, just in case. + // it to match the TQIconSet::Normal icon, just in case. disabledIcon = kpPixmapFX::scale (disabledIcon, iconSetNormalIcon.width (), iconSetNormalIcon.height (), @@ -621,29 +621,29 @@ static QIconSet toolButtonIconSet (const QString &iconName) iconSet.setPixmap (disabledIcon, - QIconSet::Small, QIconSet::Disabled); + TQIconSet::Small, TQIconSet::Disabled); return iconSet; } -static void toolButtonSetLook (QToolButton *button, - const QString &iconName, - const QString &name) +static void toolButtonSetLook (TQToolButton *button, + const TQString &iconName, + const TQString &name) { button->setIconSet (toolButtonIconSet (iconName)); button->setUsesTextLabel (true); button->setTextLabel (name, false/*no tooltip*/); - button->setAccel (QAccel::shortcutKey (name)); - button->setFocusPolicy (QWidget::StrongFocus); + button->setAccel (TQAccel::shortcutKey (name)); + button->setFocusPolicy (TQWidget::StrongFocus); button->setToggleButton (true); } // private -void kpToolResizeScaleDialog::createOperationGroupBox (QWidget *baseWidget) +void kpToolResizeScaleDialog::createOperationGroupBox (TQWidget *baseWidget) { - m_operationGroupBox = new QGroupBox (i18n ("Operation"), baseWidget); - QWhatsThis::add (m_operationGroupBox, + m_operationGroupBox = new TQGroupBox (i18n ("Operation"), baseWidget); + TQWhatsThis::add (m_operationGroupBox, i18n ("<qt>" "<ul>" "<li><b>Resize</b>: The size of the picture will be" @@ -663,25 +663,25 @@ void kpToolResizeScaleDialog::createOperationGroupBox (QWidget *baseWidget) "</qt>")); // TODO: ALT+R doesn't select the button. - m_resizeButton = new QToolButton (m_operationGroupBox); + m_resizeButton = new TQToolButton (m_operationGroupBox); toolButtonSetLook (m_resizeButton, - QString::fromLatin1 ("resize"), + TQString::fromLatin1 ("resize"), i18n ("&Resize")); - m_scaleButton = new QToolButton (m_operationGroupBox); + m_scaleButton = new TQToolButton (m_operationGroupBox); toolButtonSetLook (m_scaleButton, - QString::fromLatin1 ("scale"), + TQString::fromLatin1 ("scale"), i18n ("&Scale")); - m_smoothScaleButton = new QToolButton (m_operationGroupBox); + m_smoothScaleButton = new TQToolButton (m_operationGroupBox); toolButtonSetLook (m_smoothScaleButton, - QString::fromLatin1 ("smooth_scale"), + TQString::fromLatin1 ("smooth_scale"), i18n ("S&mooth Scale")); - //m_resizeLabel = new QLabel (i18n ("&Resize"), m_operationGroupBox); - //m_scaleLabel = new QLabel (i18n ("&Scale"), m_operationGroupBox); - //m_smoothScaleLabel = new QLabel (i18n ("S&mooth scale"), m_operationGroupBox); + //m_resizeLabel = new TQLabel (i18n ("&Resize"), m_operationGroupBox); + //m_scaleLabel = new TQLabel (i18n ("&Scale"), m_operationGroupBox); + //m_smoothScaleLabel = new TQLabel (i18n ("S&mooth scale"), m_operationGroupBox); //m_resizeLabel->setAlignment (m_resizeLabel->alignment () | Qt::ShowPrefix); @@ -689,7 +689,7 @@ void kpToolResizeScaleDialog::createOperationGroupBox (QWidget *baseWidget) //m_smoothScaleLabel->setAlignment (m_smoothScaleLabel->alignment () | Qt::ShowPrefix); - QButtonGroup *resizeScaleButtonGroup = new QButtonGroup (baseWidget); + TQButtonGroup *resizeScaleButtonGroup = new TQButtonGroup (baseWidget); resizeScaleButtonGroup->setExclusive (true); resizeScaleButtonGroup->hide (); @@ -698,7 +698,7 @@ void kpToolResizeScaleDialog::createOperationGroupBox (QWidget *baseWidget) resizeScaleButtonGroup->insert (m_smoothScaleButton); - QGridLayout *operationLayout = new QGridLayout (m_operationGroupBox, + TQGridLayout *operationLayout = new TQGridLayout (m_operationGroupBox, 1, 2, marginHint () * 2/*don't overlap groupbox title*/, spacingHint ()); @@ -713,52 +713,52 @@ void kpToolResizeScaleDialog::createOperationGroupBox (QWidget *baseWidget) //operationLayout->addWidget (m_smoothScaleLabel, 1, 2, Qt::AlignCenter); - connect (m_resizeButton, SIGNAL (toggled (bool)), - this, SLOT (slotTypeChanged ())); - connect (m_scaleButton, SIGNAL (toggled (bool)), - this, SLOT (slotTypeChanged ())); - connect (m_smoothScaleButton, SIGNAL (toggled (bool)), - this, SLOT (slotTypeChanged ())); + connect (m_resizeButton, TQT_SIGNAL (toggled (bool)), + this, TQT_SLOT (slotTypeChanged ())); + connect (m_scaleButton, TQT_SIGNAL (toggled (bool)), + this, TQT_SLOT (slotTypeChanged ())); + connect (m_smoothScaleButton, TQT_SIGNAL (toggled (bool)), + this, TQT_SLOT (slotTypeChanged ())); } // private -void kpToolResizeScaleDialog::createDimensionsGroupBox (QWidget *baseWidget) +void kpToolResizeScaleDialog::createDimensionsGroupBox (TQWidget *baseWidget) { - m_dimensionsGroupBox = new QGroupBox (i18n ("Dimensions"), baseWidget); + m_dimensionsGroupBox = new TQGroupBox (i18n ("Dimensions"), baseWidget); - QLabel *widthLabel = new QLabel (i18n ("Width:"), m_dimensionsGroupBox); + TQLabel *widthLabel = new TQLabel (i18n ("Width:"), m_dimensionsGroupBox); widthLabel->setAlignment (widthLabel->alignment () | Qt::AlignHCenter); - QLabel *heightLabel = new QLabel (i18n ("Height:"), m_dimensionsGroupBox); + TQLabel *heightLabel = new TQLabel (i18n ("Height:"), m_dimensionsGroupBox); heightLabel->setAlignment (heightLabel->alignment () | Qt::AlignHCenter); - QLabel *originalLabel = new QLabel (i18n ("Original:"), m_dimensionsGroupBox); + TQLabel *originalLabel = new TQLabel (i18n ("Original:"), m_dimensionsGroupBox); m_originalWidthInput = new KIntNumInput ( document ()->width ((bool) selection ()), m_dimensionsGroupBox); - QLabel *xLabel0 = new QLabel (i18n ("x"), m_dimensionsGroupBox); + TQLabel *xLabel0 = new TQLabel (i18n ("x"), m_dimensionsGroupBox); m_originalHeightInput = new KIntNumInput ( document ()->height ((bool) selection ()), m_dimensionsGroupBox); - QLabel *newLabel = new QLabel (i18n ("&New:"), m_dimensionsGroupBox); + TQLabel *newLabel = new TQLabel (i18n ("&New:"), m_dimensionsGroupBox); m_newWidthInput = new KIntNumInput (m_dimensionsGroupBox); - QLabel *xLabel1 = new QLabel (i18n ("x"), m_dimensionsGroupBox); + TQLabel *xLabel1 = new TQLabel (i18n ("x"), m_dimensionsGroupBox); m_newHeightInput = new KIntNumInput (m_dimensionsGroupBox); - QLabel *percentLabel = new QLabel (i18n ("&Percent:"), m_dimensionsGroupBox); + TQLabel *percentLabel = new TQLabel (i18n ("&Percent:"), m_dimensionsGroupBox); m_percentWidthInput = new KDoubleNumInput (0.01/*lower*/, 1000000/*upper*/, 100/*value*/, 1/*step*/, 2/*precision*/, m_dimensionsGroupBox); m_percentWidthInput->setSuffix (i18n ("%")); - QLabel *xLabel2 = new QLabel (i18n ("x"), m_dimensionsGroupBox); + TQLabel *xLabel2 = new TQLabel (i18n ("x"), m_dimensionsGroupBox); m_percentHeightInput = new KDoubleNumInput (0.01/*lower*/, 1000000/*upper*/, 100/*value*/, 1/*step*/, 2/*precision*/, m_dimensionsGroupBox); m_percentHeightInput->setSuffix (i18n ("%")); - m_keepAspectRatioCheckBox = new QCheckBox (i18n ("Keep &aspect ratio"), + m_keepAspectRatioCheckBox = new TQCheckBox (i18n ("Keep &aspect ratio"), m_dimensionsGroupBox); @@ -771,7 +771,7 @@ void kpToolResizeScaleDialog::createDimensionsGroupBox (QWidget *baseWidget) percentLabel->setBuddy (m_percentWidthInput); - QGridLayout *dimensionsLayout = new QGridLayout (m_dimensionsGroupBox, + TQGridLayout *dimensionsLayout = new TQGridLayout (m_dimensionsGroupBox, 5, 4, marginHint () * 2, spacingHint ()); dimensionsLayout->setColStretch (1/*column*/, 1); dimensionsLayout->setColStretch (3/*column*/, 1); @@ -800,18 +800,18 @@ void kpToolResizeScaleDialog::createDimensionsGroupBox (QWidget *baseWidget) dimensionsLayout->setRowSpacing (4/*row*/, dimensionsLayout->rowSpacing (4) * 2); - connect (m_newWidthInput, SIGNAL (valueChanged (int)), - this, SLOT (slotWidthChanged (int))); - connect (m_newHeightInput, SIGNAL (valueChanged (int)), - this, SLOT (slotHeightChanged (int))); + connect (m_newWidthInput, TQT_SIGNAL (valueChanged (int)), + this, TQT_SLOT (slotWidthChanged (int))); + connect (m_newHeightInput, TQT_SIGNAL (valueChanged (int)), + this, TQT_SLOT (slotHeightChanged (int))); - connect (m_percentWidthInput, SIGNAL (valueChanged (double)), - this, SLOT (slotPercentWidthChanged (double))); - connect (m_percentHeightInput, SIGNAL (valueChanged (double)), - this, SLOT (slotPercentHeightChanged (double))); + connect (m_percentWidthInput, TQT_SIGNAL (valueChanged (double)), + this, TQT_SLOT (slotPercentWidthChanged (double))); + connect (m_percentHeightInput, TQT_SIGNAL (valueChanged (double)), + this, TQT_SLOT (slotPercentHeightChanged (double))); - connect (m_keepAspectRatioCheckBox, SIGNAL (toggled (bool)), - this, SLOT (setKeepAspectRatio (bool))); + connect (m_keepAspectRatioCheckBox, TQT_SIGNAL (toggled (bool)), + this, TQT_SLOT (setKeepAspectRatio (bool))); } @@ -1100,7 +1100,7 @@ void kpToolResizeScaleDialog::slotOk () } - QString message, caption, continueButtonText; + TQString message, caption, continueButtonText; // Note: If eText, can't Scale nor SmoothScale. // If eSelection, can't Resize. diff --git a/kolourpaint/tools/kptoolresizescale.h b/kolourpaint/tools/kptoolresizescale.h index e23b040e..1dd95aa0 100644 --- a/kolourpaint/tools/kptoolresizescale.h +++ b/kolourpaint/tools/kptoolresizescale.h @@ -29,7 +29,7 @@ #ifndef __kptoolresizescale_h__ #define __kptoolresizescale_h__ -#include <qpixmap.h> +#include <tqpixmap.h> #include <kpcommandhistory.h> #include <kdialogbase.h> @@ -37,13 +37,13 @@ #include <kpcolor.h> #include <kpselection.h> -class QCheckBox; -class QGroupBox; -class QHBox; -class QRadioButton; -class QSize; -class QString; -class QToolButton; +class TQCheckBox; +class TQGroupBox; +class TQHBox; +class TQRadioButton; +class TQSize; +class TQString; +class TQToolButton; class KComboBox; class KDoubleNumInput; @@ -67,7 +67,7 @@ public: kpMainWindow *mainWindow); virtual ~kpToolResizeScaleCommand (); - virtual QString name () const; + virtual TQString name () const; virtual int size () const; public: @@ -77,7 +77,7 @@ public: int newHeight () const; void setNewHeight (int height); - QSize newSize () const; + TQSize newSize () const; virtual void resize (int width, int height); public: @@ -100,7 +100,7 @@ protected: int m_oldWidth, m_oldHeight; bool m_actOnTextSelection; - QPixmap m_oldPixmap, m_oldRightPixmap, m_oldBottomPixmap; + TQPixmap m_oldPixmap, m_oldRightPixmap, m_oldBottomPixmap; kpSelection *m_oldSelection; }; @@ -125,9 +125,9 @@ private: kpDocument *document () const; kpSelection *selection () const; - void createActOnBox (QWidget *baseWidget); - void createOperationGroupBox (QWidget *baseWidget); - void createDimensionsGroupBox (QWidget *baseWidget); + void createActOnBox (TQWidget *baseWidget); + void createOperationGroupBox (TQWidget *baseWidget); + void createDimensionsGroupBox (TQWidget *baseWidget); void widthFitHeightToAspectRatio (); void heightFitWidthToAspectRatio (); @@ -172,23 +172,23 @@ private slots: private: kpMainWindow *m_mainWindow; - QHBox *m_actOnBox; - QLabel *m_actOnLabel; + TQHBox *m_actOnBox; + TQLabel *m_actOnLabel; KComboBox *m_actOnCombo; - QGroupBox *m_operationGroupBox; - QToolButton *m_resizeButton, + TQGroupBox *m_operationGroupBox; + TQToolButton *m_resizeButton, *m_scaleButton, *m_smoothScaleButton; - QLabel *m_resizeLabel, + TQLabel *m_resizeLabel, *m_scaleLabel, *m_smoothScaleLabel; - QGroupBox *m_dimensionsGroupBox; + TQGroupBox *m_dimensionsGroupBox; KIntNumInput *m_originalWidthInput, *m_originalHeightInput, *m_newWidthInput, *m_newHeightInput; KDoubleNumInput *m_percentWidthInput, *m_percentHeightInput; - QCheckBox *m_keepAspectRatioCheckBox; + TQCheckBox *m_keepAspectRatioCheckBox; int m_ignoreKeepAspectRatio; }; diff --git a/kolourpaint/tools/kptoolrotate.cpp b/kolourpaint/tools/kptoolrotate.cpp index 8a37b673..fe3a4cbe 100644 --- a/kolourpaint/tools/kptoolrotate.cpp +++ b/kolourpaint/tools/kptoolrotate.cpp @@ -30,14 +30,14 @@ #include <kptoolrotate.h> -#include <qapplication.h> -#include <qbuttongroup.h> -#include <qgroupbox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpushbutton.h> -#include <qradiobutton.h> -#include <qwmatrix.h> +#include <tqapplication.h> +#include <tqbuttongroup.h> +#include <tqgroupbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqradiobutton.h> +#include <tqwmatrix.h> #include <kdebug.h> #include <kiconloader.h> @@ -70,9 +70,9 @@ kpToolRotateCommand::~kpToolRotateCommand () // public virtual [base kpCommand] -QString kpToolRotateCommand::name () const +TQString kpToolRotateCommand::name () const { - QString opName = i18n ("Rotate"); + TQString opName = i18n ("Rotate"); if (m_actOnSelection) return i18n ("Selection: %1").arg (opName); @@ -97,14 +97,14 @@ void kpToolRotateCommand::execute () return; - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); if (!m_losslessRotation) m_oldPixmap = *doc->pixmap (m_actOnSelection); - QPixmap newPixmap = kpPixmapFX::rotate (*doc->pixmap (m_actOnSelection), + TQPixmap newPixmap = kpPixmapFX::rotate (*doc->pixmap (m_actOnSelection), m_angle, m_backgroundColor); @@ -115,23 +115,23 @@ void kpToolRotateCommand::execute () // Save old selection m_oldSelection = *sel; - m_oldSelection.setPixmap (QPixmap ()); + m_oldSelection.setPixmap (TQPixmap ()); // Calculate new top left (so selection rotates about centre) // (the Times2 trickery is used to reduce integer division error without // resorting to the troublesome world of floating point) - QPoint oldCenterTimes2 (sel->x () * 2 + sel->width (), + TQPoint oldCenterTimes2 (sel->x () * 2 + sel->width (), sel->y () * 2 + sel->height ()); - QPoint newTopLeftTimes2 (oldCenterTimes2 - QPoint (newPixmap.width (), newPixmap.height ())); - QPoint newTopLeft (newTopLeftTimes2.x () / 2, newTopLeftTimes2.y () / 2); + TQPoint newTopLeftTimes2 (oldCenterTimes2 - TQPoint (newPixmap.width (), newPixmap.height ())); + TQPoint newTopLeft (newTopLeftTimes2.x () / 2, newTopLeftTimes2.y () / 2); // Calculate rotated points - QPointArray currentPoints = sel->points (); + TQPointArray currentPoints = sel->points (); currentPoints.translate (-currentPoints.boundingRect ().x (), -currentPoints.boundingRect ().y ()); - QWMatrix rotateMatrix = kpPixmapFX::rotateMatrix (*doc->pixmap (m_actOnSelection), m_angle); + TQWMatrix rotateMatrix = kpPixmapFX::rotateMatrix (*doc->pixmap (m_actOnSelection), m_angle); currentPoints = rotateMatrix.map (currentPoints); currentPoints.translate (-currentPoints.boundingRect ().x () + newTopLeft.x (), -currentPoints.boundingRect ().y () + newTopLeft.y ()); @@ -157,7 +157,7 @@ void kpToolRotateCommand::execute () << endl; #endif doc->setSelection (kpSelection (kpSelection::Rectangle, - QRect (newTopLeft.x (), newTopLeft.y (), + TQRect (newTopLeft.x (), newTopLeft.y (), newPixmap.width (), newPixmap.height ()), newPixmap, m_oldSelection.transparency ())); @@ -170,7 +170,7 @@ void kpToolRotateCommand::execute () doc->setPixmap (newPixmap); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } // public virtual [base kpCommand] @@ -181,10 +181,10 @@ void kpToolRotateCommand::unexecute () return; - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); - QPixmap oldPixmap; + TQPixmap oldPixmap; if (!m_losslessRotation) { @@ -212,7 +212,7 @@ void kpToolRotateCommand::unexecute () } - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } @@ -266,33 +266,33 @@ kpToolRotateDialog::~kpToolRotateDialog () // private void kpToolRotateDialog::createDirectionGroupBox () { - QGroupBox *directionGroupBox = new QGroupBox (i18n ("Direction"), mainWidget ()); + TQGroupBox *directionGroupBox = new TQGroupBox (i18n ("Direction"), mainWidget ()); addCustomWidget (directionGroupBox); - QLabel *antiClockwisePixmapLabel = new QLabel (directionGroupBox); + TQLabel *antiClockwisePixmapLabel = new TQLabel (directionGroupBox); antiClockwisePixmapLabel->setPixmap (UserIcon ("image_rotate_anticlockwise")); - QLabel *clockwisePixmapLabel = new QLabel (directionGroupBox); + TQLabel *clockwisePixmapLabel = new TQLabel (directionGroupBox); clockwisePixmapLabel->setPixmap (UserIcon ("image_rotate_clockwise")); - m_antiClockwiseRadioButton = new QRadioButton (i18n ("Cou&nterclockwise"), directionGroupBox); - m_clockwiseRadioButton = new QRadioButton (i18n ("C&lockwise"), directionGroupBox); + m_antiClockwiseRadioButton = new TQRadioButton (i18n ("Cou&nterclockwise"), directionGroupBox); + m_clockwiseRadioButton = new TQRadioButton (i18n ("C&lockwise"), directionGroupBox); m_antiClockwiseRadioButton->setChecked (!s_lastIsClockwise); m_clockwiseRadioButton->setChecked (s_lastIsClockwise); - QButtonGroup *buttonGroup = new QButtonGroup (directionGroupBox); + TQButtonGroup *buttonGroup = new TQButtonGroup (directionGroupBox); buttonGroup->hide (); buttonGroup->insert (m_antiClockwiseRadioButton); buttonGroup->insert (m_clockwiseRadioButton); - QGridLayout *directionLayout = new QGridLayout (directionGroupBox, + TQGridLayout *directionLayout = new TQGridLayout (directionGroupBox, 2, 2, marginHint () * 2, spacingHint ()); directionLayout->addWidget (antiClockwisePixmapLabel, 0, 0, Qt::AlignCenter); directionLayout->addWidget (clockwisePixmapLabel, 0, 1, Qt::AlignCenter); @@ -300,31 +300,31 @@ void kpToolRotateDialog::createDirectionGroupBox () directionLayout->addWidget (m_clockwiseRadioButton, 1, 1, Qt::AlignCenter); - connect (m_antiClockwiseRadioButton, SIGNAL (toggled (bool)), - this, SLOT (slotUpdate ())); - connect (m_clockwiseRadioButton, SIGNAL (toggled (bool)), - this, SLOT (slotUpdate ())); + connect (m_antiClockwiseRadioButton, TQT_SIGNAL (toggled (bool)), + this, TQT_SLOT (slotUpdate ())); + connect (m_clockwiseRadioButton, TQT_SIGNAL (toggled (bool)), + this, TQT_SLOT (slotUpdate ())); } // private void kpToolRotateDialog::createAngleGroupBox () { - QGroupBox *angleGroupBox = new QGroupBox (i18n ("Angle"), mainWidget ()); + TQGroupBox *angleGroupBox = new TQGroupBox (i18n ("Angle"), mainWidget ()); addCustomWidget (angleGroupBox); - m_angle90RadioButton = new QRadioButton (i18n ("90 °rees"), angleGroupBox); - m_angle180RadioButton = new QRadioButton (i18n ("180 d&egrees"), angleGroupBox); - m_angle270RadioButton = new QRadioButton (i18n ("270 de&grees"), angleGroupBox); + m_angle90RadioButton = new TQRadioButton (i18n ("90 °rees"), angleGroupBox); + m_angle180RadioButton = new TQRadioButton (i18n ("180 d&egrees"), angleGroupBox); + m_angle270RadioButton = new TQRadioButton (i18n ("270 de&grees"), angleGroupBox); - m_angleCustomRadioButton = new QRadioButton (i18n ("C&ustom:"), angleGroupBox); + m_angleCustomRadioButton = new TQRadioButton (i18n ("C&ustom:"), angleGroupBox); m_angleCustomInput = new KIntNumInput (s_lastAngleCustom, angleGroupBox); m_angleCustomInput->setMinValue (-359); m_angleCustomInput->setMaxValue (+359); - QLabel *degreesLabel = new QLabel (i18n ("degrees"), angleGroupBox); + TQLabel *degreesLabel = new TQLabel (i18n ("degrees"), angleGroupBox); - m_angleButtonGroup = new QButtonGroup (angleGroupBox); + m_angleButtonGroup = new TQButtonGroup (angleGroupBox); m_angleButtonGroup->hide (); m_angleButtonGroup->insert (m_angle90RadioButton); @@ -336,7 +336,7 @@ void kpToolRotateDialog::createAngleGroupBox () m_angleButtonGroup->setButton (s_lastAngleRadioButtonID); - QGridLayout *angleLayout = new QGridLayout (angleGroupBox, + TQGridLayout *angleLayout = new TQGridLayout (angleGroupBox, 6, 3, marginHint () * 2, spacingHint ()); @@ -351,20 +351,20 @@ void kpToolRotateDialog::createAngleGroupBox () angleLayout->setColStretch (1, 2); // Stretch Custom Angle Input - connect (m_angle90RadioButton, SIGNAL (toggled (bool)), - this, SLOT (slotUpdate ())); - connect (m_angle180RadioButton, SIGNAL (toggled (bool)), - this, SLOT (slotUpdate ())); - connect (m_angle270RadioButton, SIGNAL (toggled (bool)), - this, SLOT (slotUpdate ())); + connect (m_angle90RadioButton, TQT_SIGNAL (toggled (bool)), + this, TQT_SLOT (slotUpdate ())); + connect (m_angle180RadioButton, TQT_SIGNAL (toggled (bool)), + this, TQT_SLOT (slotUpdate ())); + connect (m_angle270RadioButton, TQT_SIGNAL (toggled (bool)), + this, TQT_SLOT (slotUpdate ())); - connect (m_angleCustomRadioButton, SIGNAL (toggled (bool)), - this, SLOT (slotAngleCustomRadioButtonToggled (bool))); - connect (m_angleCustomRadioButton, SIGNAL (toggled (bool)), - this, SLOT (slotUpdate ())); + connect (m_angleCustomRadioButton, TQT_SIGNAL (toggled (bool)), + this, TQT_SLOT (slotAngleCustomRadioButtonToggled (bool))); + connect (m_angleCustomRadioButton, TQT_SIGNAL (toggled (bool)), + this, TQT_SLOT (slotUpdate ())); - connect (m_angleCustomInput, SIGNAL (valueChanged (int)), - this, SLOT (slotUpdate ())); + connect (m_angleCustomInput, TQT_SIGNAL (valueChanged (int)), + this, TQT_SLOT (slotUpdate ())); } @@ -406,16 +406,16 @@ int kpToolRotateDialog::angle () const // private virtual [base kpToolPreviewDialog] -QSize kpToolRotateDialog::newDimensions () const +TQSize kpToolRotateDialog::newDimensions () const { - QWMatrix matrix = kpPixmapFX::rotateMatrix (m_oldWidth, m_oldHeight, angle ()); - // TODO: Should we be using QWMatrix::Areas? - QRect rect = matrix.map (QRect (0, 0, m_oldWidth, m_oldHeight)); + TQWMatrix matrix = kpPixmapFX::rotateMatrix (m_oldWidth, m_oldHeight, angle ()); + // TODO: Should we be using TQWMatrix::Areas? + TQRect rect = matrix.map (TQRect (0, 0, m_oldWidth, m_oldHeight)); return rect.size (); } // private virtual [base kpToolPreviewDialog] -QPixmap kpToolRotateDialog::transformPixmap (const QPixmap &pixmap, +TQPixmap kpToolRotateDialog::transformPixmap (const TQPixmap &pixmap, int targetWidth, int targetHeight) const { return kpPixmapFX::rotate (pixmap, angle (), @@ -447,7 +447,7 @@ void kpToolRotateDialog::slotUpdate () // private slot virtual [base KDialogBase] void kpToolRotateDialog::slotOk () { - QString message, caption, continueButtonText; + TQString message, caption, continueButtonText; if (document ()->selection ()) { diff --git a/kolourpaint/tools/kptoolrotate.h b/kolourpaint/tools/kptoolrotate.h index 887473dc..1cff0884 100644 --- a/kolourpaint/tools/kptoolrotate.h +++ b/kolourpaint/tools/kptoolrotate.h @@ -29,8 +29,8 @@ #ifndef __kptoolrotate_h__ #define __kptoolrotate_h__ -#include <qpixmap.h> -#include <qpoint.h> +#include <tqpixmap.h> +#include <tqpoint.h> #include <kdialogbase.h> @@ -40,9 +40,9 @@ #include <kptoolpreviewdialog.h> -class QButtonGroup; -class QRadioButton; -class QString; +class TQButtonGroup; +class TQRadioButton; +class TQString; class KIntNumInput; @@ -59,7 +59,7 @@ public: kpMainWindow *mainWindow); virtual ~kpToolRotateCommand (); - virtual QString name () const; + virtual TQString name () const; virtual int size () const; @@ -73,7 +73,7 @@ private: kpColor m_backgroundColor; bool m_losslessRotation; - QPixmap m_oldPixmap; + TQPixmap m_oldPixmap; kpSelection m_oldSelection; }; @@ -102,8 +102,8 @@ public: int angle () const; // 0 <= angle < 360 (clockwise); private: - virtual QSize newDimensions () const; - virtual QPixmap transformPixmap (const QPixmap &pixmap, + virtual TQSize newDimensions () const; + virtual TQPixmap transformPixmap (const TQPixmap &pixmap, int targetWidth, int targetHeight) const; private slots: @@ -114,11 +114,11 @@ private slots: virtual void slotOk (); private: - QRadioButton *m_antiClockwiseRadioButton, + TQRadioButton *m_antiClockwiseRadioButton, *m_clockwiseRadioButton; - QButtonGroup *m_angleButtonGroup; - QRadioButton *m_angle90RadioButton, + TQButtonGroup *m_angleButtonGroup; + TQRadioButton *m_angle90RadioButton, *m_angle180RadioButton, *m_angle270RadioButton, *m_angleCustomRadioButton; diff --git a/kolourpaint/tools/kptoolselection.cpp b/kolourpaint/tools/kptoolselection.cpp index f664f01b..7812c4f9 100644 --- a/kolourpaint/tools/kptoolselection.cpp +++ b/kolourpaint/tools/kptoolselection.cpp @@ -31,12 +31,12 @@ #include <kptoolselection.h> -#include <qapplication.h> -#include <qbitmap.h> -#include <qcursor.h> -#include <qpainter.h> -#include <qpopupmenu.h> -#include <qtimer.h> +#include <tqapplication.h> +#include <tqbitmap.h> +#include <tqcursor.h> +#include <tqpainter.h> +#include <tqpopupmenu.h> +#include <tqtimer.h> #include <kdebug.h> #include <klocale.h> @@ -53,8 +53,8 @@ kpToolSelection::kpToolSelection (Mode mode, - const QString &text, - const QString &description, + const TQString &text, + const TQString &description, int key, kpMainWindow *mainWindow, const char *name) @@ -65,13 +65,13 @@ kpToolSelection::kpToolSelection (Mode mode, m_currentResizeScaleCommand (0), m_toolWidgetOpaqueOrTransparent (0), m_currentCreateTextCommand (0), - m_createNOPTimer (new QTimer (this)), - m_RMBMoveUpdateGUITimer (new QTimer (this)) + m_createNOPTimer (new TQTimer (this)), + m_RMBMoveUpdateGUITimer (new TQTimer (this)) { - connect (m_createNOPTimer, SIGNAL (timeout ()), - this, SLOT (delayedDraw ())); - connect (m_RMBMoveUpdateGUITimer, SIGNAL (timeout ()), - this, SLOT (slotRMBMoveUpdateGUI ())); + connect (m_createNOPTimer, TQT_SIGNAL (timeout ()), + this, TQT_SLOT (delayedDraw ())); + connect (m_RMBMoveUpdateGUITimer, TQT_SIGNAL (timeout ()), + this, TQT_SLOT (slotRMBMoveUpdateGUI ())); } kpToolSelection::~kpToolSelection () @@ -121,7 +121,7 @@ bool kpToolSelection::onSelectionToSelectText () const // public -QString kpToolSelection::haventBegunDrawUserMessage () const +TQString kpToolSelection::haventBegunDrawUserMessage () const { #if DEBUG_KP_TOOL_SELECTION && 0 kdDebug () << "kpToolSelection::haventBegunDrawUserMessage()" @@ -180,8 +180,8 @@ void kpToolSelection::begin () if (m_toolWidgetOpaqueOrTransparent) { - connect (m_toolWidgetOpaqueOrTransparent, SIGNAL (isOpaqueChanged (bool)), - this, SLOT (slotIsOpaqueChanged ())); + connect (m_toolWidgetOpaqueOrTransparent, TQT_SIGNAL (isOpaqueChanged (bool)), + this, TQT_SLOT (slotIsOpaqueChanged ())); m_toolWidgetOpaqueOrTransparent->show (); } } @@ -197,7 +197,7 @@ void kpToolSelection::begin () } viewManager ()->restoreQueueUpdates (); - m_startDragFromSelectionTopLeft = QPoint (); + m_startDragFromSelectionTopLeft = TQPoint (); m_dragType = Unknown; m_dragHasBegun = false; m_hadSelectionBeforeDrag = false; // arbitrary @@ -225,8 +225,8 @@ void kpToolSelection::end () if (m_toolWidgetOpaqueOrTransparent) { - disconnect (m_toolWidgetOpaqueOrTransparent, SIGNAL (isOpaqueChanged (bool)), - this, SLOT (slotIsOpaqueChanged ())); + disconnect (m_toolWidgetOpaqueOrTransparent, TQT_SIGNAL (isOpaqueChanged (bool)), + this, TQT_SLOT (slotIsOpaqueChanged ())); m_toolWidgetOpaqueOrTransparent = 0; } @@ -251,8 +251,8 @@ void kpToolSelection::beginDraw () #if DEBUG_KP_TOOL_SELECTION kdDebug () << "kpToolSelection::beginDraw() m_startPoint=" << m_startPoint - << " QCursor::pos() view startPoint=" - << m_viewUnderStartPoint->mapFromGlobal (QCursor::pos ()) + << " TQCursor::pos() view startPoint=" + << m_viewUnderStartPoint->mapFromGlobal (TQCursor::pos ()) << endl; #endif @@ -267,7 +267,7 @@ void kpToolSelection::beginDraw () // Currently used only to end the current text if (hasBegunShape ()) - endShape (m_currentPoint, QRect (m_startPoint/* TODO: wrong */, m_currentPoint).normalize ()); + endShape (m_currentPoint, TQRect (m_startPoint/* TODO: wrong */, m_currentPoint).normalize ()); m_dragType = Create; m_dragHasBegun = false; @@ -280,7 +280,7 @@ void kpToolSelection::beginDraw () #if DEBUG_KP_TOOL_SELECTION kdDebug () << "\thas sel region rect=" << sel->boundingRect () << endl; #endif - QRect selectionRect = sel->boundingRect (); + TQRect selectionRect = sel->boundingRect (); if (onSelectionResizeHandle () && !controlOrShiftPressed ()) { @@ -366,14 +366,14 @@ void kpToolSelection::beginDraw () // protected -const QCursor &kpToolSelection::cursor () const +const TQCursor &kpToolSelection::cursor () const { #if DEBUG_KP_TOOL_SELECTION && 1 kdDebug () << "kpToolSelection::cursor()" << " m_currentPoint=" << m_currentPoint - << " QCursor::pos() view under cursor=" + << " TQCursor::pos() view under cursor=" << (viewUnderCursor () ? - viewUnderCursor ()->mapFromGlobal (QCursor::pos ()) : + viewUnderCursor ()->mapFromGlobal (TQCursor::pos ()) : KP_INVALID_POINT) << " controlOrShiftPressed=" << controlOrShiftPressed () << endl; @@ -430,7 +430,7 @@ const QCursor &kpToolSelection::cursor () const } // virtual -void kpToolSelection::hover (const QPoint &point) +void kpToolSelection::hover (const TQPoint &point) { #if DEBUG_KP_TOOL_SELECTION && 1 kdDebug () << "kpToolSelection::hover" << point << endl; @@ -449,7 +449,7 @@ void kpToolSelection::hover (const QPoint &point) setUserShapeSize (KP_INVALID_SIZE); } - QString mess = haventBegunDrawUserMessage (); + TQString mess = haventBegunDrawUserMessage (); if (mess != userMessage ()) setUserMessage (mess); } @@ -457,12 +457,12 @@ void kpToolSelection::hover (const QPoint &point) // protected void kpToolSelection::popupRMBMenu () { - QPopupMenu *pop = mainWindow () ? mainWindow ()->selectionToolRMBMenu () : 0; + TQPopupMenu *pop = mainWindow () ? mainWindow ()->selectionToolRMBMenu () : 0; if (!pop) return; // WARNING: enters event loop - may re-enter view/tool event handlers - pop->exec (QCursor::pos ()); + pop->exec (TQCursor::pos ()); // Cursor may have moved while menu up, triggering mouseMoveEvents // for the menu - not the view. Update cursor position now. @@ -513,16 +513,16 @@ void kpToolSelection::delayedDraw () if (hasBegunDraw ()) { draw (m_currentPoint, m_lastPoint, - QRect (m_startPoint, m_currentPoint).normalize ()); + TQRect (m_startPoint, m_currentPoint).normalize ()); } } // virtual -void kpToolSelection::draw (const QPoint &inThisPoint, const QPoint & /*lastPoint*/, - const QRect &inNormalizedRect) +void kpToolSelection::draw (const TQPoint &inThisPoint, const TQPoint & /*lastPoint*/, + const TQRect &inNormalizedRect) { - QPoint thisPoint = inThisPoint; - QRect normalizedRect = inNormalizedRect; + TQPoint thisPoint = inThisPoint; + TQRect normalizedRect = inNormalizedRect; #if DEBUG_KP_TOOL_SELECTION && 1 kdDebug () << "kpToolSelection::draw" << thisPoint @@ -612,12 +612,12 @@ void kpToolSelection::draw (const QPoint &inThisPoint, const QPoint & /*lastPoin { case kpToolSelection::Rectangle: { - const QRect usefulRect = normalizedRect.intersect (document ()->rect ()); + const TQRect usefulRect = normalizedRect.intersect (document ()->rect ()); document ()->setSelection (kpSelection (kpSelection::Rectangle, usefulRect, mainWindow ()->selectionTransparency ())); setUserShapePoints (m_startPoint, - QPoint (QMAX (0, QMIN (m_currentPoint.x (), document ()->width () - 1)), + TQPoint (QMAX (0, QMIN (m_currentPoint.x (), document ()->width () - 1)), QMAX (0, QMIN (m_currentPoint.y (), document ()->height () - 1)))); break; } @@ -705,11 +705,11 @@ void kpToolSelection::draw (const QPoint &inThisPoint, const QPoint & /*lastPoin #if DEBUG_KP_TOOL_SELECTION && 1 kdDebug () << "\t\tnormalizedRect=" << normalizedRect << " kpSelection::preferredMinimumSize=" - << QSize (minimumWidth, minimumHeight) + << TQSize (minimumWidth, minimumHeight) << endl; #endif - QValueVector <QString> textLines (1, QString ()); + TQValueVector <TQString> textLines (1, TQString ()); kpSelection sel (normalizedRect, textLines, textStyle); if (!m_currentCreateTextCommand) @@ -725,7 +725,7 @@ void kpToolSelection::draw (const QPoint &inThisPoint, const QPoint & /*lastPoin viewManager ()->setTextCursorPosition (0, 0); document ()->setSelection (sel); - QPoint actualEndPoint = KP_INVALID_POINT; + TQPoint actualEndPoint = KP_INVALID_POINT; if (m_startPoint == normalizedRect.topLeft ()) actualEndPoint = normalizedRect.bottomRight (); else if (m_startPoint == normalizedRect.bottomRight ()) @@ -744,7 +744,7 @@ void kpToolSelection::draw (const QPoint &inThisPoint, const QPoint & /*lastPoin setUserShapePoints (m_startPoint, m_currentPoint); break; case kpToolSelection::FreeForm: - QPointArray points; + TQPointArray points; if (document ()->selection ()) points = document ()->selection ()->points (); @@ -785,7 +785,7 @@ void kpToolSelection::draw (const QPoint &inThisPoint, const QPoint & /*lastPoin kpSelection *sel = document ()->selection (); - QRect targetSelRect = QRect (thisPoint.x () - m_startDragFromSelectionTopLeft.x (), + TQRect targetSelRect = TQRect (thisPoint.x () - m_startDragFromSelectionTopLeft.x (), thisPoint.y () - m_startDragFromSelectionTopLeft.y (), sel->width (), sel->height ()); @@ -845,7 +845,7 @@ void kpToolSelection::draw (const QPoint &inThisPoint, const QPoint & /*lastPoin if (!sel->pixmap () && !m_currentPullFromDocumentCommand) { m_currentPullFromDocumentCommand = new kpToolSelectionPullFromDocumentCommand ( - QString::null/*uninteresting child of macro cmd*/, + TQString::null/*uninteresting child of macro cmd*/, mainWindow ()); m_currentPullFromDocumentCommand->execute (); } @@ -853,7 +853,7 @@ void kpToolSelection::draw (const QPoint &inThisPoint, const QPoint & /*lastPoin if (!m_currentMoveCommand) { m_currentMoveCommand = new kpToolSelectionMoveCommand ( - QString::null/*uninteresting child of macro cmd*/, + TQString::null/*uninteresting child of macro cmd*/, mainWindow ()); m_currentMoveCommandIsSmear = false; } @@ -876,8 +876,8 @@ void kpToolSelection::draw (const QPoint &inThisPoint, const QPoint & /*lastPoin //viewManager ()->restoreFastUpdates (); //viewManager ()->restoreQueueUpdates (); - QPoint start = m_currentMoveCommand->originalSelection ().topLeft (); - QPoint end = targetSelRect.topLeft (); + TQPoint start = m_currentMoveCommand->originalSelection ().topLeft (); + TQPoint end = targetSelRect.topLeft (); setUserShapePoints (start, end, false/*don't set size*/); setUserShapeSize (end.x () - start.x (), end.y () - start.y ()); } @@ -895,7 +895,7 @@ void kpToolSelection::draw (const QPoint &inThisPoint, const QPoint & /*lastPoin kdDebug () << "\t\tnop" << endl; #endif - setUserShapePoints (QPoint (sel->width (), sel->height ())); + setUserShapePoints (TQPoint (sel->width (), sel->height ())); return; } @@ -903,7 +903,7 @@ void kpToolSelection::draw (const QPoint &inThisPoint, const QPoint & /*lastPoin if (!sel->pixmap () && !m_currentPullFromDocumentCommand) { m_currentPullFromDocumentCommand = new kpToolSelectionPullFromDocumentCommand ( - QString::null/*uninteresting child of macro cmd*/, + TQString::null/*uninteresting child of macro cmd*/, mainWindow ()); m_currentPullFromDocumentCommand->execute (); } @@ -993,13 +993,13 @@ void kpToolSelection::draw (const QPoint &inThisPoint, const QPoint & /*lastPoin viewManager ()->setFastUpdates (); m_currentResizeScaleCommand->resizeAndMoveTo (newWidth, newHeight, - QPoint (newX, newY), + TQPoint (newX, newY), true/*smooth scale delayed*/); viewManager ()->restoreFastUpdates (); - setUserShapePoints (QPoint (originalSelection.width (), + setUserShapePoints (TQPoint (originalSelection.width (), originalSelection.height ()), - QPoint (newWidth, + TQPoint (newWidth, newHeight), false/*don't set size*/); setUserShapeSize (newWidth - originalSelection.width (), @@ -1111,7 +1111,7 @@ void kpToolSelection::releasedAllButtons () } // virtual -void kpToolSelection::endDraw (const QPoint & /*thisPoint*/, const QRect & /*normalizedRect*/) +void kpToolSelection::endDraw (const TQPoint & /*thisPoint*/, const TQRect & /*normalizedRect*/) { m_createNOPTimer->stop (); m_RMBMoveUpdateGUITimer->stop (); @@ -1172,7 +1172,7 @@ void kpToolSelection::endDraw (const QPoint & /*thisPoint*/, const QRect & /*nor selection = m_currentResizeScaleCommand->originalSelection (); // just the border - selection.setPixmap (QPixmap ()); + selection.setPixmap (TQPixmap ()); kpCommand *createCommand = new kpToolSelectionCreateCommand ( i18n ("Selection: Create"), @@ -1231,7 +1231,7 @@ void kpToolSelection::endDraw (const QPoint & /*thisPoint*/, const QRect & /*nor // protected virtual [base kpTool] -void kpToolSelection::keyPressEvent (QKeyEvent *e) +void kpToolSelection::keyPressEvent (TQKeyEvent *e) { #if DEBUG_KP_TOOL_SELECTION && 0 kdDebug () << "kpToolSelection::keyPressEvent(e->text='" << e->text () << "')" << endl; @@ -1270,7 +1270,7 @@ void kpToolSelection::keyPressEvent (QKeyEvent *e) // private slot -void kpToolSelection::selectionTransparencyChanged (const QString & /*name*/) +void kpToolSelection::selectionTransparencyChanged (const TQString & /*name*/) { #if 0 #if DEBUG_KP_TOOL_SELECTION @@ -1356,7 +1356,7 @@ void kpToolSelection::slotIsOpaqueChanged () kdDebug () << "\thave sel - set transparency" << endl; #endif - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); if (hasBegunShape ()) endShapeInternal (); @@ -1374,7 +1374,7 @@ void kpToolSelection::slotIsOpaqueChanged () mainWindow ()), false/* no exec*/); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } } @@ -1400,7 +1400,7 @@ void kpToolSelection::slotBackgroundColorChanged (const kpColor &) kdDebug () << "\thave sel - set transparency" << endl; #endif - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); kpSelectionTransparency st = mainWindow ()->selectionTransparency (); kpSelectionTransparency oldST = st; @@ -1413,7 +1413,7 @@ void kpToolSelection::slotBackgroundColorChanged (const kpColor &) mainWindow ()), false/* no exec*/); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } } @@ -1439,7 +1439,7 @@ void kpToolSelection::slotColorSimilarityChanged (double, int) kdDebug () << "\thave sel - set transparency" << endl; #endif - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); kpSelectionTransparency st = mainWindow ()->selectionTransparency (); kpSelectionTransparency oldST = st; @@ -1452,7 +1452,7 @@ void kpToolSelection::slotColorSimilarityChanged (double, int) mainWindow ()), false/* no exec*/); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } } @@ -1461,7 +1461,7 @@ void kpToolSelection::slotColorSimilarityChanged (double, int) * kpToolSelectionCreateCommand */ -kpToolSelectionCreateCommand::kpToolSelectionCreateCommand (const QString &name, +kpToolSelectionCreateCommand::kpToolSelectionCreateCommand (const TQString &name, const kpSelection &fromSelection, kpMainWindow *mainWindow) : kpNamedCommand (name, mainWindow), @@ -1595,7 +1595,7 @@ void kpToolSelectionCreateCommand::unexecute () * kpToolSelectionPullFromDocumentCommand */ -kpToolSelectionPullFromDocumentCommand::kpToolSelectionPullFromDocumentCommand (const QString &name, +kpToolSelectionPullFromDocumentCommand::kpToolSelectionPullFromDocumentCommand (const TQString &name, kpMainWindow *mainWindow) : kpNamedCommand (name, mainWindow), m_backgroundColor (mainWindow ? mainWindow->backgroundColor () : kpColor::invalid), @@ -1704,7 +1704,7 @@ void kpToolSelectionPullFromDocumentCommand::unexecute () // simply selecting another region as to do that, a destroy command // must have been used. doc->selectionCopyOntoDocument (false/*use opaque pixmap*/); - doc->selection ()->setPixmap (QPixmap ()); + doc->selection ()->setPixmap (TQPixmap ()); delete m_originalSelectionRegion; m_originalSelectionRegion = new kpSelection (*doc->selection ()); @@ -1715,7 +1715,7 @@ void kpToolSelectionPullFromDocumentCommand::unexecute () * kpToolSelectionTransparencyCommand */ -kpToolSelectionTransparencyCommand::kpToolSelectionTransparencyCommand (const QString &name, +kpToolSelectionTransparencyCommand::kpToolSelectionTransparencyCommand (const TQString &name, const kpSelectionTransparency &st, const kpSelectionTransparency &oldST, kpMainWindow *mainWindow) @@ -1747,14 +1747,14 @@ void kpToolSelectionTransparencyCommand::execute () if (!doc) return; - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); m_mainWindow->setSelectionTransparency (m_st, true/*force colour change*/); if (doc->selection ()) doc->selection ()->setTransparency (m_st); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } // public virtual [base kpCommand] @@ -1768,14 +1768,14 @@ void kpToolSelectionTransparencyCommand::unexecute () if (!doc) return; - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); m_mainWindow->setSelectionTransparency (m_oldST, true/*force colour change*/); if (doc->selection ()) doc->selection ()->setTransparency (m_oldST); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } @@ -1783,7 +1783,7 @@ void kpToolSelectionTransparencyCommand::unexecute () * kpToolSelectionMoveCommand */ -kpToolSelectionMoveCommand::kpToolSelectionMoveCommand (const QString &name, +kpToolSelectionMoveCommand::kpToolSelectionMoveCommand (const TQString &name, kpMainWindow *mainWindow) : kpNamedCommand (name, mainWindow) { @@ -1810,7 +1810,7 @@ kpSelection kpToolSelectionMoveCommand::originalSelection () const << " sel=" << (doc ? doc->selection () : 0) << endl; - return kpSelection (kpSelection::Rectangle, QRect ()); + return kpSelection (kpSelection::Rectangle, TQRect ()); } kpSelection selection = *doc->selection(); @@ -1858,8 +1858,8 @@ void kpToolSelectionMoveCommand::execute () if (vm) vm->setQueueUpdates (); - QPointArray::ConstIterator copyOntoDocumentPointsEnd = m_copyOntoDocumentPoints.end (); - for (QPointArray::ConstIterator it = m_copyOntoDocumentPoints.begin (); + TQPointArray::ConstIterator copyOntoDocumentPointsEnd = m_copyOntoDocumentPoints.end (); + for (TQPointArray::ConstIterator it = m_copyOntoDocumentPoints.begin (); it != copyOntoDocumentPointsEnd; it++) { @@ -1921,7 +1921,7 @@ void kpToolSelectionMoveCommand::unexecute () } // public -void kpToolSelectionMoveCommand::moveTo (const QPoint &point, bool moveLater) +void kpToolSelectionMoveCommand::moveTo (const TQPoint &point, bool moveLater) { #if DEBUG_KP_TOOL_SELECTION && 0 kdDebug () << "kpToolSelectionMoveCommand::moveTo" << point @@ -1965,7 +1965,7 @@ void kpToolSelectionMoveCommand::moveTo (const QPoint &point, bool moveLater) // public void kpToolSelectionMoveCommand::moveTo (int x, int y, bool moveLater) { - moveTo (QPoint (x, y), moveLater); + moveTo (TQPoint (x, y), moveLater); } // public @@ -1997,7 +1997,7 @@ void kpToolSelectionMoveCommand::copyOntoDocument () if (m_oldDocumentPixmap.isNull ()) m_oldDocumentPixmap = *doc->pixmap (); - QRect selBoundingRect = sel->boundingRect (); + TQRect selBoundingRect = sel->boundingRect (); m_documentBoundingRect.unite (selBoundingRect); doc->selectionCopyOntoDocument (); @@ -2029,7 +2029,7 @@ kpToolSelectionResizeScaleCommand::kpToolSelectionResizeScaleCommand ( i18n ("Text: Resize Box") : i18n ("Selection: Smooth Scale"), mainWindow), - m_smoothScaleTimer (new QTimer (this)) + m_smoothScaleTimer (new TQTimer (this)) { m_originalSelection = *selection (); @@ -2037,8 +2037,8 @@ kpToolSelectionResizeScaleCommand::kpToolSelectionResizeScaleCommand ( m_newWidth = selection ()->width (); m_newHeight = selection ()->height (); - connect (m_smoothScaleTimer, SIGNAL (timeout ()), - this, SLOT (resizeScaleAndMove ())); + connect (m_smoothScaleTimer, TQT_SIGNAL (timeout ()), + this, TQT_SLOT (resizeScaleAndMove ())); } kpToolSelectionResizeScaleCommand::~kpToolSelectionResizeScaleCommand () @@ -2061,13 +2061,13 @@ kpSelection kpToolSelectionResizeScaleCommand::originalSelection () const // public -QPoint kpToolSelectionResizeScaleCommand::topLeft () const +TQPoint kpToolSelectionResizeScaleCommand::topLeft () const { return m_newTopLeft; } // public -void kpToolSelectionResizeScaleCommand::moveTo (const QPoint &point) +void kpToolSelectionResizeScaleCommand::moveTo (const TQPoint &point) { if (point == m_newTopLeft) return; @@ -2105,7 +2105,7 @@ void kpToolSelectionResizeScaleCommand::resize (int width, int height, // public void kpToolSelectionResizeScaleCommand::resizeAndMoveTo (int width, int height, - const QPoint &point, + const TQPoint &point, bool delayed) { if (width == m_newWidth && height == m_newHeight && @@ -2149,7 +2149,7 @@ void kpToolSelectionResizeScaleCommand::resizeScaleAndMove (bool delayed) else { newSel = kpSelection (kpSelection::Rectangle, - QRect (m_originalSelection.x (), + TQRect (m_originalSelection.x (), m_originalSelection.y (), m_newWidth, m_newHeight), @@ -2203,7 +2203,7 @@ void kpToolSelectionResizeScaleCommand::finalize () // public virtual [base kpToolResizeScaleCommand] void kpToolSelectionResizeScaleCommand::execute () { - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); killSmoothScaleTimer (); @@ -2212,13 +2212,13 @@ void kpToolSelectionResizeScaleCommand::execute () if (m_mainWindow->tool ()) m_mainWindow->tool ()->somethingBelowTheCursorChanged (); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } // public virtual [base kpToolResizeScaleCommand] void kpToolSelectionResizeScaleCommand::unexecute () { - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); killSmoothScaleTimer (); @@ -2227,7 +2227,7 @@ void kpToolSelectionResizeScaleCommand::unexecute () if (m_mainWindow->tool ()) m_mainWindow->tool ()->somethingBelowTheCursorChanged (); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } @@ -2235,7 +2235,7 @@ void kpToolSelectionResizeScaleCommand::unexecute () * kpToolSelectionDestroyCommand */ -kpToolSelectionDestroyCommand::kpToolSelectionDestroyCommand (const QString &name, +kpToolSelectionDestroyCommand::kpToolSelectionDestroyCommand (const TQString &name, bool pushOntoDocument, kpMainWindow *mainWindow) : kpNamedCommand (name, mainWindow), diff --git a/kolourpaint/tools/kptoolselection.h b/kolourpaint/tools/kptoolselection.h index ee978a15..1f209d86 100644 --- a/kolourpaint/tools/kptoolselection.h +++ b/kolourpaint/tools/kptoolselection.h @@ -30,10 +30,10 @@ #define __kp_tool_selection_h__ -#include <qpixmap.h> -#include <qpoint.h> -#include <qpointarray.h> -#include <qrect.h> +#include <tqpixmap.h> +#include <tqpoint.h> +#include <tqpointarray.h> +#include <tqrect.h> #include <kpcolor.h> #include <kpcommandhistory.h> @@ -42,9 +42,9 @@ #include <kptool.h> -class QPoint; -class QRect; -class QTimer; +class TQPoint; +class TQRect; +class TQTimer; class kpMainWindow; class kpSelection; @@ -64,7 +64,7 @@ public: enum Mode {Rectangle, Ellipse, FreeForm, Text}; kpToolSelection (Mode mode, - const QString &text, const QString &description, + const TQString &text, const TQString &description, int key, kpMainWindow *mainWindow, const char *name); virtual ~kpToolSelection (); @@ -80,7 +80,7 @@ protected: bool onSelectionToSelectText () const; public: - QString haventBegunDrawUserMessage () const; + TQString haventBegunDrawUserMessage () const; virtual void begin (); virtual void end (); @@ -91,9 +91,9 @@ public: virtual void beginDraw (); protected: - const QCursor &cursor () const; + const TQCursor &cursor () const; public: - virtual void hover (const QPoint &point); + virtual void hover (const TQPoint &point); protected: void popupRMBMenu (); void setSelectionBorderForMove (); @@ -101,17 +101,17 @@ protected slots: void slotRMBMoveUpdateGUI (); void delayedDraw (); public: - virtual void draw (const QPoint &thisPoint, const QPoint &lastPoint, - const QRect &normalizedRect); + virtual void draw (const TQPoint &thisPoint, const TQPoint &lastPoint, + const TQRect &normalizedRect); virtual void cancelShape (); virtual void releasedAllButtons (); - virtual void endDraw (const QPoint &thisPoint, const QRect &normalizedRect); + virtual void endDraw (const TQPoint &thisPoint, const TQRect &normalizedRect); protected: - virtual void keyPressEvent (QKeyEvent *e); + virtual void keyPressEvent (TQKeyEvent *e); protected: - void selectionTransparencyChanged (const QString &name); + void selectionTransparencyChanged (const TQString &name); protected slots: virtual void slotIsOpaqueChanged (); @@ -121,7 +121,7 @@ protected slots: protected: Mode m_mode; - QPoint m_startDragFromSelectionTopLeft; + TQPoint m_startDragFromSelectionTopLeft; enum DragType { Unknown, Create, Move, SelectText, ResizeScale @@ -140,14 +140,14 @@ protected: kpToolSelectionCreateCommand *m_currentCreateTextCommand; bool m_cancelledShapeButStillHoldingButtons; - QTimer *m_createNOPTimer, *m_RMBMoveUpdateGUITimer; + TQTimer *m_createNOPTimer, *m_RMBMoveUpdateGUITimer; }; class kpToolSelectionCreateCommand : public kpNamedCommand { public: // (if fromSelection doesn't have a pixmap, it will only recreate the region) - kpToolSelectionCreateCommand (const QString &name, const kpSelection &fromSelection, + kpToolSelectionCreateCommand (const TQString &name, const kpSelection &fromSelection, kpMainWindow *mainWindow); virtual ~kpToolSelectionCreateCommand (); @@ -170,7 +170,7 @@ private: class kpToolSelectionPullFromDocumentCommand : public kpNamedCommand { public: - kpToolSelectionPullFromDocumentCommand (const QString &name, kpMainWindow *mainWindow); + kpToolSelectionPullFromDocumentCommand (const TQString &name, kpMainWindow *mainWindow); virtual ~kpToolSelectionPullFromDocumentCommand (); virtual int size () const; @@ -186,7 +186,7 @@ private: class kpToolSelectionTransparencyCommand : public kpNamedCommand { public: - kpToolSelectionTransparencyCommand (const QString &name, + kpToolSelectionTransparencyCommand (const TQString &name, const kpSelectionTransparency &st, const kpSelectionTransparency &oldST, kpMainWindow *mainWindow); @@ -204,7 +204,7 @@ private: class kpToolSelectionMoveCommand : public kpNamedCommand { public: - kpToolSelectionMoveCommand (const QString &name, kpMainWindow *mainWindow); + kpToolSelectionMoveCommand (const TQString &name, kpMainWindow *mainWindow); virtual ~kpToolSelectionMoveCommand (); kpSelection originalSelection () const; @@ -214,20 +214,20 @@ public: virtual void execute (); virtual void unexecute (); - void moveTo (const QPoint &point, bool moveLater = false); + void moveTo (const TQPoint &point, bool moveLater = false); void moveTo (int x, int y, bool moveLater = false); void copyOntoDocument (); void finalize (); private: - QPoint m_startPoint, m_endPoint; + TQPoint m_startPoint, m_endPoint; - QPixmap m_oldDocumentPixmap; + TQPixmap m_oldDocumentPixmap; // area of document affected (not the bounding rect of the sel) - QRect m_documentBoundingRect; + TQRect m_documentBoundingRect; - QPointArray m_copyOntoDocumentPoints; + TQPointArray m_copyOntoDocumentPoints; }; // You could subclass kpToolResizeScaleCommand and/or @@ -238,7 +238,7 @@ private: // 2. This is designed for the size and position to change several times // before execute(). // -class kpToolSelectionResizeScaleCommand : public QObject, +class kpToolSelectionResizeScaleCommand : public TQObject, public kpNamedCommand { Q_OBJECT @@ -252,15 +252,15 @@ public: public: kpSelection originalSelection () const; - QPoint topLeft () const; - void moveTo (const QPoint &point); + TQPoint topLeft () const; + void moveTo (const TQPoint &point); int width () const; int height () const; void resize (int width, int height, bool delayed = false); // (equivalent to resize() followed by moveTo() but faster) - void resizeAndMoveTo (int width, int height, const QPoint &point, + void resizeAndMoveTo (int width, int height, const TQPoint &point, bool delayed = false); protected: @@ -284,16 +284,16 @@ public: protected: kpSelection m_originalSelection; - QPoint m_newTopLeft; + TQPoint m_newTopLeft; int m_newWidth, m_newHeight; - QTimer *m_smoothScaleTimer; + TQTimer *m_smoothScaleTimer; }; class kpToolSelectionDestroyCommand : public kpNamedCommand { public: - kpToolSelectionDestroyCommand (const QString &name, bool pushOntoDocument, + kpToolSelectionDestroyCommand (const TQString &name, bool pushOntoDocument, kpMainWindow *mainWindow); virtual ~kpToolSelectionDestroyCommand (); @@ -304,7 +304,7 @@ public: private: bool m_pushOntoDocument; - QPixmap m_oldDocPixmap; + TQPixmap m_oldDocPixmap; kpSelection *m_oldSelection; int m_textRow, m_textCol; diff --git a/kolourpaint/tools/kptoolskew.cpp b/kolourpaint/tools/kptoolskew.cpp index f1e446be..dff1d19b 100644 --- a/kolourpaint/tools/kptoolskew.cpp +++ b/kolourpaint/tools/kptoolskew.cpp @@ -31,12 +31,12 @@ #include <kptoolskew.h> -#include <qapplication.h> -#include <qgroupbox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpushbutton.h> -#include <qwmatrix.h> +#include <tqapplication.h> +#include <tqgroupbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqwmatrix.h> #include <kdebug.h> #include <kiconloader.h> @@ -73,9 +73,9 @@ kpToolSkewCommand::~kpToolSkewCommand () // public virtual [base kpCommand] -QString kpToolSkewCommand::name () const +TQString kpToolSkewCommand::name () const { - QString opName = i18n ("Skew"); + TQString opName = i18n ("Skew"); if (m_actOnSelection) return i18n ("Selection: %1").arg (opName); @@ -100,14 +100,14 @@ void kpToolSkewCommand::execute () return; - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); - m_oldPixmapPtr = new QPixmap (); + m_oldPixmapPtr = new TQPixmap (); *m_oldPixmapPtr = *doc->pixmap (m_actOnSelection); - QPixmap newPixmap = kpPixmapFX::skew (*doc->pixmap (m_actOnSelection), + TQPixmap newPixmap = kpPixmapFX::skew (*doc->pixmap (m_actOnSelection), kpToolSkewDialog::horizontalAngleForPixmapFX (m_hangle), kpToolSkewDialog::verticalAngleForPixmapFX (m_vangle), m_backgroundColor); @@ -121,10 +121,10 @@ void kpToolSkewCommand::execute () // Calculate skewed points - QPointArray currentPoints = sel->points (); + TQPointArray currentPoints = sel->points (); currentPoints.translate (-currentPoints.boundingRect ().x (), -currentPoints.boundingRect ().y ()); - QWMatrix skewMatrix = kpPixmapFX::skewMatrix ( + TQWMatrix skewMatrix = kpPixmapFX::skewMatrix ( *doc->pixmap (m_actOnSelection), kpToolSkewDialog::horizontalAngleForPixmapFX (m_hangle), kpToolSkewDialog::verticalAngleForPixmapFX (m_vangle)); @@ -153,7 +153,7 @@ void kpToolSkewCommand::execute () << endl; #endif doc->setSelection (kpSelection (kpSelection::Rectangle, - QRect (currentPoints.boundingRect ().x (), + TQRect (currentPoints.boundingRect ().x (), currentPoints.boundingRect ().y (), newPixmap.width (), newPixmap.height ()), @@ -170,7 +170,7 @@ void kpToolSkewCommand::execute () } - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } // public virtual [base kpCommand] @@ -181,10 +181,10 @@ void kpToolSkewCommand::unexecute () return; - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); - QPixmap oldPixmap = *m_oldPixmapPtr; + TQPixmap oldPixmap = *m_oldPixmapPtr; delete m_oldPixmapPtr; m_oldPixmapPtr = 0; @@ -200,7 +200,7 @@ void kpToolSkewCommand::unexecute () } - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } @@ -252,37 +252,37 @@ kpToolSkewDialog::~kpToolSkewDialog () // private void kpToolSkewDialog::createAngleGroupBox () { - QGroupBox *angleGroupBox = new QGroupBox (i18n ("Angle"), mainWidget ()); + TQGroupBox *angleGroupBox = new TQGroupBox (i18n ("Angle"), mainWidget ()); addCustomWidget (angleGroupBox); - QLabel *horizontalSkewPixmapLabel = new QLabel (angleGroupBox); + TQLabel *horizontalSkewPixmapLabel = new TQLabel (angleGroupBox); horizontalSkewPixmapLabel->setPixmap (UserIcon ("image_skew_horizontal")); - QLabel *horizontalSkewLabel = new QLabel (i18n ("&Horizontal:"), angleGroupBox); + TQLabel *horizontalSkewLabel = new TQLabel (i18n ("&Horizontal:"), angleGroupBox); m_horizontalSkewInput = new KIntNumInput (s_lastHorizontalAngle, angleGroupBox); m_horizontalSkewInput->setMinValue (-89); m_horizontalSkewInput->setMaxValue (+89); - QLabel *horizontalSkewDegreesLabel = new QLabel (i18n ("degrees"), angleGroupBox); + TQLabel *horizontalSkewDegreesLabel = new TQLabel (i18n ("degrees"), angleGroupBox); - QLabel *verticalSkewPixmapLabel = new QLabel (angleGroupBox); + TQLabel *verticalSkewPixmapLabel = new TQLabel (angleGroupBox); verticalSkewPixmapLabel->setPixmap (UserIcon ("image_skew_vertical")); - QLabel *verticalSkewLabel = new QLabel (i18n ("&Vertical:"), angleGroupBox); + TQLabel *verticalSkewLabel = new TQLabel (i18n ("&Vertical:"), angleGroupBox); m_verticalSkewInput = new KIntNumInput (s_lastVerticalAngle, angleGroupBox); m_verticalSkewInput->setMinValue (-89); m_verticalSkewInput->setMaxValue (+89); - QLabel *verticalSkewDegreesLabel = new QLabel (i18n ("degrees"), angleGroupBox); + TQLabel *verticalSkewDegreesLabel = new TQLabel (i18n ("degrees"), angleGroupBox); horizontalSkewLabel->setBuddy (m_horizontalSkewInput); verticalSkewLabel->setBuddy (m_verticalSkewInput); - QGridLayout *angleLayout = new QGridLayout (angleGroupBox, 4, 4, + TQGridLayout *angleLayout = new TQGridLayout (angleGroupBox, 4, 4, marginHint () * 2, spacingHint ()); angleLayout->addWidget (horizontalSkewPixmapLabel, 0, 0); @@ -296,31 +296,31 @@ void kpToolSkewDialog::createAngleGroupBox () angleLayout->addWidget (verticalSkewDegreesLabel, 1, 3); - connect (m_horizontalSkewInput, SIGNAL (valueChanged (int)), - this, SLOT (slotUpdate ())); - connect (m_verticalSkewInput, SIGNAL (valueChanged (int)), - this, SLOT (slotUpdate ())); + connect (m_horizontalSkewInput, TQT_SIGNAL (valueChanged (int)), + this, TQT_SLOT (slotUpdate ())); + connect (m_verticalSkewInput, TQT_SIGNAL (valueChanged (int)), + this, TQT_SLOT (slotUpdate ())); } // private virtual [base kpToolPreviewDialog] -QSize kpToolSkewDialog::newDimensions () const +TQSize kpToolSkewDialog::newDimensions () const { kpDocument *doc = document (); if (!doc) - return QSize (); + return TQSize (); - QWMatrix skewMatrix = kpPixmapFX::skewMatrix (*doc->pixmap (), + TQWMatrix skewMatrix = kpPixmapFX::skewMatrix (*doc->pixmap (), horizontalAngleForPixmapFX (), verticalAngleForPixmapFX ()); - // TODO: Should we be using QWMatrix::Areas? - QRect skewRect = skewMatrix.mapRect (doc->rect (m_actOnSelection)); + // TODO: Should we be using TQWMatrix::Areas? + TQRect skewRect = skewMatrix.mapRect (doc->rect (m_actOnSelection)); - return QSize (skewRect.width (), skewRect.height ()); + return TQSize (skewRect.width (), skewRect.height ()); } // private virtual [base kpToolPreviewDialog] -QPixmap kpToolSkewDialog::transformPixmap (const QPixmap &pixmap, +TQPixmap kpToolSkewDialog::transformPixmap (const TQPixmap &pixmap, int targetWidth, int targetHeight) const { return kpPixmapFX::skew (pixmap, @@ -396,7 +396,7 @@ bool kpToolSkewDialog::isNoOp () const // private slot virtual [base KDialogBase] void kpToolSkewDialog::slotOk () { - QString message, caption, continueButtonText; + TQString message, caption, continueButtonText; if (document ()->selection ()) { diff --git a/kolourpaint/tools/kptoolskew.h b/kolourpaint/tools/kptoolskew.h index 570909c2..ae368020 100644 --- a/kolourpaint/tools/kptoolskew.h +++ b/kolourpaint/tools/kptoolskew.h @@ -29,7 +29,7 @@ #ifndef __kptool_skew_h__ #define __kptool_skew_h__ -#include <qpixmap.h> +#include <tqpixmap.h> #include <kpcommandhistory.h> #include <kdialogbase.h> @@ -38,9 +38,9 @@ #include <kpselection.h> #include <kptoolpreviewdialog.h> -class QGroupBox; -class QLabel; -class QPixmap; +class TQGroupBox; +class TQLabel; +class TQPixmap; class KIntNumInput; @@ -56,7 +56,7 @@ public: kpMainWindow *mainWindow); virtual ~kpToolSkewCommand (); - virtual QString name () const; + virtual TQString name () const; virtual int size () const; @@ -68,7 +68,7 @@ private: int m_hangle, m_vangle; kpColor m_backgroundColor; - QPixmap *m_oldPixmapPtr; + TQPixmap *m_oldPixmapPtr; kpSelection m_oldSelection; }; @@ -88,8 +88,8 @@ private: void createAngleGroupBox (); - virtual QSize newDimensions () const; - virtual QPixmap transformPixmap (const QPixmap &pixmap, + virtual TQSize newDimensions () const; + virtual TQPixmap transformPixmap (const TQPixmap &pixmap, int targetWidth, int targetHeight) const; void updateLastAngles (); diff --git a/kolourpaint/tools/kptooltext.cpp b/kolourpaint/tools/kptooltext.cpp index 73a60e66..e2261278 100644 --- a/kolourpaint/tools/kptooltext.cpp +++ b/kolourpaint/tools/kptooltext.cpp @@ -30,7 +30,7 @@ #include <kptooltext.h> -#include <qvaluevector.h> +#include <tqvaluevector.h> #include <kdebug.h> #include <klocale.h> @@ -131,7 +131,7 @@ void kpToolText::cancelShape () } // public virtual [base kpTool] -void kpToolText::endShape (const QPoint &thisPoint, const QRect &normalizedRect) +void kpToolText::endShape (const TQPoint &thisPoint, const TQRect &normalizedRect) { #if DEBUG_KP_TOOL_TEXT kdDebug () << "kpToolText::endShape()" << endl; @@ -152,7 +152,7 @@ void kpToolText::endShape (const QPoint &thisPoint, const QRect &normalizedRect) // protected virtual [base kpTool] -void kpToolText::keyPressEvent (QKeyEvent *e) +void kpToolText::keyPressEvent (TQKeyEvent *e) { #if DEBUG_KP_TOOL_TEXT kdDebug () << "kpToolText::keyPressEvent(e->text='" << e->text () << "')" << endl; @@ -180,14 +180,14 @@ void kpToolText::keyPressEvent (QKeyEvent *e) kdDebug () << "\tno text sel - passing on event to kpTool" << endl; #endif //if (hasBegunShape ()) - // endShape (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + // endShape (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); kpToolSelection::keyPressEvent (e); return; } - const QValueVector <QString> textLines = sel->textLines (); + const TQValueVector <TQString> textLines = sel->textLines (); int cursorRow = viewManager ()->textCursorRow (); int cursorCol = viewManager ()->textCursorCol (); @@ -202,7 +202,7 @@ void kpToolText::keyPressEvent (QKeyEvent *e) { // TODO: why not endShapeInternal(); ditto for everywhere else in this file? if (hasBegunShape ()) - endShape (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + endShape (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); m_enterCommand = new kpToolTextEnterCommand (i18n ("Text: New Line"), viewManager ()->textCursorRow (), viewManager ()->textCursorCol (), @@ -223,7 +223,7 @@ void kpToolText::keyPressEvent (QKeyEvent *e) if (!m_backspaceCommand) { if (hasBegunShape ()) - endShape (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + endShape (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); m_backspaceCommand = new kpToolTextBackspaceCommand (i18n ("Text: Backspace"), viewManager ()->textCursorRow (), viewManager ()->textCursorCol (), @@ -244,7 +244,7 @@ void kpToolText::keyPressEvent (QKeyEvent *e) if (!m_deleteCommand) { if (hasBegunShape ()) - endShape (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + endShape (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); m_deleteCommand = new kpToolTextDeleteCommand (i18n ("Text: Delete"), viewManager ()->textCursorRow (), viewManager ()->textCursorCol (), @@ -263,7 +263,7 @@ void kpToolText::keyPressEvent (QKeyEvent *e) #endif if (hasBegunShape ()) - endShape (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + endShape (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); if (cursorRow > 0) { @@ -281,7 +281,7 @@ void kpToolText::keyPressEvent (QKeyEvent *e) #endif if (hasBegunShape ()) - endShape (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + endShape (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); if (cursorRow < (int) textLines.size () - 1) { @@ -316,7 +316,7 @@ void kpToolText::keyPressEvent (QKeyEvent *e) } if (hasBegunShape ()) - endShape (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + endShape (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); if ((e->state () & Qt::ControlButton) == 0) { @@ -391,7 +391,7 @@ void kpToolText::keyPressEvent (QKeyEvent *e) } if (hasBegunShape ()) - endShape (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + endShape (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); if ((e->state () & Qt::ControlButton) == 0) { @@ -445,7 +445,7 @@ void kpToolText::keyPressEvent (QKeyEvent *e) #endif if (hasBegunShape ()) - endShape (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + endShape (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); if (e->state () & Qt::ControlButton) cursorRow = 0; @@ -463,7 +463,7 @@ void kpToolText::keyPressEvent (QKeyEvent *e) #endif if (hasBegunShape ()) - endShape (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + endShape (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); if (e->state () & Qt::ControlButton) cursorRow = textLines.size () - 1; @@ -479,7 +479,7 @@ void kpToolText::keyPressEvent (QKeyEvent *e) #if DEBUG_KP_TOOL_TEXT kdDebug () << "\ttext='" << e->text () << "'" << endl; #endif - QString usableText; + TQString usableText; for (int i = 0; i < (int) e->text ().length (); i++) { if (e->text ().at (i).isPrint ()) @@ -494,7 +494,7 @@ void kpToolText::keyPressEvent (QKeyEvent *e) if (!m_insertCommand) { if (hasBegunShape ()) - endShape (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + endShape (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); m_insertCommand = new kpToolTextInsertCommand (i18n ("Text: Write"), viewManager ()->textCursorRow (), viewManager ()->textCursorCol (), @@ -520,14 +520,14 @@ void kpToolText::keyPressEvent (QKeyEvent *e) << endl; #endif //if (hasBegunShape ()) - // endShape (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + // endShape (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); kpToolSelection::keyPressEvent (e); return; } } -void kpToolText::imStartEvent (QIMEvent *e) +void kpToolText::imStartEvent (TQIMEvent *e) { #if DEBUG_KP_TOOL_TEXT && 1 kdDebug () << "kpToolText::imStartEvent() text='" << e->text () @@ -545,10 +545,10 @@ void kpToolText::imStartEvent (QIMEvent *e) m_IMStartCursorRow = viewManager ()->textCursorRow (); m_IMStartCursorCol = viewManager ()->textCursorCol (); - m_IMPreeditStr = QString::null; + m_IMPreeditStr = TQString::null; } -void kpToolText::imComposeEvent (QIMEvent *e) +void kpToolText::imComposeEvent (TQIMEvent *e) { #if DEBUG_KP_TOOL_TEXT && 1 kdDebug () << "kpToolText::imComposeEvent() text='" << e->text () @@ -574,7 +574,7 @@ void kpToolText::imComposeEvent (QIMEvent *e) if (!m_deleteCommand) { if (hasBegunShape ()) - endShape (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + endShape (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); m_deleteCommand = new kpToolTextDeleteCommand (i18n ("Text: Delete"), viewManager ()->textCursorRow (), viewManager ()->textCursorCol (), @@ -593,7 +593,7 @@ void kpToolText::imComposeEvent (QIMEvent *e) if (!m_insertCommand) { if (hasBegunShape ()) - endShape (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + endShape (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); m_insertCommand = new kpToolTextInsertCommand (i18n ("Text: Write"), viewManager ()->textCursorRow (), viewManager ()->textCursorCol (), @@ -614,7 +614,7 @@ void kpToolText::imComposeEvent (QIMEvent *e) } } -void kpToolText::imEndEvent (QIMEvent *e) +void kpToolText::imEndEvent (TQIMEvent *e) { #if DEBUG_KP_TOOL_TEXT && 1 kdDebug () << "kpToolText::imEndEvent() text='" << e->text () @@ -640,7 +640,7 @@ void kpToolText::imEndEvent (QIMEvent *e) if (!m_deleteCommand) { if (hasBegunShape ()) - endShape (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + endShape (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); m_deleteCommand = new kpToolTextDeleteCommand (i18n ("Text: Delete"), viewManager ()->textCursorRow (), viewManager ()->textCursorCol (), @@ -651,16 +651,16 @@ void kpToolText::imEndEvent (QIMEvent *e) m_deleteCommand->addDelete (); } } - m_IMPreeditStr = QString::null; + m_IMPreeditStr = TQString::null; // commit string - QString inputStr = e->text(); + TQString inputStr = e->text(); if (inputStr.length() > 0) { if (!m_insertCommand) { if (hasBegunShape ()) - endShape (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + endShape (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); m_insertCommand = new kpToolTextInsertCommand (i18n ("Text: Write"), viewManager ()->textCursorRow (), viewManager ()->textCursorCol (), @@ -700,7 +700,7 @@ bool kpToolText::shouldChangeTextStyle () const } // protected -void kpToolText::changeTextStyle (const QString &name, +void kpToolText::changeTextStyle (const TQString &name, const kpTextStyle &newTextStyle, const kpTextStyle &oldTextStyle) { @@ -709,7 +709,7 @@ void kpToolText::changeTextStyle (const QString &name, #endif if (hasBegunShape ()) - endShape (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + endShape (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); commandHistory ()->addCommand ( new kpToolTextChangeStyleCommand ( @@ -809,8 +809,8 @@ void kpToolText::slotColorSimilarityChanged (double, int) // public slot -void kpToolText::slotFontFamilyChanged (const QString &fontFamily, - const QString &oldFontFamily) +void kpToolText::slotFontFamilyChanged (const TQString &fontFamily, + const TQString &oldFontFamily) { #if DEBUG_KP_TOOL_TEXT kdDebug () << "kpToolText::slotFontFamilyChanged() new=" @@ -941,7 +941,7 @@ void kpToolText::slotStrikeThruChanged (bool isStrikeThru) * kpToolTextChangeStyleCommand */ -kpToolTextChangeStyleCommand::kpToolTextChangeStyleCommand (const QString &name, +kpToolTextChangeStyleCommand::kpToolTextChangeStyleCommand (const TQString &name, const kpTextStyle &newTextStyle, const kpTextStyle &oldTextStyle, kpMainWindow *mainWindow) : kpNamedCommand (name, mainWindow), @@ -1009,8 +1009,8 @@ void kpToolTextChangeStyleCommand::unexecute () * kpToolTextInsertCommand */ -kpToolTextInsertCommand::kpToolTextInsertCommand (const QString &name, - int row, int col, QString newText, +kpToolTextInsertCommand::kpToolTextInsertCommand (const TQString &name, + int row, int col, TQString newText, kpMainWindow *mainWindow) : kpNamedCommand (name, mainWindow), m_row (row), m_col (col) @@ -1025,14 +1025,14 @@ kpToolTextInsertCommand::~kpToolTextInsertCommand () // public -void kpToolTextInsertCommand::addText (const QString &moreText) +void kpToolTextInsertCommand::addText (const TQString &moreText) { if (moreText.isEmpty ()) return; - QValueVector <QString> textLines = selection ()->textLines (); - const QString leftHalf = textLines [m_row].left (m_col); - const QString rightHalf = textLines [m_row].mid (m_col); + TQValueVector <TQString> textLines = selection ()->textLines (); + const TQString leftHalf = textLines [m_row].left (m_col); + const TQString rightHalf = textLines [m_row].mid (m_col); textLines [m_row] = leftHalf + moreText + rightHalf; selection ()->setTextLines (textLines); @@ -1046,7 +1046,7 @@ void kpToolTextInsertCommand::addText (const QString &moreText) // public virtual [base kpCommand] int kpToolTextInsertCommand::size () const { - return m_newText.length () * sizeof (QChar); + return m_newText.length () * sizeof (TQChar); } @@ -1055,8 +1055,8 @@ void kpToolTextInsertCommand::execute () { viewManager ()->setTextCursorPosition (m_row, m_col); - QString text = m_newText; - m_newText = QString::null; + TQString text = m_newText; + m_newText = TQString::null; addText (text); } @@ -1065,9 +1065,9 @@ void kpToolTextInsertCommand::unexecute () { viewManager ()->setTextCursorPosition (m_row, m_col); - QValueVector <QString> textLines = selection ()->textLines (); - const QString leftHalf = textLines [m_row].left (m_col - m_newText.length ()); - const QString rightHalf = textLines [m_row].mid (m_col); + TQValueVector <TQString> textLines = selection ()->textLines (); + const TQString leftHalf = textLines [m_row].left (m_col - m_newText.length ()); + const TQString rightHalf = textLines [m_row].mid (m_col); textLines [m_row] = leftHalf + rightHalf; selection ()->setTextLines (textLines); @@ -1081,7 +1081,7 @@ void kpToolTextInsertCommand::unexecute () * kpToolTextEnterCommand */ -kpToolTextEnterCommand::kpToolTextEnterCommand (const QString &name, +kpToolTextEnterCommand::kpToolTextEnterCommand (const TQString &name, int row, int col, kpMainWindow *mainWindow) : kpNamedCommand (name, mainWindow), @@ -1100,9 +1100,9 @@ kpToolTextEnterCommand::~kpToolTextEnterCommand () // public void kpToolTextEnterCommand::addEnter () { - QValueVector <QString> textLines = selection ()->textLines (); + TQValueVector <TQString> textLines = selection ()->textLines (); - const QString rightHalf = textLines [m_row].mid (m_col); + const TQString rightHalf = textLines [m_row].mid (m_col); textLines [m_row].truncate (m_col); textLines.insert (textLines.begin () + m_row + 1, rightHalf); @@ -1141,7 +1141,7 @@ void kpToolTextEnterCommand::unexecute () { viewManager ()->setTextCursorPosition (m_row, m_col); - QValueVector <QString> textLines = selection ()->textLines (); + TQValueVector <TQString> textLines = selection ()->textLines (); for (int i = 0; i < m_numEnters; i++) { @@ -1175,7 +1175,7 @@ void kpToolTextEnterCommand::unexecute () * kpToolTextBackspaceCommand */ -kpToolTextBackspaceCommand::kpToolTextBackspaceCommand (const QString &name, +kpToolTextBackspaceCommand::kpToolTextBackspaceCommand (const TQString &name, int row, int col, kpMainWindow *mainWindow) : kpNamedCommand (name, mainWindow), @@ -1194,7 +1194,7 @@ kpToolTextBackspaceCommand::~kpToolTextBackspaceCommand () // public void kpToolTextBackspaceCommand::addBackspace () { - QValueVector <QString> textLines = selection ()->textLines (); + TQValueVector <TQString> textLines = selection ()->textLines (); if (m_col > 0) { @@ -1233,7 +1233,7 @@ void kpToolTextBackspaceCommand::addBackspace () // public virtual [base kpCommand] int kpToolTextBackspaceCommand::size () const { - return m_deletedText.length () * sizeof (QChar); + return m_deletedText.length () * sizeof (TQChar); } @@ -1242,7 +1242,7 @@ void kpToolTextBackspaceCommand::execute () { viewManager ()->setTextCursorPosition (m_row, m_col); - m_deletedText = QString::null; + m_deletedText = TQString::null; int oldNumBackspaces = m_numBackspaces; m_numBackspaces = 0; @@ -1255,13 +1255,13 @@ void kpToolTextBackspaceCommand::unexecute () { viewManager ()->setTextCursorPosition (m_row, m_col); - QValueVector <QString> textLines = selection ()->textLines (); + TQValueVector <TQString> textLines = selection ()->textLines (); for (int i = 0; i < (int) m_deletedText.length (); i++) { if (m_deletedText [i] == '\n') { - const QString rightHalf = textLines [m_row].mid (m_col); + const TQString rightHalf = textLines [m_row].mid (m_col); textLines [m_row].truncate (m_col); textLines.insert (textLines.begin () + m_row + 1, rightHalf); @@ -1271,15 +1271,15 @@ void kpToolTextBackspaceCommand::unexecute () } else { - const QString leftHalf = textLines [m_row].left (m_col); - const QString rightHalf = textLines [m_row].mid (m_col); + const TQString leftHalf = textLines [m_row].left (m_col); + const TQString rightHalf = textLines [m_row].mid (m_col); textLines [m_row] = leftHalf + m_deletedText [i] + rightHalf; m_col++; } } - m_deletedText = QString::null; + m_deletedText = TQString::null; selection ()->setTextLines (textLines); @@ -1291,7 +1291,7 @@ void kpToolTextBackspaceCommand::unexecute () * kpToolTextDeleteCommand */ -kpToolTextDeleteCommand::kpToolTextDeleteCommand (const QString &name, +kpToolTextDeleteCommand::kpToolTextDeleteCommand (const TQString &name, int row, int col, kpMainWindow *mainWindow) : kpNamedCommand (name, mainWindow), @@ -1310,7 +1310,7 @@ kpToolTextDeleteCommand::~kpToolTextDeleteCommand () // public void kpToolTextDeleteCommand::addDelete () { - QValueVector <QString> textLines = selection ()->textLines (); + TQValueVector <TQString> textLines = selection ()->textLines (); if (m_col < (int) textLines [m_row].length ()) { @@ -1341,7 +1341,7 @@ void kpToolTextDeleteCommand::addDelete () // public virtual [base kpCommand] int kpToolTextDeleteCommand::size () const { - return m_deletedText.length () * sizeof (QChar); + return m_deletedText.length () * sizeof (TQChar); } @@ -1350,7 +1350,7 @@ void kpToolTextDeleteCommand::execute () { viewManager ()->setTextCursorPosition (m_row, m_col); - m_deletedText = QString::null; + m_deletedText = TQString::null; int oldNumDeletes = m_numDeletes; m_numDeletes = 0; @@ -1363,27 +1363,27 @@ void kpToolTextDeleteCommand::unexecute () { viewManager ()->setTextCursorPosition (m_row, m_col); - QValueVector <QString> textLines = selection ()->textLines (); + TQValueVector <TQString> textLines = selection ()->textLines (); for (int i = 0; i < (int) m_deletedText.length (); i++) { if (m_deletedText [i] == '\n') { - const QString rightHalf = textLines [m_row].mid (m_col); + const TQString rightHalf = textLines [m_row].mid (m_col); textLines [m_row].truncate (m_col); textLines.insert (textLines.begin () + m_row + 1, rightHalf); } else { - const QString leftHalf = textLines [m_row].left (m_col); - const QString rightHalf = textLines [m_row].mid (m_col); + const TQString leftHalf = textLines [m_row].left (m_col); + const TQString rightHalf = textLines [m_row].mid (m_col); textLines [m_row] = leftHalf + m_deletedText [i] + rightHalf; } } - m_deletedText = QString::null; + m_deletedText = TQString::null; selection ()->setTextLines (textLines); diff --git a/kolourpaint/tools/kptooltext.h b/kolourpaint/tools/kptooltext.h index a99654b7..15cda865 100644 --- a/kolourpaint/tools/kptooltext.h +++ b/kolourpaint/tools/kptooltext.h @@ -29,7 +29,7 @@ #ifndef __kp_tool_text_h__ #define __kp_tool_text_h__ -#include <qstring.h> +#include <tqstring.h> #include <kpcommandhistory.h> @@ -57,17 +57,17 @@ public: bool hasBegunText () const; virtual bool hasBegunShape () const; virtual void cancelShape (); - virtual void endShape (const QPoint &thisPoint, const QRect &normalizedRect); + virtual void endShape (const TQPoint &thisPoint, const TQRect &normalizedRect); protected: - virtual void keyPressEvent (QKeyEvent *e); - virtual void imStartEvent (QIMEvent *e); - virtual void imComposeEvent (QIMEvent *e); - virtual void imEndEvent (QIMEvent *e); + virtual void keyPressEvent (TQKeyEvent *e); + virtual void imStartEvent (TQIMEvent *e); + virtual void imComposeEvent (TQIMEvent *e); + virtual void imEndEvent (TQIMEvent *e); protected: bool shouldChangeTextStyle () const; - void changeTextStyle (const QString &name, + void changeTextStyle (const TQString &name, const kpTextStyle &newTextStyle, const kpTextStyle &oldTextStyle); @@ -80,7 +80,7 @@ protected slots: virtual void slotColorSimilarityChanged (double, int); public slots: - void slotFontFamilyChanged (const QString &fontFamily, const QString &oldFontFamily); + void slotFontFamilyChanged (const TQString &fontFamily, const TQString &oldFontFamily); void slotFontSizeChanged (int fontSize, int oldFontSize); void slotBoldChanged (bool isBold); void slotItalicChanged (bool isItalic); @@ -96,14 +96,14 @@ protected: bool m_isIMStarted; int m_IMStartCursorRow; int m_IMStartCursorCol; - QString m_IMPreeditStr; + TQString m_IMPreeditStr; }; class kpToolTextChangeStyleCommand : public kpNamedCommand { public: - kpToolTextChangeStyleCommand (const QString &name, + kpToolTextChangeStyleCommand (const TQString &name, const kpTextStyle &newTextStyle, const kpTextStyle &oldTextStyle, kpMainWindow *mainWindow); virtual ~kpToolTextChangeStyleCommand (); @@ -120,12 +120,12 @@ protected: class kpToolTextInsertCommand : public kpNamedCommand { public: - kpToolTextInsertCommand (const QString &name, - int row, int col, QString newText, + kpToolTextInsertCommand (const TQString &name, + int row, int col, TQString newText, kpMainWindow *mainWindow); virtual ~kpToolTextInsertCommand (); - void addText (const QString &moreText); + void addText (const TQString &moreText); virtual int size () const; @@ -134,13 +134,13 @@ public: protected: int m_row, m_col; - QString m_newText; + TQString m_newText; }; class kpToolTextEnterCommand : public kpNamedCommand { public: - kpToolTextEnterCommand (const QString &name, + kpToolTextEnterCommand (const TQString &name, int row, int col, kpMainWindow *mainWindow); virtual ~kpToolTextEnterCommand (); @@ -160,7 +160,7 @@ protected: class kpToolTextBackspaceCommand : public kpNamedCommand { public: - kpToolTextBackspaceCommand (const QString &name, + kpToolTextBackspaceCommand (const TQString &name, int row, int col, kpMainWindow *mainWindow); virtual ~kpToolTextBackspaceCommand (); @@ -175,13 +175,13 @@ public: protected: int m_row, m_col; int m_numBackspaces; - QString m_deletedText; + TQString m_deletedText; }; class kpToolTextDeleteCommand : public kpNamedCommand { public: - kpToolTextDeleteCommand (const QString &name, + kpToolTextDeleteCommand (const TQString &name, int row, int col, kpMainWindow *mainWindow); virtual ~kpToolTextDeleteCommand (); @@ -196,7 +196,7 @@ public: protected: int m_row, m_col; int m_numDeletes; - QString m_deletedText; + TQString m_deletedText; }; #endif // __kp_tool_text_h__ |