diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-08-02 19:23:46 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-08-02 19:23:46 +0000 |
commit | eba47f8f0637f451e21348187591e1f1fd58ac74 (patch) | |
tree | 448f10b95c656604acc331a3236c1e59bde5c1ad /kolourpaint/tools/kptoolautocrop.cpp | |
parent | c7e8736c69373f48b0401319757c742e8607431a (diff) | |
download | tdegraphics-eba47f8f0637f451e21348187591e1f1fd58ac74.tar.gz tdegraphics-eba47f8f0637f451e21348187591e1f1fd58ac74.zip |
TQt conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1158446 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kolourpaint/tools/kptoolautocrop.cpp')
-rw-r--r-- | kolourpaint/tools/kptoolautocrop.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
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); } |