diff options
Diffstat (limited to 'kolourpaint')
140 files changed, 4016 insertions, 4016 deletions
diff --git a/kolourpaint/cursors/kpcursorlightcross.cpp b/kolourpaint/cursors/kpcursorlightcross.cpp index 0595d320..34051dbf 100644 --- a/kolourpaint/cursors/kpcursorlightcross.cpp +++ b/kolourpaint/cursors/kpcursorlightcross.cpp @@ -30,8 +30,8 @@ #include <kpcursorlightcross.h> -#include <qbitmap.h> -#include <qcursor.h> +#include <tqbitmap.h> +#include <tqcursor.h> #include <kdebug.h> @@ -81,7 +81,7 @@ static void setPixel (unsigned char *colorBitmap, } -const QCursor *kpMakeCursorLightCross () +const TQCursor *kpMakeCursorLightCross () { #if DEBUG_KP_CURSOR_LIGHT_CROSS kdDebug () << "kpMakeCursorLightCross() " << endl; @@ -117,8 +117,8 @@ const QCursor *kpMakeCursorLightCross () #undef X_ } - QCursor *cursor = new QCursor (QBitmap (side, side, colorBitmap, true/*little endian bit order*/), - QBitmap (side, side, maskBitmap, true/*little endian bit order*/)); + TQCursor *cursor = new TQCursor (TQBitmap (side, side, colorBitmap, true/*little endian bit order*/), + TQBitmap (side, side, maskBitmap, true/*little endian bit order*/)); delete [] maskBitmap; delete [] colorBitmap; diff --git a/kolourpaint/cursors/kpcursorlightcross.h b/kolourpaint/cursors/kpcursorlightcross.h index d2bf83e1..131d94c3 100644 --- a/kolourpaint/cursors/kpcursorlightcross.h +++ b/kolourpaint/cursors/kpcursorlightcross.h @@ -30,9 +30,9 @@ #define __kp_cursor_light_cross_h__ -class QCursor; +class TQCursor; -const QCursor *kpMakeCursorLightCross (); +const TQCursor *kpMakeCursorLightCross (); #endif // __kp_cursor_light_cross_h__ diff --git a/kolourpaint/cursors/kpcursorprovider.cpp b/kolourpaint/cursors/kpcursorprovider.cpp index 45d43801..32cc3dd8 100644 --- a/kolourpaint/cursors/kpcursorprovider.cpp +++ b/kolourpaint/cursors/kpcursorprovider.cpp @@ -28,18 +28,18 @@ #include <kpcursorprovider.h> -#include <qcursor.h> +#include <tqcursor.h> #include <kstaticdeleter.h> #include <kpcursorlightcross.h> -static const QCursor *theLightCursor = 0; +static const TQCursor *theLightCursor = 0; // public static -QCursor kpCursorProvider::lightCross () +TQCursor kpCursorProvider::lightCross () { // TODO: don't leak (although it's cleaned up on exit by OS anyway) if (!theLightCursor) diff --git a/kolourpaint/cursors/kpcursorprovider.h b/kolourpaint/cursors/kpcursorprovider.h index 191b4f78..ab9b4218 100644 --- a/kolourpaint/cursors/kpcursorprovider.h +++ b/kolourpaint/cursors/kpcursorprovider.h @@ -30,13 +30,13 @@ #define __kp_cursor_provider_h__ -class QCursor; +class TQCursor; class kpCursorProvider { public: - static QCursor lightCross (); + static TQCursor lightCross (); }; diff --git a/kolourpaint/kolourpaint.cpp b/kolourpaint/kolourpaint.cpp index b9ba0f0c..e1b41fc5 100644 --- a/kolourpaint/kolourpaint.cpp +++ b/kolourpaint/kolourpaint.cpp @@ -26,7 +26,7 @@ */ -#include <qfile.h> +#include <tqfile.h> #include <dcopclient.h> #include <kaboutdata.h> @@ -192,8 +192,8 @@ int main (int argc, char *argv []) // Qt says this is necessary but I don't think it is... - QObject::connect (&app, SIGNAL (lastWindowClosed ()), - &app, SLOT (quit ())); + TQObject::connect (&app, TQT_SIGNAL (lastWindowClosed ()), + &app, TQT_SLOT (quit ())); if (app.isRestored ()) diff --git a/kolourpaint/kpcolor.cpp b/kolourpaint/kpcolor.cpp index a9dc000b..1c325d39 100644 --- a/kolourpaint/kpcolor.cpp +++ b/kolourpaint/kpcolor.cpp @@ -31,7 +31,7 @@ #include <kpcolor.h> -#include <qdatastream.h> +#include <tqdatastream.h> #include <kdebug.h> @@ -100,7 +100,7 @@ kpColor::kpColor (const kpColor &rhs) } // friend -QDataStream &operator<< (QDataStream &stream, const kpColor &color) +TQDataStream &operator<< (TQDataStream &stream, const kpColor &color) { stream << int (color.m_rgbaIsValid) << int (color.m_rgba); @@ -108,7 +108,7 @@ QDataStream &operator<< (QDataStream &stream, const kpColor &color) } // friend -QDataStream &operator>> (QDataStream &stream, kpColor &color) +TQDataStream &operator>> (TQDataStream &stream, kpColor &color) { int a, b; stream >> a >> b; @@ -321,7 +321,7 @@ QRgb kpColor::toQRgb () const } // public -const QColor &kpColor::toQColor () const +const TQColor &kpColor::toQColor () const { if (!m_rgbaIsValid) { @@ -340,10 +340,10 @@ const QColor &kpColor::toQColor () const return Qt::black; } - m_colorCache = QColor (m_rgba); + m_colorCache = TQColor (m_rgba); if (!m_colorCache.isValid ()) { - kdError () << "kpColor::toQColor () internal error - could not return valid QColor" + kdError () << "kpColor::toQColor () internal error - could not return valid TQColor" << endl; return Qt::black; } @@ -354,7 +354,7 @@ const QColor &kpColor::toQColor () const } // public -QColor kpColor::maskColor () const +TQColor kpColor::maskColor () const { return isTransparent () ? Qt::color0 : Qt::color1; } diff --git a/kolourpaint/kpcolor.h b/kolourpaint/kpcolor.h index 131d4b61..255d645f 100644 --- a/kolourpaint/kpcolor.h +++ b/kolourpaint/kpcolor.h @@ -30,9 +30,9 @@ #define __kp_color_h__ -#include <qcolor.h> +#include <tqcolor.h> -class QDataStream; +class TQDataStream; // @@ -42,10 +42,10 @@ class QDataStream; // error handling, reporting (noisy kdError()'s) and recovery. // // In general, you should pass around kpColor objects instead of QRgb -// and QColor. Only convert an opaque kpColor to a QColor (using toQColor()) +// and TQColor. Only convert an opaque kpColor to a TQColor (using toQColor()) // if you need to draw something onscreen. Constructing a kpColor object -// from QColor is probably wrong since onscreen representations of color -// are not guaranteed to be faithful (due to QColor color allocation). +// from TQColor is probably wrong since onscreen representations of color +// are not guaranteed to be faithful (due to TQColor color allocation). // class kpColor { @@ -54,8 +54,8 @@ public: kpColor (int red, int green, int blue, bool isTransparent = false); kpColor (const QRgb &rgba); kpColor (const kpColor &rhs); - friend QDataStream &operator<< (QDataStream &stream, const kpColor &color); - friend QDataStream &operator>> (QDataStream &stream, kpColor &color); + friend TQDataStream &operator<< (TQDataStream &stream, const kpColor &color); + friend TQDataStream &operator>> (TQDataStream &stream, kpColor &color); kpColor &operator= (const kpColor &rhs); bool operator== (const kpColor &rhs) const; bool operator!= (const kpColor &rhs) const; @@ -84,17 +84,17 @@ public: QRgb toQRgb () const; // (only valid if isOpaque()) - // (const QColor & return results in fewer color reallocations) - const QColor &toQColor () const; + // (const TQColor & return results in fewer color reallocations) + const TQColor &toQColor () const; - QColor maskColor () const; + TQColor maskColor () const; private: bool m_rgbaIsValid; QRgb m_rgba; mutable bool m_colorCacheIsValid; - mutable QColor m_colorCache; + mutable TQColor m_colorCache; }; diff --git a/kolourpaint/kpcommandhistory.cpp b/kolourpaint/kpcommandhistory.cpp index 33010918..6849ebf4 100644 --- a/kolourpaint/kpcommandhistory.cpp +++ b/kolourpaint/kpcommandhistory.cpp @@ -33,7 +33,7 @@ #include <limits.h> -#include <qdatetime.h> +#include <tqdatetime.h> #include <kactionclasses.h> #include <kapplication.h> @@ -51,12 +51,12 @@ //template <typename T> -static void clearPointerList (QValueList <kpCommand *> *listPtr) +static void clearPointerList (TQValueList <kpCommand *> *listPtr) { if (!listPtr) return; - for (QValueList <kpCommand *>::iterator it = listPtr->begin (); + for (TQValueList <kpCommand *>::iterator it = listPtr->begin (); it != listPtr->end (); it++) { @@ -118,7 +118,7 @@ kpViewManager *kpCommand::viewManager () const // kpNamedCommand // -kpNamedCommand::kpNamedCommand (const QString &name, kpMainWindow *mainWindow) +kpNamedCommand::kpNamedCommand (const TQString &name, kpMainWindow *mainWindow) : kpCommand (mainWindow), m_name (name) { @@ -130,7 +130,7 @@ kpNamedCommand::~kpNamedCommand () // public virtual [base kpCommand] -QString kpNamedCommand::name () const +TQString kpNamedCommand::name () const { return m_name; } @@ -144,7 +144,7 @@ struct kpMacroCommandPrivate { }; -kpMacroCommand::kpMacroCommand (const QString &name, kpMainWindow *mainWindow) +kpMacroCommand::kpMacroCommand (const TQString &name, kpMainWindow *mainWindow) : kpNamedCommand (name, mainWindow), d (new kpMacroCommandPrivate ()) { @@ -168,7 +168,7 @@ int kpMacroCommand::size () const #if DEBUG_KP_COMMAND_HISTORY && 0 kdDebug () << "\tcalculating:" << endl; #endif - for (QValueList <kpCommand *>::const_iterator it = m_commandList.begin (); + for (TQValueList <kpCommand *>::const_iterator it = m_commandList.begin (); it != m_commandList.end (); it++) { @@ -204,7 +204,7 @@ void kpMacroCommand::execute () #if DEBUG_KP_COMMAND_HISTORY kdDebug () << "kpMacroCommand::execute()" << endl; #endif - for (QValueList <kpCommand *>::const_iterator it = m_commandList.begin (); + for (TQValueList <kpCommand *>::const_iterator it = m_commandList.begin (); it != m_commandList.end (); it++) { @@ -221,7 +221,7 @@ void kpMacroCommand::unexecute () #if DEBUG_KP_COMMAND_HISTORY kdDebug () << "kpMacroCommand::unexecute()" << endl; #endif - QValueList <kpCommand *>::const_iterator it = m_commandList.end (); + TQValueList <kpCommand *>::const_iterator it = m_commandList.end (); it--; while (it != m_commandList.end ()) @@ -257,15 +257,15 @@ kpCommandHistoryBase::kpCommandHistoryBase (bool doReadConfig, : d (new kpCommandHistoryBasePrivate ()) { m_actionUndo = new KToolBarPopupAction (undoActionText (), - QString::fromLatin1 ("undo"), + TQString::fromLatin1 ("undo"), KStdAccel::shortcut (KStdAccel::Undo), - this, SLOT (undo ()), + this, TQT_SLOT (undo ()), ac, KStdAction::name (KStdAction::Undo)); m_actionRedo = new KToolBarPopupAction (redoActionText (), - QString::fromLatin1 ("redo"), + TQString::fromLatin1 ("redo"), KStdAccel::shortcut (KStdAccel::Redo), - this, SLOT (redo ()), + this, TQT_SLOT (redo ()), ac, KStdAction::name (KStdAction::Redo)); @@ -273,10 +273,10 @@ kpCommandHistoryBase::kpCommandHistoryBase (bool doReadConfig, m_actionRedo->setEnabled (false); - connect (m_actionUndo->popupMenu (), SIGNAL (activated (int)), - this, SLOT (undoUpToNumber (int))); - connect (m_actionRedo->popupMenu (), SIGNAL (activated (int)), - this, SLOT (redoUpToNumber (int))); + connect (m_actionUndo->popupMenu (), TQT_SIGNAL (activated (int)), + this, TQT_SLOT (undoUpToNumber (int))); + connect (m_actionRedo->popupMenu (), TQT_SIGNAL (activated (int)), + this, TQT_SLOT (redoUpToNumber (int))); m_undoMinLimit = 10; @@ -620,7 +620,7 @@ void kpCommandHistoryBase::redoUpToNumber (int which) // protected -QString kpCommandHistoryBase::undoActionText () const +TQString kpCommandHistoryBase::undoActionText () const { kpCommand *undoCommand = nextUndoCommand (); @@ -631,7 +631,7 @@ QString kpCommandHistoryBase::undoActionText () const } // protected -QString kpCommandHistoryBase::redoActionText () const +TQString kpCommandHistoryBase::redoActionText () const { kpCommand *redoCommand = nextRedoCommand (); @@ -654,11 +654,11 @@ void kpCommandHistoryBase::trimCommandListsUpdateActions () } // protected -void kpCommandHistoryBase::trimCommandList (QValueList <kpCommand *> *commandList) +void kpCommandHistoryBase::trimCommandList (TQValueList <kpCommand *> *commandList) { #if DEBUG_KP_COMMAND_HISTORY kdDebug () << "kpCommandHistoryBase::trimCommandList()" << endl; - QTime timer; timer.start (); + TQTime timer; timer.start (); #endif if (!commandList) @@ -689,7 +689,7 @@ void kpCommandHistoryBase::trimCommandList (QValueList <kpCommand *> *commandLis kdDebug () << "\tsize over undoMinLimit - iterating thru cmds:" << endl; #endif - QValueList <kpCommand *>::iterator it = commandList->begin (); + TQValueList <kpCommand *>::iterator it = commandList->begin (); int upto = 0; int sizeSoFar = 0; @@ -772,15 +772,15 @@ void kpCommandHistoryBase::trimCommandLists () static void populatePopupMenu (KPopupMenu *popupMenu, - const QString &undoOrRedo, - const QValueList <kpCommand *> &commandList) + const TQString &undoOrRedo, + const TQValueList <kpCommand *> &commandList) { if (!popupMenu) return; popupMenu->clear (); - QValueList <kpCommand *>::const_iterator it = commandList.begin (); + TQValueList <kpCommand *>::const_iterator it = commandList.begin (); int i = 0; while (i < 10 && it != commandList.end ()) { @@ -810,7 +810,7 @@ void kpCommandHistoryBase::updateActions () m_actionUndo->setEnabled ((bool) nextUndoCommand ()); m_actionUndo->setText (undoActionText ()); #if DEBUG_KP_COMMAND_HISTORY - QTime timer; timer.start (); + TQTime timer; timer.start (); #endif populatePopupMenu (m_actionUndo->popupMenu (), i18n ("Undo"), diff --git a/kolourpaint/kpcommandhistory.h b/kolourpaint/kpcommandhistory.h index a1541512..c29d68fc 100644 --- a/kolourpaint/kpcommandhistory.h +++ b/kolourpaint/kpcommandhistory.h @@ -29,9 +29,9 @@ #ifndef KP_COMMAND_HISTORY_H #define KP_COMMAND_HISTORY_H -#include <qobject.h> -#include <qstring.h> -#include <qvaluelist.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqvaluelist.h> class KActionCollection; @@ -50,7 +50,7 @@ public: virtual ~kpCommand (); public: - virtual QString name () const = 0; + virtual TQString name () const = 0; // Returns the estimated size in bytes. // @@ -82,20 +82,20 @@ protected: class kpNamedCommand : public kpCommand { public: - kpNamedCommand (const QString &name, kpMainWindow *mainWindow); + kpNamedCommand (const TQString &name, kpMainWindow *mainWindow); virtual ~kpNamedCommand (); - virtual QString name () const; + virtual TQString name () const; protected: - QString m_name; + TQString m_name; }; class kpMacroCommand : public kpNamedCommand { public: - kpMacroCommand (const QString &name, kpMainWindow *mainWindow); + kpMacroCommand (const TQString &name, kpMainWindow *mainWindow); virtual ~kpMacroCommand (); @@ -116,7 +116,7 @@ public: void addCommand (kpCommand *command); protected: - QValueList <kpCommand *> m_commandList; + TQValueList <kpCommand *> m_commandList; private: class kpMacroCommandPrivate *d; @@ -176,11 +176,11 @@ public slots: virtual void redoUpToNumber (int which); protected: - QString undoActionText () const; - QString redoActionText () const; + TQString undoActionText () const; + TQString redoActionText () const; void trimCommandListsUpdateActions (); - void trimCommandList (QValueList <kpCommand *> *commandList); + void trimCommandList (TQValueList <kpCommand *> *commandList); void trimCommandLists (); void updateActions (); @@ -200,8 +200,8 @@ protected: KToolBarPopupAction *m_actionUndo, *m_actionRedo; // (Front element is the next one) - QValueList <kpCommand *> m_undoCommandList; - QValueList <kpCommand *> m_redoCommandList; + TQValueList <kpCommand *> m_undoCommandList; + TQValueList <kpCommand *> m_redoCommandList; int m_undoMinLimit, m_undoMaxLimit, m_undoMaxLimitSizeLimit; diff --git a/kolourpaint/kpdefs.h b/kolourpaint/kpdefs.h index 15faaee0..a437c2d5 100644 --- a/kolourpaint/kpdefs.h +++ b/kolourpaint/kpdefs.h @@ -32,10 +32,10 @@ #include <limits.h> -#include <qglobal.h> -#include <qpoint.h> -#include <qsize.h> -#include <qstring.h> +#include <tqglobal.h> +#include <tqpoint.h> +#include <tqsize.h> +#include <tqstring.h> #include <kdeversion.h> @@ -55,81 +55,81 @@ #define KP_RADIANS_TO_DEGREES(rad) ((rad) * 180.0 / KP_PI) -#define KP_INVALID_POINT QPoint (INT_MIN / 8, INT_MIN / 8) +#define KP_INVALID_POINT TQPoint (INT_MIN / 8, INT_MIN / 8) #define KP_INVALID_WIDTH (INT_MIN / 8) #define KP_INVALID_HEIGHT (INT_MIN / 8) -#define KP_INVALID_SIZE QSize (INT_MIN / 8, INT_MIN / 8) +#define KP_INVALID_SIZE TQSize (INT_MIN / 8, INT_MIN / 8) // // Settings // -#define kpSettingsGroupGeneral QString::fromLatin1 ("General Settings") -#define kpSettingFirstTime QString::fromLatin1 ("First Time") -#define kpSettingShowGrid QString::fromLatin1 ("Show Grid") -#define kpSettingShowPath QString::fromLatin1 ("Show Path") -#define kpSettingColorSimilarity QString::fromLatin1 ("Color Similarity") -#define kpSettingDitherOnOpen QString::fromLatin1 ("Dither on Open if Screen is 15/16bpp and Image Num Colors More Than") -#define kpSettingPrintImageCenteredOnPage QString::fromLatin1 ("Print Image Centered On Page") +#define kpSettingsGroupGeneral TQString::fromLatin1 ("General Settings") +#define kpSettingFirstTime TQString::fromLatin1 ("First Time") +#define kpSettingShowGrid TQString::fromLatin1 ("Show Grid") +#define kpSettingShowPath TQString::fromLatin1 ("Show Path") +#define kpSettingColorSimilarity TQString::fromLatin1 ("Color Similarity") +#define kpSettingDitherOnOpen TQString::fromLatin1 ("Dither on Open if Screen is 15/16bpp and Image Num Colors More Than") +#define kpSettingPrintImageCenteredOnPage TQString::fromLatin1 ("Print Image Centered On Page") -#define kpSettingsGroupFileSaveAs QString::fromLatin1 ("File/Save As") -#define kpSettingsGroupFileExport QString::fromLatin1 ("File/Export") -#define kpSettingsGroupEditCopyTo QString::fromLatin1 ("Edit/Copy To") +#define kpSettingsGroupFileSaveAs TQString::fromLatin1 ("File/Save As") +#define kpSettingsGroupFileExport TQString::fromLatin1 ("File/Export") +#define kpSettingsGroupEditCopyTo TQString::fromLatin1 ("Edit/Copy To") -#define kpSettingForcedMimeType QString::fromLatin1 ("Forced MimeType") -#define kpSettingForcedColorDepth QString::fromLatin1 ("Forced Color Depth") -#define kpSettingForcedDither QString::fromLatin1 ("Forced Dither") -#define kpSettingForcedQuality QString::fromLatin1 ("Forced Quality") +#define kpSettingForcedMimeType TQString::fromLatin1 ("Forced MimeType") +#define kpSettingForcedColorDepth TQString::fromLatin1 ("Forced Color Depth") +#define kpSettingForcedDither TQString::fromLatin1 ("Forced Dither") +#define kpSettingForcedQuality TQString::fromLatin1 ("Forced Quality") -#define kpSettingLastDocSize QString::fromLatin1 ("Last Document Size") +#define kpSettingLastDocSize TQString::fromLatin1 ("Last Document Size") -#define kpSettingMoreEffectsLastEffect QString::fromLatin1 ("More Effects - Last Effect") +#define kpSettingMoreEffectsLastEffect TQString::fromLatin1 ("More Effects - Last Effect") -#define kpSettingResizeScaleLastKeepAspect QString::fromLatin1 ("Resize Scale - Last Keep Aspect") +#define kpSettingResizeScaleLastKeepAspect TQString::fromLatin1 ("Resize Scale - Last Keep Aspect") -#define kpSettingsGroupMimeTypeProperties QString::fromLatin1 ("MimeType Properties Version 1.2-2") -#define kpSettingMimeTypeMaximumColorDepth QString::fromLatin1 ("Maximum Color Depth") -#define kpSettingMimeTypeHasConfigurableColorDepth QString::fromLatin1 ("Configurable Color Depth") -#define kpSettingMimeTypeHasConfigurableQuality QString::fromLatin1 ("Configurable Quality Setting") +#define kpSettingsGroupMimeTypeProperties TQString::fromLatin1 ("MimeType Properties Version 1.2-2") +#define kpSettingMimeTypeMaximumColorDepth TQString::fromLatin1 ("Maximum Color Depth") +#define kpSettingMimeTypeHasConfigurableColorDepth TQString::fromLatin1 ("Configurable Color Depth") +#define kpSettingMimeTypeHasConfigurableQuality TQString::fromLatin1 ("Configurable Quality Setting") -#define kpSettingsGroupUndoRedo QString::fromLatin1 ("Undo/Redo Settings") -#define kpSettingUndoMinLimit QString::fromLatin1 ("Min Limit") -#define kpSettingUndoMaxLimit QString::fromLatin1 ("Max Limit") -#define kpSettingUndoMaxLimitSizeLimit QString::fromLatin1 ("Max Limit Size Limit") +#define kpSettingsGroupUndoRedo TQString::fromLatin1 ("Undo/Redo Settings") +#define kpSettingUndoMinLimit TQString::fromLatin1 ("Min Limit") +#define kpSettingUndoMaxLimit TQString::fromLatin1 ("Max Limit") +#define kpSettingUndoMaxLimitSizeLimit TQString::fromLatin1 ("Max Limit Size Limit") -#define kpSettingsGroupThumbnail QString::fromLatin1 ("Thumbnail Settings") -#define kpSettingThumbnailShown QString::fromLatin1 ("Shown") -#define kpSettingThumbnailGeometry QString::fromLatin1 ("Geometry") -#define kpSettingThumbnailZoomed QString::fromLatin1 ("Zoomed") -#define kpSettingThumbnailShowRectangle QString::fromLatin1 ("ShowRectangle") +#define kpSettingsGroupThumbnail TQString::fromLatin1 ("Thumbnail Settings") +#define kpSettingThumbnailShown TQString::fromLatin1 ("Shown") +#define kpSettingThumbnailGeometry TQString::fromLatin1 ("Geometry") +#define kpSettingThumbnailZoomed TQString::fromLatin1 ("Zoomed") +#define kpSettingThumbnailShowRectangle TQString::fromLatin1 ("ShowRectangle") -#define kpSettingsGroupPreviewSave QString::fromLatin1 ("Save Preview Settings") -#define kpSettingPreviewSaveGeometry QString::fromLatin1 ("Geometry") -#define kpSettingPreviewSaveUpdateDelay QString::fromLatin1 ("Update Delay") +#define kpSettingsGroupPreviewSave TQString::fromLatin1 ("Save Preview Settings") +#define kpSettingPreviewSaveGeometry TQString::fromLatin1 ("Geometry") +#define kpSettingPreviewSaveUpdateDelay TQString::fromLatin1 ("Update Delay") -#define kpSettingsGroupTools QString::fromLatin1 ("Tool Settings") -#define kpSettingLastTool QString::fromLatin1 ("Last Used Tool") -#define kpSettingToolBoxIconSize QString::fromLatin1 ("Tool Box Icon Size") +#define kpSettingsGroupTools TQString::fromLatin1 ("Tool Settings") +#define kpSettingLastTool TQString::fromLatin1 ("Last Used Tool") +#define kpSettingToolBoxIconSize TQString::fromLatin1 ("Tool Box Icon Size") -#define kpSettingsGroupText QString::fromLatin1 ("Text Settings") -#define kpSettingFontFamily QString::fromLatin1 ("Font Family") -#define kpSettingFontSize QString::fromLatin1 ("Font Size") -#define kpSettingBold QString::fromLatin1 ("Bold") -#define kpSettingItalic QString::fromLatin1 ("Italic") -#define kpSettingUnderline QString::fromLatin1 ("Underline") -#define kpSettingStrikeThru QString::fromLatin1 ("Strike Thru") +#define kpSettingsGroupText TQString::fromLatin1 ("Text Settings") +#define kpSettingFontFamily TQString::fromLatin1 ("Font Family") +#define kpSettingFontSize TQString::fromLatin1 ("Font Size") +#define kpSettingBold TQString::fromLatin1 ("Bold") +#define kpSettingItalic TQString::fromLatin1 ("Italic") +#define kpSettingUnderline TQString::fromLatin1 ("Underline") +#define kpSettingStrikeThru TQString::fromLatin1 ("Strike Thru") -#define kpSettingsGroupFlattenEffect QString::fromLatin1 ("Flatten Effect Settings") -#define kpSettingFlattenEffectColor1 QString::fromLatin1 ("Color1") -#define kpSettingFlattenEffectColor2 QString::fromLatin1 ("Color2") +#define kpSettingsGroupFlattenEffect TQString::fromLatin1 ("Flatten Effect Settings") +#define kpSettingFlattenEffectColor1 TQString::fromLatin1 ("Color1") +#define kpSettingFlattenEffectColor2 TQString::fromLatin1 ("Color2") // @@ -140,11 +140,11 @@ // // This key only exists if the document does. If it exists, it can be empty. // The URL need not point to a file that exists e.g. "kolourpaint doesnotexist.png". -#define kpSessionSettingDocumentUrl QString::fromLatin1 ("Session Document Url") +#define kpSessionSettingDocumentUrl TQString::fromLatin1 ("Session Document Url") // The size of a document which is not from a URL e.g. "kolourpaint doesnotexist.png". // This key does not exist for documents from URLs. -#define kpSessionSettingNotFromUrlDocumentSize QString::fromLatin1 ("Session Not-From-Url Document Size") +#define kpSessionSettingNotFromUrlDocumentSize TQString::fromLatin1 ("Session Not-From-Url Document Size") #endif // __kp_defs_h__ diff --git a/kolourpaint/kpdocument.cpp b/kolourpaint/kpdocument.cpp index 801b922e..aa078c85 100644 --- a/kolourpaint/kpdocument.cpp +++ b/kolourpaint/kpdocument.cpp @@ -33,17 +33,17 @@ #include <math.h> -#include <qcolor.h> -#include <qbitmap.h> -#include <qbrush.h> -#include <qfile.h> -#include <qimage.h> -#include <qpixmap.h> -#include <qpainter.h> -#include <qrect.h> -#include <qsize.h> -#include <qvaluelist.h> -#include <qwmatrix.h> +#include <tqcolor.h> +#include <tqbitmap.h> +#include <tqbrush.h> +#include <tqfile.h> +#include <tqimage.h> +#include <tqpixmap.h> +#include <tqpainter.h> +#include <tqrect.h> +#include <tqsize.h> +#include <tqvaluelist.h> +#include <tqwmatrix.h> #include <kdebug.h> #include <kglobal.h> @@ -93,7 +93,7 @@ kpDocument::kpDocument (int w, int h, kpMainWindow *mainWindow) kdDebug () << "kpDocument::kpDocument (" << w << "," << h << ")" << endl; #endif - m_pixmap = new QPixmap (w, h); + m_pixmap = new TQPixmap (w, h); m_pixmap->fill (Qt::white); } @@ -126,20 +126,20 @@ void kpDocument::setMainWindow (kpMainWindow *mainWindow) */ // public static -QPixmap kpDocument::convertToPixmapAsLosslessAsPossible ( - const QImage &image, +TQPixmap kpDocument::convertToPixmapAsLosslessAsPossible ( + const TQImage &image, const kpPixmapFX::WarnAboutLossInfo &wali, kpDocumentSaveOptions *saveOptions, kpDocumentMetaInfo *metaInfo) { if (image.isNull ()) - return QPixmap (); + return TQPixmap (); #if DEBUG_KP_DOCUMENT kdDebug () << "\timage: depth=" << image.depth () - << " (X display=" << QColor::numBitPlanes () << ")" + << " (X display=" << TQColor::numBitPlanes () << ")" << " hasAlphaBuffer=" << image.hasAlphaBuffer () << endl; #endif @@ -156,8 +156,8 @@ QPixmap kpDocument::convertToPixmapAsLosslessAsPossible ( metaInfo->setDotsPerMeterY (image.dotsPerMeterY ()); metaInfo->setOffset (image.offset ()); - QValueList <QImageTextKeyLang> keyList = image.textList (); - for (QValueList <QImageTextKeyLang>::const_iterator it = keyList.begin (); + TQValueList <TQImageTextKeyLang> keyList = image.textList (); + for (TQValueList <TQImageTextKeyLang>::const_iterator it = keyList.begin (); it != keyList.end (); it++) { @@ -189,12 +189,12 @@ QPixmap kpDocument::convertToPixmapAsLosslessAsPossible ( #endif - QPixmap newPixmap = kpPixmapFX::convertToPixmapAsLosslessAsPossible (image, wali); + TQPixmap newPixmap = kpPixmapFX::convertToPixmapAsLosslessAsPossible (image, wali); #if DEBUG_KP_DOCUMENT && 1 { - const QImage image2 = kpPixmapFX::convertToImage (newPixmap); + const TQImage image2 = kpPixmapFX::convertToImage (newPixmap); kdDebug () << "(Converted to pixmap) Image dump:" << endl; bool differsFromOrgImage = false; @@ -230,8 +230,8 @@ QPixmap kpDocument::convertToPixmapAsLosslessAsPossible ( } // public static -QPixmap kpDocument::getPixmapFromFile (const KURL &url, bool suppressDoesntExistDialog, - QWidget *parent, +TQPixmap kpDocument::getPixmapFromFile (const KURL &url, bool suppressDoesntExistDialog, + TQWidget *parent, kpDocumentSaveOptions *saveOptions, kpDocumentMetaInfo *metaInfo) { @@ -246,7 +246,7 @@ QPixmap kpDocument::getPixmapFromFile (const KURL &url, bool suppressDoesntExist *metaInfo = kpDocumentMetaInfo (); - QString tempFile; + TQString tempFile; if (url.isEmpty () || !KIO::NetAccess::download (url, tempFile, parent)) { if (!suppressDoesntExistDialog) @@ -256,15 +256,15 @@ QPixmap kpDocument::getPixmapFromFile (const KURL &url, bool suppressDoesntExist .arg (kpDocument::prettyFilenameForURL (url))); } - return QPixmap (); + return TQPixmap (); } - QImage image; + TQImage image; // sync: remember to "KIO::NetAccess::removeTempFile (tempFile)" in all exit paths { - QString detectedMimeType = KImageIO::mimeType (tempFile); + TQString detectedMimeType = KImageIO::mimeType (tempFile); if (saveOptions) saveOptions->setMimeType (detectedMimeType); @@ -281,11 +281,11 @@ QPixmap kpDocument::getPixmapFromFile (const KURL &url, bool suppressDoesntExist i18n ("Could not open \"%1\" - unknown mimetype.") .arg (kpDocument::prettyFilenameForURL (url))); KIO::NetAccess::removeTempFile (tempFile); - return QPixmap (); + return TQPixmap (); } - image = QImage (tempFile); + image = TQImage (tempFile); KIO::NetAccess::removeTempFile (tempFile); } @@ -296,10 +296,10 @@ QPixmap kpDocument::getPixmapFromFile (const KURL &url, bool suppressDoesntExist i18n ("Could not open \"%1\" - unsupported image format.\n" "The file may be corrupt.") .arg (kpDocument::prettyFilenameForURL (url))); - return QPixmap (); + return TQPixmap (); } - const QPixmap newPixmap = kpDocument::convertToPixmapAsLosslessAsPossible (image, + const TQPixmap newPixmap = kpDocument::convertToPixmapAsLosslessAsPossible (image, kpPixmapFX::WarnAboutLossInfo ( i18n ("The image \"%1\"" " may have more colors than the current screen mode." @@ -332,7 +332,7 @@ QPixmap kpDocument::getPixmapFromFile (const KURL &url, bool suppressDoesntExist KMessageBox::sorry (parent, i18n ("Could not open \"%1\" - out of graphics memory.") .arg (kpDocument::prettyFilenameForURL (url))); - return QPixmap (); + return TQPixmap (); } #if DEBUG_KP_DOCUMENT @@ -370,7 +370,7 @@ bool kpDocument::open (const KURL &url, bool newDocSameNameIfNotExist) kpDocumentSaveOptions newSaveOptions; kpDocumentMetaInfo newMetaInfo; - QPixmap newPixmap = kpDocument::getPixmapFromFile (url, + TQPixmap newPixmap = kpDocument::getPixmapFromFile (url, newDocSameNameIfNotExist/*suppress "doesn't exist" dialog*/, m_mainWindow, &newSaveOptions, @@ -379,7 +379,7 @@ bool kpDocument::open (const KURL &url, bool newDocSameNameIfNotExist) if (!newPixmap.isNull ()) { delete m_pixmap; - m_pixmap = new QPixmap (newPixmap); + m_pixmap = new TQPixmap (newPixmap); setURL (url, true/*is from url*/); *m_saveOptions = newSaveOptions; @@ -444,9 +444,9 @@ bool kpDocument::save (bool overwritePrompt, bool lossyPrompt) // public static -bool kpDocument::lossyPromptContinue (const QPixmap &pixmap, +bool kpDocument::lossyPromptContinue (const TQPixmap &pixmap, const kpDocumentSaveOptions &saveOptions, - QWidget *parent) + TQWidget *parent) { #if DEBUG_KP_DOCUMENT kdDebug () << "kpDocument::lossyPromptContinue()" << endl; @@ -475,7 +475,7 @@ bool kpDocument::lossyPromptContinue (const QPixmap &pixmap, // low maximum colour depth i18n ("Lossy File Format"), KStdGuiItem::save (), - QString::fromLatin1 ("SaveInLossyMimeTypeDontAskAgain"))); + TQString::fromLatin1 ("SaveInLossyMimeTypeDontAskAgain"))); } else if (lossyType & kpDocumentSaveOptions::ColorDepthLow) { @@ -490,7 +490,7 @@ bool kpDocument::lossyPromptContinue (const QPixmap &pixmap, .arg (saveOptions.colorDepth ()), i18n ("Low Color Depth"), KStdGuiItem::save (), - QString::fromLatin1 ("SaveAtLowColorDepthDontAskAgain"))); + TQString::fromLatin1 ("SaveAtLowColorDepthDontAskAgain"))); } #undef QUIT_IF_CANCEL @@ -498,18 +498,18 @@ bool kpDocument::lossyPromptContinue (const QPixmap &pixmap, } // public static -bool kpDocument::savePixmapToDevice (const QPixmap &pixmap, - QIODevice *device, +bool kpDocument::savePixmapToDevice (const TQPixmap &pixmap, + TQIODevice *device, const kpDocumentSaveOptions &saveOptions, const kpDocumentMetaInfo &metaInfo, bool lossyPrompt, - QWidget *parent, + TQWidget *parent, bool *userCancelled) { if (userCancelled) *userCancelled = false; - QString type = KImageIO::typeForMime (saveOptions.mimeType ()); + TQString type = KImageIO::typeForMime (saveOptions.mimeType ()); #if DEBUG_KP_DOCUMENT kdDebug () << "\tmimeType=" << saveOptions.mimeType () << " type=" << type << endl; @@ -527,10 +527,10 @@ bool kpDocument::savePixmapToDevice (const QPixmap &pixmap, } - QPixmap pixmapToSave = + TQPixmap pixmapToSave = kpPixmapFX::pixmapWithDefinedTransparentPixels (pixmap, Qt::white); // CONFIG - QImage imageToSave = kpPixmapFX::convertToImage (pixmapToSave); + TQImage imageToSave = kpPixmapFX::convertToImage (pixmapToSave); // TODO: fix dup with kpDocumentSaveOptions::isLossyForSaving() @@ -563,8 +563,8 @@ bool kpDocument::savePixmapToDevice (const QPixmap &pixmap, imageToSave.setDotsPerMeterY (metaInfo.dotsPerMeterY ()); imageToSave.setOffset (metaInfo.offset ()); - QValueList <QImageTextKeyLang> keyList = metaInfo.textList (); - for (QValueList <QImageTextKeyLang>::const_iterator it = keyList.begin (); + TQValueList <TQImageTextKeyLang> keyList = metaInfo.textList (); + for (TQValueList <TQImageTextKeyLang>::const_iterator it = keyList.begin (); it != keyList.end (); it++) { @@ -596,13 +596,13 @@ bool kpDocument::savePixmapToDevice (const QPixmap &pixmap, return true; } -static void CouldNotCreateTemporaryFileDialog (QWidget *parent) +static void CouldNotCreateTemporaryFileDialog (TQWidget *parent) { KMessageBox::error (parent, i18n ("Could not save image - unable to create temporary file.")); } -static void CouldNotSaveDialog (const KURL &url, QWidget *parent) +static void CouldNotSaveDialog (const KURL &url, TQWidget *parent) { // TODO: use file.errorString() KMessageBox::error (parent, @@ -611,13 +611,13 @@ static void CouldNotSaveDialog (const KURL &url, QWidget *parent) } // public static -bool kpDocument::savePixmapToFile (const QPixmap &pixmap, +bool kpDocument::savePixmapToFile (const TQPixmap &pixmap, const KURL &url, const kpDocumentSaveOptions &saveOptions, const kpDocumentMetaInfo &metaInfo, bool overwritePrompt, bool lossyPrompt, - QWidget *parent) + TQWidget *parent) { // TODO: Use KIO::NetAccess:mostLocalURL() for accessing home:/ (and other // such local URLs) for efficiency and because only local writes @@ -628,8 +628,8 @@ bool kpDocument::savePixmapToFile (const QPixmap &pixmap, << ",overwritePrompt=" << overwritePrompt << ",lossyPrompt=" << lossyPrompt << ")" << endl; - saveOptions.printDebug (QString::fromLatin1 ("\tsaveOptions")); - metaInfo.printDebug (QString::fromLatin1 ("\tmetaInfo")); + saveOptions.printDebug (TQString::fromLatin1 ("\tsaveOptions")); + metaInfo.printDebug (TQString::fromLatin1 ("\tmetaInfo")); #endif if (overwritePrompt && KIO::NetAccess::exists (url, false/*write*/, parent)) @@ -638,7 +638,7 @@ bool kpDocument::savePixmapToFile (const QPixmap &pixmap, i18n ("A document called \"%1\" already exists.\n" "Do you want to overwrite it?") .arg (prettyFilenameForURL (url)), - QString::null, + TQString::null, i18n ("Overwrite")); if (result != KMessageBox::Continue) @@ -664,7 +664,7 @@ bool kpDocument::savePixmapToFile (const QPixmap &pixmap, // Local file? if (url.isLocalFile ()) { - const QString filename = url.path (); + const TQString filename = url.path (); // sync: All failure exit paths _must_ call KSaveFile::abort() or // else, the KSaveFile destructor will overwrite the file, @@ -723,7 +723,7 @@ bool kpDocument::savePixmapToFile (const QPixmap &pixmap, KTempFile tempFile; tempFile.setAutoDelete (true); - QString filename = tempFile.name (); + TQString filename = tempFile.name (); if (filename.isEmpty ()) { #if DEBUG_KP_DOCUMENT @@ -734,7 +734,7 @@ bool kpDocument::savePixmapToFile (const QPixmap &pixmap, } // Write to local temporary file. - QFile file (filename); + TQFile file (filename); { if (!file.open (IO_WriteOnly)) { @@ -854,7 +854,7 @@ bool kpDocument::isFromURL (bool checkURLStillExists) const // static -QString kpDocument::prettyURLForURL (const KURL &url) +TQString kpDocument::prettyURLForURL (const KURL &url) { if (url.isEmpty ()) return i18n ("Untitled"); @@ -862,14 +862,14 @@ QString kpDocument::prettyURLForURL (const KURL &url) return url.prettyURL (0, KURL::StripFileProtocol); } -QString kpDocument::prettyURL () const +TQString kpDocument::prettyURL () const { return prettyURLForURL (m_url); } // static -QString kpDocument::prettyFilenameForURL (const KURL &url) +TQString kpDocument::prettyFilenameForURL (const KURL &url) { if (url.isEmpty ()) return i18n ("Untitled"); @@ -879,7 +879,7 @@ QString kpDocument::prettyFilenameForURL (const KURL &url) return url.fileName (); } -QString kpDocument::prettyFilename () const +TQString kpDocument::prettyFilename () const { return prettyFilenameForURL (m_url); } @@ -984,7 +984,7 @@ void kpDocument::setHeight (int h, const kpColor &backgroundColor) resize (width (), h, backgroundColor); } -QRect kpDocument::rect (bool ofSelection) const +TQRect kpDocument::rect (bool ofSelection) const { if (ofSelection && m_selection) return m_selection->boundingRect (); @@ -998,13 +998,13 @@ QRect kpDocument::rect (bool ofSelection) const */ // public -QPixmap kpDocument::getPixmapAt (const QRect &rect) const +TQPixmap kpDocument::getPixmapAt (const TQRect &rect) const { return kpPixmapFX::getPixmapAt (*m_pixmap, rect); } // public -void kpDocument::setPixmapAt (const QPixmap &pixmap, const QPoint &at) +void kpDocument::setPixmapAt (const TQPixmap &pixmap, const TQPoint &at) { #if DEBUG_KP_DOCUMENT && 0 kdDebug () << "kpDocument::setPixmapAt (pixmap (w=" @@ -1016,19 +1016,19 @@ void kpDocument::setPixmapAt (const QPixmap &pixmap, const QPoint &at) #endif kpPixmapFX::setPixmapAt (m_pixmap, at, pixmap); - slotContentsChanged (QRect (at.x (), at.y (), pixmap.width (), pixmap.height ())); + slotContentsChanged (TQRect (at.x (), at.y (), pixmap.width (), pixmap.height ())); } // public -void kpDocument::paintPixmapAt (const QPixmap &pixmap, const QPoint &at) +void kpDocument::paintPixmapAt (const TQPixmap &pixmap, const TQPoint &at) { kpPixmapFX::paintPixmapAt (m_pixmap, at, pixmap); - slotContentsChanged (QRect (at.x (), at.y (), pixmap.width (), pixmap.height ())); + slotContentsChanged (TQRect (at.x (), at.y (), pixmap.width (), pixmap.height ())); } // public -QPixmap *kpDocument::pixmap (bool ofSelection) const +TQPixmap *kpDocument::pixmap (bool ofSelection) const { if (ofSelection) { @@ -1042,7 +1042,7 @@ QPixmap *kpDocument::pixmap (bool ofSelection) const } // public -void kpDocument::setPixmap (const QPixmap &pixmap) +void kpDocument::setPixmap (const TQPixmap &pixmap) { m_oldWidth = width (), m_oldHeight = height (); @@ -1055,7 +1055,7 @@ void kpDocument::setPixmap (const QPixmap &pixmap) } // public -void kpDocument::setPixmap (bool ofSelection, const QPixmap &pixmap) +void kpDocument::setPixmap (bool ofSelection, const TQPixmap &pixmap) { if (ofSelection) { @@ -1220,8 +1220,8 @@ void kpDocument::setSelection (const kpSelection &selection) // 2. We delete our copy when setSelection() is called again. // // See code above for both. - connect (m_selection, SIGNAL (changed (const QRect &)), - this, SLOT (slotContentsChanged (const QRect &))); + connect (m_selection, TQT_SIGNAL (changed (const TQRect &)), + this, TQT_SLOT (slotContentsChanged (const TQRect &))); if (!hadSelection) @@ -1235,7 +1235,7 @@ void kpDocument::setSelection (const kpSelection &selection) } // public -QPixmap kpDocument::getSelectedPixmap (const QBitmap &maskBitmap_) const +TQPixmap kpDocument::getSelectedPixmap (const TQBitmap &maskBitmap_) const { kpSelection *sel = selection (); @@ -1243,7 +1243,7 @@ QPixmap kpDocument::getSelectedPixmap (const QBitmap &maskBitmap_) const if (!sel) { kdError () << "kpDocument::getSelectedPixmap() no sel region" << endl; - return QPixmap (); + return TQPixmap (); } // easy if we already have it :) @@ -1251,15 +1251,15 @@ QPixmap kpDocument::getSelectedPixmap (const QBitmap &maskBitmap_) const return *sel->pixmap (); - const QRect boundingRect = sel->boundingRect (); + const TQRect boundingRect = sel->boundingRect (); if (!boundingRect.isValid ()) { kdError () << "kpDocument::getSelectedPixmap() boundingRect invalid" << endl; - return QPixmap (); + return TQPixmap (); } - QBitmap maskBitmap = maskBitmap_; + TQBitmap maskBitmap = maskBitmap_; if (maskBitmap.isNull () && !sel->isRectangular ()) { @@ -1268,12 +1268,12 @@ QPixmap kpDocument::getSelectedPixmap (const QBitmap &maskBitmap_) const if (maskBitmap.isNull ()) { kdError () << "kpDocument::getSelectedPixmap() could not get mask" << endl; - return QPixmap (); + return TQPixmap (); } } - QPixmap selPixmap = getPixmapAt (boundingRect); + TQPixmap selPixmap = getPixmapAt (boundingRect); if (!maskBitmap.isNull ()) { @@ -1283,11 +1283,11 @@ QPixmap kpDocument::getSelectedPixmap (const QBitmap &maskBitmap_) const // 0 1 0 // 1 0 0 // 1 1 1 - QBitmap selMaskBitmap = kpPixmapFX::getNonNullMask (selPixmap); + TQBitmap selMaskBitmap = kpPixmapFX::getNonNullMask (selPixmap); bitBlt (&selMaskBitmap, - QPoint (0, 0), + TQPoint (0, 0), &maskBitmap, - QRect (0, 0, maskBitmap.width (), maskBitmap.height ()), + TQRect (0, 0, maskBitmap.width (), maskBitmap.height ()), Qt::AndROP); selPixmap.setMask (selMaskBitmap); } @@ -1316,7 +1316,7 @@ bool kpDocument::selectionPullFromDocument (const kpColor &backgroundColor) return false; } - const QRect boundingRect = sel->boundingRect (); + const TQRect boundingRect = sel->boundingRect (); if (!boundingRect.isValid ()) { kdError () << "kpDocument::selectionPullFromDocument() boundingRect invalid" << endl; @@ -1328,14 +1328,14 @@ bool kpDocument::selectionPullFromDocument (const kpColor &backgroundColor) // Figure out mask for non-rectangular selections // - QBitmap maskBitmap = sel->maskForOwnType (true/*return null bitmap for rectangular*/); + TQBitmap maskBitmap = sel->maskForOwnType (true/*return null bitmap for rectangular*/); // // Get selection pixmap from document // - QPixmap selPixmap = getSelectedPixmap (maskBitmap); + TQPixmap selPixmap = getSelectedPixmap (maskBitmap); if (vm) vm->setQueueUpdates (); @@ -1348,11 +1348,11 @@ bool kpDocument::selectionPullFromDocument (const kpColor &backgroundColor) // // TODO: this assumes backgroundColor == sel->transparency ().transparentColor() - const QPixmap selTransparentPixmap = sel->transparentPixmap (); + const TQPixmap selTransparentPixmap = sel->transparentPixmap (); if (backgroundColor.isOpaque ()) { - QPixmap erasePixmap (boundingRect.width (), boundingRect.height ()); + TQPixmap erasePixmap (boundingRect.width (), boundingRect.height ()); erasePixmap.fill (backgroundColor.toQColor ()); if (selTransparentPixmap.mask ()) @@ -1382,7 +1382,7 @@ bool kpDocument::selectionDelete () if (!sel) return false; - const QRect boundingRect = sel->boundingRect (); + const TQRect boundingRect = sel->boundingRect (); if (!boundingRect.isValid ()) return false; @@ -1420,7 +1420,7 @@ bool kpDocument::selectionCopyOntoDocument (bool useTransparentPixmap) if (!sel->pixmap ()) return true; - const QRect boundingRect = sel->boundingRect (); + const TQRect boundingRect = sel->boundingRect (); if (!boundingRect.isValid ()) return false; @@ -1449,7 +1449,7 @@ bool kpDocument::selectionPushOntoDocument (bool useTransparentPixmap) } // public -QPixmap kpDocument::pixmapWithSelection () const +TQPixmap kpDocument::pixmapWithSelection () const { #if DEBUG_KP_DOCUMENT && 1 kdDebug () << "kpDocument::pixmapWithSelection()" << endl; @@ -1461,7 +1461,7 @@ QPixmap kpDocument::pixmapWithSelection () const #if DEBUG_KP_DOCUMENT && 1 kdDebug () << "\tselection @ " << m_selection->boundingRect () << endl; #endif - QPixmap output = *m_pixmap; + TQPixmap output = *m_pixmap; m_selection->paint (&output, rect ()); @@ -1518,7 +1518,7 @@ void kpDocument::resize (int w, int h, const kpColor &backgroundColor, bool fill * Slots */ -void kpDocument::slotContentsChanged (const QRect &rect) +void kpDocument::slotContentsChanged (const TQRect &rect) { setModified (); emit contentsChanged (rect); @@ -1528,10 +1528,10 @@ void kpDocument::slotSizeChanged (int newWidth, int newHeight) { setModified (); emit sizeChanged (newWidth, newHeight); - emit sizeChanged (QSize (newWidth, newHeight)); + emit sizeChanged (TQSize (newWidth, newHeight)); } -void kpDocument::slotSizeChanged (const QSize &newSize) +void kpDocument::slotSizeChanged (const TQSize &newSize) { slotSizeChanged (newSize.width (), newSize.height ()); } diff --git a/kolourpaint/kpdocument.h b/kolourpaint/kpdocument.h index d75e36ff..a0369566 100644 --- a/kolourpaint/kpdocument.h +++ b/kolourpaint/kpdocument.h @@ -29,21 +29,21 @@ #ifndef KP_DOCUMENT_H #define KP_DOCUMENT_H -#include <qbitmap.h> -#include <qobject.h> -#include <qstring.h> +#include <tqbitmap.h> +#include <tqobject.h> +#include <tqstring.h> #include <kurl.h> #include <kppixmapfx.h> -class QImage; -class QIODevice; -class QPixmap; -class QPoint; -class QRect; -class QSize; +class TQImage; +class TQIODevice; +class TQPixmap; +class TQPoint; +class TQRect; +class TQSize; class kpColor; class kpDocumentSaveOptions; @@ -70,14 +70,14 @@ public: // Wraps kpPixmapFX::convertToPixmapAsLosslessAsPossible() but also // returns document meta information. - static QPixmap convertToPixmapAsLosslessAsPossible ( - const QImage &image, + static TQPixmap convertToPixmapAsLosslessAsPossible ( + const TQImage &image, const kpPixmapFX::WarnAboutLossInfo &wali = kpPixmapFX::WarnAboutLossInfo (), kpDocumentSaveOptions *saveOptions = 0, kpDocumentMetaInfo *metaInfo = 0); - static QPixmap getPixmapFromFile (const KURL &url, bool suppressDoesntExistDialog, - QWidget *parent, + static TQPixmap getPixmapFromFile (const KURL &url, bool suppressDoesntExistDialog, + TQWidget *parent, kpDocumentSaveOptions *saveOptions = 0, kpDocumentMetaInfo *metaInfo = 0); // TODO: fix: open*() should only be called once. @@ -85,23 +85,23 @@ public: void openNew (const KURL &url); bool open (const KURL &url, bool newDocSameNameIfNotExist = false); - static bool lossyPromptContinue (const QPixmap &pixmap, + static bool lossyPromptContinue (const TQPixmap &pixmap, const kpDocumentSaveOptions &saveOptions, - QWidget *parent); - static bool savePixmapToDevice (const QPixmap &pixmap, - QIODevice *device, + TQWidget *parent); + static bool savePixmapToDevice (const TQPixmap &pixmap, + TQIODevice *device, const kpDocumentSaveOptions &saveOptions, const kpDocumentMetaInfo &metaInfo, bool lossyPrompt, - QWidget *parent, + TQWidget *parent, bool *userCancelled = 0); - static bool savePixmapToFile (const QPixmap &pixmap, + static bool savePixmapToFile (const TQPixmap &pixmap, const KURL &url, const kpDocumentSaveOptions &saveOptions, const kpDocumentMetaInfo &metaInfo, bool overwritePrompt, bool lossyPrompt, - QWidget *parent); + TQWidget *parent); bool save (bool overwritePrompt = false, bool lossyPrompt = false); bool saveAs (const KURL &url, const kpDocumentSaveOptions &saveOptions, @@ -126,12 +126,12 @@ public: bool isFromURL (bool checkURLStillExists = true) const; // (will convert: empty URL --> "Untitled") - static QString prettyURLForURL (const KURL &url); - QString prettyURL () const; + static TQString prettyURLForURL (const KURL &url); + TQString prettyURL () const; // (will convert: empty URL --> "Untitled") - static QString prettyFilenameForURL (const KURL &url); - QString prettyFilename () const; + static TQString prettyFilenameForURL (const KURL &url); + TQString prettyFilename () const; // (guaranteed to return valid pointer) @@ -160,7 +160,7 @@ public: int oldHeight () const; // only valid in a slot connected to sizeChanged() void setHeight (int h, const kpColor &backgroundColor); - QRect rect (bool ofSelection = false) const; + TQRect rect (bool ofSelection = false) const; /* @@ -169,16 +169,16 @@ public: // get a copy of a bit of the doc's pixmap // (not including the selection) - QPixmap getPixmapAt (const QRect &rect) const; + TQPixmap getPixmapAt (const TQRect &rect) const; - void setPixmapAt (const QPixmap &pixmap, const QPoint &at); + void setPixmapAt (const TQPixmap &pixmap, const TQPoint &at); - void paintPixmapAt (const QPixmap &pixmap, const QPoint &at); + void paintPixmapAt (const TQPixmap &pixmap, const TQPoint &at); // (not including the selection) - QPixmap *pixmap (bool ofSelection = false) const; - void setPixmap (const QPixmap &pixmap); - void setPixmap (bool ofSelection, const QPixmap &pixmap); + TQPixmap *pixmap (bool ofSelection = false) const; + void setPixmap (const TQPixmap &pixmap); + void setPixmap (bool ofSelection, const TQPixmap &pixmap); private: void updateToolsSingleKeyTriggersEnabled (); @@ -188,7 +188,7 @@ public: void setSelection (const kpSelection &selection); // TODO: this always returns opaque pixmap - need transparent ver - QPixmap getSelectedPixmap (const QBitmap &maskBitmap = QBitmap ()) const; + TQPixmap getSelectedPixmap (const TQBitmap &maskBitmap = TQBitmap ()) const; bool selectionPullFromDocument (const kpColor &backgroundColor); bool selectionDelete (); @@ -197,7 +197,7 @@ public: // same as pixmap() but returns a _copy_ of the current pixmap // + any selection pasted on top - QPixmap pixmapWithSelection () const; + TQPixmap pixmapWithSelection () const; /* @@ -212,9 +212,9 @@ public: public slots: // these will emit signals! - void slotContentsChanged (const QRect &rect); + void slotContentsChanged (const TQRect &rect); void slotSizeChanged (int newWidth, int newHeight); - void slotSizeChanged (const QSize &newSize); + void slotSizeChanged (const TQSize &newSize); signals: void documentOpened (); @@ -224,9 +224,9 @@ signals: // This is the _only_ signal that may be emitted in addition to the others. void documentModified (); - void contentsChanged (const QRect &rect); + void contentsChanged (const TQRect &rect); void sizeChanged (int newWidth, int newHeight); // see oldWidth(), oldHeight() - void sizeChanged (const QSize &newSize); + void sizeChanged (const TQSize &newSize); void selectionEnabled (bool on); @@ -236,7 +236,7 @@ signals: private: int m_constructorWidth, m_constructorHeight; kpMainWindow *m_mainWindow; - QPixmap *m_pixmap; + TQPixmap *m_pixmap; KURL m_url; bool m_isFromURL; diff --git a/kolourpaint/kpdocumentmetainfo.cpp b/kolourpaint/kpdocumentmetainfo.cpp index 5e5fc6ae..36c1dde6 100644 --- a/kolourpaint/kpdocumentmetainfo.cpp +++ b/kolourpaint/kpdocumentmetainfo.cpp @@ -27,7 +27,7 @@ #include <kpdocumentmetainfo.h> -#include <qpoint.h> +#include <tqpoint.h> #include <kdebug.h> @@ -35,9 +35,9 @@ struct kpDocumentMetaInfoPrivate { int m_dotsPerMeterX, m_dotsPerMeterY; - QPoint m_offset; + TQPoint m_offset; - QMap <QImageTextKeyLang, QString> m_textMap; + TQMap <TQImageTextKeyLang, TQString> m_textMap; }; @@ -47,7 +47,7 @@ kpDocumentMetaInfo::kpDocumentMetaInfo () { d->m_dotsPerMeterX = 0; d->m_dotsPerMeterY = 0; - d->m_offset = QPoint (0, 0); + d->m_offset = TQPoint (0, 0); } kpDocumentMetaInfo::kpDocumentMetaInfo (const kpDocumentMetaInfo &rhs) @@ -79,11 +79,11 @@ kpDocumentMetaInfo &kpDocumentMetaInfo::operator= (const kpDocumentMetaInfo &rhs // public -void kpDocumentMetaInfo::printDebug (const QString &prefix) const +void kpDocumentMetaInfo::printDebug (const TQString &prefix) const { - const QString usedPrefix = !prefix.isEmpty () ? - prefix + QString::fromLatin1 (":") : - QString::null; + const TQString usedPrefix = !prefix.isEmpty () ? + prefix + TQString::fromLatin1 (":") : + TQString::null; kdDebug () << usedPrefix << endl; @@ -91,8 +91,8 @@ void kpDocumentMetaInfo::printDebug (const QString &prefix) const << " Y=" << dotsPerMeterY () << " offset=" << offset () << endl; - QValueList <QImageTextKeyLang> keyList = textList (); - for (QValueList <QImageTextKeyLang>::const_iterator it = keyList.begin (); + TQValueList <TQImageTextKeyLang> keyList = textList (); + for (TQValueList <TQImageTextKeyLang>::const_iterator it = keyList.begin (); it != keyList.end (); it++) { @@ -133,54 +133,54 @@ void kpDocumentMetaInfo::setDotsPerMeterY (int val) // public -QPoint kpDocumentMetaInfo::offset () const +TQPoint kpDocumentMetaInfo::offset () const { return d->m_offset; } // public -void kpDocumentMetaInfo::setOffset (const QPoint &point) +void kpDocumentMetaInfo::setOffset (const TQPoint &point) { d->m_offset = point; } // public -QMap <QImageTextKeyLang, QString> kpDocumentMetaInfo::textMap () const +TQMap <TQImageTextKeyLang, TQString> kpDocumentMetaInfo::textMap () const { return d->m_textMap; } // public -QValueList <QImageTextKeyLang> kpDocumentMetaInfo::textList () const +TQValueList <TQImageTextKeyLang> kpDocumentMetaInfo::textList () const { return d->m_textMap.keys (); } // public -QString kpDocumentMetaInfo::text (const QImageTextKeyLang &itkl) const +TQString kpDocumentMetaInfo::text (const TQImageTextKeyLang &itkl) const { return d->m_textMap [itkl]; } // public -QString kpDocumentMetaInfo::text (const char *key, const char *lang) const +TQString kpDocumentMetaInfo::text (const char *key, const char *lang) const { - return text (QImageTextKeyLang (key, lang)); + return text (TQImageTextKeyLang (key, lang)); } // public -void kpDocumentMetaInfo::setText (const QImageTextKeyLang &itkl, - const QString &string) +void kpDocumentMetaInfo::setText (const TQImageTextKeyLang &itkl, + const TQString &string) { d->m_textMap [itkl] = string; } // public void kpDocumentMetaInfo::setText (const char *key, const char *lang, - const QString &string) + const TQString &string) { - setText (QImageTextKeyLang (key, lang), string); + setText (TQImageTextKeyLang (key, lang), string); } diff --git a/kolourpaint/kpdocumentmetainfo.h b/kolourpaint/kpdocumentmetainfo.h index 15e1408f..c2dc67e8 100644 --- a/kolourpaint/kpdocumentmetainfo.h +++ b/kolourpaint/kpdocumentmetainfo.h @@ -30,13 +30,13 @@ #define KP_DOCUMENT_META_INFO -#include <qimage.h> -#include <qmap.h> -#include <qstring.h> -#include <qvaluelist.h> +#include <tqimage.h> +#include <tqmap.h> +#include <tqstring.h> +#include <tqvaluelist.h> -class QPoint; +class TQPoint; class kpDocumentMetaInfo @@ -54,10 +54,10 @@ public: kpDocumentMetaInfo &operator= (const kpDocumentMetaInfo &rhs); - void printDebug (const QString &prefix) const; + void printDebug (const TQString &prefix) const; - // See QImage documentation + // See TQImage documentation int dotsPerMeterX () const; void setDotsPerMeterX (int val); @@ -66,17 +66,17 @@ public: void setDotsPerMeterY (int val); - QPoint offset () const; - void setOffset (const QPoint &point); + TQPoint offset () const; + void setOffset (const TQPoint &point); - QMap <QImageTextKeyLang, QString> textMap () const; - QValueList <QImageTextKeyLang> textList () const; + TQMap <TQImageTextKeyLang, TQString> textMap () const; + TQValueList <TQImageTextKeyLang> textList () const; - QString text (const QImageTextKeyLang &itkl) const; - QString text (const char *key, const char *lang) const; - void setText (const QImageTextKeyLang &itkl, const QString &string); - void setText (const char *key, const char *lang, const QString &string); + TQString text (const TQImageTextKeyLang &itkl) const; + TQString text (const char *key, const char *lang) const; + void setText (const TQImageTextKeyLang &itkl, const TQString &string); + void setText (const char *key, const char *lang, const TQString &string); private: diff --git a/kolourpaint/kpdocumentsaveoptions.cpp b/kolourpaint/kpdocumentsaveoptions.cpp index 701b6b51..5151e739 100644 --- a/kolourpaint/kpdocumentsaveoptions.cpp +++ b/kolourpaint/kpdocumentsaveoptions.cpp @@ -30,8 +30,8 @@ #include <kpdocumentsaveoptions.h> -#include <qpixmap.h> -#include <qstring.h> +#include <tqpixmap.h> +#include <tqstring.h> #include <kconfig.h> #include <kdebug.h> @@ -42,7 +42,7 @@ struct kpDocumentSaveOptionsPrivate { - QString m_mimeType; + TQString m_mimeType; int m_colorDepth; bool m_dither; int m_quality; @@ -67,7 +67,7 @@ kpDocumentSaveOptions::kpDocumentSaveOptions (const kpDocumentSaveOptions &rhs) d->m_quality = rhs.quality (); } -kpDocumentSaveOptions::kpDocumentSaveOptions (QString mimeType, int colorDepth, bool dither, int quality) +kpDocumentSaveOptions::kpDocumentSaveOptions (TQString mimeType, int colorDepth, bool dither, int quality) : d (new kpDocumentSaveOptionsPrivate ()) { d->m_mimeType = mimeType; @@ -111,11 +111,11 @@ kpDocumentSaveOptions &kpDocumentSaveOptions::operator= (const kpDocumentSaveOpt // public -void kpDocumentSaveOptions::printDebug (const QString &prefix) const +void kpDocumentSaveOptions::printDebug (const TQString &prefix) const { - const QString usedPrefix = !prefix.isEmpty () ? - prefix + QString::fromLatin1 (": ") : - QString::null; + const TQString usedPrefix = !prefix.isEmpty () ? + prefix + TQString::fromLatin1 (": ") : + TQString::null; kdDebug () << usedPrefix << "mimeType=" << mimeType () @@ -127,26 +127,26 @@ void kpDocumentSaveOptions::printDebug (const QString &prefix) const // public -QString kpDocumentSaveOptions::mimeType () const +TQString kpDocumentSaveOptions::mimeType () const { return d->m_mimeType; } // public -void kpDocumentSaveOptions::setMimeType (const QString &mimeType) +void kpDocumentSaveOptions::setMimeType (const TQString &mimeType) { d->m_mimeType = mimeType; } // public static -QString kpDocumentSaveOptions::invalidMimeType () +TQString kpDocumentSaveOptions::invalidMimeType () { - return QString::null; + return TQString::null; } // public static -bool kpDocumentSaveOptions::mimeTypeIsInvalid (const QString &mimeType) +bool kpDocumentSaveOptions::mimeTypeIsInvalid (const TQString &mimeType) { return (mimeType == invalidMimeType ()); } @@ -243,15 +243,15 @@ bool kpDocumentSaveOptions::qualityIsInvalid () const // public static -QString kpDocumentSaveOptions::defaultMimeType (KConfigBase *config) +TQString kpDocumentSaveOptions::defaultMimeType (KConfigBase *config) { return config->readEntry (kpSettingForcedMimeType, - QString::fromLatin1 ("image/png")); + TQString::fromLatin1 ("image/png")); } // public static void kpDocumentSaveOptions::saveDefaultMimeType (KConfigBase *config, - const QString &mimeType) + const TQString &mimeType) { config->writeEntry (kpSettingForcedMimeType, mimeType); } @@ -366,10 +366,10 @@ bool kpDocumentSaveOptions::saveDefaultDifferences (KConfigBase *config, } -static QStringList mimeTypesSupportingProperty (const QString &property, - const QStringList &defaultMimeTypesWithPropertyList) +static TQStringList mimeTypesSupportingProperty (const TQString &property, + const TQStringList &defaultMimeTypesWithPropertyList) { - QStringList mimeTypeList; + TQStringList mimeTypeList; KConfigGroupSaver cfgGroupSaver (KGlobal::config (), kpSettingsGroupMimeTypeProperties); @@ -390,10 +390,10 @@ static QStringList mimeTypesSupportingProperty (const QString &property, return mimeTypeList; } -static bool mimeTypeSupportsProperty (const QString &mimeType, - const QString &property, const QStringList &defaultMimeTypesWithPropertyList) +static bool mimeTypeSupportsProperty (const TQString &mimeType, + const TQString &property, const TQStringList &defaultMimeTypesWithPropertyList) { - const QStringList mimeTypeList = mimeTypesSupportingProperty ( + const TQStringList mimeTypeList = mimeTypesSupportingProperty ( property, defaultMimeTypesWithPropertyList); return mimeTypeList.contains (mimeType); @@ -434,31 +434,31 @@ static bool mimeTypeSupportsProperty (const QString &mimeType, // // To test whether depth is configurable, write an image in the new // mimetype with all depths and read each one back. See what -// kpDocument thinks the depth is when it gets QImage to read it. +// kpDocument thinks the depth is when it gets TQImage to read it. // public static -int kpDocumentSaveOptions::mimeTypeMaximumColorDepth (const QString &mimeType) +int kpDocumentSaveOptions::mimeTypeMaximumColorDepth (const TQString &mimeType) { - QStringList defaultList; + TQStringList defaultList; // SYNC: update mime info here // Greyscale actually (unenforced since depth not set to configurable) - defaultList << QString::fromLatin1 ("image/x-eps:32"); + defaultList << TQString::fromLatin1 ("image/x-eps:32"); - defaultList << QString::fromLatin1 ("image/x-portable-bitmap:1"); + defaultList << TQString::fromLatin1 ("image/x-portable-bitmap:1"); // Greyscale actually (unenforced since depth not set to configurable) - defaultList << QString::fromLatin1 ("image/x-portable-greymap:8"); + defaultList << TQString::fromLatin1 ("image/x-portable-greymap:8"); - defaultList << QString::fromLatin1 ("image/x-xbm:1"); + defaultList << TQString::fromLatin1 ("image/x-xbm:1"); - const QStringList mimeTypeList = mimeTypesSupportingProperty ( + const TQStringList mimeTypeList = mimeTypesSupportingProperty ( kpSettingMimeTypeMaximumColorDepth, defaultList); - const QString mimeTypeColon = mimeType + QString::fromLatin1 (":"); - for (QStringList::const_iterator it = mimeTypeList.begin (); + const TQString mimeTypeColon = mimeType + TQString::fromLatin1 (":"); + for (TQStringList::const_iterator it = mimeTypeList.begin (); it != mimeTypeList.end (); it++) { @@ -483,21 +483,21 @@ int kpDocumentSaveOptions::mimeTypeMaximumColorDepth () const // public static -bool kpDocumentSaveOptions::mimeTypeHasConfigurableColorDepth (const QString &mimeType) +bool kpDocumentSaveOptions::mimeTypeHasConfigurableColorDepth (const TQString &mimeType) { - QStringList defaultMimeTypes; + TQStringList defaultMimeTypes; // SYNC: update mime info here - defaultMimeTypes << QString::fromLatin1 ("image/png"); - defaultMimeTypes << QString::fromLatin1 ("image/x-bmp"); - defaultMimeTypes << QString::fromLatin1 ("image/x-pcx"); + defaultMimeTypes << TQString::fromLatin1 ("image/png"); + defaultMimeTypes << TQString::fromLatin1 ("image/x-bmp"); + defaultMimeTypes << TQString::fromLatin1 ("image/x-pcx"); // TODO: Only 1, 24 not 8; Qt only sees 32 but "file" cmd realises // it's either 1 or 24. - defaultMimeTypes << QString::fromLatin1 ("image/x-rgb"); + defaultMimeTypes << TQString::fromLatin1 ("image/x-rgb"); // TODO: Only 8 and 24 - no 1. - defaultMimeTypes << QString::fromLatin1 ("image/x-xpm"); + defaultMimeTypes << TQString::fromLatin1 ("image/x-xpm"); return mimeTypeSupportsProperty (mimeType, kpSettingMimeTypeHasConfigurableColorDepth, @@ -512,13 +512,13 @@ bool kpDocumentSaveOptions::mimeTypeHasConfigurableColorDepth () const // public static -bool kpDocumentSaveOptions::mimeTypeHasConfigurableQuality (const QString &mimeType) +bool kpDocumentSaveOptions::mimeTypeHasConfigurableQuality (const TQString &mimeType) { - QStringList defaultMimeTypes; + TQStringList defaultMimeTypes; // SYNC: update mime info here - defaultMimeTypes << QString::fromLatin1 ("image/jp2"); - defaultMimeTypes << QString::fromLatin1 ("image/jpeg"); + defaultMimeTypes << TQString::fromLatin1 ("image/jp2"); + defaultMimeTypes << TQString::fromLatin1 ("image/jpeg"); return mimeTypeSupportsProperty (mimeType, kpSettingMimeTypeHasConfigurableQuality, @@ -533,7 +533,7 @@ bool kpDocumentSaveOptions::mimeTypeHasConfigurableQuality () const // public -int kpDocumentSaveOptions::isLossyForSaving (const QPixmap &pixmap) const +int kpDocumentSaveOptions::isLossyForSaving (const TQPixmap &pixmap) const { int ret = 0; diff --git a/kolourpaint/kpdocumentsaveoptions.h b/kolourpaint/kpdocumentsaveoptions.h index 0d77ec2c..d6279885 100644 --- a/kolourpaint/kpdocumentsaveoptions.h +++ b/kolourpaint/kpdocumentsaveoptions.h @@ -30,8 +30,8 @@ #define KP_DOCUMENT_SAVE_OPTIONS_H -class QPixmap; -class QString; +class TQPixmap; +class TQString; class KConfigBase; @@ -41,7 +41,7 @@ class kpDocumentSaveOptions public: kpDocumentSaveOptions (); kpDocumentSaveOptions (const kpDocumentSaveOptions &rhs); - kpDocumentSaveOptions (QString mimeType, int colorDepth, bool dither, int quality); + kpDocumentSaveOptions (TQString mimeType, int colorDepth, bool dither, int quality); virtual ~kpDocumentSaveOptions (); bool operator== (const kpDocumentSaveOptions &rhs) const; @@ -50,14 +50,14 @@ public: kpDocumentSaveOptions &operator= (const kpDocumentSaveOptions &rhs); - void printDebug (const QString &prefix) const; + void printDebug (const TQString &prefix) const; - QString mimeType () const; - void setMimeType (const QString &mimeType); + TQString mimeType () const; + void setMimeType (const TQString &mimeType); - static QString invalidMimeType (); - static bool mimeTypeIsInvalid (const QString &mimeType); + static TQString invalidMimeType (); + static bool mimeTypeIsInvalid (const TQString &mimeType); bool mimeTypeIsInvalid () const; @@ -86,8 +86,8 @@ public: // (All assume that <config>'s group has been set) // (None of them call KConfigBase::reparseConfig() nor KConfigBase::sync()) - static QString defaultMimeType (KConfigBase *config); - static void saveDefaultMimeType (KConfigBase *config, const QString &mimeType); + static TQString defaultMimeType (KConfigBase *config); + static void saveDefaultMimeType (KConfigBase *config, const TQString &mimeType); static int defaultColorDepth (KConfigBase *config); static void saveDefaultColorDepth (KConfigBase *config, int colorDepth); @@ -108,14 +108,14 @@ public: public: // (purely for informational purposes - not enforced by this class) - static int mimeTypeMaximumColorDepth (const QString &mimeType); + static int mimeTypeMaximumColorDepth (const TQString &mimeType); int mimeTypeMaximumColorDepth () const; - static bool mimeTypeHasConfigurableColorDepth (const QString &mimeType); + static bool mimeTypeHasConfigurableColorDepth (const TQString &mimeType); bool mimeTypeHasConfigurableColorDepth () const; - static bool mimeTypeHasConfigurableQuality (const QString &mimeType); + static bool mimeTypeHasConfigurableQuality (const TQString &mimeType); bool mimeTypeHasConfigurableQuality () const; @@ -136,7 +136,7 @@ public: // Returns whether saving <pixmap> with these options will result in // loss of information. Returned value is the bitwise OR of // LossType enum possiblities. - int isLossyForSaving (const QPixmap &pixmap) const; + int isLossyForSaving (const TQPixmap &pixmap) const; private: diff --git a/kolourpaint/kpdocumentsaveoptionswidget.cpp b/kolourpaint/kpdocumentsaveoptionswidget.cpp index 39edf5b8..4847c72d 100644 --- a/kolourpaint/kpdocumentsaveoptionswidget.cpp +++ b/kolourpaint/kpdocumentsaveoptionswidget.cpp @@ -30,12 +30,12 @@ #include <kpdocumentsaveoptionswidget.h> -#include <qapplication.h> -#include <qbuffer.h> -#include <qimage.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qtimer.h> +#include <tqapplication.h> +#include <tqbuffer.h> +#include <tqimage.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqtimer.h> #include <kcombobox.h> #include <kconfig.h> @@ -58,13 +58,13 @@ // protected static -const QSize kpDocumentSaveOptionsPreviewDialog::s_pixmapLabelMinimumSize (25, 25); +const TQSize kpDocumentSaveOptionsPreviewDialog::s_pixmapLabelMinimumSize (25, 25); kpDocumentSaveOptionsPreviewDialog::kpDocumentSaveOptionsPreviewDialog ( - QWidget *parent, + TQWidget *parent, const char *name) - : QWidget (parent, name, + : TQWidget (parent, name, Qt::WType_TopLevel | Qt::WStyle_Customize | Qt::WStyle_DialogBorder | @@ -79,15 +79,15 @@ KDialogBase (parent, name, false/*non-modal*/, { setCaption (i18n ("Save Preview")); - QWidget *baseWidget = this;//new QWidget (this); + TQWidget *baseWidget = this;//new TQWidget (this); //setMainWidget (baseWidget); - QGridLayout *lay = new QGridLayout (baseWidget, 2, 1, + TQGridLayout *lay = new TQGridLayout (baseWidget, 2, 1, KDialog::marginHint (), KDialog::spacingHint ()); m_filePixmapLabel = new kpResizeSignallingLabel (baseWidget); - m_fileSizeLabel = new QLabel (baseWidget); + m_fileSizeLabel = new TQLabel (baseWidget); m_filePixmapLabel->setMinimumSize (s_pixmapLabelMinimumSize); @@ -100,8 +100,8 @@ KDialogBase (parent, name, false/*non-modal*/, lay->setRowStretch (0, 1); - connect (m_filePixmapLabel, SIGNAL (resized ()), - this, SLOT (updatePixmapPreview ())); + connect (m_filePixmapLabel, TQT_SIGNAL (resized ()), + this, TQT_SLOT (updatePixmapPreview ())); } kpDocumentSaveOptionsPreviewDialog::~kpDocumentSaveOptionsPreviewDialog () @@ -111,22 +111,22 @@ kpDocumentSaveOptionsPreviewDialog::~kpDocumentSaveOptionsPreviewDialog () // public -QSize kpDocumentSaveOptionsPreviewDialog::preferredMinimumSize () const +TQSize kpDocumentSaveOptionsPreviewDialog::preferredMinimumSize () const { const int contentsWidth = 180; const int totalMarginsWidth = 2 * KDialog::marginHint (); - return QSize (contentsWidth + totalMarginsWidth, + return TQSize (contentsWidth + totalMarginsWidth, contentsWidth * 3 / 4 + totalMarginsWidth); } // public slot -void kpDocumentSaveOptionsPreviewDialog::setFilePixmapAndSize (const QPixmap &pixmap, +void kpDocumentSaveOptionsPreviewDialog::setFilePixmapAndSize (const TQPixmap &pixmap, int fileSize) { delete m_filePixmap; - m_filePixmap = new QPixmap (pixmap); + m_filePixmap = new TQPixmap (pixmap); updatePixmapPreview (); @@ -148,14 +148,14 @@ void kpDocumentSaveOptionsPreviewDialog::setFilePixmapAndSize (const QPixmap &pi // HACK: I don't know if the percentage thing will work well and we're // really close to the message freeze so provide alt. texts to choose // from during the message freeze :) - const QString alternateText0 = i18n ("%1 bytes"); - const QString alternateText1 = i18n ("%1 bytes (%2%)"); - const QString alternateText2 = i18n ("%1 B"); - const QString alternateText3 = i18n ("%1 B (%2%)"); - const QString alternateText4 = i18n ("%1 B (approx. %2%)"); - const QString alternateText5 = i18n ("%1B"); - const QString alternateText6 = i18n ("%1B (%2%)"); - const QString alternateText7 = i18n ("%1B (approx. %2%)"); + const TQString alternateText0 = i18n ("%1 bytes"); + const TQString alternateText1 = i18n ("%1 bytes (%2%)"); + const TQString alternateText2 = i18n ("%1 B"); + const TQString alternateText3 = i18n ("%1 B (%2%)"); + const TQString alternateText4 = i18n ("%1 B (approx. %2%)"); + const TQString alternateText5 = i18n ("%1B"); + const TQString alternateText6 = i18n ("%1B (%2%)"); + const TQString alternateText7 = i18n ("%1B (approx. %2%)"); m_fileSizeLabel->setText (i18n ("%1 bytes (approx. %2%)") .arg (KGlobal::locale ()->formatLong (m_fileSize)) .arg (percent)); @@ -206,12 +206,12 @@ void kpDocumentSaveOptionsPreviewDialog::updatePixmapPreview () #endif - QPixmap transformedPixmap = + TQPixmap transformedPixmap = kpPixmapFX::scale (*m_filePixmap, newWidth, newHeight); - QPixmap labelPixmap (m_filePixmapLabel->width (), + TQPixmap labelPixmap (m_filePixmapLabel->width (), m_filePixmapLabel->height ()); kpPixmapFX::fill (&labelPixmap, kpColor::transparent); kpPixmapFX::setPixmapAt (&labelPixmap, @@ -224,54 +224,54 @@ void kpDocumentSaveOptionsPreviewDialog::updatePixmapPreview () } else { - m_filePixmapLabel->setPixmap (QPixmap ()); + m_filePixmapLabel->setPixmap (TQPixmap ()); } } // protected virtual [base QWidget] -void kpDocumentSaveOptionsPreviewDialog::closeEvent (QCloseEvent *e) +void kpDocumentSaveOptionsPreviewDialog::closeEvent (TQCloseEvent *e) { #if DEBUG_KP_DOCUMENT_SAVE_OPTIONS_WIDGET kdDebug () << "kpDocumentSaveOptionsPreviewDialog::closeEvent()" << endl; #endif - QWidget::closeEvent (e); + TQWidget::closeEvent (e); emit finished (); } // protected virtual [base QWidget] -void kpDocumentSaveOptionsPreviewDialog::moveEvent (QMoveEvent *e) +void kpDocumentSaveOptionsPreviewDialog::moveEvent (TQMoveEvent *e) { #if DEBUG_KP_DOCUMENT_SAVE_OPTIONS_WIDGET kdDebug () << "kpDocumentSaveOptionsPreviewDialog::moveEvent()" << endl; #endif - QWidget::moveEvent (e); + TQWidget::moveEvent (e); emit moved (); } // protected virtual [base QWidget] -void kpDocumentSaveOptionsPreviewDialog::resizeEvent (QResizeEvent *e) +void kpDocumentSaveOptionsPreviewDialog::resizeEvent (TQResizeEvent *e) { #if DEBUG_KP_DOCUMENT_SAVE_OPTIONS_WIDGET kdDebug () << "kpDocumentSaveOptionsPreviewDialog::resizeEvent()" << endl; #endif - QWidget::resizeEvent (e); + TQWidget::resizeEvent (e); emit resized (); } kpDocumentSaveOptionsWidget::kpDocumentSaveOptionsWidget ( - const QPixmap &docPixmap, + const TQPixmap &docPixmap, const kpDocumentSaveOptions &saveOptions, const kpDocumentMetaInfo &metaInfo, - QWidget *parent, const char *name) - : QWidget (parent, name), + TQWidget *parent, const char *name) + : TQWidget (parent, name), m_visualParent (parent) { init (); @@ -281,8 +281,8 @@ kpDocumentSaveOptionsWidget::kpDocumentSaveOptionsWidget ( } kpDocumentSaveOptionsWidget::kpDocumentSaveOptionsWidget ( - QWidget *parent, const char *name) - : QWidget (parent, name), + TQWidget *parent, const char *name) + : TQWidget (parent, name), m_visualParent (parent) { init (); @@ -296,16 +296,16 @@ void kpDocumentSaveOptionsWidget::init () m_visualParent = 0; - m_colorDepthLabel = new QLabel (i18n ("Convert &to:"), this); + m_colorDepthLabel = new TQLabel (i18n ("Convert &to:"), this); m_colorDepthCombo = new KComboBox (this); - m_colorDepthSpaceWidget = new QWidget (this); + m_colorDepthSpaceWidget = new TQWidget (this); - m_qualityLabel = new QLabel (i18n ("Quali&ty:"), this); + m_qualityLabel = new TQLabel (i18n ("Quali&ty:"), this); m_qualityInput = new KIntNumInput (this); // Note that we set min to 1 not 0 since "0 Quality" is a bit misleading // and 101 quality settings would be weird. So we lose 1 quality setting - // according to QImage::save(). + // according to TQImage::save(). // TODO: 100 quality is also misleading since that implies perfect quality. m_qualityInput->setRange (1, 100, 1/*step*/, true/*slider*/); @@ -318,7 +318,7 @@ void kpDocumentSaveOptionsWidget::init () m_qualityLabel->setBuddy (m_qualityInput); - QHBoxLayout *lay = new QHBoxLayout (this, 0/*margin*/, KDialog::spacingHint ()); + TQHBoxLayout *lay = new TQHBoxLayout (this, 0/*margin*/, KDialog::spacingHint ()); lay->addWidget (m_colorDepthLabel, 0/*stretch*/, Qt::AlignLeft); lay->addWidget (m_colorDepthCombo, 0/*stretch*/); @@ -331,27 +331,27 @@ void kpDocumentSaveOptionsWidget::init () lay->addWidget (m_previewButton, 0/*stretch*/, Qt::AlignRight); - connect (m_colorDepthCombo, SIGNAL (activated (int)), - this, SLOT (slotColorDepthSelected ())); - connect (m_colorDepthCombo, SIGNAL (activated (int)), - this, SLOT (updatePreview ())); + connect (m_colorDepthCombo, TQT_SIGNAL (activated (int)), + this, TQT_SLOT (slotColorDepthSelected ())); + connect (m_colorDepthCombo, TQT_SIGNAL (activated (int)), + this, TQT_SLOT (updatePreview ())); - connect (m_qualityInput, SIGNAL (valueChanged (int)), - this, SLOT (updatePreviewDelayed ())); + connect (m_qualityInput, TQT_SIGNAL (valueChanged (int)), + this, TQT_SLOT (updatePreviewDelayed ())); - connect (m_previewButton, SIGNAL (toggled (bool)), - this, SLOT (showPreview (bool))); + connect (m_previewButton, TQT_SIGNAL (toggled (bool)), + this, TQT_SLOT (showPreview (bool))); m_updatePreviewDelay = 200/*ms*/; - m_updatePreviewTimer = new QTimer (this); - connect (m_updatePreviewTimer, SIGNAL (timeout ()), - this, SLOT (updatePreview ())); + m_updatePreviewTimer = new TQTimer (this); + connect (m_updatePreviewTimer, TQT_SIGNAL (timeout ()), + this, TQT_SLOT (updatePreview ())); - m_updatePreviewDialogLastRelativeGeometryTimer = new QTimer (this); - connect (m_updatePreviewDialogLastRelativeGeometryTimer, SIGNAL (timeout ()), - this, SLOT (updatePreviewDialogLastRelativeGeometry ())); + m_updatePreviewDialogLastRelativeGeometryTimer = new TQTimer (this); + connect (m_updatePreviewDialogLastRelativeGeometryTimer, TQT_SIGNAL (timeout ()), + this, TQT_SLOT (updatePreviewDialogLastRelativeGeometry ())); setMode (None); @@ -371,7 +371,7 @@ kpDocumentSaveOptionsWidget::~kpDocumentSaveOptionsWidget () // public -void kpDocumentSaveOptionsWidget::setVisualParent (QWidget *visualParent) +void kpDocumentSaveOptionsWidget::setVisualParent (TQWidget *visualParent) { #if DEBUG_KP_DOCUMENT_SAVE_OPTIONS_WIDGET kdDebug () << "kpDocumentSaveOptionsWidget::setVisualParent(" @@ -396,13 +396,13 @@ bool kpDocumentSaveOptionsWidget::mimeTypeHasConfigurableQuality () const // public -QString kpDocumentSaveOptionsWidget::mimeType () const +TQString kpDocumentSaveOptionsWidget::mimeType () const { return m_baseDocumentSaveOptions.mimeType (); } // public slots -void kpDocumentSaveOptionsWidget::setMimeType (const QString &string) +void kpDocumentSaveOptionsWidget::setMimeType (const TQString &string) { #if DEBUG_KP_DOCUMENT_SAVE_OPTIONS_WIDGET kdDebug () << "kpDocumentSaveOptionsWidget::setMimeType(" << string @@ -575,7 +575,7 @@ void kpDocumentSaveOptionsWidget::setColorDepthDither (int newDepth, bool newDit newDepth, newDither); // TODO: Ignoring when comboItem >= m_colorDepthCombo->count() is wrong. // This happens if this mimeType has configurable colour depth - // and an incorrect maximum colour depth (less than a QImage of + // and an incorrect maximum colour depth (less than a TQImage of // this mimeType, opened by kpDocument). if (comboItem >= 0 && comboItem < m_colorDepthCombo->count ()) m_colorDepthCombo->setCurrentItem (comboItem); @@ -632,7 +632,7 @@ void kpDocumentSaveOptionsWidget::setQuality (int newQuality) #endif m_baseDocumentSaveOptions.setQuality (newQuality); - m_qualityInput->setValue (newQuality == -1/*QImage::save() default*/ ? + m_qualityInput->setValue (newQuality == -1/*TQImage::save() default*/ ? 75 : newQuality); } @@ -655,10 +655,10 @@ void kpDocumentSaveOptionsWidget::setDocumentSaveOptions ( // public -void kpDocumentSaveOptionsWidget::setDocumentPixmap (const QPixmap &documentPixmap) +void kpDocumentSaveOptionsWidget::setDocumentPixmap (const TQPixmap &documentPixmap) { delete m_documentPixmap; - m_documentPixmap = new QPixmap (documentPixmap); + m_documentPixmap = new TQPixmap (documentPixmap); updatePreview (); } @@ -705,7 +705,7 @@ void kpDocumentSaveOptionsWidget::setMode (Mode mode) // we change the height of "this", causing the text on the labels // to move but the first instance of the text doesn't get erased. // Qt bug. - QTimer::singleShot (0, this, SLOT (repaintLabels ())); + TQTimer::singleShot (0, this, TQT_SLOT (repaintLabels ())); } // protected slot @@ -738,8 +738,8 @@ void kpDocumentSaveOptionsWidget::showPreview (bool yes) m_previewDialog = new kpDocumentSaveOptionsPreviewDialog (m_visualParent, "previewSaveDialog"); updatePreview (); - connect (m_previewDialog, SIGNAL (finished ()), - this, SLOT (hidePreview ())); + connect (m_previewDialog, TQT_SIGNAL (finished ()), + this, TQT_SLOT (hidePreview ())); KConfigGroupSaver cfgGroupSaver (KGlobal::config (), kpSettingsGroupPreviewSave); @@ -783,7 +783,7 @@ void kpDocumentSaveOptionsWidget::showPreview (bool yes) << endl; #endif - QRect relativeGeometry; + TQRect relativeGeometry; if (!m_previewDialogLastRelativeGeometry.isEmpty () && m_visualParent->rect ().intersects (m_previewDialogLastRelativeGeometry)) { @@ -800,7 +800,7 @@ void kpDocumentSaveOptionsWidget::showPreview (bool yes) const int margin = 20; relativeGeometry = - QRect (m_visualParent->width () - + TQRect (m_visualParent->width () - m_previewDialog->preferredMinimumSize ().width () - margin, margin * 2, // Avoid folder combo @@ -809,7 +809,7 @@ void kpDocumentSaveOptionsWidget::showPreview (bool yes) } - const QRect globalGeometry = + const TQRect globalGeometry = kpWidgetMapper::toGlobal (m_visualParent, relativeGeometry); #if DEBUG_KP_DOCUMENT_SAVE_OPTIONS_WIDGET @@ -827,17 +827,17 @@ void kpDocumentSaveOptionsWidget::showPreview (bool yes) #if DEBUG_KP_DOCUMENT_SAVE_OPTIONS_WIDGET kdDebug () << "\tgeometry after show=" - << QRect (m_previewDialog->x (), m_previewDialog->y (), + << TQRect (m_previewDialog->x (), m_previewDialog->y (), m_previewDialog->width (), m_previewDialog->height ()) << endl; #endif updatePreviewDialogLastRelativeGeometry (); - connect (m_previewDialog, SIGNAL (moved ()), - this, SLOT (updatePreviewDialogLastRelativeGeometry ())); - connect (m_previewDialog, SIGNAL (resized ()), - this, SLOT (updatePreviewDialogLastRelativeGeometry ())); + connect (m_previewDialog, TQT_SIGNAL (moved ()), + this, TQT_SLOT (updatePreviewDialogLastRelativeGeometry ())); + connect (m_previewDialog, TQT_SIGNAL (resized ()), + this, TQT_SLOT (updatePreviewDialogLastRelativeGeometry ())); m_updatePreviewDialogLastRelativeGeometryTimer->start (200/*ms*/); } @@ -856,7 +856,7 @@ void kpDocumentSaveOptionsWidget::showPreview (bool yes) << m_previewDialogLastRelativeGeometry << " (Qt would have us believe " << kpWidgetMapper::fromGlobal (m_visualParent, - QRect (m_previewDialog->x (), m_previewDialog->y (), + TQRect (m_previewDialog->x (), m_previewDialog->y (), m_previewDialog->width (), m_previewDialog->height ())) << ")" << endl; @@ -891,11 +891,11 @@ void kpDocumentSaveOptionsWidget::updatePreview () m_updatePreviewTimer->stop (); - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); - QByteArray data; + TQByteArray data; - QBuffer buffer (data); + TQBuffer buffer (data); buffer.open (IO_WriteOnly); kpDocument::savePixmapToDevice (*m_documentPixmap, &buffer, @@ -906,7 +906,7 @@ void kpDocumentSaveOptionsWidget::updatePreview () buffer.close (); - QImage image; + TQImage image; image.loadFromData (data, KImageIO::typeForMime (mimeType ()).latin1 ()); @@ -915,7 +915,7 @@ void kpDocumentSaveOptionsWidget::updatePreview () kpPixmapFX::convertToPixmapAsLosslessAsPossible (image), data.size ()); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } // protected slot @@ -931,7 +931,7 @@ void kpDocumentSaveOptionsWidget::updatePreviewDialogLastRelativeGeometry () { m_previewDialogLastRelativeGeometry = kpWidgetMapper::fromGlobal (m_visualParent, - QRect (m_previewDialog->x (), m_previewDialog->y (), + TQRect (m_previewDialog->x (), m_previewDialog->y (), m_previewDialog->width (), m_previewDialog->height ())); #if DEBUG_KP_DOCUMENT_SAVE_OPTIONS_WIDGET kdDebug () << "\tcaching pos = " diff --git a/kolourpaint/kpdocumentsaveoptionswidget.h b/kolourpaint/kpdocumentsaveoptionswidget.h index 50bd35aa..1aeb8cb1 100644 --- a/kolourpaint/kpdocumentsaveoptionswidget.h +++ b/kolourpaint/kpdocumentsaveoptionswidget.h @@ -30,13 +30,13 @@ #define KP_DOCUMENT_SAVE_OPTIONS_WIDGET_H -#include <qsize.h> +#include <tqsize.h> -#include <qwidget.h> +#include <tqwidget.h> -class QPixmap; -class QLabel; +class TQPixmap; +class TQLabel; class kpResizeSignallingLabel; @@ -46,13 +46,13 @@ class kpDocumentSaveOptionsPreviewDialog : public QWidget Q_OBJECT public: - kpDocumentSaveOptionsPreviewDialog (QWidget *parent, const char *name = 0); + kpDocumentSaveOptionsPreviewDialog (TQWidget *parent, const char *name = 0); virtual ~kpDocumentSaveOptionsPreviewDialog (); - QSize preferredMinimumSize () const; + TQSize preferredMinimumSize () const; protected: - static const QSize s_pixmapLabelMinimumSize; + static const TQSize s_pixmapLabelMinimumSize; signals: void moved (); @@ -60,32 +60,32 @@ signals: void finished (); public slots: - void setFilePixmapAndSize (const QPixmap &filePixmap, int fileSize); + void setFilePixmapAndSize (const TQPixmap &filePixmap, int fileSize); void updatePixmapPreview (); protected: - virtual void closeEvent (QCloseEvent *e); - virtual void moveEvent (QMoveEvent *e); - virtual void resizeEvent (QResizeEvent *e); + virtual void closeEvent (TQCloseEvent *e); + virtual void moveEvent (TQMoveEvent *e); + virtual void resizeEvent (TQResizeEvent *e); protected: - QPixmap *m_filePixmap; + TQPixmap *m_filePixmap; int m_fileSize; kpResizeSignallingLabel *m_filePixmapLabel; - QLabel *m_fileSizeLabel; + TQLabel *m_fileSizeLabel; }; -#include <qrect.h> -#include <qwidget.h> +#include <tqrect.h> +#include <tqwidget.h> #include <kpdocumentmetainfo.h> #include <kpdocumentsaveoptions.h> -class QLabel; -class QTimer; +class TQLabel; +class TQTimer; class KComboBox; class KIntNumInput; @@ -97,11 +97,11 @@ class kpDocumentSaveOptionsWidget : public QWidget Q_OBJECT public: - kpDocumentSaveOptionsWidget (const QPixmap &docPixmap, + kpDocumentSaveOptionsWidget (const TQPixmap &docPixmap, const kpDocumentSaveOptions &saveOptions, const kpDocumentMetaInfo &metaInfo, - QWidget *parent, const char *name = 0); - kpDocumentSaveOptionsWidget (QWidget *parent, const char *name = 0); + TQWidget *parent, const char *name = 0); + kpDocumentSaveOptionsWidget (TQWidget *parent, const char *name = 0); private: void init (); public: @@ -109,7 +109,7 @@ public: // <visualParent> is usually the filedialog - void setVisualParent (QWidget *visualParent); + void setVisualParent (TQWidget *visualParent); protected: @@ -117,9 +117,9 @@ protected: bool mimeTypeHasConfigurableQuality () const; public: - QString mimeType () const; + TQString mimeType () const; public slots: - void setMimeType (const QString &string); + void setMimeType (const TQString &string); public: int colorDepth () const; @@ -144,7 +144,7 @@ public slots: public: - void setDocumentPixmap (const QPixmap &documentPixmap); + void setDocumentPixmap (const TQPixmap &documentPixmap); void setDocumentMetaInfo (const kpDocumentMetaInfo &metaInfo); @@ -171,29 +171,29 @@ protected slots: protected: - QWidget *m_visualParent; + TQWidget *m_visualParent; Mode m_mode; - QPixmap *m_documentPixmap; + TQPixmap *m_documentPixmap; kpDocumentSaveOptions m_baseDocumentSaveOptions; kpDocumentMetaInfo m_documentMetaInfo; - QLabel *m_colorDepthLabel; + TQLabel *m_colorDepthLabel; KComboBox *m_colorDepthCombo; int m_colorDepthComboLastSelectedItem; - QWidget *m_colorDepthSpaceWidget; + TQWidget *m_colorDepthSpaceWidget; - QLabel *m_qualityLabel; + TQLabel *m_qualityLabel; KIntNumInput *m_qualityInput; KPushButton *m_previewButton; kpDocumentSaveOptionsPreviewDialog *m_previewDialog; - QRect m_previewDialogLastRelativeGeometry; - QTimer *m_updatePreviewTimer; + TQRect m_previewDialogLastRelativeGeometry; + TQTimer *m_updatePreviewTimer; int m_updatePreviewDelay; - QTimer *m_updatePreviewDialogLastRelativeGeometryTimer; + TQTimer *m_updatePreviewDialogLastRelativeGeometryTimer; }; diff --git a/kolourpaint/kpmainwindow.cpp b/kolourpaint/kpmainwindow.cpp index 9af3177b..9e760c2c 100644 --- a/kolourpaint/kpmainwindow.cpp +++ b/kolourpaint/kpmainwindow.cpp @@ -29,9 +29,9 @@ #include <kpmainwindow.h> #include <kpmainwindow_p.h> -#include <qdragobject.h> -#include <qpainter.h> -#include <qtimer.h> +#include <tqdragobject.h> +#include <tqpainter.h> +#include <tqtimer.h> #include <kactionclasses.h> #include <kapplication.h> @@ -59,7 +59,7 @@ #include <kpzoomedview.h> #if DEBUG_KP_MAIN_WINDOW - #include <qdatetime.h> + #include <tqdatetime.h> #endif @@ -169,8 +169,8 @@ void kpMainWindow::init () { #if DEBUG_KP_MAIN_WINDOW kdDebug () << "kpMainWindow(" << name () << ")::init()" << endl; - QTime totalTime; totalTime.start (); - QTime time; time.start (); + TQTime totalTime; totalTime.start (); + TQTime time; time.start (); #endif d = new kpMainWindowPrivate; @@ -259,20 +259,20 @@ void kpMainWindow::init () #endif m_scrollView = new kpViewScrollableContainer (this, "scrollView"); - connect (m_scrollView, SIGNAL (beganDocResize ()), - this, SLOT (slotBeganDocResize ())); - connect (m_scrollView, SIGNAL (continuedDocResize (const QSize &)), - this, SLOT (slotContinuedDocResize (const QSize &))); - connect (m_scrollView, SIGNAL (cancelledDocResize ()), - this, SLOT (slotCancelledDocResize ())); - connect (m_scrollView, SIGNAL (endedDocResize (const QSize &)), - this, SLOT (slotEndedDocResize (const QSize &))); - - connect (m_scrollView, SIGNAL (statusMessageChanged (const QString &)), - this, SLOT (slotDocResizeMessageChanged (const QString &))); - - connect (m_scrollView, SIGNAL (contentsMoving (int, int)), - this, SLOT (slotScrollViewAboutToScroll ())); + connect (m_scrollView, TQT_SIGNAL (beganDocResize ()), + this, TQT_SLOT (slotBeganDocResize ())); + connect (m_scrollView, TQT_SIGNAL (continuedDocResize (const TQSize &)), + this, TQT_SLOT (slotContinuedDocResize (const TQSize &))); + connect (m_scrollView, TQT_SIGNAL (cancelledDocResize ()), + this, TQT_SLOT (slotCancelledDocResize ())); + connect (m_scrollView, TQT_SIGNAL (endedDocResize (const TQSize &)), + this, TQT_SLOT (slotEndedDocResize (const TQSize &))); + + connect (m_scrollView, TQT_SIGNAL (statusMessageChanged (const TQString &)), + this, TQT_SLOT (slotDocResizeMessageChanged (const TQString &))); + + connect (m_scrollView, TQT_SIGNAL (contentsMoving (int, int)), + this, TQT_SLOT (slotScrollViewAboutToScroll ())); setCentralWidget (m_scrollView); m_scrollView->show (); #if DEBUG_KP_MAIN_WINDOW @@ -334,7 +334,7 @@ void kpMainWindow::readProperties (KConfig *cfg) kdDebug () << "\turl=" << url << endl; #endif - const QSize notFromURLDocSize = + const TQSize notFromURLDocSize = cfg->readSizeEntry (kpSessionSettingNotFromUrlDocumentSize); // Is from URL? @@ -413,7 +413,7 @@ void kpMainWindow::saveProperties (KConfig *cfg) // constructorWidth(). // // Similarly for height() and constructorHeight(). - const QSize docSize (m_document->constructorWidth (), + const TQSize docSize (m_document->constructorWidth (), m_document->constructorHeight ()); #if DEBUG_KP_MAIN_WINDOW kdDebug () << "\tnot from url; doc size=" << docSize << endl; @@ -423,7 +423,7 @@ void kpMainWindow::saveProperties (KConfig *cfg) // Local session save i.e. queryClose() was not called beforehand - // (see QApplication::saveState())? + // (see TQApplication::saveState())? #if 0 if (m_document->isModified ()) { @@ -550,7 +550,7 @@ bool kpMainWindow::actionsSingleKeyTriggersEnabled () const { #if DEBUG_KP_MAIN_WINDOW kdDebug () << "kpMainWindow::actionsSingleKeyTriggersEnabled()" << endl; - QTime timer; timer.start (); + TQTime timer; timer.start (); #endif if (m_toolToolBar) @@ -573,7 +573,7 @@ void kpMainWindow::enableActionsSingleKeyTriggers (bool enable) #if DEBUG_KP_MAIN_WINDOW kdDebug () << "kpMainWindow::enableActionsSingleKeyTriggers(" << enable << ")" << endl; - QTime timer; timer.start (); + TQTime timer; timer.start (); #endif if (m_toolToolBar) @@ -658,11 +658,11 @@ void kpMainWindow::setDocument (kpDocument *newDoc) if (!m_lastCopyToURL.isEmpty ()) - m_lastCopyToURL.setFileName (QString::null); + m_lastCopyToURL.setFileName (TQString::null); m_copyToFirstTime = true; if (!m_lastExportURL.isEmpty ()) - m_lastExportURL.setFileName (QString::null); + m_lastExportURL.setFileName (TQString::null); m_exportFirstTime = true; @@ -707,16 +707,16 @@ void kpMainWindow::setDocument (kpDocument *newDoc) #endif // Copy/Cut/Deselect/Delete - connect (m_document, SIGNAL (selectionEnabled (bool)), - m_actionCut, SLOT (setEnabled (bool))); - connect (m_document, SIGNAL (selectionEnabled (bool)), - m_actionCopy, SLOT (setEnabled (bool))); - connect (m_document, SIGNAL (selectionEnabled (bool)), - m_actionDelete, SLOT (setEnabled (bool))); - connect (m_document, SIGNAL (selectionEnabled (bool)), - m_actionDeselect, SLOT (setEnabled (bool))); - connect (m_document, SIGNAL (selectionEnabled (bool)), - m_actionCopyToFile, SLOT (setEnabled (bool))); + connect (m_document, TQT_SIGNAL (selectionEnabled (bool)), + m_actionCut, TQT_SLOT (setEnabled (bool))); + connect (m_document, TQT_SIGNAL (selectionEnabled (bool)), + m_actionCopy, TQT_SLOT (setEnabled (bool))); + connect (m_document, TQT_SIGNAL (selectionEnabled (bool)), + m_actionDelete, TQT_SLOT (setEnabled (bool))); + connect (m_document, TQT_SIGNAL (selectionEnabled (bool)), + m_actionDeselect, TQT_SLOT (setEnabled (bool))); + connect (m_document, TQT_SIGNAL (selectionEnabled (bool)), + m_actionCopyToFile, TQT_SLOT (setEnabled (bool))); // this code won't actually enable any actions at this stage // (fresh document) but better safe than sorry @@ -726,40 +726,40 @@ void kpMainWindow::setDocument (kpDocument *newDoc) m_actionDelete->setEnabled (m_document->selection ()); m_actionCopyToFile->setEnabled (m_document->selection ()); - connect (m_document, SIGNAL (selectionEnabled (bool)), - this, SLOT (slotImageMenuUpdateDueToSelection ())); - connect (m_document, SIGNAL (selectionIsTextChanged (bool)), - this, SLOT (slotImageMenuUpdateDueToSelection ())); + connect (m_document, TQT_SIGNAL (selectionEnabled (bool)), + this, TQT_SLOT (slotImageMenuUpdateDueToSelection ())); + connect (m_document, TQT_SIGNAL (selectionIsTextChanged (bool)), + this, TQT_SLOT (slotImageMenuUpdateDueToSelection ())); // Status bar - connect (m_document, SIGNAL (documentOpened ()), - this, SLOT (recalculateStatusBar ())); + connect (m_document, TQT_SIGNAL (documentOpened ()), + this, TQT_SLOT (recalculateStatusBar ())); - connect (m_document, SIGNAL (sizeChanged (const QSize &)), - this, SLOT (setStatusBarDocSize (const QSize &))); + connect (m_document, TQT_SIGNAL (sizeChanged (const TQSize &)), + this, TQT_SLOT (setStatusBarDocSize (const TQSize &))); // Caption (url, modified) - connect (m_document, SIGNAL (documentModified ()), - this, SLOT (slotUpdateCaption ())); - connect (m_document, SIGNAL (documentOpened ()), - this, SLOT (slotUpdateCaption ())); - connect (m_document, SIGNAL (documentSaved ()), - this, SLOT (slotUpdateCaption ())); + connect (m_document, TQT_SIGNAL (documentModified ()), + this, TQT_SLOT (slotUpdateCaption ())); + connect (m_document, TQT_SIGNAL (documentOpened ()), + this, TQT_SLOT (slotUpdateCaption ())); + connect (m_document, TQT_SIGNAL (documentSaved ()), + this, TQT_SLOT (slotUpdateCaption ())); // File/Reload action only available with non-empty URL - connect (m_document, SIGNAL (documentSaved ()), - this, SLOT (slotEnableReload ())); + connect (m_document, TQT_SIGNAL (documentSaved ()), + this, TQT_SLOT (slotEnableReload ())); - connect (m_document, SIGNAL (documentSaved ()), - this, SLOT (slotEnableSettingsShowPath ())); + connect (m_document, TQT_SIGNAL (documentSaved ()), + this, TQT_SLOT (slotEnableSettingsShowPath ())); // Command history if (m_commandHistory) { - connect (m_commandHistory, SIGNAL (documentRestored ()), - this, SLOT (slotDocumentRestored ())); // caption "!modified" - connect (m_document, SIGNAL (documentSaved ()), - m_commandHistory, SLOT (documentSaved ())); + connect (m_commandHistory, TQT_SIGNAL (documentRestored ()), + this, TQT_SLOT (slotDocumentRestored ())); // caption "!modified" + connect (m_document, TQT_SIGNAL (documentSaved ()), + m_commandHistory, TQT_SLOT (documentSaved ())); } else { @@ -768,10 +768,10 @@ void kpMainWindow::setDocument (kpDocument *newDoc) } // Sync document -> views - connect (m_document, SIGNAL (contentsChanged (const QRect &)), - m_viewManager, SLOT (updateViews (const QRect &))); - connect (m_document, SIGNAL (sizeChanged (int, int)), - m_viewManager, SLOT (adjustViewsToEnvironment ())); + connect (m_document, TQT_SIGNAL (contentsChanged (const TQRect &)), + m_viewManager, TQT_SLOT (updateViews (const TQRect &))); + connect (m_document, TQT_SIGNAL (sizeChanged (int, int)), + m_viewManager, TQT_SLOT (adjustViewsToEnvironment ())); #if DEBUG_KP_MAIN_WINDOW kdDebug () << "\tenabling actions" << endl; @@ -814,7 +814,7 @@ void kpMainWindow::setDocument (kpDocument *newDoc) #if DEBUG_KP_MAIN_WINDOW kdDebug () << "\tcreating thumbnail LATER" << endl; #endif - QTimer::singleShot (0, this, SLOT (slotCreateThumbnail ())); + TQTimer::singleShot (0, this, TQT_SLOT (slotCreateThumbnail ())); } } #endif @@ -855,7 +855,7 @@ bool kpMainWindow::queryClose () i18n ("The document \"%1\" has been modified.\n" "Do you want to save it?") .arg (m_document->prettyFilename ()), - QString::null/*caption*/, + TQString::null/*caption*/, KStdGuiItem::save (), KStdGuiItem::discard ()); switch (result) @@ -871,15 +871,15 @@ bool kpMainWindow::queryClose () // private virtual [base QWidget] -void kpMainWindow::dragEnterEvent (QDragEnterEvent *e) +void kpMainWindow::dragEnterEvent (TQDragEnterEvent *e) { e->accept (kpSelectionDrag::canDecode (e) || KURLDrag::canDecode (e) || - QTextDrag::canDecode (e)); + TQTextDrag::canDecode (e)); } // private virtual [base QWidget] -void kpMainWindow::dropEvent (QDropEvent *e) +void kpMainWindow::dropEvent (TQDropEvent *e) { #if DEBUG_KP_MAIN_WINDOW kdDebug () << "kpMainWindow::dropEvent" << e->pos () << endl; @@ -887,12 +887,12 @@ void kpMainWindow::dropEvent (QDropEvent *e) kpSelection sel; KURL::List urls; - QString text; + TQString text; if (kpSelectionDrag::decode (e, sel/*ref*/, pasteWarnAboutLossInfo ())) { sel.setTransparency (selectionTransparency ()); - // TODO: drop at point like with QTextDrag below? + // TODO: drop at point like with TQTextDrag below? paste (sel); } else if (KURLDrag::decode (e, urls/*ref*/)) @@ -902,10 +902,10 @@ void kpMainWindow::dropEvent (QDropEvent *e) open (*it); } } - else if (QTextDrag::decode (e, text/*ref*/)) + else if (TQTextDrag::decode (e, text/*ref*/)) { - QPoint selTopLeft = KP_INVALID_POINT; - const QPoint globalPos = QWidget::mapToGlobal (e->pos ()); + TQPoint selTopLeft = KP_INVALID_POINT; + const TQPoint globalPos = TQWidget::mapToGlobal (e->pos ()); #if DEBUG_KP_MAIN_WINDOW kdDebug () << "\tpos toGlobal=" << globalPos << endl; #endif @@ -931,7 +931,7 @@ void kpMainWindow::dropEvent (QDropEvent *e) << kpWidgetMapper::toGlobal (m_mainView, m_mainView->rect ()) << " scrollView->globalRect=" << kpWidgetMapper::toGlobal (m_scrollView, - QRect (0, 0, + TQRect (0, 0, m_scrollView->visibleWidth (), m_scrollView->visibleHeight ())) << endl; @@ -950,7 +950,7 @@ void kpMainWindow::dropEvent (QDropEvent *e) .contains (globalPos) && m_scrollView && kpWidgetMapper::toGlobal (m_scrollView, - QRect (0, 0, + TQRect (0, 0, m_scrollView->visibleWidth (), m_scrollView->visibleHeight ())) .contains (globalPos)) @@ -962,8 +962,8 @@ void kpMainWindow::dropEvent (QDropEvent *e) if (view) { - const QPoint viewPos = view->mapFromGlobal (globalPos); - const QPoint docPoint = view->transformViewToDoc (viewPos); + const TQPoint viewPos = view->mapFromGlobal (globalPos); + const TQPoint docPoint = view->transformViewToDoc (viewPos); // viewUnderCursor() is hacky and can return a view when we aren't // over one thanks to drags. @@ -973,7 +973,7 @@ void kpMainWindow::dropEvent (QDropEvent *e) // TODO: In terms of doc pixels, would be inconsistent behaviour // based on zoomLevel of view. - // selTopLeft -= QPoint (-view->selectionResizeHandleAtomicSize (), + // selTopLeft -= TQPoint (-view->selectionResizeHandleAtomicSize (), // -view->selectionResizeHandleAtomicSize ()); } } @@ -998,12 +998,12 @@ void kpMainWindow::slotScrollViewAboutToScroll () else { // We're getting a late signal from the scrollview (thanks to - // a timer inside the QScrollView). By now, setDocument() has + // a timer inside the TQScrollView). By now, setDocument() has // already killed the document(), tool() and viewManager(). } #endif - QTimer::singleShot (0, this, SLOT (slotScrollViewAfterScroll ())); + TQTimer::singleShot (0, this, TQT_SLOT (slotScrollViewAfterScroll ())); } // private slot @@ -1022,7 +1022,7 @@ void kpMainWindow::slotScrollViewAfterScroll () // private virtual [base QWidget] -void kpMainWindow::moveEvent (QMoveEvent * /*e*/) +void kpMainWindow::moveEvent (TQMoveEvent * /*e*/) { if (m_thumbnail) { @@ -1045,7 +1045,7 @@ void kpMainWindow::slotUpdateCaption () } else { - setCaption (QString::null, false); + setCaption (TQString::null, false); } } diff --git a/kolourpaint/kpmainwindow.h b/kolourpaint/kpmainwindow.h index f5514848..abc5434b 100644 --- a/kolourpaint/kpmainwindow.h +++ b/kolourpaint/kpmainwindow.h @@ -32,10 +32,10 @@ #define DEBUG_KP_MAIN_WINDOW 0 -#include <qpoint.h> -#include <qptrlist.h> -#include <qsize.h> -#include <qvaluevector.h> +#include <tqpoint.h> +#include <tqptrlist.h> +#include <tqsize.h> +#include <tqvaluevector.h> #include <kmainwindow.h> #include <kurl.h> @@ -45,12 +45,12 @@ #include <kppixmapfx.h> -class QPainter; -class QPoint; -class QPopupMenu; -class QRect; -class QSize; -class QStringList; +class TQPainter; +class TQPoint; +class TQPopupMenu; +class TQRect; +class TQSize; +class TQStringList; class KAction; class KFontAction; @@ -113,7 +113,7 @@ private: double m_configColorSimilarity; bool m_configThumbnailShown; - QRect m_configThumbnailGeometry; + TQRect m_configThumbnailGeometry; bool m_configZoomedThumbnail; void readGeneralSettings (); @@ -166,15 +166,15 @@ private: virtual bool queryClose (); - virtual void dragEnterEvent (QDragEnterEvent *e); - virtual void dropEvent (QDropEvent *e); + virtual void dragEnterEvent (TQDragEnterEvent *e); + virtual void dropEvent (TQDropEvent *e); private slots: void slotScrollViewAboutToScroll (); void slotScrollViewAfterScroll (); private: - virtual void moveEvent (QMoveEvent *e); + virtual void moveEvent (TQMoveEvent *e); private slots: void slotUpdateCaption (); @@ -203,7 +203,7 @@ private: *m_toolRoundedRectangle; kpToolText *m_toolText; - QPtrList <kpTool> m_tools; + TQPtrList <kpTool> m_tools; int m_lastToolNumber; bool m_toolActionsEnabled; @@ -263,19 +263,19 @@ private: private: bool maybeDragScrollingMainView () const; private slots: - bool slotDragScroll (const QPoint &docPoint, - const QPoint &docLastPoint, + bool slotDragScroll (const TQPoint &docPoint, + const TQPoint &docLastPoint, int zoomLevel, bool *didSomething); bool slotEndDragScroll (); private slots: void slotBeganDocResize (); - void slotContinuedDocResize (const QSize &size); + void slotContinuedDocResize (const TQSize &size); void slotCancelledDocResize (); - void slotEndedDocResize (const QSize &size); + void slotEndedDocResize (const TQSize &size); - void slotDocResizeMessageChanged (const QString &string); + void slotDocResizeMessageChanged (const TQString &string); private slots: void slotActionPrevToolOptionGroup1 (); @@ -334,8 +334,8 @@ private slots: void slotNew (); private: - QSize defaultDocSize () const; - void saveDefaultDocSize (const QSize &size); + TQSize defaultDocSize () const; + void saveDefaultDocSize (const TQSize &size); private: bool shouldOpenInNewWindow () const; @@ -343,7 +343,7 @@ private: private: kpDocument *openInternal (const KURL &url, - const QSize &fallbackDocSize, + const TQSize &fallbackDocSize, bool newDocSameNameIfNotExist); // Same as above except that it: // @@ -358,8 +358,8 @@ private: // make sense to bubble the Recent Files list. bool open (const KURL &url, bool newDocSameNameIfNotExist = false); - KURL::List askForOpenURLs (const QString &caption, - const QString &startURL, + KURL::List askForOpenURLs (const TQString &caption, + const TQString &startURL, bool allowMultipleURLs = true); private slots: @@ -367,18 +367,18 @@ private slots: void slotOpenRecent (const KURL &url); void slotScan (); - void slotScanned (const QImage &image, int); + void slotScanned (const TQImage &image, int); bool save (bool localOnly = false); bool slotSave (); private: - KURL askForSaveURL (const QString &caption, - const QString &startURL, - const QPixmap &pixmapToBeSaved, + KURL askForSaveURL (const TQString &caption, + const TQString &startURL, + const TQPixmap &pixmapToBeSaved, const kpDocumentSaveOptions &startSaveOptions, const kpDocumentMetaInfo &docMetaInfo, - const QString &forcedSaveOptionsGroup, + const TQString &forcedSaveOptionsGroup, bool localOnly, kpDocumentSaveOptions *chosenSaveOptions, bool isSavingForFirstTime, @@ -439,22 +439,22 @@ private: bool m_copyToFirstTime; public: - QPopupMenu *selectionToolRMBMenu (); + TQPopupMenu *selectionToolRMBMenu (); private slots: void slotCut (); void slotCopy (); void slotEnablePaste (); private: - QRect calcUsefulPasteRect (int pixmapWidth, int pixmapHeight); + TQRect calcUsefulPasteRect (int pixmapWidth, int pixmapHeight); void paste (const kpSelection &sel, bool forceTopLeft = false); public: // (<forceNewTextSelection> is ignored if <text> is empty) - void pasteText (const QString &text, + void pasteText (const TQString &text, bool forceNewTextSelection = false, - const QPoint &newTextSelectionTopLeft = KP_INVALID_POINT); - void pasteTextAt (const QString &text, const QPoint &point, + const TQPoint &newTextSelectionTopLeft = KP_INVALID_POINT); + void pasteTextAt (const TQString &text, const TQPoint &point, // Allow tiny adjustment of <point> so that mouse // pointer is not exactly on top of the topLeft of // any new text selection (so that it doesn't look @@ -498,12 +498,12 @@ private: KToggleAction *m_actionShowGrid, *m_actionShowThumbnail, *m_actionZoomedThumbnail; - QValueVector <int> m_zoomList; + TQValueVector <int> m_zoomList; private: void sendZoomListToActionZoom (); - int zoomLevelFromString (const QString &string); - QString zoomLevelToString (int zoomLevel); + int zoomLevelFromString (const TQString &string); + TQString zoomLevelToString (int zoomLevel); void zoomTo (int zoomLevel, bool centerUnderCursor = false); private slots: @@ -534,8 +534,8 @@ private: void updateMainViewGrid (); private: - QRect mapToGlobal (const QRect &rect) const; - QRect mapFromGlobal (const QRect &rect) const; + TQRect mapToGlobal (const TQRect &rect) const; + TQRect mapFromGlobal (const TQRect &rect) const; private slots: void slotDestroyThumbnailIfNotVisible (bool tnIsVisible); @@ -544,7 +544,7 @@ private slots: void slotCreateThumbnail (); private: - QTimer *m_thumbnailSaveConfigTimer; + TQTimer *m_thumbnailSaveConfigTimer; public: void notifyThumbnailGeometryChanged (); @@ -573,7 +573,7 @@ private: bool isSelectionActive () const; bool isTextSelection () const; - QString autoCropText () const; + TQString autoCropText () const; void setupImageMenuActions (); void enableImageMenuDocumentActions (bool enable = true); @@ -647,9 +647,9 @@ private: kpSqueezedTextLabel *m_statusBarMessageLabel; bool m_statusBarShapeLastPointsInitialised; - QPoint m_statusBarShapeLastStartPoint, m_statusBarShapeLastEndPoint; + TQPoint m_statusBarShapeLastStartPoint, m_statusBarShapeLastEndPoint; bool m_statusBarShapeLastSizeInitialised; - QSize m_statusBarShapeLastSize; + TQSize m_statusBarShapeLastSize; enum { @@ -665,11 +665,11 @@ private: void createStatusBar (); private slots: - void setStatusBarMessage (const QString &message = QString::null); - void setStatusBarShapePoints (const QPoint &startPoint = KP_INVALID_POINT, - const QPoint &endPoint = KP_INVALID_POINT); - void setStatusBarShapeSize (const QSize &size = KP_INVALID_SIZE); - void setStatusBarDocSize (const QSize &size = KP_INVALID_SIZE); + void setStatusBarMessage (const TQString &message = TQString::null); + void setStatusBarShapePoints (const TQPoint &startPoint = KP_INVALID_POINT, + const TQPoint &endPoint = KP_INVALID_POINT); + void setStatusBarShapeSize (const TQSize &size = KP_INVALID_SIZE); + void setStatusBarDocSize (const TQSize &size = KP_INVALID_SIZE); void setStatusBarDocDepth (int depth = 0); void setStatusBarZoom (int zoom = 0); @@ -712,7 +712,7 @@ private: *m_actionTextUnderline, *m_actionTextStrikeThru; int m_settingTextStyle; - QString m_textOldFontFamily; + TQString m_textOldFontFamily; int m_textOldFontSize; @@ -725,7 +725,7 @@ private: private slots: void slotHelpTakingScreenshots (); - void slotHelpTakingScreenshotsFollowLink (const QString &link); + void slotHelpTakingScreenshotsFollowLink (const TQString &link); private: diff --git a/kolourpaint/kpmainwindow_edit.cpp b/kolourpaint/kpmainwindow_edit.cpp index 3cf9b4f6..1dfdb3fd 100644 --- a/kolourpaint/kpmainwindow_edit.cpp +++ b/kolourpaint/kpmainwindow_edit.cpp @@ -27,13 +27,13 @@ #include <kpmainwindow.h> -#include <qapplication.h> -#include <qclipboard.h> -#include <qdatetime.h> -#include <qfontmetrics.h> -#include <qimage.h> -#include <qpixmap.h> -#include <qvaluevector.h> +#include <tqapplication.h> +#include <tqclipboard.h> +#include <tqdatetime.h> +#include <tqfontmetrics.h> +#include <tqimage.h> +#include <tqpixmap.h> +#include <tqvaluevector.h> #include <kaction.h> #include <kdebug.h> @@ -103,25 +103,25 @@ void kpMainWindow::setupEditMenuActions () } - m_actionCut = KStdAction::cut (this, SLOT (slotCut ()), ac); - m_actionCopy = KStdAction::copy (this, SLOT (slotCopy ()), ac); - m_actionPaste = KStdAction::paste (this, SLOT (slotPaste ()), ac); + m_actionCut = KStdAction::cut (this, TQT_SLOT (slotCut ()), ac); + m_actionCopy = KStdAction::copy (this, TQT_SLOT (slotCopy ()), ac); + m_actionPaste = KStdAction::paste (this, TQT_SLOT (slotPaste ()), ac); m_actionPasteInNewWindow = new KAction (i18n ("Paste in &New Window"), Qt::CTRL + Qt::SHIFT + Qt::Key_V, - this, SLOT (slotPasteInNewWindow ()), ac, "edit_paste_in_new_window"); + this, TQT_SLOT (slotPasteInNewWindow ()), ac, "edit_paste_in_new_window"); - //m_actionDelete = KStdAction::clear (this, SLOT (slotDelete ()), ac); + //m_actionDelete = KStdAction::clear (this, TQT_SLOT (slotDelete ()), ac); m_actionDelete = new KAction (i18n ("&Delete Selection"), 0, - this, SLOT (slotDelete ()), ac, "edit_clear"); + this, TQT_SLOT (slotDelete ()), ac, "edit_clear"); - m_actionSelectAll = KStdAction::selectAll (this, SLOT (slotSelectAll ()), ac); - m_actionDeselect = KStdAction::deselect (this, SLOT (slotDeselect ()), ac); + m_actionSelectAll = KStdAction::selectAll (this, TQT_SLOT (slotSelectAll ()), ac); + m_actionDeselect = KStdAction::deselect (this, TQT_SLOT (slotDeselect ()), ac); m_actionCopyToFile = new KAction (i18n ("C&opy to File..."), 0, - this, SLOT (slotCopyToFile ()), ac, "edit_copy_to_file"); + this, TQT_SLOT (slotCopyToFile ()), ac, "edit_copy_to_file"); m_actionPasteFromFile = new KAction (i18n ("Paste &From File..."), 0, - this, SLOT (slotPasteFromFile ()), ac, "edit_paste_from_file"); + this, TQT_SLOT (slotPasteFromFile ()), ac, "edit_paste_from_file"); m_editMenuDocumentActionsEnabled = false; @@ -129,8 +129,8 @@ void kpMainWindow::setupEditMenuActions () // Paste should always be enabled, as long as there is something paste // (independent of whether we have a document or not) - connect (QApplication::clipboard (), SIGNAL (dataChanged ()), - this, SLOT (slotEnablePaste ())); + connect (TQApplication::clipboard (), TQT_SIGNAL (dataChanged ()), + this, TQT_SLOT (slotEnablePaste ())); slotEnablePaste (); } @@ -158,9 +158,9 @@ void kpMainWindow::enableEditMenuDocumentActions (bool enable) // public -QPopupMenu *kpMainWindow::selectionToolRMBMenu () +TQPopupMenu *kpMainWindow::selectionToolRMBMenu () { - return (QPopupMenu *) guiFactory ()->container ("selectionToolRMBMenu", this); + return (TQPopupMenu *) guiFactory ()->container ("selectionToolRMBMenu", this); } @@ -180,7 +180,7 @@ void kpMainWindow::slotCut () } - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); if (toolHasBegunShape ()) tool ()->endShapeInternal (); @@ -188,7 +188,7 @@ void kpMainWindow::slotCut () slotCopy (); slotDelete (); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } @@ -208,7 +208,7 @@ void kpMainWindow::slotCopy () } - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); if (toolHasBegunShape ()) tool ()->endShapeInternal (); @@ -223,7 +223,7 @@ void kpMainWindow::slotCopy () { if (!sel.text ().isEmpty ()) { - QApplication::clipboard ()->setData (new QTextDrag (sel.text ()), + TQApplication::clipboard ()->setData (new TQTextDrag (sel.text ()), QClipboard::Clipboard); // SYNC: Normally, users highlight text and press CTRL+C. @@ -237,19 +237,19 @@ void kpMainWindow::slotCopy () // mouse button" clipboard. We don't do this for images // as no one ever middle-mouse-pastes images. // - // Note that we don't share the QTextDrag pointer with + // Note that we don't share the TQTextDrag pointer with // the above in case Qt doesn't expect it. // // Once we change KolourPaint to support highlighted text // and CTRL+C to copy only the highlighted text, delete // this code. - QApplication::clipboard ()->setData (new QTextDrag (sel.text ()), + TQApplication::clipboard ()->setData (new TQTextDrag (sel.text ()), QClipboard::Selection); } } else { - QPixmap rawPixmap; + TQPixmap rawPixmap; if (sel.pixmap ()) rawPixmap = *sel.pixmap (); @@ -268,11 +268,11 @@ void kpMainWindow::slotCopy () rawPixmap, Qt::white)); // CONFIG - QApplication::clipboard ()->setData (new kpSelectionDrag (sel), + TQApplication::clipboard ()->setData (new kpSelectionDrag (sel), QClipboard::Clipboard); } - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } @@ -280,7 +280,7 @@ static bool HasSomethingToPaste (kpMainWindow *mw) { #if DEBUG_KP_MAIN_WINDOW kdDebug () << "kpMainWindow(" << mw->name () << "):HasSomethingToPaste()" << endl; - QTime timer; + TQTime timer; timer.start (); #else (void) mw; @@ -288,12 +288,12 @@ static bool HasSomethingToPaste (kpMainWindow *mw) bool hasSomething = false; - QMimeSource *ms = QApplication::clipboard ()->data (QClipboard::Clipboard); + TQMimeSource *ms = TQApplication::clipboard ()->data (QClipboard::Clipboard); if (ms) { - // It's faster to test for QTextDrag::canDecode() first due to the + // It's faster to test for TQTextDrag::canDecode() first due to the // lazy evaluation of the '||' operator. - hasSomething = (QTextDrag::canDecode (ms) || + hasSomething = (TQTextDrag::canDecode (ms) || kpSelectionDrag::canDecode (ms)); #if DEBUG_KP_MAIN_WINDOW kdDebug () << "\t" << mw->name () << "***canDecode=" << timer.restart () << endl; @@ -311,7 +311,7 @@ static bool HasSomethingToPaste (kpMainWindow *mw) return hasSomething; } -// HACK: SYNC: Non-Qt apps do not cause QApplication::clipboard() to +// HACK: SYNC: Non-Qt apps do not cause TQApplication::clipboard() to // emit dataChanged(). We don't want to have our paste // action disabled when we can actually paste something. // @@ -332,13 +332,13 @@ static bool HasSomethingToPasteWithDialogIfNot (kpMainWindow *mw) #if 1 (void) mw; #else - QApplication::setOverrideCursor (Qt::arrowCursor); + TQApplication::setOverrideCursor (Qt::arrowCursor); KMessageBox::sorry (mw, STRING_FREEZE_i18n ("<qt><p>There is nothing in the clipboard to paste.</p></qt>"), STRING_FREEZE_i18n ("Cannot Paste")); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); #endif return false; @@ -378,7 +378,7 @@ void kpMainWindow::slotEnablePaste () // private -QRect kpMainWindow::calcUsefulPasteRect (int pixmapWidth, int pixmapHeight) +TQRect kpMainWindow::calcUsefulPasteRect (int pixmapWidth, int pixmapHeight) { #if DEBUG_KP_MAIN_WINDOW && 1 kdDebug () << "kpMainWindow::calcUsefulPasteRect(" @@ -389,29 +389,29 @@ QRect kpMainWindow::calcUsefulPasteRect (int pixmapWidth, int pixmapHeight) if (!m_document) { kdError () << "kpMainWindow::calcUsefulPasteRect() without doc" << endl; - return QRect (); + return TQRect (); } // TODO: 1st choice is to paste sel near but not overlapping last deselect point if (m_mainView && m_scrollView) { - const QPoint viewTopLeft (m_scrollView->contentsX (), + const TQPoint viewTopLeft (m_scrollView->contentsX (), m_scrollView->contentsY ()); - const QPoint docTopLeft = m_mainView->transformViewToDoc (viewTopLeft); + const TQPoint docTopLeft = m_mainView->transformViewToDoc (viewTopLeft); if ((docTopLeft.x () + pixmapWidth <= m_document->width () && docTopLeft.y () + pixmapHeight <= m_document->height ()) || pixmapWidth <= docTopLeft.x () || pixmapHeight <= docTopLeft.y ()) { - return QRect (docTopLeft.x (), docTopLeft.y (), + return TQRect (docTopLeft.x (), docTopLeft.y (), pixmapWidth, pixmapHeight); } } - return QRect (0, 0, pixmapWidth, pixmapHeight); + return TQRect (0, 0, pixmapWidth, pixmapHeight); } // private @@ -428,7 +428,7 @@ void kpMainWindow::paste (const kpSelection &sel, bool forceTopLeft) return; } - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); if (toolHasBegunShape ()) tool ()->endShapeInternal (); @@ -464,9 +464,9 @@ void kpMainWindow::paste (const kpSelection &sel, bool forceTopLeft) #if DEBUG_KP_MAIN_WINDOW && 1 - kdDebug () << "sel.size=" << QSize (sel.width (), sel.height ()) + kdDebug () << "sel.size=" << TQSize (sel.width (), sel.height ()) << " document.size=" - << QSize (m_document->width (), m_document->height ()) + << TQSize (m_document->width (), m_document->height ()) << endl; #endif @@ -489,13 +489,13 @@ void kpMainWindow::paste (const kpSelection &sel, bool forceTopLeft) } - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } // public -void kpMainWindow::pasteText (const QString &text, +void kpMainWindow::pasteText (const TQString &text, bool forceNewTextSelection, - const QPoint &newTextSelectionTopLeft) + const TQPoint &newTextSelectionTopLeft) { #if DEBUG_KP_MAIN_WINDOW && 1 kdDebug () << "kpMainWindow::pasteText(" << text @@ -509,18 +509,18 @@ void kpMainWindow::pasteText (const QString &text, // sync: restoreOverrideCursor() in all exit paths - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); if (toolHasBegunShape ()) tool ()->endShapeInternal (); - QValueVector <QString> textLines (1, QString::null); + TQValueVector <TQString> textLines (1, TQString::null); for (int i = 0; i < (int) text.length (); i++) { if (text [i] == '\n') - textLines.push_back (QString::null); + textLines.push_back (TQString::null); else textLines [textLines.size () - 1].append (text [i]); } @@ -544,7 +544,7 @@ void kpMainWindow::pasteText (const QString &text, { macroCmd->addCommand ( new kpToolTextEnterCommand ( - QString::null/*uninteresting child of macroCmd*/, + TQString::null/*uninteresting child of macroCmd*/, m_viewManager->textCursorRow (), m_viewManager->textCursorCol (), this)); @@ -552,7 +552,7 @@ void kpMainWindow::pasteText (const QString &text, macroCmd->addCommand ( new kpToolTextInsertCommand ( - QString::null/*uninteresting child of macroCmd*/, + TQString::null/*uninteresting child of macroCmd*/, m_viewManager->textCursorRow (), m_viewManager->textCursorCol (), textLines [i], @@ -568,14 +568,14 @@ void kpMainWindow::pasteText (const QString &text, #endif const kpTextStyle ts = textStyle (); - const QFontMetrics fontMetrics = ts.fontMetrics (); + const TQFontMetrics fontMetrics = ts.fontMetrics (); int height = textLines.size () * fontMetrics.height (); if (textLines.size () >= 1) height += (textLines.size () - 1) * fontMetrics.leading (); int width = 0; - for (QValueVector <QString>::const_iterator it = textLines.begin (); + for (TQValueVector <TQString>::const_iterator it = textLines.begin (); it != textLines.end (); it++) { @@ -589,7 +589,7 @@ void kpMainWindow::pasteText (const QString &text, width + kpSelection::textBorderSize () * 2); const int selHeight = QMAX (kpSelection::minimumHeightForTextStyle (ts), height + kpSelection::textBorderSize () * 2); - kpSelection sel (QRect (0, 0, selWidth, selHeight), + kpSelection sel (TQRect (0, 0, selWidth, selHeight), textLines, ts); @@ -605,11 +605,11 @@ void kpMainWindow::pasteText (const QString &text, } - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } // public -void kpMainWindow::pasteTextAt (const QString &text, const QPoint &point, +void kpMainWindow::pasteTextAt (const TQString &text, const TQPoint &point, bool allowNewTextSelectionPointShift) { #if DEBUG_KP_MAIN_WINDOW && 1 @@ -620,7 +620,7 @@ void kpMainWindow::pasteTextAt (const QString &text, const QPoint &point, << ")" << endl; #endif - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); if (toolHasBegunShape ()) tool ()->endShapeInternal (); @@ -642,20 +642,20 @@ void kpMainWindow::pasteTextAt (const QString &text, const QPoint &point, } else { - QPoint pointToUse = point; + TQPoint pointToUse = point; if (allowNewTextSelectionPointShift) { // TODO: In terms of doc pixels, would be inconsistent behaviour // based on zoomLevel of view. - // pointToUse -= QPoint (-view->selectionResizeHandleAtomicSize (), + // pointToUse -= TQPoint (-view->selectionResizeHandleAtomicSize (), // -view->selectionResizeHandleAtomicSize ()); } pasteText (text, true/*force new text selection*/, pointToUse); } - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } // public slot @@ -666,7 +666,7 @@ void kpMainWindow::slotPaste () #endif // sync: restoreOverrideCursor() in all exit paths - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); if (toolHasBegunShape ()) tool ()->endShapeInternal (); @@ -674,7 +674,7 @@ void kpMainWindow::slotPaste () if (!::HasSomethingToPasteWithDialogIfNot (this)) { - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); return; } @@ -683,28 +683,28 @@ void kpMainWindow::slotPaste () // Acquire the pixmap // - QMimeSource *ms = QApplication::clipboard ()->data (QClipboard::Clipboard); + TQMimeSource *ms = TQApplication::clipboard ()->data (QClipboard::Clipboard); if (!ms) { kdError () << "kpMainWindow::slotPaste() without mimeSource" << endl; - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); return; } kpSelection sel; - QString text; + TQString text; if (kpSelectionDrag::decode (ms, sel/*ref*/, pasteWarnAboutLossInfo ())) { sel.setTransparency (selectionTransparency ()); paste (sel); } - else if (QTextDrag::decode (ms, text/*ref*/)) + else if (TQTextDrag::decode (ms, text/*ref*/)) { pasteText (text); } else { - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); kdDebug () << "kpMainWindow::slotPaste() could not decode selection" << endl; kdDebug () << "\tFormats supported:" << endl; @@ -730,7 +730,7 @@ void kpMainWindow::slotPaste () kdDebug () << "\thave memberList" << endl; #endif - for (QPtrList <KMainWindow>::const_iterator it = KMainWindow::memberList->begin (); + for (TQPtrList <KMainWindow>::const_iterator it = KMainWindow::memberList->begin (); it != KMainWindow::memberList->end (); it++) { @@ -752,7 +752,7 @@ void kpMainWindow::slotPaste () return; } - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } // private slot @@ -763,7 +763,7 @@ void kpMainWindow::slotPasteInNewWindow () #endif // sync: restoreOverrideCursor() in all exit paths - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); if (toolHasBegunShape ()) tool ()->endShapeInternal (); @@ -771,7 +771,7 @@ void kpMainWindow::slotPasteInNewWindow () if (!::HasSomethingToPasteWithDialogIfNot (this)) { - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); return; } @@ -812,7 +812,7 @@ void kpMainWindow::slotPasteInNewWindow () win->slotCrop (); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } // public slot @@ -976,7 +976,7 @@ void kpMainWindow::slotCopyToFile () kpSelection sel = *m_document->selection (); - QPixmap pixmapToSave; + TQPixmap pixmapToSave; if (!sel.pixmap ()) { @@ -1050,7 +1050,7 @@ void kpMainWindow::slotPasteFromFile () m_lastPasteFromURL = url; - QPixmap pixmap = kpDocument::getPixmapFromFile (url, + TQPixmap pixmap = kpDocument::getPixmapFromFile (url, false/*show error message if doesn't exist*/, this); @@ -1062,7 +1062,7 @@ void kpMainWindow::slotPasteFromFile () addRecentURL (url); paste (kpSelection (kpSelection::Rectangle, - QRect (0, 0, pixmap.width (), pixmap.height ()), + TQRect (0, 0, pixmap.width (), pixmap.height ()), pixmap, selectionTransparency ())); } diff --git a/kolourpaint/kpmainwindow_file.cpp b/kolourpaint/kpmainwindow_file.cpp index b30b323e..a3a10433 100644 --- a/kolourpaint/kpmainwindow_file.cpp +++ b/kolourpaint/kpmainwindow_file.cpp @@ -28,11 +28,11 @@ #include <kpmainwindow.h> -#include <qcstring.h> -#include <qdatastream.h> -#include <qpaintdevicemetrics.h> -#include <qpainter.h> -#include <qsize.h> +#include <tqcstring.h> +#include <tqdatastream.h> +#include <tqpaintdevicemetrics.h> +#include <tqpainter.h> +#include <tqsize.h> #include <dcopclient.h> #include <kapplication.h> @@ -67,41 +67,41 @@ void kpMainWindow::setupFileMenuActions () #endif KActionCollection *ac = actionCollection (); - m_actionNew = KStdAction::openNew (this, SLOT (slotNew ()), ac); - m_actionOpen = KStdAction::open (this, SLOT (slotOpen ()), ac); + m_actionNew = KStdAction::openNew (this, TQT_SLOT (slotNew ()), ac); + m_actionOpen = KStdAction::open (this, TQT_SLOT (slotOpen ()), ac); - m_actionOpenRecent = KStdAction::openRecent (this, SLOT (slotOpenRecent (const KURL &)), ac); + m_actionOpenRecent = KStdAction::openRecent (this, TQT_SLOT (slotOpenRecent (const KURL &)), ac); m_actionOpenRecent->loadEntries (kapp->config ()); #if DEBUG_KP_MAIN_WINDOW kdDebug () << "\trecent URLs=" << m_actionOpenRecent->items () << endl; #endif - m_actionSave = KStdAction::save (this, SLOT (slotSave ()), ac); - m_actionSaveAs = KStdAction::saveAs (this, SLOT (slotSaveAs ()), ac); + m_actionSave = KStdAction::save (this, TQT_SLOT (slotSave ()), ac); + m_actionSaveAs = KStdAction::saveAs (this, TQT_SLOT (slotSaveAs ()), ac); m_actionExport = new KAction (i18n ("E&xport..."), 0, - this, SLOT (slotExport ()), ac, "file_export"); + this, TQT_SLOT (slotExport ()), ac, "file_export"); m_actionScan = new KAction (i18n ("Scan..."), SmallIcon ("scanner"), 0, - this, SLOT (slotScan ()), ac, "file_scan"); + this, TQT_SLOT (slotScan ()), ac, "file_scan"); - //m_actionRevert = KStdAction::revert (this, SLOT (slotRevert ()), ac); + //m_actionRevert = KStdAction::revert (this, TQT_SLOT (slotRevert ()), ac); m_actionReload = new KAction (i18n ("Reloa&d"), KStdAccel::reload (), - this, SLOT (slotReload ()), ac, "file_revert"); + this, TQT_SLOT (slotReload ()), ac, "file_revert"); slotEnableReload (); - m_actionPrint = KStdAction::print (this, SLOT (slotPrint ()), ac); - m_actionPrintPreview = KStdAction::printPreview (this, SLOT (slotPrintPreview ()), ac); + m_actionPrint = KStdAction::print (this, TQT_SLOT (slotPrint ()), ac); + m_actionPrintPreview = KStdAction::printPreview (this, TQT_SLOT (slotPrintPreview ()), ac); - m_actionMail = KStdAction::mail (this, SLOT (slotMail ()), ac); + m_actionMail = KStdAction::mail (this, TQT_SLOT (slotMail ()), ac); m_actionSetAsWallpaperCentered = new KAction (i18n ("Set as Wa&llpaper (Centered)"), 0, - this, SLOT (slotSetAsWallpaperCentered ()), ac, "file_set_as_wallpaper_centered"); + this, TQT_SLOT (slotSetAsWallpaperCentered ()), ac, "file_set_as_wallpaper_centered"); m_actionSetAsWallpaperTiled = new KAction (i18n ("Set as Wallpaper (&Tiled)"), 0, - this, SLOT (slotSetAsWallpaperTiled ()), ac, "file_set_as_wallpaper_tiled"); + this, TQT_SLOT (slotSetAsWallpaperTiled ()), ac, "file_set_as_wallpaper_tiled"); - m_actionClose = KStdAction::close (this, SLOT (slotClose ()), ac); - m_actionQuit = KStdAction::quit (this, SLOT (slotQuit ()), ac); + m_actionClose = KStdAction::close (this, TQT_SLOT (slotClose ()), ac); + m_actionQuit = KStdAction::quit (this, TQT_SLOT (slotQuit ()), ac); m_scanDialog = 0; @@ -173,7 +173,7 @@ void kpMainWindow::addRecentURL (const KURL &url) kdDebug () << "\thave memberList" << endl; #endif - for (QPtrList <KMainWindow>::const_iterator it = KMainWindow::memberList->begin (); + for (TQPtrList <KMainWindow>::const_iterator it = KMainWindow::memberList->begin (); it != KMainWindow::memberList->end (); it++) { @@ -228,7 +228,7 @@ void kpMainWindow::slotNew () // private -QSize kpMainWindow::defaultDocSize () const +TQSize kpMainWindow::defaultDocSize () const { // KConfig::readEntry() does not actually reread from disk, hence doesn't // realise what other processes have done e.g. Settings / Show Path @@ -237,17 +237,17 @@ QSize kpMainWindow::defaultDocSize () const KConfigGroupSaver cfgGroupSaver (kapp->config (), kpSettingsGroupGeneral); KConfigBase *cfg = cfgGroupSaver.config (); - QSize docSize = cfg->readSizeEntry (kpSettingLastDocSize); + TQSize docSize = cfg->readSizeEntry (kpSettingLastDocSize); if (docSize.isEmpty ()) { - docSize = QSize (400, 300); + docSize = TQSize (400, 300); } else { // Don't get too big or you'll thrash (or even lock up) the computer // just by opening a window - docSize = QSize (QMIN (2048, docSize.width ()), + docSize = TQSize (QMIN (2048, docSize.width ()), QMIN (2048, docSize.height ())); } @@ -255,7 +255,7 @@ QSize kpMainWindow::defaultDocSize () const } // private -void kpMainWindow::saveDefaultDocSize (const QSize &size) +void kpMainWindow::saveDefaultDocSize (const TQSize &size) { #if DEBUG_KP_MAIN_WINDOW kdDebug () << "\tCONFIG: saving Last Doc Size = " << size << endl; @@ -295,7 +295,7 @@ void kpMainWindow::setDocumentChoosingWindow (kpDocument *doc) // private kpDocument *kpMainWindow::openInternal (const KURL &url, - const QSize &fallbackDocSize, + const TQSize &fallbackDocSize, bool newDocSameNameIfNotExist) { // create doc @@ -334,12 +334,12 @@ bool kpMainWindow::open (const KURL &url, bool newDocSameNameIfNotExist) // private -KURL::List kpMainWindow::askForOpenURLs (const QString &caption, const QString &startURL, +KURL::List kpMainWindow::askForOpenURLs (const TQString &caption, const TQString &startURL, bool allowMultipleURLs) { - QStringList mimeTypes = KImageIO::mimeTypes (KImageIO::Reading); + TQStringList mimeTypes = KImageIO::mimeTypes (KImageIO::Reading); #if DEBUG_KP_MAIN_WINDOW - QStringList sortedMimeTypes = mimeTypes; + TQStringList sortedMimeTypes = mimeTypes; sortedMimeTypes.sort (); kdDebug () << "kpMainWindow::askForURLs(allowMultiple=" << allowMultipleURLs @@ -347,7 +347,7 @@ KURL::List kpMainWindow::askForOpenURLs (const QString &caption, const QString & << "\tmimeTypes=" << mimeTypes << endl << "\tsortedMimeTypes=" << sortedMimeTypes << endl; #endif - QString filter = mimeTypes.join (" "); + TQString filter = mimeTypes.join (" "); KFileDialog fd (startURL, filter, this, "fd", true/*modal*/); fd.setCaption (caption); @@ -370,7 +370,7 @@ void kpMainWindow::slotOpen () const KURL::List urls = askForOpenURLs (i18n ("Open Image"), - m_document ? m_document->url ().url () : QString::null); + m_document ? m_document->url ().url () : TQString::null); for (KURL::List::const_iterator it = urls.begin (); it != urls.end (); @@ -451,8 +451,8 @@ void kpMainWindow::slotScan () #if DEBUG_KP_MAIN_WINDOW kdDebug () << "\tcreated scanDialog=" << m_scanDialog << endl; #endif - connect (m_scanDialog, SIGNAL (finalImage (const QImage &, int)), - SLOT (slotScanned (const QImage &, int))); + connect (m_scanDialog, TQT_SIGNAL (finalImage (const TQImage &, int)), + TQT_SLOT (slotScanned (const TQImage &, int))); } @@ -481,7 +481,7 @@ void kpMainWindow::slotScan () } // private slot -void kpMainWindow::slotScanned (const QImage &image, int) +void kpMainWindow::slotScanned (const TQImage &image, int) { #if DEBUG_KP_MAIN_WINDOW kdDebug () << "kpMainWindow::slotScanned() image.rect=" << image.rect () << endl; @@ -509,11 +509,11 @@ void kpMainWindow::slotScanned (const QImage &image, int) // TODO: Maybe this code should be moved into kpdocument.cpp - // since it resembles the responsibilities of kpDocument::open(). - // Convert QImage to kpDocument's image format, gathering meta info - // from QImage. + // Convert TQImage to kpDocument's image format, gathering meta info + // from TQImage. kpDocumentSaveOptions saveOptions; kpDocumentMetaInfo metaInfo; - const QPixmap pixmap = kpDocument::convertToPixmapAsLosslessAsPossible ( + const TQPixmap pixmap = kpDocument::convertToPixmapAsLosslessAsPossible ( image, kpMainWindow::pasteWarnAboutLossInfo (), &saveOptions, @@ -580,12 +580,12 @@ bool kpMainWindow::slotSave () } // private -KURL kpMainWindow::askForSaveURL (const QString &caption, - const QString &startURL, - const QPixmap &pixmapToBeSaved, +KURL kpMainWindow::askForSaveURL (const TQString &caption, + const TQString &startURL, + const TQPixmap &pixmapToBeSaved, const kpDocumentSaveOptions &startSaveOptions, const kpDocumentMetaInfo &docMetaInfo, - const QString &forcedSaveOptionsGroup, + const TQString &forcedSaveOptionsGroup, bool localOnly, kpDocumentSaveOptions *chosenSaveOptions, bool isSavingForFirstTime, @@ -625,9 +625,9 @@ KURL kpMainWindow::askForSaveURL (const QString &caption, kpDocumentSaveOptions fdSaveOptions = startSaveOptions; - QStringList mimeTypes = KImageIO::mimeTypes (KImageIO::Writing); + TQStringList mimeTypes = KImageIO::mimeTypes (KImageIO::Writing); #if DEBUG_KP_MAIN_WINDOW - QStringList sortedMimeTypes = mimeTypes; + TQStringList sortedMimeTypes = mimeTypes; sortedMimeTypes.sort (); kdDebug () << "\tmimeTypes=" << mimeTypes << endl << "\tsortedMimeTypes=" << sortedMimeTypes << endl; @@ -692,7 +692,7 @@ KURL kpMainWindow::askForSaveURL (const QString &caption, docMetaInfo, this); - KFileDialog fd (startURL, QString::null, this, "fd", true/*modal*/, + KFileDialog fd (startURL, TQString::null, this, "fd", true/*modal*/, saveOptionsWidget); saveOptionsWidget->setVisualParent (&fd); fd.setCaption (caption); @@ -704,8 +704,8 @@ KURL kpMainWindow::askForSaveURL (const QString &caption, if (localOnly) fd.setMode (KFile::File | KFile::LocalOnly); - connect (&fd, SIGNAL (filterChanged (const QString &)), - saveOptionsWidget, SLOT (setMimeType (const QString &))); + connect (&fd, TQT_SIGNAL (filterChanged (const TQString &)), + saveOptionsWidget, TQT_SLOT (setMimeType (const TQString &))); if (fd.exec ()) @@ -898,7 +898,7 @@ bool kpMainWindow::slotReload () "Reloading will lose all changes since you last saved it.\n" "Are you sure?") .arg (m_document->prettyFilename ()), - QString::null/*caption*/, + TQString::null/*caption*/, i18n ("&Reload")); } else @@ -908,7 +908,7 @@ bool kpMainWindow::slotReload () "Reloading will lose all changes.\n" "Are you sure?") .arg (m_document->prettyFilename ()), - QString::null/*caption*/, + TQString::null/*caption*/, i18n ("&Reload")); } @@ -963,7 +963,7 @@ void kpMainWindow::sendFilenameToPrinter (KPrinter *printer) { int dot; - QString fileName = url.fileName (); + TQString fileName = url.fileName (); dot = fileName.findRev ('.'); // file.ext but not .hidden-file? @@ -1027,7 +1027,7 @@ void kpMainWindow::sendPixmapToPrinter (KPrinter *printer, bool showPrinterSetupDialog) { // Get image to be printed. - QPixmap pixmap = m_document->pixmapWithSelection (); + TQPixmap pixmap = m_document->pixmapWithSelection (); // Get image DPI. @@ -1069,7 +1069,7 @@ void kpMainWindow::sendPixmapToPrinter (KPrinter *printer, // what if you have multiple screens connected to the same computer // with different DPIs? // TODO: mysteriously, someone else is setting this to 96dpi always. - QPaintDeviceMetrics screenMetrics (&pixmap/*screen element*/); + TQPaintDeviceMetrics screenMetrics (&pixmap/*screen element*/); const int dpiX = screenMetrics.logicalDpiX (), dpiY = screenMetrics.logicalDpiY (); #if DEBUG_KP_MAIN_WINDOW @@ -1088,7 +1088,7 @@ void kpMainWindow::sendPixmapToPrinter (KPrinter *printer, // m m m = margin // m m // mmmmm - QPaintDeviceMetrics printerMetrics (printer); + TQPaintDeviceMetrics printerMetrics (printer); const int printerWidthMM = printerMetrics.widthMM (); const int printerHeightMM = printerMetrics.heightMM (); #if DEBUG_KP_MAIN_WINDOW @@ -1132,7 +1132,7 @@ void kpMainWindow::sendPixmapToPrinter (KPrinter *printer, } - // Make sure DPIs are equal as that's all QPrinter::setResolution() + // Make sure DPIs are equal as that's all TQPrinter::setResolution() // supports. We do this in such a way that we only ever stretch an // image, to avoid losing information. Don't antialias as the printer // will do that to translate our DPI to its physical resolution and @@ -1166,7 +1166,7 @@ void kpMainWindow::sendPixmapToPrinter (KPrinter *printer, // ASSERT: dpiX == dpiY - // QPrinter::setResolution() has to be called before QPrinter::setup(). + // TQPrinter::setResolution() has to be called before TQPrinter::setup(). printer->setResolution (QMAX (1, qRound (dpiX))); @@ -1190,14 +1190,14 @@ void kpMainWindow::sendPixmapToPrinter (KPrinter *printer, { // The user can mutate margins at their own risk in this dialog. // It doesn't seem to affect the size of the page as reported - // by QPaintDeviceMetrics::{width,height}MM(). + // by TQPaintDeviceMetrics::{width,height}MM(). if (!printer->setup (this)) return; } // Send pixmap to printer. - QPainter painter; + TQPainter painter; painter.begin (printer); painter.drawPixmap (qRound (originX), qRound (originY), pixmap); painter.end (); @@ -1244,7 +1244,7 @@ void kpMainWindow::slotMail () int result = KMessageBox::questionYesNo (this, i18n ("You must save this image before sending it.\n" "Do you want to save it?"), - QString::null, + TQString::null, KStdGuiItem::save (), KStdGuiItem::cancel ()); if (result == KMessageBox::Yes) @@ -1263,13 +1263,13 @@ void kpMainWindow::slotMail () } kapp->invokeMailer ( - QString::null/*to*/, - QString::null/*cc*/, - QString::null/*bcc*/, + TQString::null/*to*/, + TQString::null/*cc*/, + TQString::null/*bcc*/, m_document->prettyFilename()/*subject*/, - QString::null/*body*/, - QString::null/*messageFile*/, - QStringList (m_document->url ().url ())/*attachments*/); + TQString::null/*body*/, + TQString::null/*messageFile*/, + TQStringList (m_document->url ().url ())/*attachments*/); } @@ -1281,7 +1281,7 @@ void kpMainWindow::setAsWallpaper (bool centered) !m_document->isFromURL () || m_document->isModified ()/*needs to be saved*/) { - QString question; + TQString question; if (!m_document->url ().isLocalFile ()) { @@ -1297,7 +1297,7 @@ void kpMainWindow::setAsWallpaper (bool centered) } int result = KMessageBox::questionYesNo (this, - question, QString::null, + question, TQString::null, KStdGuiItem::save (), KStdGuiItem::cancel ()); if (result == KMessageBox::Yes) @@ -1318,15 +1318,15 @@ void kpMainWindow::setAsWallpaper (bool centered) } - QByteArray data; - QDataStream dataStream (data, IO_WriteOnly); + TQByteArray data; + TQDataStream dataStream (data, IO_WriteOnly); // write path #if DEBUG_KP_MAIN_WINDOW kdDebug () << "kpMainWindow::setAsWallpaper() path=" << m_document->url ().path () << endl; #endif - dataStream << QString (m_document->url ().path ()); + dataStream << TQString (m_document->url ().path ()); // write position: // @@ -1353,7 +1353,7 @@ void kpMainWindow::setAsWallpaper (bool centered) // installed so kdebase/kdesktop/KBackgroundIface.h might not be around // to be compiled in (where user == developer :)) if (!KApplication::dcopClient ()->send ("kdesktop", "KBackgroundIface", - "setWallpaper(QString,int)", data)) + "setWallpaper(TQString,int)", data)) { KMessageBox::sorry (this, i18n ("Could not change wallpaper.")); } diff --git a/kolourpaint/kpmainwindow_help.cpp b/kolourpaint/kpmainwindow_help.cpp index fb1fc790..9d69143c 100644 --- a/kolourpaint/kpmainwindow_help.cpp +++ b/kolourpaint/kpmainwindow_help.cpp @@ -57,7 +57,7 @@ void kpMainWindow::setupHelpMenuActions () // -- Thurston d->m_actionHelpTakingScreenshots = new KAction ( i18n ("Acquiring &Screenshots"), 0, - this, SLOT (slotHelpTakingScreenshots ()), + this, TQT_SLOT (slotHelpTakingScreenshots ()), ac, "help_taking_screenshots"); @@ -71,18 +71,18 @@ void kpMainWindow::enableHelpMenuDocumentActions (bool /*enable*/) // SYNC: kdebase/kwin/kwinbindings.cpp -static QString printScreenShortcutString () +static TQString printScreenShortcutString () { KConfigGroupSaver cfgGroupSaver (KGlobal::config (), "Global Shortcuts"); KConfigBase *cfg = cfgGroupSaver.config (); // TODO: i18n() entry name? kwinbindings.cpp seems to but it doesn't // make sense. - const QString cfgEntryString = cfg->readEntry ("Desktop Screenshot"); + const TQString cfgEntryString = cfg->readEntry ("Desktop Screenshot"); // (only use 1st key sequence, if it exists) - const QString humanReadableShortcut = + const TQString humanReadableShortcut = KShortcut (cfgEntryString).seq (0).toString (); if (!humanReadableShortcut.isEmpty ()) @@ -125,7 +125,7 @@ void kpMainWindow::slotHelpTakingScreenshots () } #endif - QString message; + TQString message; if (isRunningKDE) { message = i18n @@ -185,10 +185,10 @@ void kpMainWindow::slotHelpTakingScreenshots () true/*separator line*/); KActiveLabel *messageLabel = new KActiveLabel (message, &dlg); - disconnect (messageLabel, SIGNAL (linkClicked (const QString &)), - messageLabel, SLOT (openLink (const QString &))); - connect (messageLabel, SIGNAL (linkClicked (const QString &)), - this, SLOT (slotHelpTakingScreenshotsFollowLink (const QString &))); + disconnect (messageLabel, TQT_SIGNAL (linkClicked (const TQString &)), + messageLabel, TQT_SLOT (openLink (const TQString &))); + connect (messageLabel, TQT_SIGNAL (linkClicked (const TQString &)), + this, TQT_SLOT (slotHelpTakingScreenshotsFollowLink (const TQString &))); dlg.setMainWidget (messageLabel); @@ -196,7 +196,7 @@ void kpMainWindow::slotHelpTakingScreenshots () } // private -void kpMainWindow::slotHelpTakingScreenshotsFollowLink (const QString &link) +void kpMainWindow::slotHelpTakingScreenshotsFollowLink (const TQString &link) { #if DEBUG_KP_MAIN_WINDOW kdDebug () << "kpMainWindow::slotHelpTakingScreenshotsFollowLink(" diff --git a/kolourpaint/kpmainwindow_image.cpp b/kolourpaint/kpmainwindow_image.cpp index 7f662af7..a00f0fd3 100644 --- a/kolourpaint/kpmainwindow_image.cpp +++ b/kolourpaint/kpmainwindow_image.cpp @@ -29,8 +29,8 @@ #include <kpmainwindow.h> #include <kpmainwindow_p.h> -#include <qcolor.h> -#include <qsize.h> +#include <tqcolor.h> +#include <tqsize.h> #include <kaction.h> #include <kapplication.h> @@ -77,7 +77,7 @@ bool kpMainWindow::isTextSelection () const // private -QString kpMainWindow::autoCropText () const +TQString kpMainWindow::autoCropText () const { return kpToolAutoCropCommand::name (isSelectionActive (), kpToolAutoCropCommand::ShowAccel); @@ -90,37 +90,37 @@ void kpMainWindow::setupImageMenuActions () KActionCollection *ac = actionCollection (); m_actionResizeScale = new KAction (i18n ("R&esize / Scale..."), Qt::CTRL + Qt::Key_E, - this, SLOT (slotResizeScale ()), ac, "image_resize_scale"); + this, TQT_SLOT (slotResizeScale ()), ac, "image_resize_scale"); m_actionCrop = new KAction (i18n ("Se&t as Image (Crop)"), Qt::CTRL + Qt::Key_T, - this, SLOT (slotCrop ()), ac, "image_crop"); + this, TQT_SLOT (slotCrop ()), ac, "image_crop"); m_actionAutoCrop = new KAction (autoCropText (), Qt::CTRL + Qt::Key_U, - this, SLOT (slotAutoCrop ()), ac, "image_auto_crop"); + this, TQT_SLOT (slotAutoCrop ()), ac, "image_auto_crop"); m_actionFlip = new KAction (i18n ("&Flip..."), Qt::CTRL + Qt::Key_F, - this, SLOT (slotFlip ()), ac, "image_flip"); + this, TQT_SLOT (slotFlip ()), ac, "image_flip"); m_actionRotate = new KAction (i18n ("&Rotate..."), Qt::CTRL + Qt::Key_R, - this, SLOT (slotRotate ()), ac, "image_rotate"); + this, TQT_SLOT (slotRotate ()), ac, "image_rotate"); m_actionSkew = new KAction (i18n ("S&kew..."), Qt::CTRL + Qt::Key_K, - this, SLOT (slotSkew ()), ac, "image_skew"); + this, TQT_SLOT (slotSkew ()), ac, "image_skew"); m_actionConvertToBlackAndWhite = new KAction (i18n ("Reduce to Mo&nochrome (Dithered)"), 0, - this, SLOT (slotConvertToBlackAndWhite ()), ac, "image_convert_to_black_and_white"); + this, TQT_SLOT (slotConvertToBlackAndWhite ()), ac, "image_convert_to_black_and_white"); m_actionConvertToGrayscale = new KAction (i18n ("Reduce to &Grayscale"), 0, - this, SLOT (slotConvertToGrayscale ()), ac, "image_convert_to_grayscale"); + this, TQT_SLOT (slotConvertToGrayscale ()), ac, "image_convert_to_grayscale"); m_actionInvertColors = new KAction (i18n ("&Invert Colors"), Qt::CTRL + Qt::Key_I, - this, SLOT (slotInvertColors ()), ac, "image_invert_colors"); + this, TQT_SLOT (slotInvertColors ()), ac, "image_invert_colors"); m_actionClear = new KAction (i18n ("C&lear"), Qt::CTRL + Qt::SHIFT + Qt::Key_N, - this, SLOT (slotClear ()), ac, "image_clear"); + this, TQT_SLOT (slotClear ()), ac, "image_clear"); m_actionMoreEffects = new KAction (i18n ("&More Effects..."), Qt::CTRL + Qt::Key_M, - this, SLOT (slotMoreEffects ()), ac, "image_more_effects"); + this, TQT_SLOT (slotMoreEffects ()), ac, "image_more_effects"); enableImageMenuDocumentActions (false); } @@ -157,10 +157,10 @@ void kpMainWindow::slotImageMenuUpdateDueToSelection () int id = mBar->idAt (index); // SYNC: kolourpaintui.rc - QString menuBarItemTextImage = i18n ("&Image"); - QString menuBarItemTextSelection = i18n ("Select&ion"); + TQString menuBarItemTextImage = i18n ("&Image"); + TQString menuBarItemTextSelection = i18n ("Select&ion"); - const QString menuBarItemText = mBar->text (id); + const TQString menuBarItemText = mBar->text (id); if (menuBarItemText == menuBarItemTextImage || menuBarItemText == menuBarItemTextSelection) { @@ -260,7 +260,7 @@ void kpMainWindow::addImageOrSelectionCommand (kpCommand *cmd, kpMacroCommand *macroCmd = new kpMacroCommand (cmd->name (), this); macroCmd->addCommand (new kpToolSelectionPullFromDocumentCommand ( - QString::null/*uninteresting child of macro cmd*/, + TQString::null/*uninteresting child of macro cmd*/, this)); macroCmd->addCommand (cmd); @@ -308,7 +308,7 @@ void kpMainWindow::slotResizeScale () dialog.type () == kpToolResizeScaleCommand::Resize) { // TODO: this should be the responsibility of kpDocument - saveDefaultDocSize (QSize (dialog.imageWidth (), dialog.imageHeight ())); + saveDefaultDocSize (TQSize (dialog.imageWidth (), dialog.imageHeight ())); } } diff --git a/kolourpaint/kpmainwindow_settings.cpp b/kolourpaint/kpmainwindow_settings.cpp index 609f7dfe..9e3914e8 100644 --- a/kolourpaint/kpmainwindow_settings.cpp +++ b/kolourpaint/kpmainwindow_settings.cpp @@ -57,19 +57,19 @@ void kpMainWindow::setupSettingsMenuActions () createStandardStatusBarAction (); - m_actionFullScreen = KStdAction::fullScreen (this, SLOT (slotFullScreen ()), ac, + m_actionFullScreen = KStdAction::fullScreen (this, TQT_SLOT (slotFullScreen ()), ac, this/*window*/); m_actionShowPath = new KToggleAction (i18n ("Show &Path"), 0, - this, SLOT (slotShowPathToggled ()), ac, "settings_show_path"); + this, TQT_SLOT (slotShowPathToggled ()), ac, "settings_show_path"); m_actionShowPath->setCheckedState (i18n ("Hide &Path")); slotEnableSettingsShowPath (); - m_actionKeyBindings = KStdAction::keyBindings (this, SLOT (slotKeyBindings ()), ac); - m_actionConfigureToolbars = KStdAction::configureToolbars (this, SLOT (slotConfigureToolBars ()), ac); - // m_actionConfigure = KStdAction::preferences (this, SLOT (slotConfigure ()), ac); + m_actionKeyBindings = KStdAction::keyBindings (this, TQT_SLOT (slotKeyBindings ()), ac); + m_actionConfigureToolbars = KStdAction::configureToolbars (this, TQT_SLOT (slotConfigureToolBars ()), ac); + // m_actionConfigure = KStdAction::preferences (this, TQT_SLOT (slotConfigure ()), ac); enableSettingsMenuDocumentActions (false); @@ -168,14 +168,14 @@ void kpMainWindow::slotConfigureToolBars () //saveMainWindowSettings (kapp->config (), autoSaveGroup ()); KEditToolbar dialog (actionCollection (), - QString::null/*default ui.rc file*/, + TQString::null/*default ui.rc file*/, true/*global resource*/, this/*parent*/); // Clicking on OK after Apply brings up the dialog (below) again. // Bug with KEditToolBar. dialog.showButtonApply (false); - connect (&dialog, SIGNAL (newToolbarConfig ()), - this, SLOT (slotNewToolBarConfig ())); + connect (&dialog, TQT_SIGNAL (newToolbarConfig ()), + this, TQT_SLOT (slotNewToolBarConfig ())); dialog.exec (); } @@ -195,7 +195,7 @@ void kpMainWindow::slotNewToolBarConfig () KMessageBox::information (this, i18n ("You have to restart KolourPaint for these changes to take effect."), i18n ("Toolbar Settings Changed"), - QString::fromLatin1 ("ToolBarSettingsChanged")); + TQString::fromLatin1 ("ToolBarSettingsChanged")); //createGUI(); //applyMainWindowSettings (kapp->config (), autoSaveGroup ()); diff --git a/kolourpaint/kpmainwindow_statusbar.cpp b/kolourpaint/kpmainwindow_statusbar.cpp index ed854604..ba3b8702 100644 --- a/kolourpaint/kpmainwindow_statusbar.cpp +++ b/kolourpaint/kpmainwindow_statusbar.cpp @@ -30,8 +30,8 @@ #include <kpmainwindow.h> -#include <qlabel.h> -#include <qstring.h> +#include <tqlabel.h> +#include <tqstring.h> #include <kdebug.h> #include <klocale.h> @@ -51,12 +51,12 @@ void kpMainWindow::addPermanentStatusBarItem (int id, int maxTextLen) { KStatusBar *sb = statusBar (); - QString textWithMaxLen; - textWithMaxLen.fill (QString::number (8/*big fat*/).at (0), + TQString textWithMaxLen; + textWithMaxLen.fill (TQString::number (8/*big fat*/).at (0), maxTextLen); //+ 2/*spaces on either side*/); sb->insertFixedItem (textWithMaxLen, id, true/*permanent, place on the right*/); - sb->changeItem (QString::null, id); + sb->changeItem (TQString::null, id); } // private @@ -67,7 +67,7 @@ void kpMainWindow::createStatusBar () // 9999 pixels "ought to be enough for anybody" const int maxDimenLength = 4; - //sb->insertItem (QString::null, StatusBarItemMessage, 1/*stretch*/); + //sb->insertItem (TQString::null, StatusBarItemMessage, 1/*stretch*/); //sb->setItemAlignment (StatusBarItemMessage, Qt::AlignLeft | Qt::AlignVCenter); m_statusBarMessageLabel = new kpSqueezedTextLabel (sb); @@ -95,7 +95,7 @@ void kpMainWindow::createStatusBar () // private slot -void kpMainWindow::setStatusBarMessage (const QString &message) +void kpMainWindow::setStatusBarMessage (const TQString &message) { #if DEBUG_STATUS_BAR && 1 kdDebug () << "kpMainWindow::setStatusBarMessage(" @@ -112,8 +112,8 @@ void kpMainWindow::setStatusBarMessage (const QString &message) } // private slot -void kpMainWindow::setStatusBarShapePoints (const QPoint &startPoint, - const QPoint &endPoint) +void kpMainWindow::setStatusBarShapePoints (const TQPoint &startPoint, + const TQPoint &endPoint) { #if DEBUG_STATUS_BAR && 0 kdDebug () << "kpMainWindow::setStatusBarShapePoints(" @@ -137,7 +137,7 @@ void kpMainWindow::setStatusBarShapePoints (const QPoint &startPoint, if (startPoint == KP_INVALID_POINT) { - statusBar ()->changeItem (QString::null, StatusBarItemShapePoints); + statusBar ()->changeItem (TQString::null, StatusBarItemShapePoints); } else if (endPoint == KP_INVALID_POINT) { @@ -162,7 +162,7 @@ void kpMainWindow::setStatusBarShapePoints (const QPoint &startPoint, } // private slot -void kpMainWindow::setStatusBarShapeSize (const QSize &size) +void kpMainWindow::setStatusBarShapeSize (const TQSize &size) { #if DEBUG_STATUS_BAR && 0 kdDebug () << "kpMainWindow::setStatusBarShapeSize(" @@ -185,7 +185,7 @@ void kpMainWindow::setStatusBarShapeSize (const QSize &size) if (size == KP_INVALID_SIZE) { - statusBar ()->changeItem (QString::null, StatusBarItemShapeSize); + statusBar ()->changeItem (TQString::null, StatusBarItemShapeSize); } else { @@ -200,7 +200,7 @@ void kpMainWindow::setStatusBarShapeSize (const QSize &size) } // private slot -void kpMainWindow::setStatusBarDocSize (const QSize &size) +void kpMainWindow::setStatusBarDocSize (const TQSize &size) { #if DEBUG_STATUS_BAR && 0 kdDebug () << "kpMainWindow::setStatusBarDocSize(" @@ -214,7 +214,7 @@ void kpMainWindow::setStatusBarDocSize (const QSize &size) if (size == KP_INVALID_SIZE) { - statusBar ()->changeItem (QString::null, StatusBarItemDocSize); + statusBar ()->changeItem (TQString::null, StatusBarItemDocSize); } else { @@ -240,7 +240,7 @@ void kpMainWindow::setStatusBarDocDepth (int depth) if (depth <= 0) { - statusBar ()->changeItem (QString::null, StatusBarItemDocDepth); + statusBar ()->changeItem (TQString::null, StatusBarItemDocDepth); } else { @@ -264,7 +264,7 @@ void kpMainWindow::setStatusBarZoom (int zoom) if (zoom <= 0) { - statusBar ()->changeItem (QString::null, StatusBarItemZoom); + statusBar ()->changeItem (TQString::null, StatusBarItemZoom); } else { @@ -278,7 +278,7 @@ void kpMainWindow::recalculateStatusBarMessage () #if DEBUG_STATUS_BAR && 1 kdDebug () << "kpMainWindow::recalculateStatusBarMessage()" << endl; #endif - QString scrollViewMessage = m_scrollView->statusMessage (); + TQString scrollViewMessage = m_scrollView->statusMessage (); #if DEBUG_STATUS_BAR && 1 kdDebug () << "\tscrollViewMessage=" << scrollViewMessage << endl; kdDebug () << "\tresizing doc? " << !m_scrollView->newDocSize ().isEmpty () @@ -290,7 +290,7 @@ void kpMainWindow::recalculateStatusBarMessage () // HACK: To work around kpViewScrollableContainer's unreliable // status messages (which in turn is due to Qt not updating - // QWidget::hasMouse() on drags and we needing to hack around it) + // TQWidget::hasMouse() on drags and we needing to hack around it) if (!scrollViewMessage.isEmpty () && m_scrollView->newDocSize ().isEmpty () && m_viewManager && m_viewManager->viewUnderCursor ()) @@ -303,7 +303,7 @@ void kpMainWindow::recalculateStatusBarMessage () m_scrollView->clearStatusMessage (); m_scrollView->blockSignals (false); - scrollViewMessage = QString::null; + scrollViewMessage = TQString::null; #if DEBUG_STATUS_BAR && 1 kdDebug () << "\t\t\tdone" << endl; #endif @@ -334,13 +334,13 @@ void kpMainWindow::recalculateStatusBarShape () kdDebug () << "kpMainWindow::recalculateStatusBarShape()" << endl; #endif - QSize docResizeTo = m_scrollView->newDocSize (); + TQSize docResizeTo = m_scrollView->newDocSize (); #if DEBUG_STATUS_BAR && 0 kdDebug () << "\tdocResizeTo=" << docResizeTo << endl; #endif if (docResizeTo.isValid ()) { - const QPoint startPoint (m_document->width (), m_document->height ()); + const TQPoint startPoint (m_document->width (), m_document->height ()); #if DEBUG_STATUS_BAR && 0 kdDebug () << "\thavedMovedFromOrgSize=" << m_scrollView->haveMovedFromOriginalDocSize () << endl; @@ -355,9 +355,9 @@ void kpMainWindow::recalculateStatusBarShape () const int newWidth = docResizeTo.width (); const int newHeight = docResizeTo.height (); - setStatusBarShapePoints (startPoint, QPoint (newWidth, newHeight)); - const QPoint sizeAsPoint (QPoint (newWidth, newHeight) - startPoint); - setStatusBarShapeSize (QSize (sizeAsPoint.x (), sizeAsPoint.y ())); + setStatusBarShapePoints (startPoint, TQPoint (newWidth, newHeight)); + const TQPoint sizeAsPoint (TQPoint (newWidth, newHeight) - startPoint); + setStatusBarShapeSize (TQSize (sizeAsPoint.x (), sizeAsPoint.y ())); } } else @@ -397,7 +397,7 @@ void kpMainWindow::recalculateStatusBar () if (m_document) { - setStatusBarDocSize (QSize (m_document->width (), m_document->height ())); + setStatusBarDocSize (TQSize (m_document->width (), m_document->height ())); setStatusBarDocDepth (m_document->pixmap ()->depth ()); } else diff --git a/kolourpaint/kpmainwindow_text.cpp b/kolourpaint/kpmainwindow_text.cpp index d5694dea..233ba5b5 100644 --- a/kolourpaint/kpmainwindow_text.cpp +++ b/kolourpaint/kpmainwindow_text.cpp @@ -50,22 +50,22 @@ void kpMainWindow::setupTextToolBarActions () KActionCollection *ac = actionCollection (); m_actionTextFontFamily = new KFontAction (i18n ("Font Family"), 0/*shortcut*/, - this, SLOT (slotTextFontFamilyChanged ()), ac, "text_font_family"); + this, TQT_SLOT (slotTextFontFamilyChanged ()), ac, "text_font_family"); m_actionTextFontSize = new KFontSizeAction (i18n ("Font Size"), 0/*shortcut*/, - this, SLOT (slotTextFontSizeChanged ()), ac, "text_font_size"); + this, TQT_SLOT (slotTextFontSizeChanged ()), ac, "text_font_size"); m_actionTextBold = new KToggleAction (i18n ("Bold"), "text_bold"/*icon*/, 0/*shortcut*/, - this, SLOT (slotTextBoldChanged ()), ac, "text_bold"); + this, TQT_SLOT (slotTextBoldChanged ()), ac, "text_bold"); m_actionTextItalic = new KToggleAction (i18n ("Italic"), "text_italic"/*icon*/, 0/*shortcut*/, - this, SLOT (slotTextItalicChanged ()), ac, "text_italic"); + this, TQT_SLOT (slotTextItalicChanged ()), ac, "text_italic"); m_actionTextUnderline = new KToggleAction (i18n ("Underline"), "text_under"/*icon*/, 0/*shortcut*/, - this, SLOT (slotTextUnderlineChanged ()), ac, "text_underline"); + this, TQT_SLOT (slotTextUnderlineChanged ()), ac, "text_underline"); m_actionTextStrikeThru = new KToggleAction (i18n ("Strike Through"), "text_strike"/*icon*/, 0/*shortcut*/, - this, SLOT (slotTextStrikeThruChanged ()), ac, "text_strike_thru"); + this, TQT_SLOT (slotTextStrikeThruChanged ()), ac, "text_strike_thru"); readAndApplyTextSettings (); @@ -80,7 +80,7 @@ void kpMainWindow::readAndApplyTextSettings () KConfigGroupSaver cfgGroupSaver (kapp->config (), kpSettingsGroupText); KConfigBase *cfg = cfgGroupSaver.config (); - m_actionTextFontFamily->setFont (cfg->readEntry (kpSettingFontFamily, QString::fromLatin1 ("Times"))); + m_actionTextFontFamily->setFont (cfg->readEntry (kpSettingFontFamily, TQString::fromLatin1 ("Times"))); m_actionTextFontSize->setFontSize (cfg->readNumEntry (kpSettingFontSize, 14)); m_actionTextBold->setChecked (cfg->readBoolEntry (kpSettingBold, false)); m_actionTextItalic->setChecked (cfg->readBoolEntry (kpSettingItalic, false)); diff --git a/kolourpaint/kpmainwindow_tools.cpp b/kolourpaint/kpmainwindow_tools.cpp index fb86f91f..de48e1df 100644 --- a/kolourpaint/kpmainwindow_tools.cpp +++ b/kolourpaint/kpmainwindow_tools.cpp @@ -103,23 +103,23 @@ void kpMainWindow::setupToolActions () m_actionPrevToolOptionGroup1 = new kpSingleKeyTriggersAction ( i18n ("Previous Tool Option (Group #1)"), kpTool::shortcutForKey (Qt::Key_1), - this, SLOT (slotActionPrevToolOptionGroup1 ()), + this, TQT_SLOT (slotActionPrevToolOptionGroup1 ()), ac, "prev_tool_option_group_1"); m_actionNextToolOptionGroup1 = new kpSingleKeyTriggersAction ( i18n ("Next Tool Option (Group #1)"), kpTool::shortcutForKey (Qt::Key_2), - this, SLOT (slotActionNextToolOptionGroup1 ()), + this, TQT_SLOT (slotActionNextToolOptionGroup1 ()), ac, "next_tool_option_group_1"); m_actionPrevToolOptionGroup2 = new kpSingleKeyTriggersAction ( i18n ("Previous Tool Option (Group #2)"), kpTool::shortcutForKey (Qt::Key_3), - this, SLOT (slotActionPrevToolOptionGroup2 ()), + this, TQT_SLOT (slotActionPrevToolOptionGroup2 ()), ac, "prev_tool_option_group_2"); m_actionNextToolOptionGroup2 = new kpSingleKeyTriggersAction ( i18n ("Next Tool Option (Group #2)"), kpTool::shortcutForKey (Qt::Key_4), - this, SLOT (slotActionNextToolOptionGroup2 ()), + this, TQT_SLOT (slotActionNextToolOptionGroup2 ()), ac, "next_tool_option_group_2"); } @@ -127,12 +127,12 @@ void kpMainWindow::setupToolActions () void kpMainWindow::createToolBox () { m_toolToolBar = new kpToolToolBar (i18n ("Tool Box"), this, 2/*columns/rows*/, "Tool Box"); - connect (m_toolToolBar, SIGNAL (sigToolSelected (kpTool *)), - this, SLOT (slotToolSelected (kpTool *))); - connect (m_toolToolBar, SIGNAL (toolWidgetOptionSelected ()), - this, SLOT (updateToolOptionPrevNextActionsEnabled ())); + connect (m_toolToolBar, TQT_SIGNAL (sigToolSelected (kpTool *)), + this, TQT_SLOT (slotToolSelected (kpTool *))); + connect (m_toolToolBar, TQT_SIGNAL (toolWidgetOptionSelected ()), + this, TQT_SLOT (updateToolOptionPrevNextActionsEnabled ())); - for (QPtrList <kpTool>::const_iterator it = m_tools.begin (); + for (TQPtrList <kpTool>::const_iterator it = m_tools.begin (); it != m_tools.end (); it++) { @@ -183,7 +183,7 @@ void kpMainWindow::enableToolsDocumentActions (bool enable) m_toolToolBar->setEnabled (enable); - for (QPtrList <kpTool>::const_iterator it = m_tools.begin (); + for (TQPtrList <kpTool>::const_iterator it = m_tools.begin (); it != m_tools.end (); it++) { @@ -331,55 +331,55 @@ void kpMainWindow::slotToolSelected (kpTool *tool) if (previousTool) { - disconnect (previousTool, SIGNAL (movedAndAboutToDraw (const QPoint &, const QPoint &, int, bool *)), - this, SLOT (slotDragScroll (const QPoint &, const QPoint &, int, bool *))); - disconnect (previousTool, SIGNAL (endedDraw (const QPoint &)), - this, SLOT (slotEndDragScroll ())); - disconnect (previousTool, SIGNAL (cancelledShape (const QPoint &)), - this, SLOT (slotEndDragScroll ())); - - disconnect (previousTool, SIGNAL (userMessageChanged (const QString &)), - this, SLOT (recalculateStatusBarMessage ())); - disconnect (previousTool, SIGNAL (userShapePointsChanged (const QPoint &, const QPoint &)), - this, SLOT (recalculateStatusBarShape ())); - disconnect (previousTool, SIGNAL (userShapeSizeChanged (const QSize &)), - this, SLOT (recalculateStatusBarShape ())); - - disconnect (m_colorToolBar, SIGNAL (colorsSwapped (const kpColor &, const kpColor &)), - previousTool, SLOT (slotColorsSwappedInternal (const kpColor &, const kpColor &))); - disconnect (m_colorToolBar, SIGNAL (foregroundColorChanged (const kpColor &)), - previousTool, SLOT (slotForegroundColorChangedInternal (const kpColor &))); - disconnect (m_colorToolBar, SIGNAL (backgroundColorChanged (const kpColor &)), - previousTool, SLOT (slotBackgroundColorChangedInternal (const kpColor &))); - disconnect (m_colorToolBar, SIGNAL (colorSimilarityChanged (double, int)), - previousTool, SLOT (slotColorSimilarityChangedInternal (double, int))); + disconnect (previousTool, TQT_SIGNAL (movedAndAboutToDraw (const TQPoint &, const TQPoint &, int, bool *)), + this, TQT_SLOT (slotDragScroll (const TQPoint &, const TQPoint &, int, bool *))); + disconnect (previousTool, TQT_SIGNAL (endedDraw (const TQPoint &)), + this, TQT_SLOT (slotEndDragScroll ())); + disconnect (previousTool, TQT_SIGNAL (cancelledShape (const TQPoint &)), + this, TQT_SLOT (slotEndDragScroll ())); + + disconnect (previousTool, TQT_SIGNAL (userMessageChanged (const TQString &)), + this, TQT_SLOT (recalculateStatusBarMessage ())); + disconnect (previousTool, TQT_SIGNAL (userShapePointsChanged (const TQPoint &, const TQPoint &)), + this, TQT_SLOT (recalculateStatusBarShape ())); + disconnect (previousTool, TQT_SIGNAL (userShapeSizeChanged (const TQSize &)), + this, TQT_SLOT (recalculateStatusBarShape ())); + + disconnect (m_colorToolBar, TQT_SIGNAL (colorsSwapped (const kpColor &, const kpColor &)), + previousTool, TQT_SLOT (slotColorsSwappedInternal (const kpColor &, const kpColor &))); + disconnect (m_colorToolBar, TQT_SIGNAL (foregroundColorChanged (const kpColor &)), + previousTool, TQT_SLOT (slotForegroundColorChangedInternal (const kpColor &))); + disconnect (m_colorToolBar, TQT_SIGNAL (backgroundColorChanged (const kpColor &)), + previousTool, TQT_SLOT (slotBackgroundColorChangedInternal (const kpColor &))); + disconnect (m_colorToolBar, TQT_SIGNAL (colorSimilarityChanged (double, int)), + previousTool, TQT_SLOT (slotColorSimilarityChangedInternal (double, int))); } if (tool) { - connect (tool, SIGNAL (movedAndAboutToDraw (const QPoint &, const QPoint &, int, bool *)), - this, SLOT (slotDragScroll (const QPoint &, const QPoint &, int, bool *))); - connect (tool, SIGNAL (endedDraw (const QPoint &)), - this, SLOT (slotEndDragScroll ())); - connect (tool, SIGNAL (cancelledShape (const QPoint &)), - this, SLOT (slotEndDragScroll ())); - - connect (tool, SIGNAL (userMessageChanged (const QString &)), - this, SLOT (recalculateStatusBarMessage ())); - connect (tool, SIGNAL (userShapePointsChanged (const QPoint &, const QPoint &)), - this, SLOT (recalculateStatusBarShape ())); - connect (tool, SIGNAL (userShapeSizeChanged (const QSize &)), - this, SLOT (recalculateStatusBarShape ())); + connect (tool, TQT_SIGNAL (movedAndAboutToDraw (const TQPoint &, const TQPoint &, int, bool *)), + this, TQT_SLOT (slotDragScroll (const TQPoint &, const TQPoint &, int, bool *))); + connect (tool, TQT_SIGNAL (endedDraw (const TQPoint &)), + this, TQT_SLOT (slotEndDragScroll ())); + connect (tool, TQT_SIGNAL (cancelledShape (const TQPoint &)), + this, TQT_SLOT (slotEndDragScroll ())); + + connect (tool, TQT_SIGNAL (userMessageChanged (const TQString &)), + this, TQT_SLOT (recalculateStatusBarMessage ())); + connect (tool, TQT_SIGNAL (userShapePointsChanged (const TQPoint &, const TQPoint &)), + this, TQT_SLOT (recalculateStatusBarShape ())); + connect (tool, TQT_SIGNAL (userShapeSizeChanged (const TQSize &)), + this, TQT_SLOT (recalculateStatusBarShape ())); recalculateStatusBar (); - connect (m_colorToolBar, SIGNAL (colorsSwapped (const kpColor &, const kpColor &)), - tool, SLOT (slotColorsSwappedInternal (const kpColor &, const kpColor &))); - connect (m_colorToolBar, SIGNAL (foregroundColorChanged (const kpColor &)), - tool, SLOT (slotForegroundColorChangedInternal (const kpColor &))); - connect (m_colorToolBar, SIGNAL (backgroundColorChanged (const kpColor &)), - tool, SLOT (slotBackgroundColorChangedInternal (const kpColor &))); - connect (m_colorToolBar, SIGNAL (colorSimilarityChanged (double, int)), - tool, SLOT (slotColorSimilarityChangedInternal (double, int))); + connect (m_colorToolBar, TQT_SIGNAL (colorsSwapped (const kpColor &, const kpColor &)), + tool, TQT_SLOT (slotColorsSwappedInternal (const kpColor &, const kpColor &))); + connect (m_colorToolBar, TQT_SIGNAL (foregroundColorChanged (const kpColor &)), + tool, TQT_SLOT (slotForegroundColorChangedInternal (const kpColor &))); + connect (m_colorToolBar, TQT_SIGNAL (backgroundColorChanged (const kpColor &)), + tool, TQT_SLOT (slotBackgroundColorChangedInternal (const kpColor &))); + connect (m_colorToolBar, TQT_SIGNAL (colorSimilarityChanged (double, int)), + tool, TQT_SLOT (slotColorSimilarityChangedInternal (double, int))); saveLastTool (); @@ -403,7 +403,7 @@ void kpMainWindow::readLastTool () int kpMainWindow::toolNumber () const { int number = 0; - for (QPtrList <kpTool>::const_iterator it = m_tools.begin (); + for (TQPtrList <kpTool>::const_iterator it = m_tools.begin (); it != m_tools.end (); it++) { @@ -440,8 +440,8 @@ bool kpMainWindow::maybeDragScrollingMainView () const } // private slot -bool kpMainWindow::slotDragScroll (const QPoint &docPoint, - const QPoint &docLastPoint, +bool kpMainWindow::slotDragScroll (const TQPoint &docPoint, + const TQPoint &docLastPoint, int zoomLevel, bool *scrolled) { @@ -479,7 +479,7 @@ void kpMainWindow::slotBeganDocResize () } // private slot -void kpMainWindow::slotContinuedDocResize (const QSize &) +void kpMainWindow::slotContinuedDocResize (const TQSize &) { recalculateStatusBarShape (); } @@ -491,7 +491,7 @@ void kpMainWindow::slotCancelledDocResize () } // private slot -void kpMainWindow::slotEndedDocResize (const QSize &size) +void kpMainWindow::slotEndedDocResize (const TQSize &size) { #define DOC_RESIZE_COMPLETED() \ { \ @@ -543,7 +543,7 @@ void kpMainWindow::slotEndedDocResize (const QSize &size) kpToolResizeScaleCommand::Resize, this)); - saveDefaultDocSize (QSize (m_docResizeWidth, m_docResizeHeight)); + saveDefaultDocSize (TQSize (m_docResizeWidth, m_docResizeHeight)); } @@ -553,7 +553,7 @@ void kpMainWindow::slotEndedDocResize (const QSize &size) } // private slot -void kpMainWindow::slotDocResizeMessageChanged (const QString &string) +void kpMainWindow::slotDocResizeMessageChanged (const TQString &string) { #if DEBUG_KP_MAIN_WINDOW kdDebug () << "kpMainWindow::slotDocResizeMessageChanged(" << string diff --git a/kolourpaint/kpmainwindow_view.cpp b/kolourpaint/kpmainwindow_view.cpp index 1aa9b5dc..5459f1a7 100644 --- a/kolourpaint/kpmainwindow_view.cpp +++ b/kolourpaint/kpmainwindow_view.cpp @@ -30,9 +30,9 @@ #include <kpmainwindow.h> #include <kpmainwindow_p.h> -#include <qdatetime.h> -#include <qpainter.h> -#include <qtimer.h> +#include <tqdatetime.h> +#include <tqpainter.h> +#include <tqtimer.h> #include <kactionclasses.h> #include <kapplication.h> @@ -67,18 +67,18 @@ void kpMainWindow::setupViewMenuActions () m_actionFullScreen->setEnabled (false);*/ - m_actionActualSize = KStdAction::actualSize (this, SLOT (slotActualSize ()), ac); - /*m_actionFitToPage = KStdAction::fitToPage (this, SLOT (slotFitToPage ()), ac); - m_actionFitToWidth = KStdAction::fitToWidth (this, SLOT (slotFitToWidth ()), ac); - m_actionFitToHeight = KStdAction::fitToHeight (this, SLOT (slotFitToHeight ()), ac);*/ + m_actionActualSize = KStdAction::actualSize (this, TQT_SLOT (slotActualSize ()), ac); + /*m_actionFitToPage = KStdAction::fitToPage (this, TQT_SLOT (slotFitToPage ()), ac); + m_actionFitToWidth = KStdAction::fitToWidth (this, TQT_SLOT (slotFitToWidth ()), ac); + m_actionFitToHeight = KStdAction::fitToHeight (this, TQT_SLOT (slotFitToHeight ()), ac);*/ - m_actionZoomIn = KStdAction::zoomIn (this, SLOT (slotZoomIn ()), ac); - m_actionZoomOut = KStdAction::zoomOut (this, SLOT (slotZoomOut ()), ac); + m_actionZoomIn = KStdAction::zoomIn (this, TQT_SLOT (slotZoomIn ()), ac); + m_actionZoomOut = KStdAction::zoomOut (this, TQT_SLOT (slotZoomOut ()), ac); m_actionZoom = new KSelectAction (i18n ("&Zoom"), 0, - this, SLOT (slotZoom ()), actionCollection (), "view_zoom_to"); + this, TQT_SLOT (slotZoom ()), actionCollection (), "view_zoom_to"); m_actionZoom->setEditable (true); // create the zoom list for the 1st call to zoomTo() below @@ -91,7 +91,7 @@ void kpMainWindow::setupViewMenuActions () m_actionShowGrid = new KToggleAction (i18n ("Show &Grid"), CTRL + Key_G, - this, SLOT (slotShowGridToggled ()), actionCollection (), "view_show_grid"); + this, TQT_SLOT (slotShowGridToggled ()), actionCollection (), "view_show_grid"); m_actionShowGrid->setCheckedState (i18n ("Hide &Grid")); @@ -99,12 +99,12 @@ void kpMainWindow::setupViewMenuActions () // Testcase: Press CTRL+H twice on a fresh KolourPaint. // The second CTRL+H doesn't close the thumbnail. m_actionShowThumbnail = new KToggleAction (i18n ("Show T&humbnail"), CTRL + Key_H, - this, SLOT (slotShowThumbnailToggled ()), actionCollection (), "view_show_thumbnail"); + this, TQT_SLOT (slotShowThumbnailToggled ()), actionCollection (), "view_show_thumbnail"); m_actionShowThumbnail->setCheckedState (i18n ("Hide T&humbnail")); // Please do not use setCheckedState() here - it wouldn't make sense m_actionZoomedThumbnail = new KToggleAction (i18n ("Zoo&med Thumbnail Mode"), 0, - this, SLOT (slotZoomedThumbnailToggled ()), actionCollection (), "view_zoomed_thumbnail"); + this, TQT_SLOT (slotZoomedThumbnailToggled ()), actionCollection (), "view_zoomed_thumbnail"); // For consistency with the above action, don't use setCheckedState() // @@ -114,7 +114,7 @@ void kpMainWindow::setupViewMenuActions () d->m_actionShowThumbnailRectangle = new KToggleAction ( i18n ("Enable Thumbnail &Rectangle"), 0, - this, SLOT (slotThumbnailShowRectangleToggled ()), + this, TQT_SLOT (slotThumbnailShowRectangleToggled ()), actionCollection (), "view_show_thumbnail_rectangle"); @@ -176,10 +176,10 @@ void kpMainWindow::actionShowGridUpdate () // private void kpMainWindow::sendZoomListToActionZoom () { - QStringList items; + TQStringList items; - const QValueVector <int>::ConstIterator zoomListEnd (m_zoomList.end ()); - for (QValueVector <int>::ConstIterator it = m_zoomList.begin (); + const TQValueVector <int>::ConstIterator zoomListEnd (m_zoomList.end ()); + for (TQValueVector <int>::ConstIterator it = m_zoomList.begin (); it != zoomListEnd; it++) { @@ -196,7 +196,7 @@ void kpMainWindow::sendZoomListToActionZoom () } // private -int kpMainWindow::zoomLevelFromString (const QString &string) +int kpMainWindow::zoomLevelFromString (const TQString &string) { // loop until not digit int i; @@ -214,7 +214,7 @@ int kpMainWindow::zoomLevelFromString (const QString &string) } // private -QString kpMainWindow::zoomLevelToString (int zoomLevel) +TQString kpMainWindow::zoomLevelToString (int zoomLevel) { return i18n ("%1%").arg (zoomLevel); } @@ -238,7 +238,7 @@ void kpMainWindow::zoomTo (int zoomLevel, bool centerUnderCursor) "results in imprecise editing and redraw glitches.\n" "Do you really want to set to zoom level to %1%?") .arg (zoomLevel), - QString::null/*caption*/, + TQString::null/*caption*/, i18n ("Set Zoom Level to %1%").arg (zoomLevel), "DoNotAskAgain_ZoomLevelNotMultipleOf100") != KMessageBox::Continue) { @@ -248,7 +248,7 @@ void kpMainWindow::zoomTo (int zoomLevel, bool centerUnderCursor) #endif int index = 0; - QValueVector <int>::Iterator it = m_zoomList.begin (); + TQValueVector <int>::Iterator it = m_zoomList.begin (); while (index < (int) m_zoomList.count () && zoomLevel > *it) it++, index++; @@ -287,7 +287,7 @@ void kpMainWindow::zoomTo (int zoomLevel, bool centerUnderCursor) if (m_scrollView && m_scrollView->viewport ()) { // Ordinary flicker is better than the whole view moving - QPainter p (m_mainView); + TQPainter p (m_mainView); p.fillRect (m_mainView->rect (), m_scrollView->viewport ()->colorGroup ().background ()); } @@ -327,9 +327,9 @@ void kpMainWindow::zoomTo (int zoomLevel, bool centerUnderCursor) m_viewManager && m_viewManager->viewUnderCursor ()) { kpView *const vuc = m_viewManager->viewUnderCursor (); - QPoint viewPoint = vuc->mouseViewPoint (); + TQPoint viewPoint = vuc->mouseViewPoint (); - // vuc->transformViewToDoc() returns QPoint which only has int + // vuc->transformViewToDoc() returns TQPoint which only has int // accuracy so we do X and Y manually. targetDocX = vuc->transformViewToDocX (viewPoint.x ()); targetDocY = vuc->transformViewToDocY (viewPoint.y ()); @@ -358,7 +358,7 @@ void kpMainWindow::zoomTo (int zoomLevel, bool centerUnderCursor) #if DEBUG_ZOOM_FLICKER { kdDebug () << "FLICKER: just setZoomLevel" << endl; - QTime timer; timer.start (); + TQTime timer; timer.start (); while (timer.elapsed () < 1000) ; } @@ -376,7 +376,7 @@ void kpMainWindow::zoomTo (int zoomLevel, bool centerUnderCursor) #if DEBUG_ZOOM_FLICKER { kdDebug () << "FLICKER: just centred" << endl; - QTime timer; timer.start (); + TQTime timer; timer.start (); while (timer.elapsed () < 2000) ; } @@ -397,7 +397,7 @@ void kpMainWindow::zoomTo (int zoomLevel, bool centerUnderCursor) const double viewY = vuc->transformDocToViewY (targetDocY); // Rounding error from zooming in and out :( // TODO: do everything in terms of tool doc points in type "double". - const QPoint viewPoint ((int) viewX, (int) viewY); + const TQPoint viewPoint ((int) viewX, (int) viewY); #if DEBUG_KP_MAIN_WINDOW kdDebug () << "\t\tdoc: (" << targetDocX << "," << targetDocY << ")" << " viewUnderCursor: (" << viewX << "," << viewY << ")" @@ -406,7 +406,7 @@ void kpMainWindow::zoomTo (int zoomLevel, bool centerUnderCursor) if (vuc->clipRegion ().contains (viewPoint)) { - const QPoint globalPoint = + const TQPoint globalPoint = kpWidgetMapper::toGlobal (vuc, viewPoint); #if DEBUG_KP_MAIN_WINDOW kdDebug () << "\t\tglobalPoint=" << globalPoint << endl; @@ -415,11 +415,11 @@ void kpMainWindow::zoomTo (int zoomLevel, bool centerUnderCursor) // TODO: Determine some sane cursor flashing indication - // cursor movement is convenient but not conventional. // - // Major problem: if using QApplication::setOverrideCursor() + // Major problem: if using TQApplication::setOverrideCursor() // and in some stage of flash and window quits. // // Or if using kpView::setCursor() and change tool. - QCursor::setPos (globalPoint); + TQCursor::setPos (globalPoint); } // e.g. Zoom to 200%, scroll mainView to bottom-right. // Unzoomed Thumbnail shows top-left portion of bottom-right of @@ -459,7 +459,7 @@ void kpMainWindow::zoomTo (int zoomLevel, bool centerUnderCursor) #if DEBUG_ZOOM_FLICKER { kdDebug () << "FLICKER: updated grid action" << endl; - QTime timer; timer.start (); + TQTime timer; timer.start (); while (timer.elapsed () < 1000) ; } @@ -470,7 +470,7 @@ void kpMainWindow::zoomTo (int zoomLevel, bool centerUnderCursor) #if DEBUG_ZOOM_FLICKER { kdDebug () << "FLICKER: just updated grid" << endl; - QTime timer; timer.start (); + TQTime timer; timer.start (); while (timer.elapsed () < 1000) ; } @@ -484,7 +484,7 @@ void kpMainWindow::zoomTo (int zoomLevel, bool centerUnderCursor) #if DEBUG_ZOOM_FLICKER { kdDebug () << "FLICKER: just set focus to mainview" << endl; - QTime timer; timer.start (); + TQTime timer; timer.start (); while (timer.elapsed () < 1000) ; } @@ -498,7 +498,7 @@ void kpMainWindow::zoomTo (int zoomLevel, bool centerUnderCursor) #if DEBUG_ZOOM_FLICKER { kdDebug () << "FLICKER: signalled something below cursor" << endl; - QTime timer; timer.start (); + TQTime timer; timer.start (); while (timer.elapsed () < 1000) ; } @@ -511,7 +511,7 @@ void kpMainWindow::zoomTo (int zoomLevel, bool centerUnderCursor) // caused mainly by m_scrollView->center() // // TODO: remove flicker completely - //QTimer::singleShot (0, this, SLOT (finishZoomTo ())); + //TQTimer::singleShot (0, this, TQT_SLOT (finishZoomTo ())); // Later: I don't think there is an update() that needs to be queued // - let's reduce latency instead. @@ -528,7 +528,7 @@ void kpMainWindow::finishZoomTo () #if DEBUG_ZOOM_FLICKER { kdDebug () << "FLICKER: inside finishZoomTo" << endl; - QTime timer; timer.start (); + TQTime timer; timer.start (); while (timer.elapsed () < 2000) ; } @@ -546,7 +546,7 @@ void kpMainWindow::finishZoomTo () #if DEBUG_ZOOM_FLICKER { kdDebug () << "FLICKER: just updated mainView" << endl; - QTime timer; timer.start (); + TQTime timer; timer.start (); while (timer.elapsed () < 1000) ; } @@ -562,7 +562,7 @@ void kpMainWindow::finishZoomTo () #if DEBUG_ZOOM_FLICKER { kdDebug () << "FLICKER: just updated scrollView::viewport()" << endl; - QTime timer; timer.start (); + TQTime timer; timer.start (); while (timer.elapsed () < 1000) ; } @@ -573,7 +573,7 @@ void kpMainWindow::finishZoomTo () #if DEBUG_ZOOM_FLICKER { kdDebug () << "FLICKER: just updated scrollView" << endl; - QTime timer; timer.start (); + TQTime timer; timer.start (); while (timer.elapsed () < 1000) ; } @@ -587,7 +587,7 @@ void kpMainWindow::finishZoomTo () #if DEBUG_ZOOM_FLICKER { kdDebug () << "FLICKER: restored vm queued updates" << endl; - QTime timer; timer.start (); + TQTime timer; timer.start (); while (timer.elapsed () < 1000) ; } @@ -602,7 +602,7 @@ void kpMainWindow::finishZoomTo () #if DEBUG_ZOOM_FLICKER { kdDebug () << "FLICKER: finishZoomTo done" << endl; - QTime timer; timer.start (); + TQTime timer; timer.start (); while (timer.elapsed () < 1000) ; } @@ -749,13 +749,13 @@ void kpMainWindow::updateMainViewGrid () // private -QRect kpMainWindow::mapToGlobal (const QRect &rect) const +TQRect kpMainWindow::mapToGlobal (const TQRect &rect) const { return kpWidgetMapper::toGlobal (this, rect); } // private -QRect kpMainWindow::mapFromGlobal (const QRect &rect) const +TQRect kpMainWindow::mapFromGlobal (const TQRect &rect) const { return kpWidgetMapper::fromGlobal (this, rect); } @@ -821,9 +821,9 @@ void kpMainWindow::notifyThumbnailGeometryChanged () if (!m_thumbnailSaveConfigTimer) { - m_thumbnailSaveConfigTimer = new QTimer (this); - connect (m_thumbnailSaveConfigTimer, SIGNAL (timeout ()), - this, SLOT (slotSaveThumbnailGeometry ())); + m_thumbnailSaveConfigTimer = new TQTimer (this); + connect (m_thumbnailSaveConfigTimer, TQT_SIGNAL (timeout ()), + this, TQT_SLOT (slotSaveThumbnailGeometry ())); } m_thumbnailSaveConfigTimer->start (500/*msec*/, true/*single shot*/); @@ -839,7 +839,7 @@ void kpMainWindow::slotSaveThumbnailGeometry () if (!m_thumbnail) return; - QRect rect (m_thumbnail->x (), m_thumbnail->y (), + TQRect rect (m_thumbnail->x (), m_thumbnail->y (), m_thumbnail->width (), m_thumbnail->height ()); #if DEBUG_KP_MAIN_WINDOW kdDebug () << "\tthumbnail relative geometry=" << rect << endl; @@ -1069,7 +1069,7 @@ void kpMainWindow::updateThumbnail () // Read last saved geometry before creating thumbnail & friends // in case they call notifyThumbnailGeometryChanged() - QRect thumbnailGeometry = m_configThumbnailGeometry; + TQRect thumbnailGeometry = m_configThumbnailGeometry; #if DEBUG_KP_MAIN_WINDOW kdDebug () << "\t\tlast used geometry=" << thumbnailGeometry << endl; #endif @@ -1082,9 +1082,9 @@ void kpMainWindow::updateThumbnail () kdDebug () << "\t\tmoving thumbnail to right place" << endl; #endif if (!thumbnailGeometry.isEmpty () && - QRect (0, 0, width (), height ()).intersects (thumbnailGeometry)) + TQRect (0, 0, width (), height ()).intersects (thumbnailGeometry)) { - const QRect geometry = mapToGlobal (thumbnailGeometry); + const TQRect geometry = mapToGlobal (thumbnailGeometry); m_thumbnail->resize (geometry.size ()); m_thumbnail->move (geometry.topLeft ()); } @@ -1095,7 +1095,7 @@ void kpMainWindow::updateThumbnail () const int margin = 20; const int initialWidth = 160, initialHeight = 120; - QRect geometryRect (width () - initialWidth - margin * 2, + TQRect geometryRect (width () - initialWidth - margin * 2, m_scrollView->y () + margin, initialWidth, initialHeight); @@ -1121,8 +1121,8 @@ void kpMainWindow::updateThumbnail () #if DEBUG_KP_MAIN_WINDOW kdDebug () << "\t\tconnecting thumbnail::visibilityChange to destroy slot" << endl; #endif - connect (m_thumbnail, SIGNAL (visibilityChanged (bool)), - this, SLOT (slotDestroyThumbnailIfNotVisible (bool))); + connect (m_thumbnail, TQT_SIGNAL (visibilityChanged (bool)), + this, TQT_SLOT (slotDestroyThumbnailIfNotVisible (bool))); #if DEBUG_KP_MAIN_WINDOW kdDebug () << "\t\tDONE" << endl; #endif @@ -1143,8 +1143,8 @@ void kpMainWindow::updateThumbnail () destroyThumbnailView (); - disconnect (m_thumbnail, SIGNAL (visibilityChanged (bool)), - this, SLOT (slotDestroyThumbnailIfNotVisible (bool))); + disconnect (m_thumbnail, TQT_SIGNAL (visibilityChanged (bool)), + this, TQT_SLOT (slotDestroyThumbnailIfNotVisible (bool))); m_thumbnail->deleteLater (); m_thumbnail = 0; } diff --git a/kolourpaint/kpselection.cpp b/kolourpaint/kpselection.cpp index eb5924cf..728fbad9 100644 --- a/kolourpaint/kpselection.cpp +++ b/kolourpaint/kpselection.cpp @@ -31,10 +31,10 @@ #include <kpselection.h> -#include <qfont.h> -#include <qimage.h> -#include <qpainter.h> -#include <qwmatrix.h> +#include <tqfont.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqwmatrix.h> #include <kdebug.h> #include <klocale.h> @@ -46,27 +46,27 @@ kpSelection::kpSelection (const kpSelectionTransparency &transparency) - : QObject (), + : TQObject (), m_type (kpSelection::Rectangle), m_pixmap (0) { setTransparency (transparency); } -kpSelection::kpSelection (Type type, const QRect &rect, const QPixmap &pixmap, +kpSelection::kpSelection (Type type, const TQRect &rect, const TQPixmap &pixmap, const kpSelectionTransparency &transparency) - : QObject (), + : TQObject (), m_type (type), m_rect (rect) { calculatePoints (); - m_pixmap = pixmap.isNull () ? 0 : new QPixmap (pixmap); + m_pixmap = pixmap.isNull () ? 0 : new TQPixmap (pixmap); setTransparency (transparency); } -kpSelection::kpSelection (Type type, const QRect &rect, const kpSelectionTransparency &transparency) - : QObject (), +kpSelection::kpSelection (Type type, const TQRect &rect, const kpSelectionTransparency &transparency) + : TQObject (), m_type (type), m_rect (rect), m_pixmap (0) @@ -76,10 +76,10 @@ kpSelection::kpSelection (Type type, const QRect &rect, const kpSelectionTranspa setTransparency (transparency); } -kpSelection::kpSelection (const QRect &rect, - const QValueVector <QString> &textLines_, +kpSelection::kpSelection (const TQRect &rect, + const TQValueVector <TQString> &textLines_, const kpTextStyle &textStyle_) - : QObject (), + : TQObject (), m_type (Text), m_rect (rect), m_pixmap (0), @@ -90,21 +90,21 @@ kpSelection::kpSelection (const QRect &rect, setTextLines (textLines_); } -kpSelection::kpSelection (const QPointArray &points, const QPixmap &pixmap, +kpSelection::kpSelection (const TQPointArray &points, const TQPixmap &pixmap, const kpSelectionTransparency &transparency) - : QObject (), + : TQObject (), m_type (Points), m_rect (points.boundingRect ()), m_points (points) { - m_pixmap = pixmap.isNull () ? 0 : new QPixmap (pixmap); + m_pixmap = pixmap.isNull () ? 0 : new TQPixmap (pixmap); m_points.detach (); setTransparency (transparency); } -kpSelection::kpSelection (const QPointArray &points, const kpSelectionTransparency &transparency) - : QObject (), +kpSelection::kpSelection (const TQPointArray &points, const kpSelectionTransparency &transparency) + : TQObject (), m_type (Points), m_rect (points.boundingRect ()), m_points (points), @@ -116,11 +116,11 @@ kpSelection::kpSelection (const QPointArray &points, const kpSelectionTransparen } kpSelection::kpSelection (const kpSelection &rhs) - : QObject (), + : TQObject (), m_type (rhs.m_type), m_rect (rhs.m_rect), m_points (rhs.m_points), - m_pixmap (rhs.m_pixmap ? new QPixmap (*rhs.m_pixmap) : 0), + m_pixmap (rhs.m_pixmap ? new TQPixmap (*rhs.m_pixmap) : 0), m_textLines (rhs.m_textLines), m_textStyle (rhs.m_textStyle), m_transparency (rhs.m_transparency), @@ -140,7 +140,7 @@ kpSelection &kpSelection::operator= (const kpSelection &rhs) m_points.detach (); delete m_pixmap; - m_pixmap = rhs.m_pixmap ? new QPixmap (*rhs.m_pixmap) : 0; + m_pixmap = rhs.m_pixmap ? new TQPixmap (*rhs.m_pixmap) : 0; m_textLines = rhs.m_textLines; m_textStyle = rhs.m_textStyle; @@ -153,11 +153,11 @@ kpSelection &kpSelection::operator= (const kpSelection &rhs) // friend -QDataStream &operator<< (QDataStream &stream, const kpSelection &selection) +TQDataStream &operator<< (TQDataStream &stream, const kpSelection &selection) { #if DEBUG_KP_SELECTION && 1 kdDebug () << "kpSelection::operator<<(sel: rect=" << selection.boundingRect () - << " pixmap rect=" << (selection.pixmap () ? selection.pixmap ()->rect () : QRect ()) + << " pixmap rect=" << (selection.pixmap () ? selection.pixmap ()->rect () : TQRect ()) << endl; #endif stream << int (selection.m_type); @@ -169,10 +169,10 @@ QDataStream &operator<< (QDataStream &stream, const kpSelection &selection) #endif // TODO: need for text? - // For now we just use QTextDrag for Text Selections so this point is mute. + // For now we just use TQTextDrag for Text Selections so this point is mute. if (selection.m_pixmap) { - const QImage image = kpPixmapFX::convertToImage (*selection.m_pixmap); + const TQImage image = kpPixmapFX::convertToImage (*selection.m_pixmap); #if DEBUG_KP_SELECTION && 1 kdDebug () << "\twrote image rect=" << image.rect () << endl; #endif @@ -183,7 +183,7 @@ QDataStream &operator<< (QDataStream &stream, const kpSelection &selection) #if DEBUG_KP_SELECTION && 1 kdDebug () << "\twrote no image because no pixmap" << endl; #endif - stream << QImage (); + stream << TQImage (); } //stream << selection.m_textLines; @@ -193,7 +193,7 @@ QDataStream &operator<< (QDataStream &stream, const kpSelection &selection) } // friend -QDataStream &operator>> (QDataStream &stream, kpSelection &selection) +TQDataStream &operator>> (TQDataStream &stream, kpSelection &selection) { selection.readFromStream (stream); return stream; @@ -202,7 +202,7 @@ QDataStream &operator>> (QDataStream &stream, kpSelection &selection) // public // TODO: KolourPaint has not been tested against invalid or malicious // clipboard data [Bug #28]. -void kpSelection::readFromStream (QDataStream &stream, +void kpSelection::readFromStream (TQDataStream &stream, const kpPixmapFX::WarnAboutLossInfo &wali) { #if DEBUG_KP_SELECTION && 1 @@ -223,11 +223,11 @@ void kpSelection::readFromStream (QDataStream &stream, //kdDebug () << "\tpoints=" << m_points << endl; #endif - QImage image; + TQImage image; stream >> image; delete m_pixmap; if (!image.isNull ()) - m_pixmap = new QPixmap (kpPixmapFX::convertToPixmap (image, false/*no dither*/, wali)); + m_pixmap = new TQPixmap (kpPixmapFX::convertToPixmap (image, false/*no dither*/, wali)); else m_pixmap = 0; #if DEBUG_KP_SELECTION && 1 @@ -276,19 +276,19 @@ void kpSelection::calculatePoints () // top for (int x = 0; x < m_rect.width (); x++) - m_points [pointsUpto++] = QPoint (m_rect.x () + x, m_rect.top ()); + m_points [pointsUpto++] = TQPoint (m_rect.x () + x, m_rect.top ()); // right for (int y = 0; y < m_rect.height (); y++) - m_points [pointsUpto++] = QPoint (m_rect.right (), m_rect.y () + y); + m_points [pointsUpto++] = TQPoint (m_rect.right (), m_rect.y () + y); // bottom for (int x = m_rect.width () - 1; x >= 0; x--) - m_points [pointsUpto++] = QPoint (m_rect.x () + x, m_rect.bottom ()); + m_points [pointsUpto++] = TQPoint (m_rect.x () + x, m_rect.bottom ()); // left for (int y = m_rect.height () - 1; y >= 0; y--) - m_points [pointsUpto++] = QPoint (m_rect.left (), m_rect.y () + y); + m_points [pointsUpto++] = TQPoint (m_rect.left (), m_rect.y () + y); return; } @@ -317,7 +317,7 @@ bool kpSelection::isText () const } // public -QString kpSelection::name () const +TQString kpSelection::name () const { if (m_type == Text) return i18n ("Text"); @@ -337,30 +337,30 @@ int kpSelection::size () const // public -QBitmap kpSelection::maskForOwnType (bool nullForRectangular) const +TQBitmap kpSelection::maskForOwnType (bool nullForRectangular) const { if (!m_rect.isValid ()) { kdError () << "kpSelection::maskForOwnType() boundingRect invalid" << endl; - return QBitmap (); + return TQBitmap (); } if (isRectangular ()) { if (nullForRectangular) - return QBitmap (); + return TQBitmap (); - QBitmap maskBitmap (m_rect.width (), m_rect.height ()); + TQBitmap maskBitmap (m_rect.width (), m_rect.height ()); maskBitmap.fill (Qt::color1/*opaque*/); return maskBitmap; } - QBitmap maskBitmap (m_rect.width (), m_rect.height ()); + TQBitmap maskBitmap (m_rect.width (), m_rect.height ()); maskBitmap.fill (Qt::color0/*transparent*/); - QPainter painter; + TQPainter painter; painter.begin (&maskBitmap); painter.setPen (Qt::color1)/*opaque*/; painter.setBrush (Qt::color1/*opaque*/); @@ -369,7 +369,7 @@ QBitmap kpSelection::maskForOwnType (bool nullForRectangular) const painter.drawEllipse (0, 0, m_rect.width (), m_rect.height ()); else if (m_type == kpSelection::Points) { - QPointArray points = m_points; + TQPointArray points = m_points; points.detach (); points.translate (-m_rect.x (), -m_rect.y ()); @@ -384,13 +384,13 @@ QBitmap kpSelection::maskForOwnType (bool nullForRectangular) const // public -QPoint kpSelection::topLeft () const +TQPoint kpSelection::topLeft () const { return m_rect.topLeft (); } // public -QPoint kpSelection::point () const +TQPoint kpSelection::point () const { return m_rect.topLeft (); } @@ -419,7 +419,7 @@ void kpSelection::moveBy (int dx, int dy) if (dx == 0 && dy == 0) return; - QRect oldRect = boundingRect (); + TQRect oldRect = boundingRect (); #if DEBUG_KP_SELECTION && 1 kdDebug () << "\toldRect=" << oldRect << endl; @@ -438,41 +438,41 @@ void kpSelection::moveBy (int dx, int dy) // public void kpSelection::moveTo (int dx, int dy) { - moveTo (QPoint (dx, dy)); + moveTo (TQPoint (dx, dy)); } // public -void kpSelection::moveTo (const QPoint &topLeftPoint) +void kpSelection::moveTo (const TQPoint &topLeftPoint) { #if DEBUG_KP_SELECTION && 1 kdDebug () << "kpSelection::moveTo(" << topLeftPoint << ")" << endl; #endif - QRect oldBoundingRect = boundingRect (); + TQRect oldBoundingRect = boundingRect (); #if DEBUG_KP_SELECTION && 1 kdDebug () << "\toldBoundingRect=" << oldBoundingRect << endl; #endif if (topLeftPoint == oldBoundingRect.topLeft ()) return; - QPoint delta (topLeftPoint - oldBoundingRect.topLeft ()); + TQPoint delta (topLeftPoint - oldBoundingRect.topLeft ()); moveBy (delta.x (), delta.y ()); } // public -QPointArray kpSelection::points () const +TQPointArray kpSelection::points () const { return m_points; } // public -QPointArray kpSelection::pointArray () const +TQPointArray kpSelection::pointArray () const { return m_points; } // public -QRect kpSelection::boundingRect () const +TQRect kpSelection::boundingRect () const { return m_rect; } @@ -490,9 +490,9 @@ int kpSelection::height () const } // public -bool kpSelection::contains (const QPoint &point) const +bool kpSelection::contains (const TQPoint &point) const { - QRect rect = boundingRect (); + TQRect rect = boundingRect (); #if DEBUG_KP_SELECTION && 1 kdDebug () << "kpSelection::contains(" << point @@ -504,7 +504,7 @@ bool kpSelection::contains (const QPoint &point) const if (!rect.contains (point)) return false; - // OPT: QRegion is probably incredibly slow - cache + // OPT: TQRegion is probably incredibly slow - cache // We can't use the m_pixmap (if avail) and get the transparency of // the pixel at that point as it may be transparent but still within the // border @@ -514,11 +514,11 @@ bool kpSelection::contains (const QPoint &point) const case kpSelection::Text: return true; case kpSelection::Ellipse: - return QRegion (m_rect, QRegion::Ellipse).contains (point); + return TQRegion (m_rect, TQRegion::Ellipse).contains (point); case kpSelection::Points: // TODO: make this always include the border // (draw up a rect sel in this mode to see what I mean) - return QRegion (m_points, false/*even-odd algo*/).contains (point); + return TQRegion (m_points, false/*even-odd algo*/).contains (point); default: return false; } @@ -527,25 +527,25 @@ bool kpSelection::contains (const QPoint &point) const // public bool kpSelection::contains (int x, int y) { - return contains (QPoint (x, y)); + return contains (TQPoint (x, y)); } // public -QPixmap *kpSelection::pixmap () const +TQPixmap *kpSelection::pixmap () const { return m_pixmap; } // public -void kpSelection::setPixmap (const QPixmap &pixmap) +void kpSelection::setPixmap (const TQPixmap &pixmap) { delete m_pixmap; // TODO: If isText(), setting pixmap() to 0 is unexpected (implies // it's a border, not a text box) but saves memory when using - // that kpSelection::setPixmap (QPixmap ()) hack. - m_pixmap = pixmap.isNull () ? 0 : new QPixmap (pixmap); - QRect changedRect = boundingRect (); + // that kpSelection::setPixmap (TQPixmap ()) hack. + m_pixmap = pixmap.isNull () ? 0 : new TQPixmap (pixmap); + TQRect changedRect = boundingRect (); if (m_pixmap) { @@ -572,11 +572,11 @@ void kpSelection::setPixmap (const QPixmap &pixmap) } m_type = kpSelection::Rectangle; - m_rect = QRect (m_rect.x (), m_rect.y (), + m_rect = TQRect (m_rect.x (), m_rect.y (), m_pixmap->width (), m_pixmap->height ()); calculatePoints (); - m_textLines = QValueVector <QString> (); + m_textLines = TQValueVector <TQString> (); changedRect = changedRect.unite (boundingRect ()); } @@ -615,9 +615,9 @@ static QRgb mostContrastingRGB (QRgb val) } // private -static void drawTextLines (QPainter *painter, QPainter *maskPainter, - const QRect &rect, - const QValueVector <QString> &textLines) +static void drawTextLines (TQPainter *painter, TQPainter *maskPainter, + const TQRect &rect, + const TQValueVector <TQString> &textLines) { if (!painter->clipRegion ().isEmpty () || !maskPainter->clipRegion ().isEmpty ()) { @@ -638,13 +638,13 @@ static void drawTextLines (QPainter *painter, QPainter *maskPainter, // Can't do this because the line heights become - // >QFontMetrics::height() if you type Chinese characters (!) and then + // >TQFontMetrics::height() if you type Chinese characters (!) and then // the cursor gets out of sync. // PAINTER_CALL (drawText (rect, 0/*flags*/, text ())); #if 0 - const QFontMetrics fontMetrics (painter->fontMetrics ()); + const TQFontMetrics fontMetrics (painter->fontMetrics ()); kdDebug () << "height=" << fontMetrics.height () << " leading=" << fontMetrics.leading () @@ -655,10 +655,10 @@ static void drawTextLines (QPainter *painter, QPainter *maskPainter, #endif - PAINTER_CALL (setClipRect (rect, QPainter::CoordPainter/*transform*/)); + PAINTER_CALL (setClipRect (rect, TQPainter::CoordPainter/*transform*/)); int baseLine = rect.y () + painter->fontMetrics ().ascent (); - for (QValueVector <QString>::const_iterator it = textLines.begin (); + for (TQValueVector <TQString>::const_iterator it = textLines.begin (); it != textLines.end (); it++) { @@ -671,25 +671,25 @@ static void drawTextLines (QPainter *painter, QPainter *maskPainter, } // private -void kpSelection::paintOpaqueText (QPixmap *destPixmap, const QRect &docRect) const +void kpSelection::paintOpaqueText (TQPixmap *destPixmap, const TQRect &docRect) const { if (!isText () || !m_textStyle.foregroundColor ().isOpaque ()) return; - const QRect modifyingRect = docRect.intersect (boundingRect ()); + const TQRect modifyingRect = docRect.intersect (boundingRect ()); if (modifyingRect.isEmpty ()) return; - QBitmap destPixmapMask; - QPainter destPixmapPainter, destPixmapMaskPainter; + TQBitmap destPixmapMask; + TQPainter destPixmapPainter, destPixmapMaskPainter; if (destPixmap->mask ()) { if (m_textStyle.effectiveBackgroundColor ().isTransparent ()) { - QRect modifyingRectRelPixmap = modifyingRect; + TQRect modifyingRectRelPixmap = modifyingRect; modifyingRectRelPixmap.moveBy (-docRect.x (), -docRect.y ()); // Set the RGB of transparent pixels to foreground colour to avoid @@ -746,14 +746,14 @@ void kpSelection::paintOpaqueText (QPixmap *destPixmap, const QRect &docRect) co } // private -QPixmap kpSelection::transparentForegroundTextPixmap () const +TQPixmap kpSelection::transparentForegroundTextPixmap () const { if (!isText () || !m_textStyle.foregroundColor ().isTransparent ()) - return QPixmap (); + return TQPixmap (); - QPixmap pixmap (m_rect.width (), m_rect.height ()); - QBitmap pixmapMask (m_rect.width (), m_rect.height ()); + TQPixmap pixmap (m_rect.width (), m_rect.height ()); + TQBitmap pixmapMask (m_rect.width (), m_rect.height ()); // Iron out stupid case first @@ -768,12 +768,12 @@ QPixmap kpSelection::transparentForegroundTextPixmap () const // -- Foreground transparent, background opaque -- - QFont font = m_textStyle.font (); - // TODO: why doesn't "font.setStyleStrategy (QFont::NoAntialias);" + TQFont font = m_textStyle.font (); + // TODO: why doesn't "font.setStyleStrategy (TQFont::NoAntialias);" // let us avoid the hack below? - QPainter pixmapPainter, pixmapMaskPainter; + TQPainter pixmapPainter, pixmapMaskPainter; pixmap.fill (m_textStyle.effectiveBackgroundColor ().toQColor ()); pixmapPainter.begin (&pixmap); @@ -784,7 +784,7 @@ QPixmap kpSelection::transparentForegroundTextPixmap () const // we can identify the transparent pixels for manually creating // the mask. pixmapPainter.setPen ( - QColor (mostContrastingRGB (m_textStyle.effectiveBackgroundColor ().toQRgb () & RGB_MASK))); + TQColor (mostContrastingRGB (m_textStyle.effectiveBackgroundColor ().toQRgb () & RGB_MASK))); pixmapPainter.setFont (font); @@ -794,7 +794,7 @@ QPixmap kpSelection::transparentForegroundTextPixmap () const pixmapMaskPainter.setFont (font); - QRect rect (textAreaRect ()); + TQRect rect (textAreaRect ()); rect.moveBy (-m_rect.x (), -m_rect.y ()); ::drawTextLines (&pixmapPainter, &pixmapMaskPainter, rect, @@ -811,7 +811,7 @@ QPixmap kpSelection::transparentForegroundTextPixmap () const #if DEBUG_KP_SELECTION kdDebug () << "\tinvoking foreground transparency hack" << endl; #endif - QImage image = kpPixmapFX::convertToImage (pixmap); + TQImage image = kpPixmapFX::convertToImage (pixmap); QRgb backgroundRGB = image.pixel (0, 0); // on textBorderSize() pixmapMaskPainter.begin (&pixmapMask); @@ -838,7 +838,7 @@ QPixmap kpSelection::transparentForegroundTextPixmap () const } // public -void kpSelection::paint (QPixmap *destPixmap, const QRect &docRect) const +void kpSelection::paint (TQPixmap *destPixmap, const TQRect &docRect) const { if (!isText ()) { @@ -895,7 +895,7 @@ void kpSelection::calculateTextPixmap () if (m_textStyle.foregroundColor().isOpaque ()) { - m_pixmap = new QPixmap (m_rect.width (), m_rect.height ()); + m_pixmap = new TQPixmap (m_rect.width (), m_rect.height ()); if (usesBackgroundPixmapToPaint ()) kpPixmapFX::fill (m_pixmap, kpColor::transparent); @@ -904,24 +904,24 @@ void kpSelection::calculateTextPixmap () } else { - m_pixmap = new QPixmap (transparentForegroundTextPixmap ()); + m_pixmap = new TQPixmap (transparentForegroundTextPixmap ()); } } // public static -QString kpSelection::textForTextLines (const QValueVector <QString> &textLines_) +TQString kpSelection::textForTextLines (const TQValueVector <TQString> &textLines_) { if (textLines_.isEmpty ()) - return QString::null; + return TQString::null; - QString bigString = textLines_ [0]; + TQString bigString = textLines_ [0]; - for (QValueVector <QString>::const_iterator it = textLines_.begin () + 1; + for (TQValueVector <TQString>::const_iterator it = textLines_.begin () + 1; it != textLines_.end (); it++) { - bigString += QString::fromLatin1 ("\n"); + bigString += TQString::fromLatin1 ("\n"); bigString += (*it); } @@ -929,30 +929,30 @@ QString kpSelection::textForTextLines (const QValueVector <QString> &textLines_) } // public -QString kpSelection::text () const +TQString kpSelection::text () const { if (!isText ()) { - return QString::null; + return TQString::null; } return textForTextLines (m_textLines); } // public -QValueVector <QString> kpSelection::textLines () const +TQValueVector <TQString> kpSelection::textLines () const { if (!isText ()) { kdError () << "kpSelection::textLines() not a text selection" << endl; - return QValueVector <QString> (); + return TQValueVector <TQString> (); } return m_textLines; } // public -void kpSelection::setTextLines (const QValueVector <QString> &textLines_) +void kpSelection::setTextLines (const TQValueVector <TQString> &textLines_) { if (!isText ()) { @@ -964,7 +964,7 @@ void kpSelection::setTextLines (const QValueVector <QString> &textLines_) if (m_textLines.isEmpty ()) { kdError () << "kpSelection::setTextLines() passed no lines" << endl; - m_textLines.push_back (QString::null); + m_textLines.push_back (TQString::null); } calculateTextPixmap (); emit changed (boundingRect ()); @@ -977,22 +977,22 @@ int kpSelection::textBorderSize () } // public -QRect kpSelection::textAreaRect () const +TQRect kpSelection::textAreaRect () const { if (!isText ()) { kdError () << "kpSelection::textAreaRect() not a text selection" << endl; - return QRect (); + return TQRect (); } - return QRect (m_rect.x () + textBorderSize (), + return TQRect (m_rect.x () + textBorderSize (), m_rect.y () + textBorderSize (), m_rect.width () - textBorderSize () * 2, m_rect.height () - textBorderSize () * 2); } // public -bool kpSelection::pointIsInTextBorderArea (const QPoint &globalPoint) const +bool kpSelection::pointIsInTextBorderArea (const TQPoint &globalPoint) const { if (!isText ()) { @@ -1004,7 +1004,7 @@ bool kpSelection::pointIsInTextBorderArea (const QPoint &globalPoint) const } // public -bool kpSelection::pointIsInTextArea (const QPoint &globalPoint) const +bool kpSelection::pointIsInTextArea (const TQPoint &globalPoint) const { if (!isText ()) { @@ -1025,9 +1025,9 @@ void kpSelection::textResize (int width, int height) return; } - QRect oldRect = m_rect; + TQRect oldRect = m_rect; - m_rect = QRect (oldRect.x (), oldRect.y (), width, height); + m_rect = TQRect (oldRect.x (), oldRect.y (), width, height); calculatePoints (); calculateTextPixmap (); @@ -1049,9 +1049,9 @@ int kpSelection::minimumHeightForTextStyle (const kpTextStyle &) } // public static -QSize kpSelection::minimumSizeForTextStyle (const kpTextStyle &textStyle) +TQSize kpSelection::minimumSizeForTextStyle (const kpTextStyle &textStyle) { - return QSize (minimumWidthForTextStyle (textStyle), + return TQSize (minimumWidthForTextStyle (textStyle), minimumHeightForTextStyle (textStyle)); } @@ -1061,7 +1061,7 @@ int kpSelection::preferredMinimumWidthForTextStyle (const kpTextStyle &textStyle { const int about15CharsWidth = textStyle.fontMetrics ().width ( - QString::fromLatin1 ("1234567890abcde")); + TQString::fromLatin1 ("1234567890abcde")); const int preferredMinWidth = QMAX (150, @@ -1082,9 +1082,9 @@ int kpSelection::preferredMinimumHeightForTextStyle (const kpTextStyle &textStyl } // public static -QSize kpSelection::preferredMinimumSizeForTextStyle (const kpTextStyle &textStyle) +TQSize kpSelection::preferredMinimumSizeForTextStyle (const kpTextStyle &textStyle) { - return QSize (preferredMinimumWidthForTextStyle (textStyle), + return TQSize (preferredMinimumWidthForTextStyle (textStyle), preferredMinimumHeightForTextStyle (textStyle)); } @@ -1108,14 +1108,14 @@ int kpSelection::minimumHeight () const } // public -QSize kpSelection::minimumSize () const +TQSize kpSelection::minimumSize () const { - return QSize (minimumWidth (), minimumHeight ()); + return TQSize (minimumWidth (), minimumHeight ()); } // public -int kpSelection::textRowForPoint (const QPoint &globalPoint) const +int kpSelection::textRowForPoint (const TQPoint &globalPoint) const { if (!isText ()) { @@ -1126,7 +1126,7 @@ int kpSelection::textRowForPoint (const QPoint &globalPoint) const if (!pointIsInTextArea (globalPoint)) return -1; - const QFontMetrics fontMetrics (m_textStyle.fontMetrics ()); + const TQFontMetrics fontMetrics (m_textStyle.fontMetrics ()); int row = (globalPoint.y () - textAreaRect ().y ()) / fontMetrics.lineSpacing (); @@ -1137,7 +1137,7 @@ int kpSelection::textRowForPoint (const QPoint &globalPoint) const } // public -int kpSelection::textColForPoint (const QPoint &globalPoint) const +int kpSelection::textColForPoint (const TQPoint &globalPoint) const { if (!isText ()) { @@ -1151,7 +1151,7 @@ int kpSelection::textColForPoint (const QPoint &globalPoint) const const int localX = globalPoint.x () - textAreaRect ().x (); - const QFontMetrics fontMetrics (m_textStyle.fontMetrics ()); + const TQFontMetrics fontMetrics (m_textStyle.fontMetrics ()); // (should be 0 but call just in case) int charLocalLeft = fontMetrics.width (m_textLines [row], 0); @@ -1171,7 +1171,7 @@ int kpSelection::textColForPoint (const QPoint &globalPoint) const } // public -QPoint kpSelection::pointForTextRowCol (int row, int col) +TQPoint kpSelection::pointForTextRowCol (int row, int col) { if (!isText ()) { @@ -1194,13 +1194,13 @@ QPoint kpSelection::pointForTextRowCol (int row, int col) return KP_INVALID_POINT; } - const QFontMetrics fontMetrics (m_textStyle.fontMetrics ()); + const TQFontMetrics fontMetrics (m_textStyle.fontMetrics ()); const int x = fontMetrics.width (m_textLines [row], col); const int y = row * fontMetrics.height () + (row >= 1 ? row * fontMetrics.leading () : 0); - return textAreaRect ().topLeft () + QPoint (x, y); + return textAreaRect ().topLeft () + TQPoint (x, y); } // public @@ -1229,16 +1229,16 @@ void kpSelection::setTextStyle (const kpTextStyle &textStyle_) } // public -QPixmap kpSelection::opaquePixmap () const +TQPixmap kpSelection::opaquePixmap () const { - QPixmap *p = pixmap (); + TQPixmap *p = pixmap (); if (p) { return *p; } else { - return QPixmap (); + return TQPixmap (); } } @@ -1278,8 +1278,8 @@ void kpSelection::calculateTransparencyMask () m_transparencyMask.resize (m_pixmap->width (), m_pixmap->height ()); - QImage image = kpPixmapFX::convertToImage (*m_pixmap); - QPainter transparencyMaskPainter (&m_transparencyMask); + TQImage image = kpPixmapFX::convertToImage (*m_pixmap); + TQPainter transparencyMaskPainter (&m_transparencyMask); bool hasTransparent = false; for (int y = 0; y < m_pixmap->height (); y++) @@ -1314,13 +1314,13 @@ void kpSelection::calculateTransparencyMask () } // public -QPixmap kpSelection::transparentPixmap () const +TQPixmap kpSelection::transparentPixmap () const { - QPixmap pixmap = opaquePixmap (); + TQPixmap pixmap = opaquePixmap (); if (!m_transparencyMask.isNull ()) { - kpPixmapFX::paintMaskTransparentWithBrush (&pixmap, QPoint (0, 0), + kpPixmapFX::paintMaskTransparentWithBrush (&pixmap, TQPoint (0, 0), m_transparencyMask); } @@ -1344,7 +1344,7 @@ bool kpSelection::setTransparency (const kpSelectionTransparency &transparency, bool haveChanged = true; - QBitmap oldTransparencyMask = m_transparencyMask; + TQBitmap oldTransparencyMask = m_transparencyMask; calculateTransparencyMask (); @@ -1360,8 +1360,8 @@ bool kpSelection::setTransparency (const kpSelectionTransparency &transparency, } else if (checkTransparentPixmapChanged) { - QImage oldTransparencyMaskImage = kpPixmapFX::convertToImage (oldTransparencyMask); - QImage newTransparencyMaskImage = kpPixmapFX::convertToImage (m_transparencyMask); + TQImage oldTransparencyMaskImage = kpPixmapFX::convertToImage (oldTransparencyMask); + TQImage newTransparencyMaskImage = kpPixmapFX::convertToImage (m_transparencyMask); bool changed = false; for (int y = 0; y < oldTransparencyMaskImage.height () && !changed; y++) @@ -1372,7 +1372,7 @@ bool kpSelection::setTransparency (const kpSelectionTransparency &transparency, kpPixmapFX::getColorAtPixel (newTransparencyMaskImage, x, y)) { #if DEBUG_KP_SELECTION - kdDebug () << "\tdiffer at " << QPoint (x, y) + kdDebug () << "\tdiffer at " << TQPoint (x, y) << " old=" << (int *) kpPixmapFX::getColorAtPixel (oldTransparencyMaskImage, x, y).toQRgb () << " new=" << (int *) kpPixmapFX::getColorAtPixel (newTransparencyMaskImage, x, y).toQRgb () << endl; @@ -1399,11 +1399,11 @@ bool kpSelection::setTransparency (const kpSelectionTransparency &transparency, // private void kpSelection::flipPoints (bool horiz, bool vert) { - QRect oldRect = boundingRect (); + TQRect oldRect = boundingRect (); m_points.translate (-oldRect.x (), -oldRect.y ()); - const QWMatrix matrix = kpPixmapFX::flipMatrix (oldRect.width (), oldRect.height (), + const TQWMatrix matrix = kpPixmapFX::flipMatrix (oldRect.width (), oldRect.height (), horiz, vert); m_points = matrix.map (m_points); diff --git a/kolourpaint/kpselection.h b/kolourpaint/kpselection.h index 69b836b9..b99f5cb9 100644 --- a/kolourpaint/kpselection.h +++ b/kolourpaint/kpselection.h @@ -29,15 +29,15 @@ #ifndef __kpselection_h__ #define __kpselection_h__ -#include <qbitmap.h> -#include <qdatastream.h> -#include <qobject.h> -#include <qpixmap.h> -#include <qpoint.h> -#include <qpointarray.h> -#include <qvaluevector.h> -#include <qrect.h> -#include <qstring.h> +#include <tqbitmap.h> +#include <tqdatastream.h> +#include <tqobject.h> +#include <tqpixmap.h> +#include <tqpoint.h> +#include <tqpointarray.h> +#include <tqvaluevector.h> +#include <tqrect.h> +#include <tqstring.h> #include <kpcolor.h> #include <kppixmapfx.h> @@ -45,7 +45,7 @@ #include <kptextstyle.h> -class QSize; +class TQSize; /* @@ -69,23 +69,23 @@ public: kpSelection (const kpSelectionTransparency &transparency = kpSelectionTransparency ()); // (for Rectangle & Ellipse) - kpSelection (Type type, const QRect &rect, const QPixmap &pixmap = QPixmap (), + kpSelection (Type type, const TQRect &rect, const TQPixmap &pixmap = TQPixmap (), const kpSelectionTransparency &transparency = kpSelectionTransparency ()); - kpSelection (Type type, const QRect &rect, const kpSelectionTransparency &transparency); + kpSelection (Type type, const TQRect &rect, const kpSelectionTransparency &transparency); // (for Text) - kpSelection (const QRect &rect, const QValueVector <QString> &textLines_, const kpTextStyle &textStyle_); + kpSelection (const TQRect &rect, const TQValueVector <TQString> &textLines_, const kpTextStyle &textStyle_); // (for Points) - kpSelection (const QPointArray &points, const QPixmap &pixmap = QPixmap (), + kpSelection (const TQPointArray &points, const TQPixmap &pixmap = TQPixmap (), const kpSelectionTransparency &transparency = kpSelectionTransparency ()); - kpSelection (const QPointArray &points, const kpSelectionTransparency &transparency); + kpSelection (const TQPointArray &points, const kpSelectionTransparency &transparency); kpSelection (const kpSelection &rhs); kpSelection &operator= (const kpSelection &rhs); - friend QDataStream &operator<< (QDataStream &stream, const kpSelection &selection); - friend QDataStream &operator>> (QDataStream &stream, kpSelection &selection); - void readFromStream (QDataStream &stream, + friend TQDataStream &operator<< (TQDataStream &stream, const kpSelection &selection); + friend TQDataStream &operator>> (TQDataStream &stream, kpSelection &selection); + void readFromStream (TQDataStream &stream, const kpPixmapFX::WarnAboutLossInfo &wali = kpPixmapFX::WarnAboutLossInfo ()); ~kpSelection (); @@ -98,67 +98,67 @@ public: bool isRectangular () const; bool isText () const; // returns either i18n ("Selection") or i18n ("Text") - QString name () const; + TQString name () const; int size () const; - QBitmap maskForOwnType (bool nullForRectangular = false) const; + TQBitmap maskForOwnType (bool nullForRectangular = false) const; // synonyms - QPoint topLeft () const; - QPoint point () const; + TQPoint topLeft () const; + TQPoint point () const; int x () const; int y () const; void moveBy (int dx, int dy); void moveTo (int dx, int dy); - void moveTo (const QPoint &topLeftPoint); + void moveTo (const TQPoint &topLeftPoint); // synonyms - QPointArray points () const; - QPointArray pointArray () const; + TQPointArray points () const; + TQPointArray pointArray () const; - QRect boundingRect () const; + TQRect boundingRect () const; int width () const; int height () const; // (for non-rectangular selections, may return false even if // kpView::onSelectionResizeHandle()) - bool contains (const QPoint &point) const; + bool contains (const TQPoint &point) const; bool contains (int x, int y); // (Avoid using for text selections since text selection may // require a background for antialiasing purposes - use paint() // instead, else no antialising) - QPixmap *pixmap () const; - void setPixmap (const QPixmap &pixmap); + TQPixmap *pixmap () const; + void setPixmap (const TQPixmap &pixmap); bool usesBackgroundPixmapToPaint () const; private: - void paintOpaqueText (QPixmap *destPixmap, const QRect &docRect) const; - QPixmap transparentForegroundTextPixmap () const; + void paintOpaqueText (TQPixmap *destPixmap, const TQRect &docRect) const; + TQPixmap transparentForegroundTextPixmap () const; public: // (<docRect> is the document rectangle that <*destPixmap> represents) - void paint (QPixmap *destPixmap, const QRect &docRect) const; + void paint (TQPixmap *destPixmap, const TQRect &docRect) const; private: void calculateTextPixmap (); public: - static QString textForTextLines (const QValueVector <QString> &textLines_); - QString text () const; // textLines() as one long string - QValueVector <QString> textLines () const; - void setTextLines (const QValueVector <QString> &textLines_); + static TQString textForTextLines (const TQValueVector <TQString> &textLines_); + TQString text () const; // textLines() as one long string + TQValueVector <TQString> textLines () const; + void setTextLines (const TQValueVector <TQString> &textLines_); static int textBorderSize (); - QRect textAreaRect () const; - bool pointIsInTextBorderArea (const QPoint &globalPoint) const; - bool pointIsInTextArea (const QPoint &globalPoint) const; + TQRect textAreaRect () const; + bool pointIsInTextBorderArea (const TQPoint &globalPoint) const; + bool pointIsInTextArea (const TQPoint &globalPoint) const; void textResize (int width, int height); @@ -168,33 +168,33 @@ public: // Be more robust when external enforcement fails. static int minimumWidthForTextStyle (const kpTextStyle &); static int minimumHeightForTextStyle (const kpTextStyle &); - static QSize minimumSizeForTextStyle (const kpTextStyle &); + static TQSize minimumSizeForTextStyle (const kpTextStyle &); static int preferredMinimumWidthForTextStyle (const kpTextStyle &textStyle); static int preferredMinimumHeightForTextStyle (const kpTextStyle &textStyle); - static QSize preferredMinimumSizeForTextStyle (const kpTextStyle &textStyle); + static TQSize preferredMinimumSizeForTextStyle (const kpTextStyle &textStyle); int minimumWidth () const; int minimumHeight () const; - QSize minimumSize () const; + TQSize minimumSize () const; - int textRowForPoint (const QPoint &globalPoint) const; - int textColForPoint (const QPoint &globalPoint) const; - QPoint pointForTextRowCol (int row, int col); + int textRowForPoint (const TQPoint &globalPoint) const; + int textColForPoint (const TQPoint &globalPoint) const; + TQPoint pointForTextRowCol (int row, int col); kpTextStyle textStyle () const; void setTextStyle (const kpTextStyle &textStyle); // TODO: ret val inconstent with pixmap() // - fix when merge with kpTempPixmap - QPixmap opaquePixmap () const; // same as pixmap() + TQPixmap opaquePixmap () const; // same as pixmap() private: void calculateTransparencyMask (); public: // Returns opaquePixmap() after applying kpSelectionTransparency - QPixmap transparentPixmap () const; + TQPixmap transparentPixmap () const; kpSelectionTransparency transparency () const; // Returns whether or not the selection changed due to setting the @@ -211,21 +211,21 @@ public: void flip (bool horiz, bool vert); signals: - void changed (const QRect &docRect); + void changed (const TQRect &docRect); private: // OPT: use implicit sharing Type m_type; - QRect m_rect; - QPointArray m_points; - QPixmap *m_pixmap; + TQRect m_rect; + TQPointArray m_points; + TQPixmap *m_pixmap; - QValueVector <QString> m_textLines; + TQValueVector <TQString> m_textLines; kpTextStyle m_textStyle; kpSelectionTransparency m_transparency; - QBitmap m_transparencyMask; + TQBitmap m_transparencyMask; private: // There is no need to maintain binary compatibility at this stage. diff --git a/kolourpaint/kpselectiondrag.cpp b/kolourpaint/kpselectiondrag.cpp index 23ab9a4e..91ecf35c 100644 --- a/kolourpaint/kpselectiondrag.cpp +++ b/kolourpaint/kpselectiondrag.cpp @@ -30,7 +30,7 @@ #include <kpselectiondrag.h> -#include <qdatastream.h> +#include <tqdatastream.h> #include <kdebug.h> @@ -42,18 +42,18 @@ const char * const kpSelectionDrag::selectionMimeType = "application/x-kolourpaint-selection"; -kpSelectionDrag::kpSelectionDrag (QWidget *dragSource, const char *name) - : QImageDrag (dragSource, name) +kpSelectionDrag::kpSelectionDrag (TQWidget *dragSource, const char *name) + : TQImageDrag (dragSource, name) { } -kpSelectionDrag::kpSelectionDrag (const QImage &image, QWidget *dragSource, const char *name) - : QImageDrag (image, dragSource, name) +kpSelectionDrag::kpSelectionDrag (const TQImage &image, TQWidget *dragSource, const char *name) + : TQImageDrag (image, dragSource, name) { } -kpSelectionDrag::kpSelectionDrag (const kpSelection &sel, QWidget *dragSource, const char *name) - : QImageDrag (dragSource, name) +kpSelectionDrag::kpSelectionDrag (const kpSelection &sel, TQWidget *dragSource, const char *name) + : TQImageDrag (dragSource, name) { setSelection (sel); } @@ -76,7 +76,7 @@ void kpSelectionDrag::setSelection (const kpSelection &sel) // OPT: an awful waste of memory storing image in both selection and QImage - // HACK: need to set image else QImageDrag::format() lies + // HACK: need to set image else TQImageDrag::format() lies setImage (kpPixmapFX::convertToImage (*m_selection.pixmap ())); } @@ -93,7 +93,7 @@ const char *kpSelectionDrag::format (int which) const #if DEBUG_KP_SELECTION_DRAG && 0 kdDebug () << "kpSelectionDrag::format(" << which << ")" << endl; #endif - const char *ret = QImageDrag::format (which); + const char *ret = TQImageDrag::format (which); if (ret) { #if DEBUG_KP_SELECTION_DRAG && 0 @@ -103,11 +103,11 @@ const char *kpSelectionDrag::format (int which) const } int i; - for (i = 0; QImageDrag::format (i); i++) + for (i = 0; TQImageDrag::format (i); i++) ; #if DEBUG_KP_SELECTION_DRAG && 0 - kdDebug () << "\tend of QImageDrag format list at " << i << endl; + kdDebug () << "\tend of TQImageDrag format list at " << i << endl; #endif if (i == which) @@ -127,8 +127,8 @@ const char *kpSelectionDrag::format (int which) const } // public virtual [base QMimeSource] -// Don't need to override in Qt 3.2 (the QMimeSource base will work) -// but we do so just in case QImageDrag later decides to override it. +// Don't need to override in Qt 3.2 (the TQMimeSource base will work) +// but we do so just in case TQImageDrag later decides to override it. bool kpSelectionDrag::provides (const char *mimeType) const { #if DEBUG_KP_SELECTION_DRAG @@ -139,26 +139,26 @@ bool kpSelectionDrag::provides (const char *mimeType) const return false; return (!strcmp (mimeType, kpSelectionDrag::selectionMimeType) || - QImageDrag::provides (mimeType)); + TQImageDrag::provides (mimeType)); } // public virtual [base QMimeSource] -QByteArray kpSelectionDrag::encodedData (const char *mimeType) const +TQByteArray kpSelectionDrag::encodedData (const char *mimeType) const { #if DEBUG_KP_SELECTION_DRAG kdDebug () << "kpSelectionDrag::encodedData(" << mimeType << ")" << endl; #endif if (!mimeType) - return QByteArray (); + return TQByteArray (); if (!strcmp (mimeType, kpSelectionDrag::selectionMimeType)) { - QByteArray ba; - QDataStream stream (ba, IO_WriteOnly); + TQByteArray ba; + TQDataStream stream (ba, IO_WriteOnly); #if DEBUG_KP_SELECTION_DRAG - kdDebug () << "\twant it as kpSelection in QByteArray" << endl; + kdDebug () << "\twant it as kpSelection in TQByteArray" << endl; #endif if (holdsSelection ()) @@ -171,9 +171,9 @@ QByteArray kpSelectionDrag::encodedData (const char *mimeType) const else { #if DEBUG_KP_SELECTION_DRAG - kdDebug () << "\t\thave image - call kpSelectionDrag::decode(QImage)" << endl; + kdDebug () << "\t\thave image - call kpSelectionDrag::decode(TQImage)" << endl; #endif - QImage image; + TQImage image; if (kpSelectionDrag::decode (this, image/*ref*/)) { #if DEBUG_KP_SELECTION_DRAG @@ -184,16 +184,16 @@ QByteArray kpSelectionDrag::encodedData (const char *mimeType) const << endl; #endif - QPixmap pixmap = kpPixmapFX::convertToPixmapAsLosslessAsPossible (image); + TQPixmap pixmap = kpPixmapFX::convertToPixmapAsLosslessAsPossible (image); stream << kpSelection (kpSelection::Rectangle, - QRect (0, 0, pixmap.width (), pixmap.height ()), + TQRect (0, 0, pixmap.width (), pixmap.height ()), pixmap); } else { kdError () << "kpSelectionDrag::encodedData(" << mimeType << ")" - << " kpSelectionDrag(QImage) could not decode data into QImage" + << " kpSelectionDrag(TQImage) could not decode data into TQImage" << endl; stream << kpSelection (); } @@ -204,16 +204,16 @@ QByteArray kpSelectionDrag::encodedData (const char *mimeType) const else { #if DEBUG_KP_SELECTION_DRAG - kdDebug () << "\twant it as QImage in QByteArray" << endl; + kdDebug () << "\twant it as TQImage in TQByteArray" << endl; #endif - return QImageDrag::encodedData (mimeType); + return TQImageDrag::encodedData (mimeType); } } // public static -bool kpSelectionDrag::canDecode (const QMimeSource *e) +bool kpSelectionDrag::canDecode (const TQMimeSource *e) { #if DEBUG_KP_SELECTION_DRAG kdDebug () << "kpSelectionDrag::canDecode()" << endl; @@ -223,25 +223,25 @@ bool kpSelectionDrag::canDecode (const QMimeSource *e) return false; return (e->provides (kpSelectionDrag::selectionMimeType) || - QImageDrag::canDecode (e)); + TQImageDrag::canDecode (e)); } // public static -bool kpSelectionDrag::decode (const QMimeSource *e, QImage &img) +bool kpSelectionDrag::decode (const TQMimeSource *e, TQImage &img) { #if DEBUG_KP_SELECTION_DRAG - kdDebug () << "kpSelectionDrag::decode(QImage)" << endl; + kdDebug () << "kpSelectionDrag::decode(TQImage)" << endl; #endif if (!e) return false; - return (QImageDrag::canDecode (e) && // prevents X errors, jumps based on unitialised values... - QImageDrag::decode (e, img/*ref*/)); + return (TQImageDrag::canDecode (e) && // prevents X errors, jumps based on unitialised values... + TQImageDrag::decode (e, img/*ref*/)); } // public static -bool kpSelectionDrag::decode (const QMimeSource *e, kpSelection &sel, +bool kpSelectionDrag::decode (const TQMimeSource *e, kpSelection &sel, const kpPixmapFX::WarnAboutLossInfo &wali) { #if DEBUG_KP_SELECTION_DRAG @@ -253,10 +253,10 @@ bool kpSelectionDrag::decode (const QMimeSource *e, kpSelection &sel, if (e->provides (kpSelectionDrag::selectionMimeType)) { #if DEBUG_KP_SELECTION_DRAG - kdDebug () << "\tmimeSource provides selection - just return it in QByteArray" << endl; + kdDebug () << "\tmimeSource provides selection - just return it in TQByteArray" << endl; #endif - QByteArray data = e->encodedData (kpSelectionDrag::selectionMimeType); - QDataStream stream (data, IO_ReadOnly); + TQByteArray data = e->encodedData (kpSelectionDrag::selectionMimeType); + TQDataStream stream (data, IO_ReadOnly); // (no need for wali as kpSelection's by definition only support QPixmap's) stream >> sel; @@ -267,7 +267,7 @@ bool kpSelectionDrag::decode (const QMimeSource *e, kpSelection &sel, kdDebug () << "\tmimeSource doesn't provide selection - try image" << endl; #endif - QImage image; + TQImage image; if (kpSelectionDrag::decode (e, image/*ref*/)) { #if DEBUG_KP_SELECTION_DRAG @@ -275,7 +275,7 @@ bool kpSelectionDrag::decode (const QMimeSource *e, kpSelection &sel, #endif sel = kpSelection (kpSelection::Rectangle, - QRect (0, 0, image.width (), image.height ()), + TQRect (0, 0, image.width (), image.height ()), kpPixmapFX::convertToPixmapAsLosslessAsPossible (image, wali)); } else diff --git a/kolourpaint/kpselectiondrag.h b/kolourpaint/kpselectiondrag.h index 5aae82d9..e2b81e62 100644 --- a/kolourpaint/kpselectiondrag.h +++ b/kolourpaint/kpselectiondrag.h @@ -29,7 +29,7 @@ #ifndef __kp_selection_drag_h__ #define __kp_selection_drag_h__ -#include <qdragobject.h> +#include <tqdragobject.h> #include <kppixmapfx.h> #include <kpselection.h> @@ -40,9 +40,9 @@ class kpSelectionDrag : public QImageDrag Q_OBJECT public: - kpSelectionDrag (QWidget *dragSource = 0, const char *name = 0); - kpSelectionDrag (const QImage &image, QWidget *dragSource = 0, const char *name = 0); - kpSelectionDrag (const kpSelection &sel, QWidget *dragSource = 0, const char *name = 0); + kpSelectionDrag (TQWidget *dragSource = 0, const char *name = 0); + kpSelectionDrag (const TQImage &image, TQWidget *dragSource = 0, const char *name = 0); + kpSelectionDrag (const kpSelection &sel, TQWidget *dragSource = 0, const char *name = 0); virtual ~kpSelectionDrag (); static const char * const selectionMimeType; @@ -55,11 +55,11 @@ protected: public: virtual const char *format (int which = 0) const; virtual bool provides (const char *mimeType) const; - virtual QByteArray encodedData (const char *mimeType) const; + virtual TQByteArray encodedData (const char *mimeType) const; - static bool canDecode (const QMimeSource *e); - static bool decode (const QMimeSource *e, QImage &img); - static bool decode (const QMimeSource *e, kpSelection &sel, + static bool canDecode (const TQMimeSource *e); + static bool decode (const TQMimeSource *e, TQImage &img); + static bool decode (const TQMimeSource *e, kpSelection &sel, const kpPixmapFX::WarnAboutLossInfo &wali = kpPixmapFX::WarnAboutLossInfo ()); diff --git a/kolourpaint/kpsinglekeytriggersaction.cpp b/kolourpaint/kpsinglekeytriggersaction.cpp index d3b64002..07573bf4 100644 --- a/kolourpaint/kpsinglekeytriggersaction.cpp +++ b/kolourpaint/kpsinglekeytriggersaction.cpp @@ -116,9 +116,9 @@ void kpSingleKeyTriggersActionInterface::enableSingleKeyTriggers (bool enable) // -kpSingleKeyTriggersAction::kpSingleKeyTriggersAction (const QString &text, +kpSingleKeyTriggersAction::kpSingleKeyTriggersAction (const TQString &text, const KShortcut &shortcut, - const QObject *receiver, const char *slot, + const TQObject *receiver, const char *slot, KActionCollection *parent, const char *name) : KAction (text, shortcut, receiver, slot, parent, name) { diff --git a/kolourpaint/kpsinglekeytriggersaction.h b/kolourpaint/kpsinglekeytriggersaction.h index fc404bd5..2c1ddf3f 100644 --- a/kolourpaint/kpsinglekeytriggersaction.h +++ b/kolourpaint/kpsinglekeytriggersaction.h @@ -62,9 +62,9 @@ class kpSingleKeyTriggersAction : public KAction, Q_OBJECT public: - kpSingleKeyTriggersAction (const QString &text, + kpSingleKeyTriggersAction (const TQString &text, const KShortcut &shortcut, - const QObject *receiver, const char *slot, + const TQObject *receiver, const char *slot, KActionCollection *parent, const char *name); virtual ~kpSingleKeyTriggersAction (); diff --git a/kolourpaint/kptemppixmap.cpp b/kolourpaint/kptemppixmap.cpp index 55f669ee..186f0ed9 100644 --- a/kolourpaint/kptemppixmap.cpp +++ b/kolourpaint/kptemppixmap.cpp @@ -36,7 +36,7 @@ kpTempPixmap::kpTempPixmap (bool isBrush, RenderMode renderMode, - const QPoint &topLeft, const QPixmap &pixmap) + const TQPoint &topLeft, const TQPixmap &pixmap) : m_isBrush (isBrush), m_renderMode (renderMode), m_topLeft (topLeft), @@ -83,13 +83,13 @@ kpTempPixmap::RenderMode kpTempPixmap::renderMode () const } // public -QPoint kpTempPixmap::topLeft () const +TQPoint kpTempPixmap::topLeft () const { return m_topLeft; } // public -QPixmap kpTempPixmap::pixmap () const +TQPixmap kpTempPixmap::pixmap () const { return m_pixmap; } @@ -102,9 +102,9 @@ bool kpTempPixmap::isVisible (const kpViewManager *vm) const } // public -QRect kpTempPixmap::rect () const +TQRect kpTempPixmap::rect () const { - return QRect (m_topLeft.x (), m_topLeft.y (), + return TQRect (m_topLeft.x (), m_topLeft.y (), m_pixmap.width (), m_pixmap.height ()); } @@ -129,7 +129,7 @@ bool kpTempPixmap::mayChangeDocumentMask () const } // public -void kpTempPixmap::paint (QPixmap *destPixmap, const QRect &docRect) const +void kpTempPixmap::paint (TQPixmap *destPixmap, const TQRect &docRect) const { #define PARAMS destPixmap, m_topLeft - docRect.topLeft (), m_pixmap switch (m_renderMode) diff --git a/kolourpaint/kptemppixmap.h b/kolourpaint/kptemppixmap.h index 6ddb9413..2bd9d7bc 100644 --- a/kolourpaint/kptemppixmap.h +++ b/kolourpaint/kptemppixmap.h @@ -32,8 +32,8 @@ #define __kp_temp_pixmap_h__ -#include <qpoint.h> -#include <qpixmap.h> +#include <tqpoint.h> +#include <tqpixmap.h> class kpViewManager; @@ -53,18 +53,18 @@ public: * not the mouse cursor is inside a view. If false, the * pixmap is always displayed. */ - kpTempPixmap (bool isBrush, RenderMode renderMode, const QPoint &topLeft, const QPixmap &pixmap); + kpTempPixmap (bool isBrush, RenderMode renderMode, const TQPoint &topLeft, const TQPixmap &pixmap); kpTempPixmap (const kpTempPixmap &rhs); kpTempPixmap &operator= (const kpTempPixmap &rhs); ~kpTempPixmap (); bool isBrush () const; RenderMode renderMode () const; - QPoint topLeft () const; - QPixmap pixmap () const; + TQPoint topLeft () const; + TQPixmap pixmap () const; bool isVisible (const kpViewManager *vm) const; - QRect rect () const; + TQRect rect () const; int width () const; int height () const; @@ -77,13 +77,13 @@ public: * the unzoomed <docRect> of the kpDocument. You should check for * visibility before calling this function. */ - void paint (QPixmap *destPixmap, const QRect &docRect) const; + void paint (TQPixmap *destPixmap, const TQRect &docRect) const; private: bool m_isBrush; RenderMode m_renderMode; - QPoint m_topLeft; - QPixmap m_pixmap; + TQPoint m_topLeft; + TQPixmap m_pixmap; }; diff --git a/kolourpaint/kptextstyle.cpp b/kolourpaint/kptextstyle.cpp index 9f4d8fce..61f58dab 100644 --- a/kolourpaint/kptextstyle.cpp +++ b/kolourpaint/kptextstyle.cpp @@ -28,9 +28,9 @@ #include <kptextstyle.h> -#include <qdatastream.h> -#include <qfont.h> -#include <qfontmetrics.h> +#include <tqdatastream.h> +#include <tqfont.h> +#include <tqfontmetrics.h> kpTextStyle::kpTextStyle () @@ -41,7 +41,7 @@ kpTextStyle::kpTextStyle () { } -kpTextStyle::kpTextStyle (const QString &fontFamily, +kpTextStyle::kpTextStyle (const TQString &fontFamily, int fontSize, bool isBold, bool isItalic, bool isUnderline, bool isStrikeThru, @@ -62,7 +62,7 @@ kpTextStyle::~kpTextStyle () // friend -QDataStream &operator<< (QDataStream &stream, const kpTextStyle &textStyle) +TQDataStream &operator<< (TQDataStream &stream, const kpTextStyle &textStyle) { stream << textStyle.m_fontFamily; stream << textStyle.m_fontSize; @@ -78,7 +78,7 @@ QDataStream &operator<< (QDataStream &stream, const kpTextStyle &textStyle) } // friend -QDataStream &operator>> (QDataStream &stream, kpTextStyle &textStyle) +TQDataStream &operator>> (TQDataStream &stream, kpTextStyle &textStyle) { stream >> textStyle.m_fontFamily; stream >> textStyle.m_fontSize; @@ -121,13 +121,13 @@ bool kpTextStyle::operator!= (const kpTextStyle &rhs) const // public -QString kpTextStyle::fontFamily () const +TQString kpTextStyle::fontFamily () const { return m_fontFamily; } // public -void kpTextStyle::setFontFamily (const QString &f) +void kpTextStyle::setFontFamily (const TQString &f) { m_fontFamily = f; } @@ -261,9 +261,9 @@ kpColor kpTextStyle::effectiveBackgroundColor () const // public -QFont kpTextStyle::font () const +TQFont kpTextStyle::font () const { - QFont fnt (m_fontFamily, m_fontSize); + TQFont fnt (m_fontFamily, m_fontSize); fnt.setBold (m_isBold); fnt.setItalic (m_isItalic); fnt.setUnderline (m_isUnderline); @@ -273,7 +273,7 @@ QFont kpTextStyle::font () const } // public -QFontMetrics kpTextStyle::fontMetrics () const +TQFontMetrics kpTextStyle::fontMetrics () const { - return QFontMetrics (font ()); + return TQFontMetrics (font ()); } diff --git a/kolourpaint/kptextstyle.h b/kolourpaint/kptextstyle.h index 9356ce2c..c55fc97d 100644 --- a/kolourpaint/kptextstyle.h +++ b/kolourpaint/kptextstyle.h @@ -28,19 +28,19 @@ #ifndef __kp_text_style_h__ #define __kp_text_style_h__ -#include <qstring.h> +#include <tqstring.h> #include <kpcolor.h> -class QDataStream; -class QFont; -class QFontMetrics; +class TQDataStream; +class TQFont; +class TQFontMetrics; class kpTextStyle { public: kpTextStyle (); - kpTextStyle (const QString &fontFamily, + kpTextStyle (const TQString &fontFamily, int fontSize, bool isBold, bool isItalic, bool isUnderline, bool isStrikeThru, @@ -50,14 +50,14 @@ public: ~kpTextStyle (); - friend QDataStream &operator<< (QDataStream &stream, const kpTextStyle &textStyle); - friend QDataStream &operator>> (QDataStream &stream, kpTextStyle &textStyle); + friend TQDataStream &operator<< (TQDataStream &stream, const kpTextStyle &textStyle); + friend TQDataStream &operator>> (TQDataStream &stream, kpTextStyle &textStyle); bool operator== (const kpTextStyle &rhs) const; bool operator!= (const kpTextStyle &rhs) const; - QString fontFamily () const; - void setFontFamily (const QString &f); + TQString fontFamily () const; + void setFontFamily (const TQString &f); int fontSize () const; void setFontSize (int s); @@ -94,11 +94,11 @@ public: // Else, returns kpColor::transparent. kpColor effectiveBackgroundColor () const; - QFont font () const; - QFontMetrics fontMetrics () const; + TQFont font () const; + TQFontMetrics fontMetrics () const; private: - QString m_fontFamily; + TQString m_fontFamily; int m_fontSize; bool m_isBold, m_isItalic, m_isUnderline, m_isStrikeThru; kpColor m_foregroundColor, m_backgroundColor; diff --git a/kolourpaint/kpthumbnail.cpp b/kolourpaint/kpthumbnail.cpp index a45164ac..5c57b12d 100644 --- a/kolourpaint/kpthumbnail.cpp +++ b/kolourpaint/kpthumbnail.cpp @@ -30,9 +30,9 @@ #include <kpthumbnail.h> -#include <qdockarea.h> -#include <qdockwindow.h> -#include <qtimer.h> +#include <tqdockarea.h> +#include <tqdockwindow.h> +#include <tqtimer.h> #include <kdebug.h> #include <klocale.h> @@ -47,10 +47,10 @@ // TODO: get out of the Alt+Tab list kpThumbnail::kpThumbnail (kpMainWindow *parent, const char *name) #if KP_IS_QT_3_3 - : QDockWindow (QDockWindow::OutsideDock, parent, name), + : TQDockWindow (TQDockWindow::OutsideDock, parent, name), #else // With Qt <3.3, OutsideDock requires parent = 0, // sync: make sure outside of dock - : QDockWindow (QDockWindow::InDock, parent, name), + : TQDockWindow (TQDockWindow::InDock, parent, name), #warning "Using Qt <3.3: the thumbnail will flicker more when appearing" #endif m_mainWindow (parent), @@ -81,22 +81,22 @@ kpThumbnail::kpThumbnail (kpMainWindow *parent, const char *name) } - QSize layoutMinimumSize = layout () ? layout ()->minimumSize () : QSize (); + TQSize layoutMinimumSize = layout () ? layout ()->minimumSize () : TQSize (); #if DEBUG_KP_THUMBNAIL kdDebug () << "\tlayout=" << layout () - << " minSize=" << (layout () ? layout ()->minimumSize () : QSize ()) << endl; + << " minSize=" << (layout () ? layout ()->minimumSize () : TQSize ()) << endl; kdDebug () << "\tboxLayout=" << boxLayout () - << " minSize=" << (boxLayout () ? boxLayout ()->minimumSize () : QSize ()) + << " minSize=" << (boxLayout () ? boxLayout ()->minimumSize () : TQSize ()) << endl; #endif if (layout ()) - layout ()->setResizeMode (QLayout::FreeResize); + layout ()->setResizeMode (TQLayout::FreeResize); setMinimumSize (QMAX (layoutMinimumSize.width (), 64), QMAX (layoutMinimumSize.height (), 64)); // Enable "X" Close Button - setCloseMode (QDockWindow::Always); + setCloseMode (TQDockWindow::Always); setResizeEnabled (true); @@ -127,10 +127,10 @@ void kpThumbnail::setView (kpThumbnailView *view) if (m_view) { - disconnect (m_view, SIGNAL (destroyed ()), - this, SLOT (slotViewDestroyed ())); - disconnect (m_view, SIGNAL (zoomLevelChanged (int, int)), - this, SLOT (updateCaption ())); + disconnect (m_view, TQT_SIGNAL (destroyed ()), + this, TQT_SLOT (slotViewDestroyed ())); + disconnect (m_view, TQT_SIGNAL (zoomLevelChanged (int, int)), + this, TQT_SLOT (updateCaption ())); boxLayout ()->remove (m_view); } @@ -139,10 +139,10 @@ void kpThumbnail::setView (kpThumbnailView *view) if (m_view) { - connect (m_view, SIGNAL (destroyed ()), - this, SLOT (slotViewDestroyed ())); - connect (m_view, SIGNAL (zoomLevelChanged (int, int)), - this, SLOT (updateCaption ())); + connect (m_view, TQT_SIGNAL (destroyed ()), + this, TQT_SLOT (slotViewDestroyed ())); + connect (m_view, TQT_SIGNAL (zoomLevelChanged (int, int)), + this, TQT_SLOT (updateCaption ())); updateCaption (); boxLayout ()->addWidget (m_view); @@ -182,14 +182,14 @@ void kpThumbnail::slotViewDestroyed () // protected virtual [base QWidget] -void kpThumbnail::resizeEvent (QResizeEvent *e) +void kpThumbnail::resizeEvent (TQResizeEvent *e) { #if DEBUG_KP_THUMBNAIL kdDebug () << "kpThumbnail::resizeEvent(" << width () << "," << height () << ")" << endl; #endif - QDockWindow::resizeEvent (e); + TQDockWindow::resizeEvent (e); // updateVariableZoom (); TODO: is below a good idea since this commented out @@ -203,7 +203,7 @@ void kpThumbnail::resizeEvent (QResizeEvent *e) } // protected virtual [base QWidget] -void kpThumbnail::moveEvent (QMoveEvent * /*e*/) +void kpThumbnail::moveEvent (TQMoveEvent * /*e*/) { if (m_mainWindow) m_mainWindow->notifyThumbnailGeometryChanged (); diff --git a/kolourpaint/kpthumbnail.h b/kolourpaint/kpthumbnail.h index 183dc2f1..9ed738dc 100644 --- a/kolourpaint/kpthumbnail.h +++ b/kolourpaint/kpthumbnail.h @@ -29,7 +29,7 @@ #ifndef __kp_thumbnail_h__ #define __kp_thumbnail_h__ -#include <qdockwindow.h> +#include <tqdockwindow.h> class kpMainWindow; class kpThumbnailView; @@ -56,8 +56,8 @@ protected slots: void slotViewDestroyed (); protected: - virtual void resizeEvent (QResizeEvent *e); - virtual void moveEvent (QMoveEvent *e); + virtual void resizeEvent (TQResizeEvent *e); + virtual void moveEvent (TQMoveEvent *e); private: kpMainWindow *m_mainWindow; diff --git a/kolourpaint/kptool.cpp b/kolourpaint/kptool.cpp index 8d337c5b..3d016fdb 100644 --- a/kolourpaint/kptool.cpp +++ b/kolourpaint/kptool.cpp @@ -33,13 +33,13 @@ #include <limits.h> -#include <qapplication.h> -#include <qclipboard.h> -#include <qcursor.h> -#include <qevent.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qpixmap.h> +#include <tqapplication.h> +#include <tqclipboard.h> +#include <tqcursor.h> +#include <tqevent.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqpixmap.h> #include <kapplication.h> #include <kdebug.h> @@ -68,7 +68,7 @@ struct kpToolPrivate }; -kpTool::kpTool (const QString &text, const QString &description, +kpTool::kpTool (const TQString &text, const TQString &description, int key, kpMainWindow *mainWindow, const char *name) { @@ -94,7 +94,7 @@ kpTool::~kpTool () // private -void kpTool::init (const QString &text, const QString &description, +void kpTool::init (const TQString &text, const TQString &description, int key, kpMainWindow *mainWindow, const char *name) { @@ -151,31 +151,31 @@ void kpTool::createAction () m_action = new kpToolAction (text (), iconName (), shortcutForKey (m_key), - this, SLOT (slotActionActivated ()), + this, TQT_SLOT (slotActionActivated ()), m_mainWindow->actionCollection (), name ()); - m_action->setExclusiveGroup (QString::fromLatin1 ("Tool Box Actions")); + m_action->setExclusiveGroup (TQString::fromLatin1 ("Tool Box Actions")); m_action->setWhatsThis (description ()); - connect (m_action, SIGNAL (toolTipChanged (const QString &)), - this, SLOT (slotActionToolTipChanged (const QString &))); + connect (m_action, TQT_SIGNAL (toolTipChanged (const TQString &)), + this, TQT_SLOT (slotActionToolTipChanged (const TQString &))); } // protected slot -void kpTool::slotActionToolTipChanged (const QString &string) +void kpTool::slotActionToolTipChanged (const TQString &string) { emit actionToolTipChanged (string); } // public -QString kpTool::text () const +TQString kpTool::text () const { return m_text; } // public -void kpTool::setText (const QString &text) +void kpTool::setText (const TQString &text) { m_text = text; @@ -187,7 +187,7 @@ void kpTool::setText (const QString &text) // public static -QString kpTool::toolTipForTextAndShortcut (const QString &text, +TQString kpTool::toolTipForTextAndShortcut (const TQString &text, const KShortcut &shortcut) { for (int i = 0; i < (int) shortcut.count (); i++) @@ -205,7 +205,7 @@ QString kpTool::toolTipForTextAndShortcut (const QString &text, } // public static -QString kpTool::toolTip () const +TQString kpTool::toolTip () const { return toolTipForTextAndShortcut (text (), shortcut ()); } @@ -255,7 +255,7 @@ KShortcut kpTool::shortcut () const // public static bool kpTool::keyIsText (int key) { - // TODO: should work like !QKeyEvent::text().isEmpty() + // TODO: should work like !TQKeyEvent::text().isEmpty() return !(key & (Qt::MODIFIER_MASK ^ Qt::SHIFT)); } @@ -332,13 +332,13 @@ void kpTool::enableSingleKeyTriggers (bool enable) // public -QString kpTool::description () const +TQString kpTool::description () const { return m_description; } // public -void kpTool::setDescription (const QString &description) +void kpTool::setDescription (const TQString &description) { m_description = description; @@ -357,7 +357,7 @@ const char *kpTool::name () const // static -QRect kpTool::neededRect (const QRect &rect, int lineWidth) +TQRect kpTool::neededRect (const TQRect &rect, int lineWidth) { int x1, y1, x2, y2; rect.coords (&x1, &y1, &x2, &y2); @@ -365,12 +365,12 @@ QRect kpTool::neededRect (const QRect &rect, int lineWidth) if (lineWidth < 1) lineWidth = 1; - return QRect (QPoint (x1 - lineWidth + 1, y1 - lineWidth + 1), - QPoint (x2 + lineWidth - 1, y2 + lineWidth - 1)); + return TQRect (TQPoint (x1 - lineWidth + 1, y1 - lineWidth + 1), + TQPoint (x2 + lineWidth - 1, y2 + lineWidth - 1)); } // static -QPixmap kpTool::neededPixmap (const QPixmap &pixmap, const QRect &boundingRect) +TQPixmap kpTool::neededPixmap (const TQPixmap &pixmap, const TQRect &boundingRect) { return kpPixmapFX::getPixmapAt (pixmap, boundingRect); } @@ -383,7 +383,7 @@ bool kpTool::hasCurrentPoint () const } // public -QPoint kpTool::currentPoint (bool zoomToDoc) const +TQPoint kpTool::currentPoint (bool zoomToDoc) const { #if DEBUG_KP_TOOL && 0 kdDebug () << "kpTool::currentPoint(zoomToDoc=" << zoomToDoc << ")" << endl; @@ -408,8 +408,8 @@ QPoint kpTool::currentPoint (bool zoomToDoc) const } - const QPoint globalPos = QCursor::pos (); - const QPoint viewPos = v->mapFromGlobal (globalPos); + const TQPoint globalPos = TQCursor::pos (); + const TQPoint viewPos = v->mapFromGlobal (globalPos); #if DEBUG_KP_TOOL && 0 kdDebug () << "\tglobalPos=" << globalPos << " viewPos=" << viewPos @@ -419,7 +419,7 @@ QPoint kpTool::currentPoint (bool zoomToDoc) const return viewPos; - const QPoint docPos = v->transformViewToDoc (viewPos); + const TQPoint docPos = v->transformViewToDoc (viewPos); #if DEBUG_KP_TOOL && 0 kdDebug () << "\tdocPos=" << docPos << endl; #endif @@ -436,8 +436,8 @@ void kpTool::somethingBelowTheCursorChanged () // private // TODO: don't dup code from mouseMoveEvent() -void kpTool::somethingBelowTheCursorChanged (const QPoint ¤tPoint_, - const QPoint ¤tViewPoint_) +void kpTool::somethingBelowTheCursorChanged (const TQPoint ¤tPoint_, + const TQPoint ¤tViewPoint_) { #if DEBUG_KP_TOOL && 0 kdDebug () << "kpTool::somethingBelowTheCursorChanged(docPoint=" @@ -460,7 +460,7 @@ void kpTool::somethingBelowTheCursorChanged (const QPoint ¤tPoint_, { if (m_currentPoint != KP_INVALID_POINT) { - draw (m_currentPoint, m_lastPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + draw (m_currentPoint, m_lastPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); m_lastPoint = m_currentPoint; } } @@ -516,7 +516,7 @@ void kpTool::endInternal () { // before we can stop using the tool, we must stop the current drawing operation (if any) if (hasBegunShape ()) - endShapeInternal (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + endShapeInternal (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); // call user virtual func end (); @@ -576,7 +576,7 @@ void kpTool::beginDraw () } // virtual -void kpTool::hover (const QPoint &point) +void kpTool::hover (const TQPoint &point) { #if DEBUG_KP_TOOL kdDebug () << "kpTool::hover" << point @@ -602,7 +602,7 @@ void kpTool::reselect () // public -QIconSet kpTool::iconSet (int forceSize) const +TQIconSet kpTool::iconSet (int forceSize) const { #if DEBUG_KP_TOOL && 0 kdDebug () << "kpTool(" << name () << ")::iconSet(forceSize=" << forceSize << ")" << endl; @@ -615,7 +615,7 @@ QIconSet kpTool::iconSet (int forceSize) const } // public -QString kpTool::iconName () const +TQString kpTool::iconName () const { return name (); } @@ -638,7 +638,7 @@ void kpTool::slotActionActivated () // virtual -void kpTool::draw (const QPoint &, const QPoint &, const QRect &) +void kpTool::draw (const TQPoint &, const TQPoint &, const TQRect &) { } @@ -687,7 +687,7 @@ void kpTool::releasedAllButtons () { } -void kpTool::endDrawInternal (const QPoint &thisPoint, const QRect &normalizedRect, +void kpTool::endDrawInternal (const TQPoint &thisPoint, const TQRect &normalizedRect, bool wantEndShape) { #if DEBUG_KP_TOOL && 1 @@ -742,13 +742,13 @@ void kpTool::endDrawInternal (const QPoint &thisPoint, const QRect &normalizedRe } // private -void kpTool::endShapeInternal (const QPoint &thisPoint, const QRect &normalizedRect) +void kpTool::endShapeInternal (const TQPoint &thisPoint, const TQRect &normalizedRect) { endDrawInternal (thisPoint, normalizedRect, true/*end shape*/); } // virtual -void kpTool::endDraw (const QPoint &, const QRect &) +void kpTool::endDraw (const TQPoint &, const TQRect &) { } @@ -904,7 +904,7 @@ void kpTool::slotColorSimilarityChangedInternal (double similarity, int processe bool kpTool::currentPointNextToLast () const { - if (m_lastPoint == QPoint (-1, -1)) + if (m_lastPoint == TQPoint (-1, -1)) return true; int dx = kAbs (m_currentPoint.x () - m_lastPoint.x ()); @@ -915,7 +915,7 @@ bool kpTool::currentPointNextToLast () const bool kpTool::currentPointCardinallyNextToLast () const { - if (m_lastPoint == QPoint (-1, -1)) + if (m_lastPoint == TQPoint (-1, -1)) return true; int dx = kAbs (m_currentPoint.x () - m_lastPoint.x ()); @@ -929,7 +929,7 @@ kpCommandHistory *kpTool::commandHistory () const return m_mainWindow ? m_mainWindow->commandHistory () : 0; } -void kpTool::mousePressEvent (QMouseEvent *e) +void kpTool::mousePressEvent (TQMouseEvent *e) { #if DEBUG_KP_TOOL && 1 kdDebug () << "kpTool::mousePressEvent pos=" << e->pos () @@ -944,7 +944,7 @@ void kpTool::mousePressEvent (QMouseEvent *e) if (m_mainWindow && e->button () == Qt::MidButton) { - const QString text = QApplication::clipboard ()->text (QClipboard::Selection); + const TQString text = TQApplication::clipboard ()->text (QClipboard::Selection); #if DEBUG_KP_TOOL && 1 kdDebug () << "\tMMB pasteText='" << text << "'" << endl; #endif @@ -956,7 +956,7 @@ void kpTool::mousePressEvent (QMouseEvent *e) kdDebug () << "\t\thasBegunShape - end" << endl; #endif endShapeInternal (m_currentPoint, - QRect (m_startPoint, m_currentPoint).normalize ()); + TQRect (m_startPoint, m_currentPoint).normalize ()); } if (viewUnderCursor ()) @@ -994,8 +994,8 @@ void kpTool::mousePressEvent (QMouseEvent *e) // if we get a mousePressEvent when we're drawing, then the other // mouse button must have been pressed - m_currentPoint = view ? view->transformViewToDoc (e->pos ()) : QPoint (-1, -1); - m_currentViewPoint = view ? e->pos () : QPoint (-1, -1); + m_currentPoint = view ? view->transformViewToDoc (e->pos ()) : TQPoint (-1, -1); + m_currentViewPoint = view ? e->pos () : TQPoint (-1, -1); cancelShapeInternal (); } @@ -1019,10 +1019,10 @@ void kpTool::mousePressEvent (QMouseEvent *e) m_shiftPressed = (buttonState & Qt::ShiftButton); m_controlPressed = (buttonState & Qt::ControlButton); m_altPressed = (buttonState & Qt::AltButton); - m_startPoint = m_currentPoint = view ? view->transformViewToDoc (e->pos ()) : QPoint (-1, -1); - m_currentViewPoint = view ? e->pos () : QPoint (-1, -1); + m_startPoint = m_currentPoint = view ? view->transformViewToDoc (e->pos ()) : TQPoint (-1, -1); + m_currentViewPoint = view ? e->pos () : TQPoint (-1, -1); m_viewUnderStartPoint = view; - m_lastPoint = QPoint (-1, -1); + m_lastPoint = TQPoint (-1, -1); #if DEBUG_KP_TOOL && 1 kdDebug () << "\tBeginning draw @ " << m_currentPoint << endl; @@ -1030,11 +1030,11 @@ void kpTool::mousePressEvent (QMouseEvent *e) beginDrawInternal (); - draw (m_currentPoint, m_lastPoint, QRect (m_currentPoint, m_currentPoint)); + draw (m_currentPoint, m_lastPoint, TQRect (m_currentPoint, m_currentPoint)); m_lastPoint = m_currentPoint; } -void kpTool::mouseMoveEvent (QMouseEvent *e) +void kpTool::mouseMoveEvent (TQMouseEvent *e) { #if DEBUG_KP_TOOL && 0 kdDebug () << "kpTool::mouseMoveEvent pos=" << e->pos () @@ -1087,7 +1087,7 @@ void kpTool::mouseMoveEvent (QMouseEvent *e) viewManager ()->setFastUpdates (); } - draw (m_currentPoint, m_lastPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + draw (m_currentPoint, m_lastPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); if (dragScrolled) viewManager ()->restoreFastUpdates (); @@ -1110,7 +1110,7 @@ void kpTool::mouseMoveEvent (QMouseEvent *e) } } -void kpTool::mouseReleaseEvent (QMouseEvent *e) +void kpTool::mouseReleaseEvent (TQMouseEvent *e) { #if DEBUG_KP_TOOL && 1 kdDebug () << "kpTool::mouseReleaseEvent pos=" << e->pos () @@ -1128,9 +1128,9 @@ void kpTool::mouseReleaseEvent (QMouseEvent *e) return; } - m_currentPoint = view ? view->transformViewToDoc (e->pos ()) : QPoint (-1, -1); - m_currentViewPoint = view ? e->pos () : QPoint (-1, -1); - endDrawInternal (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + m_currentPoint = view ? view->transformViewToDoc (e->pos ()) : TQPoint (-1, -1); + m_currentViewPoint = view ? e->pos () : TQPoint (-1, -1); + endDrawInternal (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); } if ((e->stateAfter () & Qt::MouseButtonMask) == 0) @@ -1139,7 +1139,7 @@ void kpTool::mouseReleaseEvent (QMouseEvent *e) } } -void kpTool::wheelEvent (QWheelEvent *e) +void kpTool::wheelEvent (TQWheelEvent *e) { #if DEBUG_KP_TOOL kdDebug () << "kpTool::wheelEvent() state=" << e->state () @@ -1183,7 +1183,7 @@ void kpTool::wheelEvent (QWheelEvent *e) } -void kpTool::keyPressEvent (QKeyEvent *e) +void kpTool::keyPressEvent (TQKeyEvent *e) { #if DEBUG_KP_TOOL && 0 kdDebug () << "kpTool::keyPressEvent() e->key=" << e->key () << endl; @@ -1214,7 +1214,7 @@ void kpTool::keyPressEvent (QKeyEvent *e) break; /* - * QCursor::setPos conveniently causes mouseMoveEvents :) + * TQCursor::setPos conveniently causes mouseMoveEvents :) */ case Qt::Key_Home: dx = -1, dy = -1; break; @@ -1237,8 +1237,8 @@ void kpTool::keyPressEvent (QKeyEvent *e) if (view) { // TODO: what about the modifiers - QMouseEvent me (QEvent::MouseButtonPress, - view->mapFromGlobal (QCursor::pos ()), + TQMouseEvent me (TQEvent::MouseButtonPress, + view->mapFromGlobal (TQCursor::pos ()), Qt::LeftButton, 0); mousePressEvent (&me); @@ -1251,7 +1251,7 @@ void kpTool::keyPressEvent (QKeyEvent *e) kpView *view = viewUnderCursor (); if (view && (dx || dy)) { - QPoint oldPoint = view->mapFromGlobal (QCursor::pos ()); + TQPoint oldPoint = view->mapFromGlobal (TQCursor::pos ()); #if DEBUG_KP_TOOL && 0 kdDebug () << "\toldPoint=" << oldPoint << " dx=" << dx << " dy=" << dy << endl; @@ -1266,17 +1266,17 @@ void kpTool::keyPressEvent (QKeyEvent *e) #if DEBUG_KP_TOOL && 0 - kdDebug () << "\tnewPoint=" << QPoint (newViewX, newViewY) << endl; + kdDebug () << "\tnewPoint=" << TQPoint (newViewX, newViewY) << endl; #endif - if (view->transformViewToDoc (QPoint (newViewX, newViewY)) == + if (view->transformViewToDoc (TQPoint (newViewX, newViewY)) == view->transformViewToDoc (oldPoint)) { newViewX += viewIncX, newViewY += viewIncY; #if DEBUG_KP_TOOL && 0 kdDebug () << "\tneed adjust for doc - newPoint=" - << QPoint (newViewX, newViewY) << endl; + << TQPoint (newViewX, newViewY) << endl; #endif } @@ -1285,12 +1285,12 @@ void kpTool::keyPressEvent (QKeyEvent *e) int x = QMIN (QMAX (newViewX, 0), view->width () - 1); int y = QMIN (QMAX (newViewY, 0), view->height () - 1); - QCursor::setPos (view->mapToGlobal (QPoint (x, y))); + TQCursor::setPos (view->mapToGlobal (TQPoint (x, y))); e->accept (); } } -void kpTool::keyReleaseEvent (QKeyEvent *e) +void kpTool::keyReleaseEvent (TQKeyEvent *e) { #if DEBUG_KP_TOOL && 0 kdDebug () << "kpTool::keyReleaseEvent() e->key=" << e->key () << endl; @@ -1334,8 +1334,8 @@ void kpTool::keyReleaseEvent (QKeyEvent *e) kpView *view = viewUnderCursor (); if (view) { - QMouseEvent me (QEvent::MouseButtonRelease, - view->mapFromGlobal (QCursor::pos ()), + TQMouseEvent me (TQEvent::MouseButtonRelease, + view->mapFromGlobal (TQCursor::pos ()), Qt::LeftButton, Qt::LeftButton); mouseReleaseEvent (&me); @@ -1346,7 +1346,7 @@ void kpTool::keyReleaseEvent (QKeyEvent *e) } // private -void kpTool::keyUpdateModifierState (QKeyEvent *e) +void kpTool::keyUpdateModifierState (TQKeyEvent *e) { #if DEBUG_KP_TOOL && 0 kdDebug () << "kpTool::updateModifierState() e->key=" << e->key () << endl; @@ -1389,7 +1389,7 @@ void kpTool::notifyModifierStateChanged () if (careAboutModifierState ()) { if (m_beganDraw) - draw (m_currentPoint, m_lastPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + draw (m_currentPoint, m_lastPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); else { m_currentPoint = currentPoint (); @@ -1429,28 +1429,28 @@ void kpTool::setAltPressed (bool pressed) notifyModifierStateChanged (); } -void kpTool::focusInEvent (QFocusEvent *) +void kpTool::focusInEvent (TQFocusEvent *) { } -void kpTool::focusOutEvent (QFocusEvent *) +void kpTool::focusOutEvent (TQFocusEvent *) { #if DEBUG_KP_TOOL && 0 kdDebug () << "kpTool::focusOutEvent() beganDraw=" << m_beganDraw << endl; #endif if (m_beganDraw) - endDrawInternal (m_currentPoint, QRect (m_startPoint, m_currentPoint).normalize ()); + endDrawInternal (m_currentPoint, TQRect (m_startPoint, m_currentPoint).normalize ()); } -void kpTool::enterEvent (QEvent *) +void kpTool::enterEvent (TQEvent *) { #if DEBUG_KP_TOOL && 1 kdDebug () << "kpTool::enterEvent() beganDraw=" << m_beganDraw << endl; #endif } -void kpTool::leaveEvent (QEvent *) +void kpTool::leaveEvent (TQEvent *) { #if DEBUG_KP_TOOL && 1 kdDebug () << "kpTool::leaveEvent() beganDraw=" << m_beganDraw << endl; @@ -1492,7 +1492,7 @@ int kpTool::mouseButton (const Qt::ButtonState &buttonState) // public static -QString kpTool::cancelUserMessage (int mouseButton) +TQString kpTool::cancelUserMessage (int mouseButton) { if (mouseButton == 0) return i18n ("Right click to cancel."); @@ -1501,20 +1501,20 @@ QString kpTool::cancelUserMessage (int mouseButton) } // public -QString kpTool::cancelUserMessage () const +TQString kpTool::cancelUserMessage () const { return cancelUserMessage (m_mouseButton); } // public -QString kpTool::userMessage () const +TQString kpTool::userMessage () const { return m_userMessage; } // public -void kpTool::setUserMessage (const QString &userMessage) +void kpTool::setUserMessage (const TQString &userMessage) { m_userMessage = userMessage; @@ -1528,13 +1528,13 @@ void kpTool::setUserMessage (const QString &userMessage) // public -QPoint kpTool::userShapeStartPoint () const +TQPoint kpTool::userShapeStartPoint () const { return m_userShapeStartPoint; } // public -QPoint kpTool::userShapeEndPoint () const +TQPoint kpTool::userShapeEndPoint () const { return m_userShapeEndPoint; } @@ -1553,8 +1553,8 @@ int kpTool::calculateLength (int start, int end) } // public -void kpTool::setUserShapePoints (const QPoint &startPoint, - const QPoint &endPoint, +void kpTool::setUserShapePoints (const TQPoint &startPoint, + const TQPoint &endPoint, bool setSize) { m_userShapeStartPoint = startPoint; @@ -1578,7 +1578,7 @@ void kpTool::setUserShapePoints (const QPoint &startPoint, // public -QSize kpTool::userShapeSize () const +TQSize kpTool::userShapeSize () const { return m_userShapeSize; } @@ -1596,7 +1596,7 @@ int kpTool::userShapeHeight () const } // public -void kpTool::setUserShapeSize (const QSize &size) +void kpTool::setUserShapeSize (const TQSize &size) { m_userShapeSize = size; @@ -1608,17 +1608,17 @@ void kpTool::setUserShapeSize (const QSize &size) // public void kpTool::setUserShapeSize (int width, int height) { - setUserShapeSize (QSize (width, height)); + setUserShapeSize (TQSize (width, height)); } // public static bool kpTool::warnIfBigImageSize (int oldWidth, int oldHeight, int newWidth, int newHeight, - const QString &text, - const QString &caption, - const QString &continueButtonText, - QWidget *parent) + const TQString &text, + const TQString &caption, + const TQString &continueButtonText, + TQWidget *parent) { #if DEBUG_KP_TOOL kdDebug () << "kpTool::warnIfBigImageSize()" @@ -1627,7 +1627,7 @@ bool kpTool::warnIfBigImageSize (int oldWidth, int oldHeight, << " pixmapSize=" << kpPixmapFX::pixmapSize (newWidth, newHeight, - QPixmap::defaultDepth ()) + TQPixmap::defaultDepth ()) << " vs BigImageSize=" << KP_BIG_IMAGE_SIZE << endl; #endif @@ -1639,20 +1639,20 @@ bool kpTool::warnIfBigImageSize (int oldWidth, int oldHeight, } // Was already large - user was warned before, don't annoy him/her again - if (kpPixmapFX::pixmapSize (oldWidth, oldHeight, QPixmap::defaultDepth ()) >= + if (kpPixmapFX::pixmapSize (oldWidth, oldHeight, TQPixmap::defaultDepth ()) >= KP_BIG_IMAGE_SIZE) { return true; } - if (kpPixmapFX::pixmapSize (newWidth, newHeight, QPixmap::defaultDepth ()) >= + if (kpPixmapFX::pixmapSize (newWidth, newHeight, TQPixmap::defaultDepth ()) >= KP_BIG_IMAGE_SIZE) { int accept = KMessageBox::warningContinueCancel (parent, text, caption, continueButtonText, - QString::fromLatin1 ("BigImageDontAskAgain")); + TQString::fromLatin1 ("BigImageDontAskAgain")); return (accept == KMessageBox::Continue); } diff --git a/kolourpaint/kptool.h b/kolourpaint/kptool.h index ba7ee75e..a0309463 100644 --- a/kolourpaint/kptool.h +++ b/kolourpaint/kptool.h @@ -28,17 +28,17 @@ #ifndef __kp_tool_h__ #define __kp_tool_h__ -#include <qobject.h> -#include <qpoint.h> -#include <qrect.h> -#include <qsize.h> -#include <qstring.h> +#include <tqobject.h> +#include <tqpoint.h> +#include <tqrect.h> +#include <tqsize.h> +#include <tqstring.h> #include <kpdefs.h> -class QIconSet; -class QPixmap; +class TQIconSet; +class TQPixmap; class KKeySequence; class KShortcut; @@ -60,13 +60,13 @@ class kpTool : public QObject Q_OBJECT public: - kpTool (const QString &text, const QString &description, + kpTool (const TQString &text, const TQString &description, int key, kpMainWindow *mainWindow, const char *name); virtual ~kpTool (); private: - void init (const QString &text, const QString &description, + void init (const TQString &text, const TQString &description, int key, kpMainWindow *mainWindow, const char *name); @@ -78,21 +78,21 @@ protected: kpToolAction *m_action; signals: - void actionToolTipChanged (const QString &string); + void actionToolTipChanged (const TQString &string); protected slots: - void slotActionToolTipChanged (const QString &string); + void slotActionToolTipChanged (const TQString &string); public: - QString text () const; - void setText (const QString &text); + TQString text () const; + void setText (const TQString &text); - static QString toolTipForTextAndShortcut (const QString &text, + static TQString toolTipForTextAndShortcut (const TQString &text, const KShortcut &shortcut); - QString toolTip () const; + TQString toolTip () const; - QString description () const; - void setDescription (const QString &description); + TQString description () const; + void setDescription (const TQString &description); int key () const; void setKey (int key); @@ -114,8 +114,8 @@ public: const char *name () const; - static QRect neededRect (const QRect &rect, int lineWidth); - static QPixmap neededPixmap (const QPixmap &pixmap, const QRect &boundingRect); + static TQRect neededRect (const TQRect &rect, int lineWidth); + static TQPixmap neededPixmap (const TQPixmap &pixmap, const TQRect &boundingRect); bool hasCurrentPoint () const; // Returns the position of the cursor relative to the topleft point of @@ -134,7 +134,7 @@ public: // // Keep in mind that if viewUnderStartPoint(), this can return coordinates // outside of the document/view. - QPoint currentPoint (bool zoomToDoc = true) const; + TQPoint currentPoint (bool zoomToDoc = true) const; public slots: // Call this when something below the mouse cursor may have changed @@ -151,8 +151,8 @@ public slots: private: // Same as above except that you claim you know better than currentPoint() - void somethingBelowTheCursorChanged (const QPoint ¤tPoint_, - const QPoint ¤tViewPoint_); + void somethingBelowTheCursorChanged (const TQPoint ¤tPoint_, + const TQPoint ¤tViewPoint_); public: // called when the tool is selected @@ -177,25 +177,25 @@ public: signals: // emitted after beginDraw() has been called - void beganDraw (const QPoint &point); + void beganDraw (const TQPoint &point); // Emitted just before draw() is called in mouseMoveEvent(). Slots // connected to this signal should return in <scrolled> whether the // mouse pos may have changed. Used by drag scrolling. - void movedAndAboutToDraw (const QPoint ¤tPoint, const QPoint &lastPoint, + void movedAndAboutToDraw (const TQPoint ¤tPoint, const TQPoint &lastPoint, int zoomLevel, bool *scrolled); // emitted after endDraw() has been called - void endedDraw (const QPoint &point); + void endedDraw (const TQPoint &point); // emitted after cancelShape() has been called - void cancelledShape (const QPoint &point); + void cancelledShape (const TQPoint &point); public: - QIconSet iconSet (int forceSize = 0) const; - QString iconName () const; + TQIconSet iconSet (int forceSize = 0) const; + TQString iconName () const; kpToolAction *action (); signals: @@ -215,20 +215,20 @@ protected: // mouse move without button pressed // (only m_currentPoint & m_currentViewPoint is defined) - virtual void hover (const QPoint &point); + virtual void hover (const TQPoint &point); // this is useful for "instant" tools like the Pen & Eraser - virtual void draw (const QPoint &thisPoint, const QPoint &lastPoint, - const QRect &normalizedRect); + virtual void draw (const TQPoint &thisPoint, const TQPoint &lastPoint, + const TQRect &normalizedRect); // (m_mouseButton will not change from beginDraw()) virtual void cancelShape (); virtual void releasedAllButtons (); - virtual void endDraw (const QPoint &thisPoint, const QRect &normalizedRect); + virtual void endDraw (const TQPoint &thisPoint, const TQRect &normalizedRect); - virtual void endShape (const QPoint &thisPoint = QPoint (), - const QRect &normalizedRect = QRect ()) + virtual void endShape (const TQPoint &thisPoint = TQPoint (), + const TQRect &normalizedRect = TQRect ()) { endDraw (thisPoint, normalizedRect); } @@ -280,7 +280,7 @@ protected: int m_mouseButton; /* 0 = left, 1 = right */ bool m_shiftPressed, m_controlPressed, m_altPressed; // m_altPressed is unreliable bool m_beganDraw; // set after beginDraw() is called, unset before endDraw() is called - QPoint m_startPoint, + TQPoint m_startPoint, m_currentPoint, m_currentViewPoint, m_lastPoint; @@ -292,45 +292,45 @@ protected: void endInternal (); void beginDrawInternal (); - void endDrawInternal (const QPoint &thisPoint, const QRect &normalizedRect, + void endDrawInternal (const TQPoint &thisPoint, const TQRect &normalizedRect, bool wantEndShape = false); void cancelShapeInternal (); - void endShapeInternal (const QPoint &thisPoint = QPoint (), - const QRect &normalizedRect = QRect ()); + void endShapeInternal (const TQPoint &thisPoint = TQPoint (), + const TQRect &normalizedRect = TQRect ()); friend class kpView; // If you're reimplementing any of these, you probably don't know what // you're doing - reimplement begin(),beginDraw(),draw(),cancelShape(), // endDraw() etc. instead. - virtual void mousePressEvent (QMouseEvent *e); - virtual void mouseMoveEvent (QMouseEvent *e); - virtual void mouseReleaseEvent (QMouseEvent *e); - virtual void wheelEvent (QWheelEvent *e); + virtual void mousePressEvent (TQMouseEvent *e); + virtual void mouseMoveEvent (TQMouseEvent *e); + virtual void mouseReleaseEvent (TQMouseEvent *e); + virtual void wheelEvent (TQWheelEvent *e); - virtual void keyPressEvent (QKeyEvent *e); - virtual void keyReleaseEvent (QKeyEvent *e); + virtual void keyPressEvent (TQKeyEvent *e); + virtual void keyReleaseEvent (TQKeyEvent *e); - virtual void imStartEvent(QIMEvent *){} - virtual void imComposeEvent(QIMEvent *){} - virtual void imEndEvent(QIMEvent *){} + virtual void imStartEvent(TQIMEvent *){} + virtual void imComposeEvent(TQIMEvent *){} + virtual void imEndEvent(TQIMEvent *){} private: - void keyUpdateModifierState (QKeyEvent *e); + void keyUpdateModifierState (TQKeyEvent *e); void notifyModifierStateChanged (); protected: virtual void setShiftPressed (bool pressed); virtual void setControlPressed (bool pressed); virtual void setAltPressed (bool pressed); - virtual void focusInEvent (QFocusEvent *e); - virtual void focusOutEvent (QFocusEvent *e); - virtual void enterEvent (QEvent *e); - virtual void leaveEvent (QEvent *e); + virtual void focusInEvent (TQFocusEvent *e); + virtual void focusOutEvent (TQFocusEvent *e); + virtual void enterEvent (TQEvent *e); + virtual void leaveEvent (TQEvent *e); // 0 = left, 1 = right, -1 = other (none, left+right, mid) static int mouseButton (const Qt::ButtonState &buttonState); - QString m_text, m_description; + TQString m_text, m_description; const char *m_name; kpMainWindow *m_mainWindow; @@ -346,36 +346,36 @@ protected: public: // Returns "(Left|Right) click to cancel." where Left or Right is chosen // depending on which one is the _opposite_ of <mouseButton> - static QString cancelUserMessage (int mouseButton); - QString cancelUserMessage () const; + static TQString cancelUserMessage (int mouseButton); + TQString cancelUserMessage () const; - QString userMessage () const; - void setUserMessage (const QString &userMessage = QString::null); + TQString userMessage () const; + void setUserMessage (const TQString &userMessage = TQString::null); - QPoint userShapeStartPoint () const; - QPoint userShapeEndPoint () const; + TQPoint userShapeStartPoint () const; + TQPoint userShapeEndPoint () const; static int calculateLength (int start, int end); - void setUserShapePoints (const QPoint &startPoint = KP_INVALID_POINT, - const QPoint &endPoint = KP_INVALID_POINT, + void setUserShapePoints (const TQPoint &startPoint = KP_INVALID_POINT, + const TQPoint &endPoint = KP_INVALID_POINT, bool setSize = true); - QSize userShapeSize () const; + TQSize userShapeSize () const; int userShapeWidth () const; int userShapeHeight () const; - void setUserShapeSize (const QSize &size = KP_INVALID_SIZE); + void setUserShapeSize (const TQSize &size = KP_INVALID_SIZE); void setUserShapeSize (int width, int height); signals: - void userMessageChanged (const QString &userMessage); - void userShapePointsChanged (const QPoint &startPoint = KP_INVALID_POINT, - const QPoint &endPoint = KP_INVALID_POINT); - void userShapeSizeChanged (const QSize &size); + void userMessageChanged (const TQString &userMessage); + void userShapePointsChanged (const TQPoint &startPoint = KP_INVALID_POINT, + const TQPoint &endPoint = KP_INVALID_POINT); + void userShapeSizeChanged (const TQSize &size); void userShapeSizeChanged (int width, int height); protected: - QString m_userMessage; - QPoint m_userShapeStartPoint, m_userShapeEndPoint; - QSize m_userShapeSize; + TQString m_userMessage; + TQPoint m_userShapeStartPoint, m_userShapeEndPoint; + TQSize m_userShapeSize; public: @@ -406,10 +406,10 @@ public: // continueButtonText = i18n ("Rotat&e (Image|Selection)"); static bool warnIfBigImageSize (int oldWidth, int oldHeight, int newWidth, int newHeight, - const QString &text, - const QString &caption, - const QString &continueButtonText, - QWidget *parent); + const TQString &text, + const TQString &caption, + const TQString &continueButtonText, + TQWidget *parent); protected: diff --git a/kolourpaint/kpview.cpp b/kolourpaint/kpview.cpp index 1f18c659..8e0020f6 100644 --- a/kolourpaint/kpview.cpp +++ b/kolourpaint/kpview.cpp @@ -35,20 +35,20 @@ #include <math.h> #include <stdlib.h> -#include <qbitmap.h> -#include <qcursor.h> -#include <qdragobject.h> -#include <qguardedptr.h> -#include <qimage.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qpoint.h> -#include <qrect.h> -#include <qregion.h> -#include <qmemarray.h> +#include <tqbitmap.h> +#include <tqcursor.h> +#include <tqdragobject.h> +#include <tqguardedptr.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqpoint.h> +#include <tqrect.h> +#include <tqregion.h> +#include <tqmemarray.h> #if DEBUG_KP_VIEW || DEBUG_KP_VIEW_RENDERER - #include <qdatetime.h> + #include <tqdatetime.h> #endif #include <kdebug.h> @@ -80,20 +80,20 @@ struct kpViewPrivate // // For more details, see SVN commit: // "r385274 | dang | 2005-02-02 22:08:27 +1100 (Wed, 02 Feb 2005) | 21 lines". - QGuardedPtr <kpDocument> m_document; - QGuardedPtr <kpToolToolBar> m_toolToolBar; - QGuardedPtr <kpViewManager> m_viewManager; - QGuardedPtr <kpView> m_buddyView; - QGuardedPtr <kpViewScrollableContainer> m_scrollableContainer; + TQGuardedPtr <kpDocument> m_document; + TQGuardedPtr <kpToolToolBar> m_toolToolBar; + TQGuardedPtr <kpViewManager> m_viewManager; + TQGuardedPtr <kpView> m_buddyView; + TQGuardedPtr <kpViewScrollableContainer> m_scrollableContainer; int m_hzoom, m_vzoom; - QPoint m_origin; + TQPoint m_origin; bool m_showGrid; bool m_isBuddyViewScrollableContainerRectangleShown; - QRect m_buddyViewScrollableContainerRectangle; + TQRect m_buddyViewScrollableContainerRectangle; - QRegion m_queuedUpdateArea; - QPixmap *m_backBuffer; + TQRegion m_queuedUpdateArea; + TQPixmap *m_backBuffer; }; @@ -102,9 +102,9 @@ kpView::kpView (kpDocument *document, kpViewManager *viewManager, kpView *buddyView, kpViewScrollableContainer *scrollableContainer, - QWidget *parent, const char *name) + TQWidget *parent, const char *name) - : QWidget (parent, name, Qt::WNoAutoErase/*no flicker*/), + : TQWidget (parent, name, Qt::WNoAutoErase/*no flicker*/), d (new kpViewPrivate ()) { d->m_document = document; @@ -114,7 +114,7 @@ kpView::kpView (kpDocument *document, d->m_scrollableContainer = scrollableContainer; d->m_hzoom = 100, d->m_vzoom = 100; - d->m_origin = QPoint (0, 0); + d->m_origin = TQPoint (0, 0); d->m_showGrid = false; d->m_isBuddyViewScrollableContainerRectangleShown = false; @@ -122,7 +122,7 @@ kpView::kpView (kpDocument *document, setBackgroundMode (Qt::NoBackground); // no flicker - setFocusPolicy (QWidget::WheelFocus); + setFocusPolicy (TQWidget::WheelFocus); setMouseTracking (true); // mouseMoveEvent's even when no mousebtn down setKeyCompression (true); setInputMethodEnabled (true); // ensure using InputMethod @@ -218,13 +218,13 @@ void kpView::setZoomLevel (int hzoom, int vzoom) // public -QPoint kpView::origin () const +TQPoint kpView::origin () const { return d->m_origin; } // public virtual -void kpView::setOrigin (const QPoint &origin) +void kpView::setOrigin (const TQPoint &origin) { #if DEBUG_KP_VIEW kdDebug () << "kpView(" << name () << ")::setOrigin" << origin << endl; @@ -297,55 +297,55 @@ void kpView::showBuddyViewScrollableContainerRectangle (bool yes) // Got these connect statements by analysing deps of // updateBuddyViewScrollableContainerRectangle() rect update code. - connect (this, SIGNAL (zoomLevelChanged (int, int)), - this, SLOT (updateBuddyViewScrollableContainerRectangle ())); - connect (this, SIGNAL (originChanged (const QPoint &)), - this, SLOT (updateBuddyViewScrollableContainerRectangle ())); + connect (this, TQT_SIGNAL (zoomLevelChanged (int, int)), + this, TQT_SLOT (updateBuddyViewScrollableContainerRectangle ())); + connect (this, TQT_SIGNAL (originChanged (const TQPoint &)), + this, TQT_SLOT (updateBuddyViewScrollableContainerRectangle ())); if (buddyViewScrollableContainer ()) { - connect (buddyViewScrollableContainer (), SIGNAL (contentsMovingSoon (int, int)), - this, SLOT (updateBuddyViewScrollableContainerRectangle ())); - connect (buddyViewScrollableContainer (), SIGNAL (resized ()), - this, SLOT (updateBuddyViewScrollableContainerRectangle ())); + connect (buddyViewScrollableContainer (), TQT_SIGNAL (contentsMovingSoon (int, int)), + this, TQT_SLOT (updateBuddyViewScrollableContainerRectangle ())); + connect (buddyViewScrollableContainer (), TQT_SIGNAL (resized ()), + this, TQT_SLOT (updateBuddyViewScrollableContainerRectangle ())); } if (buddyView ()) { - connect (buddyView (), SIGNAL (zoomLevelChanged (int, int)), - this, SLOT (updateBuddyViewScrollableContainerRectangle ())); - connect (buddyView (), SIGNAL (originChanged (const QPoint &)), - this, SLOT (updateBuddyViewScrollableContainerRectangle ())); + connect (buddyView (), TQT_SIGNAL (zoomLevelChanged (int, int)), + this, TQT_SLOT (updateBuddyViewScrollableContainerRectangle ())); + connect (buddyView (), TQT_SIGNAL (originChanged (const TQPoint &)), + this, TQT_SLOT (updateBuddyViewScrollableContainerRectangle ())); - connect (buddyView (), SIGNAL (sizeChanged (int, int)), - this, SLOT (updateBuddyViewScrollableContainerRectangle ())); + connect (buddyView (), TQT_SIGNAL (sizeChanged (int, int)), + this, TQT_SLOT (updateBuddyViewScrollableContainerRectangle ())); } } else { - disconnect (this, SIGNAL (zoomLevelChanged (int, int)), - this, SLOT (updateBuddyViewScrollableContainerRectangle ())); - disconnect (this, SIGNAL (originChanged (const QPoint &)), - this, SLOT (updateBuddyViewScrollableContainerRectangle ())); + disconnect (this, TQT_SIGNAL (zoomLevelChanged (int, int)), + this, TQT_SLOT (updateBuddyViewScrollableContainerRectangle ())); + disconnect (this, TQT_SIGNAL (originChanged (const TQPoint &)), + this, TQT_SLOT (updateBuddyViewScrollableContainerRectangle ())); if (buddyViewScrollableContainer ()) { - disconnect (buddyViewScrollableContainer (), SIGNAL (contentsMovingSoon (int, int)), - this, SLOT (updateBuddyViewScrollableContainerRectangle ())); - disconnect (buddyViewScrollableContainer (), SIGNAL (resized ()), - this, SLOT (updateBuddyViewScrollableContainerRectangle ())); + disconnect (buddyViewScrollableContainer (), TQT_SIGNAL (contentsMovingSoon (int, int)), + this, TQT_SLOT (updateBuddyViewScrollableContainerRectangle ())); + disconnect (buddyViewScrollableContainer (), TQT_SIGNAL (resized ()), + this, TQT_SLOT (updateBuddyViewScrollableContainerRectangle ())); } if (buddyView ()) { - disconnect (buddyView (), SIGNAL (zoomLevelChanged (int, int)), - this, SLOT (updateBuddyViewScrollableContainerRectangle ())); - disconnect (buddyView (), SIGNAL (originChanged (const QPoint &)), - this, SLOT (updateBuddyViewScrollableContainerRectangle ())); + disconnect (buddyView (), TQT_SIGNAL (zoomLevelChanged (int, int)), + this, TQT_SLOT (updateBuddyViewScrollableContainerRectangle ())); + disconnect (buddyView (), TQT_SIGNAL (originChanged (const TQPoint &)), + this, TQT_SLOT (updateBuddyViewScrollableContainerRectangle ())); - disconnect (buddyView (), SIGNAL (sizeChanged (int, int)), - this, SLOT (updateBuddyViewScrollableContainerRectangle ())); + disconnect (buddyView (), TQT_SIGNAL (sizeChanged (int, int)), + this, TQT_SLOT (updateBuddyViewScrollableContainerRectangle ())); } } @@ -355,7 +355,7 @@ void kpView::showBuddyViewScrollableContainerRectangle (bool yes) // protected -QRect kpView::buddyViewScrollableContainerRectangle () const +TQRect kpView::buddyViewScrollableContainerRectangle () const { return d->m_buddyViewScrollableContainerRectangle; } @@ -378,12 +378,12 @@ void kpView::updateBuddyViewScrollableContainerRectangle () } - QRect newRect; + TQRect newRect; if (isBuddyViewScrollableContainerRectangleShown () && buddyViewScrollableContainer () && buddyView ()) { - QRect docRect = buddyView ()->transformViewToDoc ( - QRect (buddyViewScrollableContainer ()->contentsXSoon (), + TQRect docRect = buddyView ()->transformViewToDoc ( + TQRect (buddyViewScrollableContainer ()->contentsXSoon (), buddyViewScrollableContainer ()->contentsYSoon (), QMIN (buddyView ()->width (), buddyViewScrollableContainer ()->visibleWidth ()), @@ -391,19 +391,19 @@ void kpView::updateBuddyViewScrollableContainerRectangle () buddyViewScrollableContainer ()->visibleHeight ()))); - QRect viewRect = this->transformDocToView (docRect); + TQRect viewRect = this->transformDocToView (docRect); // (Surround the area of interest by moving outwards by 1 pixel in each // direction - don't overlap area) - newRect = QRect (viewRect.x () - 1, + newRect = TQRect (viewRect.x () - 1, viewRect.y () - 1, viewRect.width () + 2, viewRect.height () + 2); } else { - newRect = QRect (); + newRect = TQRect (); } if (newRect != d->m_buddyViewScrollableContainerRectangle) @@ -441,32 +441,32 @@ double kpView::transformViewToDocY (double viewY) const } // public -QPoint kpView::transformViewToDoc (const QPoint &viewPoint) const +TQPoint kpView::transformViewToDoc (const TQPoint &viewPoint) const { - return QPoint ((int) transformViewToDocX (viewPoint.x ()), + return TQPoint ((int) transformViewToDocX (viewPoint.x ()), (int) transformViewToDocY (viewPoint.y ())); } // public -QRect kpView::transformViewToDoc (const QRect &viewRect) const +TQRect kpView::transformViewToDoc (const TQRect &viewRect) const { if (zoomLevelX () == 100 && zoomLevelY () == 100) { - return QRect (viewRect.x () - origin ().x (), + return TQRect (viewRect.x () - origin ().x (), viewRect.y () - origin ().y (), viewRect.width (), viewRect.height ()); } else { - const QPoint docTopLeft = transformViewToDoc (viewRect.topLeft ()); + const TQPoint docTopLeft = transformViewToDoc (viewRect.topLeft ()); // (don't call transformViewToDoc[XY]() - need to round up dimensions) const int docWidth = qRound (double (viewRect.width ()) * 100.0 / double (zoomLevelX ())); const int docHeight = qRound (double (viewRect.height ()) * 100.0 / double (zoomLevelY ())); - // (like QWMatrix::Areas) - return QRect (docTopLeft.x (), docTopLeft.y (), docWidth, docHeight); + // (like TQWMatrix::Areas) + return TQRect (docTopLeft.x (), docTopLeft.y (), docWidth, docHeight); } } @@ -484,38 +484,38 @@ double kpView::transformDocToViewY (double docY) const } // public -QPoint kpView::transformDocToView (const QPoint &docPoint) const +TQPoint kpView::transformDocToView (const TQPoint &docPoint) const { - return QPoint ((int) transformDocToViewX (docPoint.x ()), + return TQPoint ((int) transformDocToViewX (docPoint.x ()), (int) transformDocToViewY (docPoint.y ())); } // public -QRect kpView::transformDocToView (const QRect &docRect) const +TQRect kpView::transformDocToView (const TQRect &docRect) const { if (zoomLevelX () == 100 && zoomLevelY () == 100) { - return QRect (docRect.x () + origin ().x (), + return TQRect (docRect.x () + origin ().x (), docRect.y () + origin ().y (), docRect.width (), docRect.height ()); } else { - const QPoint viewTopLeft = transformDocToView (docRect.topLeft ()); + const TQPoint viewTopLeft = transformDocToView (docRect.topLeft ()); // (don't call transformDocToView[XY]() - need to round up dimensions) const int viewWidth = qRound (double (docRect.width ()) * double (zoomLevelX ()) / 100.0); const int viewHeight = qRound (double (docRect.height ()) * double (zoomLevelY ()) / 100.0); - // (like QWMatrix::Areas) - return QRect (viewTopLeft.x (), viewTopLeft.y (), viewWidth, viewHeight); + // (like TQWMatrix::Areas) + return TQRect (viewTopLeft.x (), viewTopLeft.y (), viewWidth, viewHeight); } } // public -QPoint kpView::transformViewToOtherView (const QPoint &viewPoint, +TQPoint kpView::transformViewToOtherView (const TQPoint &viewPoint, const kpView *otherView) { if (this == otherView) @@ -527,7 +527,7 @@ QPoint kpView::transformViewToOtherView (const QPoint &viewPoint, const double otherViewX = otherView->transformDocToViewX (docX); const double otherViewY = otherView->transformDocToViewY (docY); - return QPoint ((int) otherViewX, (int) otherViewY); + return TQPoint ((int) otherViewX, (int) otherViewY); } @@ -566,7 +566,7 @@ void kpView::setHasMouse (bool yes) // public -void kpView::addToQueuedArea (const QRegion ®ion) +void kpView::addToQueuedArea (const TQRegion ®ion) { #if DEBUG_KP_VIEW && 0 kdDebug () << "kpView(" << name () @@ -578,7 +578,7 @@ void kpView::addToQueuedArea (const QRegion ®ion) } // public -void kpView::addToQueuedArea (const QRect &rect) +void kpView::addToQueuedArea (const TQRect &rect) { #if DEBUG_KP_VIEW && 0 kdDebug () << "kpView(" << name () @@ -596,7 +596,7 @@ void kpView::invalidateQueuedArea () kdDebug () << "kpView::invalidateQueuedArea()" << endl; #endif - d->m_queuedUpdateArea = QRegion (); + d->m_queuedUpdateArea = TQRegion (); } // public @@ -625,7 +625,7 @@ void kpView::updateQueuedArea () } // public -void kpView::updateMicroFocusHint (const QRect µFocusHint) +void kpView::updateMicroFocusHint (const TQRect µFocusHint) { int x = microFocusHint.topLeft().x(); int y = microFocusHint.topLeft().y(); @@ -635,25 +635,25 @@ void kpView::updateMicroFocusHint (const QRect µFocusHint) } // public -QRect kpView::selectionViewRect () const +TQRect kpView::selectionViewRect () const { return selection () ? transformDocToView (selection ()->boundingRect ()) : - QRect (); + TQRect (); } // public -QPoint kpView::mouseViewPoint (const QPoint &returnViewPoint) const +TQPoint kpView::mouseViewPoint (const TQPoint &returnViewPoint) const { if (returnViewPoint != KP_INVALID_POINT) return returnViewPoint; else - return mapFromGlobal (QCursor::pos ()); + return mapFromGlobal (TQCursor::pos ()); } // public -QPoint kpView::mouseViewPointRelativeToSelection (const QPoint &viewPoint) const +TQPoint kpView::mouseViewPointRelativeToSelection (const TQPoint &viewPoint) const { if (!selection ()) return KP_INVALID_POINT; @@ -662,9 +662,9 @@ QPoint kpView::mouseViewPointRelativeToSelection (const QPoint &viewPoint) const } // public -bool kpView::mouseOnSelection (const QPoint &viewPoint) const +bool kpView::mouseOnSelection (const TQPoint &viewPoint) const { - const QRect selViewRect = selectionViewRect (); + const TQRect selViewRect = selectionViewRect (); if (!selViewRect.isValid ()) return false; @@ -682,7 +682,7 @@ int kpView::textSelectionMoveBorderAtomicSize () const } // public -bool kpView::mouseOnSelectionToMove (const QPoint &viewPoint) const +bool kpView::mouseOnSelectionToMove (const TQPoint &viewPoint) const { if (!mouseOnSelection (viewPoint)) return false; @@ -694,10 +694,10 @@ bool kpView::mouseOnSelectionToMove (const QPoint &viewPoint) const return false; - const QPoint viewPointRelSel = mouseViewPointRelativeToSelection (viewPoint); + const TQPoint viewPointRelSel = mouseViewPointRelativeToSelection (viewPoint); // Middle point should always be selectable - const QPoint selCenterDocPoint = selection ()->boundingRect ().center (); + const TQPoint selCenterDocPoint = selection ()->boundingRect ().center (); if (tool () && tool ()->currentPoint () == selCenterDocPoint) { @@ -706,7 +706,7 @@ bool kpView::mouseOnSelectionToMove (const QPoint &viewPoint) const const int atomicSize = textSelectionMoveBorderAtomicSize (); - const QRect selViewRect = selectionViewRect (); + const TQRect selViewRect = selectionViewRect (); return (viewPointRelSel.x () < atomicSize || viewPointRelSel.x () >= selViewRect.width () - atomicSize || @@ -721,7 +721,7 @@ bool kpView::selectionLargeEnoughToHaveResizeHandlesIfAtomicSize (int atomicSize if (!selection ()) return false; - const QRect selViewRect = selectionViewRect (); + const TQRect selViewRect = selectionViewRect (); return (selViewRect.width () >= atomicSize * 5 || selViewRect.height () >= atomicSize * 5); @@ -747,13 +747,13 @@ bool kpView::selectionLargeEnoughToHaveResizeHandles () const } // public -QRegion kpView::selectionResizeHandlesViewRegion (bool forRenderer) const +TQRegion kpView::selectionResizeHandlesViewRegion (bool forRenderer) const { - QRegion ret; + TQRegion ret; const int atomicLength = selectionResizeHandleAtomicSize (); if (atomicLength <= 0) - return QRegion (); + return TQRegion (); // HACK: At low zoom (e.g. 100%), resize handles will probably be too @@ -790,10 +790,10 @@ QRegion kpView::selectionResizeHandlesViewRegion (bool forRenderer) const } - const QRect selViewRect = selectionViewRect (); + const TQRect selViewRect = selectionViewRect (); #define ADD_BOX_RELATIVE_TO_SELECTION(type,x,y) \ - ret += QRect ((x), (y), type##AtomicLength, type##AtomicLength) + ret += TQRect ((x), (y), type##AtomicLength, type##AtomicLength) ADD_BOX_RELATIVE_TO_SELECTION (normal, selViewRect.width () - normalAtomicLength, @@ -830,7 +830,7 @@ QRegion kpView::selectionResizeHandlesViewRegion (bool forRenderer) const } // public -int kpView::mouseOnSelectionResizeHandle (const QPoint &viewPoint) const +int kpView::mouseOnSelectionResizeHandle (const TQPoint &viewPoint) const { #if DEBUG_KP_VIEW kdDebug () << "kpView::mouseOnSelectionResizeHandle(viewPoint=" @@ -846,7 +846,7 @@ int kpView::mouseOnSelectionResizeHandle (const QPoint &viewPoint) const } - const QRect selViewRect = selectionViewRect (); + const TQRect selViewRect = selectionViewRect (); #if DEBUG_KP_VIEW kdDebug () << "\tselViewRect=" << selViewRect << endl; #endif @@ -867,14 +867,14 @@ int kpView::mouseOnSelectionResizeHandle (const QPoint &viewPoint) const } - const QPoint viewPointRelSel = mouseViewPointRelativeToSelection (viewPoint); + const TQPoint viewPointRelSel = mouseViewPointRelativeToSelection (viewPoint); #if DEBUG_KP_VIEW kdDebug () << "\tviewPointRelSel=" << viewPointRelSel << endl; #endif #define LOCAL_POINT_IN_BOX_AT(x,y) \ - QRect ((x), (y), atomicLength, atomicLength).contains (viewPointRelSel) + TQRect ((x), (y), atomicLength, atomicLength).contains (viewPointRelSel) // Favour the bottom & right and the corners. if (LOCAL_POINT_IN_BOX_AT (selViewRect.width () - atomicLength, @@ -923,7 +923,7 @@ int kpView::mouseOnSelectionResizeHandle (const QPoint &viewPoint) const } // public -bool kpView::mouseOnSelectionToSelectText (const QPoint &viewPoint) const +bool kpView::mouseOnSelectionToSelectText (const TQPoint &viewPoint) const { #if DEBUG_KP_VIEW kdDebug () << "kpView::mouseOnSelectionToSelectText(viewPoint=" @@ -958,7 +958,7 @@ bool kpView::mouseOnSelectionToSelectText (const QPoint &viewPoint) const // protected virtual [base QWidget] -void kpView::mouseMoveEvent (QMouseEvent *e) +void kpView::mouseMoveEvent (TQMouseEvent *e) { #if DEBUG_KP_VIEW && 0 kdDebug () << "kpView(" << name () << ")::mouseMoveEvent (" @@ -978,7 +978,7 @@ void kpView::mouseMoveEvent (QMouseEvent *e) } // protected virtual [base QWidget] -void kpView::mousePressEvent (QMouseEvent *e) +void kpView::mousePressEvent (TQMouseEvent *e) { #if DEBUG_KP_VIEW && 0 kdDebug () << "kpView(" << name () << ")::mousePressEvent (" @@ -995,7 +995,7 @@ void kpView::mousePressEvent (QMouseEvent *e) } // protected virtual [base QWidget] -void kpView::mouseReleaseEvent (QMouseEvent *e) +void kpView::mouseReleaseEvent (TQMouseEvent *e) { #if DEBUG_KP_VIEW && 0 kdDebug () << "kpView(" << name () << ")::mouseReleaseEvent (" @@ -1012,7 +1012,7 @@ void kpView::mouseReleaseEvent (QMouseEvent *e) } // public virtual [base QWidget] -void kpView::wheelEvent (QWheelEvent *e) +void kpView::wheelEvent (TQWheelEvent *e) { if (tool ()) tool ()->wheelEvent (e); @@ -1020,7 +1020,7 @@ void kpView::wheelEvent (QWheelEvent *e) // protected virtual [base QWidget] -void kpView::keyPressEvent (QKeyEvent *e) +void kpView::keyPressEvent (TQKeyEvent *e) { #if DEBUG_KP_VIEW && 0 kdDebug () << "kpView(" << name () << ")::keyPressEvent()" << endl; @@ -1033,7 +1033,7 @@ void kpView::keyPressEvent (QKeyEvent *e) } // protected virtual [base QWidget] -void kpView::keyReleaseEvent (QKeyEvent *e) +void kpView::keyReleaseEvent (TQKeyEvent *e) { #if DEBUG_KP_VIEW && 0 kdDebug () << "kpView(" << name () << ")::keyReleaseEvent()" << endl; @@ -1047,7 +1047,7 @@ void kpView::keyReleaseEvent (QKeyEvent *e) // protected virtual [base QWidget] -void kpView::focusInEvent (QFocusEvent *e) +void kpView::focusInEvent (TQFocusEvent *e) { #if DEBUG_KP_VIEW && 0 kdDebug () << "kpView(" << name () << ")::focusInEvent()" << endl; @@ -1057,7 +1057,7 @@ void kpView::focusInEvent (QFocusEvent *e) } // protected virtual [base QWidget] -void kpView::focusOutEvent (QFocusEvent *e) +void kpView::focusOutEvent (TQFocusEvent *e) { #if DEBUG_KP_VIEW && 0 kdDebug () << "kpView(" << name () << ")::focusOutEvent()" << endl; @@ -1068,7 +1068,7 @@ void kpView::focusOutEvent (QFocusEvent *e) // protected virtual [base QWidget] -void kpView::enterEvent (QEvent *e) +void kpView::enterEvent (TQEvent *e) { #if DEBUG_KP_VIEW && 0 kdDebug () << "kpView(" << name () << ")::enterEvent()" << endl; @@ -1090,7 +1090,7 @@ void kpView::enterEvent (QEvent *e) } // protected virtual [base QWidget] -void kpView::leaveEvent (QEvent *e) +void kpView::leaveEvent (TQEvent *e) { #if DEBUG_KP_VIEW && 0 kdDebug () << "kpView(" << name () << ")::leaveEvent()" << endl; @@ -1103,7 +1103,7 @@ void kpView::leaveEvent (QEvent *e) // protected virtual [base QWidget] -void kpView::dragEnterEvent (QDragEnterEvent *) +void kpView::dragEnterEvent (TQDragEnterEvent *) { #if DEBUG_KP_VIEW && 1 kdDebug () << "kpView(" << name () << ")::dragEnterEvent()" << endl; @@ -1113,7 +1113,7 @@ void kpView::dragEnterEvent (QDragEnterEvent *) } // protected virtual [base QWidget] -void kpView::dragLeaveEvent (QDragLeaveEvent *) +void kpView::dragLeaveEvent (TQDragLeaveEvent *) { #if DEBUG_KP_VIEW && 1 kdDebug () << "kpView(" << name () << ")::dragLeaveEvent" << endl; @@ -1132,11 +1132,11 @@ void kpView::resize (int w, int h) << endl; #endif - QWidget::resize (w, h); + TQWidget::resize (w, h); } // protected virtual [base QWidget] -void kpView::resizeEvent (QResizeEvent *e) +void kpView::resizeEvent (TQResizeEvent *e) { #if DEBUG_KP_VIEW && 1 kdDebug () << "kpView(" << name () << ")::resizeEvent(" @@ -1145,7 +1145,7 @@ void kpView::resizeEvent (QResizeEvent *e) << ") old=" << e->oldSize () << endl; #endif - QWidget::resizeEvent (e); + TQWidget::resizeEvent (e); emit sizeChanged (width (), height ()); emit sizeChanged (size ()); @@ -1153,7 +1153,7 @@ void kpView::resizeEvent (QResizeEvent *e) // private virtual -void kpView::imStartEvent (QIMEvent *e) +void kpView::imStartEvent (TQIMEvent *e) { #if DEBUG_KP_VIEW && 1 kdDebug () << "kpView(" << name () << ")::imStartEvent" << endl; @@ -1165,7 +1165,7 @@ void kpView::imStartEvent (QIMEvent *e) } // private virtual -void kpView::imComposeEvent (QIMEvent *e) +void kpView::imComposeEvent (TQIMEvent *e) { #if DEBUG_KP_VIEW && 1 kdDebug () << "kpView(" << name () << ")::imComposeEvent" << endl; @@ -1177,7 +1177,7 @@ void kpView::imComposeEvent (QIMEvent *e) } // private virtual -void kpView::imEndEvent (QIMEvent *e) +void kpView::imEndEvent (TQIMEvent *e) { #if DEBUG_KP_VIEW && 1 kdDebug () << "kpView(" << name () << ")::imEndEvent" << endl; @@ -1194,13 +1194,13 @@ void kpView::imEndEvent (QIMEvent *e) // // protected -QRect kpView::paintEventGetDocRect (const QRect &viewRect) const +TQRect kpView::paintEventGetDocRect (const TQRect &viewRect) const { #if DEBUG_KP_VIEW_RENDERER && 1 kdDebug () << "kpView::paintEventGetDocRect(" << viewRect << ")" << endl; #endif - QRect docRect; + TQRect docRect; // From the "we aren't sure whether to round up or round down" department: @@ -1210,7 +1210,7 @@ QRect kpView::paintEventGetDocRect (const QRect &viewRect) const { // think of a grid - you need to fully cover the zoomed-in pixels // when docRect is zoomed back to the view later - docRect = QRect (transformViewToDoc (viewRect.topLeft ()), // round down + docRect = TQRect (transformViewToDoc (viewRect.topLeft ()), // round down transformViewToDoc (viewRect.bottomRight ())); // round down } @@ -1220,7 +1220,7 @@ QRect kpView::paintEventGetDocRect (const QRect &viewRect) const // - helpful because it ensures we at least cover the required area // at e.g. 67% or 573% // - harmless since paintEventDrawRect() clips for us anyway - docRect.setBottomRight (docRect.bottomRight () + QPoint (2, 2)); + docRect.setBottomRight (docRect.bottomRight () + TQPoint (2, 2)); } #if DEBUG_KP_VIEW_RENDERER && 1 @@ -1239,9 +1239,9 @@ QRect kpView::paintEventGetDocRect (const QRect &viewRect) const } // public -void kpView::drawTransparentBackground (QPainter *painter, +void kpView::drawTransparentBackground (TQPainter *painter, int /*viewWidth*/, int /*viewHeight*/, - const QRect &rect, + const TQRect &rect, bool isPreview) { const int cellSize = !isPreview ? 16 : 10; @@ -1260,14 +1260,14 @@ void kpView::drawTransparentBackground (QPainter *painter, for (int x = startx; x <= rect.right (); x += cellSize) { bool parity = (x / cellSize + y / cellSize) % 2; - QColor col; + TQColor col; if (parity) { if (!isPreview) - col = QColor (213, 213, 213); + col = TQColor (213, 213, 213); else - col = QColor (224, 224, 224); + col = TQColor (224, 224, 224); } else col = Qt::white; @@ -1280,7 +1280,7 @@ void kpView::drawTransparentBackground (QPainter *painter, } // protected -void kpView::paintEventDrawCheckerBoard (QPainter *painter, const QRect &viewRect) +void kpView::paintEventDrawCheckerBoard (TQPainter *painter, const TQRect &viewRect) { kpDocument *doc = document (); if (!doc) @@ -1293,7 +1293,7 @@ void kpView::paintEventDrawCheckerBoard (QPainter *painter, const QRect &viewRec } // protected -void kpView::paintEventDrawSelection (QPixmap *destPixmap, const QRect &docRect) +void kpView::paintEventDrawSelection (TQPixmap *destPixmap, const TQRect &docRect) { #if DEBUG_KP_VIEW_RENDERER && 1 kdDebug () << "kpView::paintEventDrawSelection() docRect=" << docRect << endl; @@ -1339,15 +1339,15 @@ void kpView::paintEventDrawSelection (QPixmap *destPixmap, const QRect &docRect) #endif if (vm->selectionBorderVisible ()) { - QPainter destPixmapPainter (destPixmap); + TQPainter destPixmapPainter (destPixmap); destPixmapPainter.setRasterOp (Qt::XorROP); - destPixmapPainter.setPen (QPen (Qt::white, 1, Qt::DotLine)); + destPixmapPainter.setPen (TQPen (Qt::white, 1, Qt::DotLine)); - destPixmapPainter.setBackgroundMode (QPainter::OpaqueMode); + destPixmapPainter.setBackgroundMode (TQPainter::OpaqueMode); destPixmapPainter.setBackgroundColor (Qt::blue); - QBitmap maskBitmap; - QPainter maskBitmapPainter; + TQBitmap maskBitmap; + TQPainter maskBitmapPainter; if (destPixmap->mask ()) { maskBitmap = *destPixmap->mask (); @@ -1363,7 +1363,7 @@ void kpView::paintEventDrawSelection (QPixmap *destPixmap, const QRect &docRect) maskBitmapPainter . cmd; \ } - QRect boundingRect = sel->boundingRect (); + TQRect boundingRect = sel->boundingRect (); #if DEBUG_KP_VIEW_RENDERER && 1 kdDebug () << "\tsel boundingRect=" << boundingRect @@ -1405,7 +1405,7 @@ void kpView::paintEventDrawSelection (QPixmap *destPixmap, const QRect &docRect) #if DEBUG_KP_VIEW_RENDERER kdDebug () << "\tselection border = freeForm" << endl; #endif - QPointArray points = sel->points (); + TQPointArray points = sel->points (); points.detach (); points.translate (-docRect.x (), -docRect.y ()); if (vm->selectionBorderFinished ()) @@ -1470,18 +1470,18 @@ void kpView::paintEventDrawSelection (QPixmap *destPixmap, const QRect &docRect) !vm->activeView ())) // sync: call will break when vm is not held by 1 mainWindow { // TODO: Fix code duplication: kpViewManager::{setTextCursorPosition,updateTextCursor}() & kpView::paintEventDrawSelection() - QPoint topLeft = sel->pointForTextRowCol (vm->textCursorRow (), vm->textCursorCol ()); + TQPoint topLeft = sel->pointForTextRowCol (vm->textCursorRow (), vm->textCursorCol ()); if (topLeft != KP_INVALID_POINT) { - QRect rect = QRect (topLeft.x (), topLeft.y (), + TQRect rect = TQRect (topLeft.x (), topLeft.y (), 1, sel->textStyle ().fontMetrics ().height ()); rect = rect.intersect (sel->textAreaRect ()); if (!rect.isEmpty ()) { rect.moveBy (-docRect.x (), -docRect.y ()); - QBitmap maskBitmap; - QPainter destPixmapPainter, maskBitmapPainter; + TQBitmap maskBitmap; + TQPainter destPixmapPainter, maskBitmapPainter; if (destPixmap->mask ()) { @@ -1510,7 +1510,7 @@ bool kpView::selectionResizeHandleAtomicSizeCloseToZoomLevel () const } // protected -void kpView::paintEventDrawSelectionResizeHandles (QPainter *painter, const QRect &viewRect) +void kpView::paintEventDrawSelectionResizeHandles (TQPainter *painter, const TQRect &viewRect) { #if DEBUG_KP_VIEW_RENDERER && 1 kdDebug () << "kpView::paintEventDrawSelectionResizeHandles(" @@ -1535,7 +1535,7 @@ void kpView::paintEventDrawSelectionResizeHandles (QPainter *painter, const QRec return; } - const QRect selViewRect = selectionViewRect (); + const TQRect selViewRect = selectionViewRect (); #if DEBUG_KP_VIEW_RENDERER && 1 kdDebug () << "\tselViewRect=" << selViewRect << endl; #endif @@ -1547,7 +1547,7 @@ void kpView::paintEventDrawSelectionResizeHandles (QPainter *painter, const QRec return; } - QRegion selResizeHandlesRegion = selectionResizeHandlesViewRegion (true/*for renderer*/); + TQRegion selResizeHandlesRegion = selectionResizeHandlesViewRegion (true/*for renderer*/); #if DEBUG_KP_VIEW_RENDERER && 1 kdDebug () << "\tsel resize handles view region=" << selResizeHandlesRegion << endl; @@ -1556,7 +1556,7 @@ void kpView::paintEventDrawSelectionResizeHandles (QPainter *painter, const QRec painter->save (); - QColor fillColor; + TQColor fillColor; if (selectionResizeHandleAtomicSizeCloseToZoomLevel ()) { fillColor = Qt::blue; @@ -1568,8 +1568,8 @@ void kpView::paintEventDrawSelectionResizeHandles (QPainter *painter, const QRec painter->setRasterOp (Qt::XorROP); } - QMemArray <QRect> rects = selResizeHandlesRegion.rects (); - for (QMemArray <QRect>::ConstIterator it = rects.begin (); + TQMemArray <TQRect> rects = selResizeHandlesRegion.rects (); + for (TQMemArray <TQRect>::ConstIterator it = rects.begin (); it != rects.end (); it++) { @@ -1580,7 +1580,7 @@ void kpView::paintEventDrawSelectionResizeHandles (QPainter *painter, const QRec } // protected -void kpView::paintEventDrawTempPixmap (QPixmap *destPixmap, const QRect &docRect) +void kpView::paintEventDrawTempPixmap (TQPixmap *destPixmap, const TQRect &docRect) { kpViewManager *vm = viewManager (); if (!vm) @@ -1602,13 +1602,13 @@ void kpView::paintEventDrawTempPixmap (QPixmap *destPixmap, const QRect &docRect } // protected -void kpView::paintEventDrawGridLines (QPainter *painter, const QRect &viewRect) +void kpView::paintEventDrawGridLines (TQPainter *painter, const TQRect &viewRect) { int hzoomMultiple = zoomLevelX () / 100; int vzoomMultiple = zoomLevelY () / 100; - QPen ordinaryPen (Qt::gray); - QPen tileBoundaryPen (Qt::lightGray); + TQPen ordinaryPen (Qt::gray); + TQPen tileBoundaryPen (Qt::lightGray); painter->setPen (ordinaryPen); @@ -1658,7 +1658,7 @@ void kpView::paintEventDrawGridLines (QPainter *painter, const QRect &viewRect) } -void kpView::paintEventDrawRect (const QRect &viewRect) +void kpView::paintEventDrawRect (const TQRect &viewRect) { #if DEBUG_KP_VIEW_RENDERER kdDebug () << "\tkpView::paintEventDrawRect(viewRect=" << viewRect @@ -1676,7 +1676,7 @@ void kpView::paintEventDrawRect (const QRect &viewRect) return; - QRect docRect = paintEventGetDocRect (viewRect); + TQRect docRect = paintEventGetDocRect (viewRect); #if DEBUG_KP_VIEW_RENDERER && 1 kdDebug () << "\tdocRect=" << docRect << endl; @@ -1684,7 +1684,7 @@ void kpView::paintEventDrawRect (const QRect &viewRect) // uncomment to cause deliberate flicker (identifies needless updates) #if DEBUG_KP_VIEW_RENDERER && 0 - QPainter flickerPainter (this); + TQPainter flickerPainter (this); flickerPainter.fillRect (viewRect, Qt::red); flickerPainter.end (); #endif @@ -1700,13 +1700,13 @@ void kpView::paintEventDrawRect (const QRect &viewRect) d->m_backBuffer->width () > width () || d->m_backBuffer->height () > height ()) { - // don't use QPixmap::resize() as that wastes time copying pixels + // don't use TQPixmap::resize() as that wastes time copying pixels // that will be overwritten anyway // // OPT: Should use doubling trick or at least go up in multiples // to reduce X server pressure. delete d->m_backBuffer; - d->m_backBuffer = new QPixmap (viewRect.width (), viewRect.height ()); + d->m_backBuffer = new TQPixmap (viewRect.width (), viewRect.height ()); } // uncomment to catch bits of the view that the renderer forgot to update @@ -1714,7 +1714,7 @@ void kpView::paintEventDrawRect (const QRect &viewRect) d->m_backBuffer->fill (Qt::green); #endif - QPainter backBufferPainter; + TQPainter backBufferPainter; backBufferPainter.begin (d->m_backBuffer); @@ -1722,7 +1722,7 @@ void kpView::paintEventDrawRect (const QRect &viewRect) // Draw checkboard for transparent images and/or views with borders // - QPixmap docPixmap; + TQPixmap docPixmap; bool tempPixmapWillBeRendered = false; @@ -1784,7 +1784,7 @@ void kpView::paintEventDrawRect (const QRect &viewRect) #endif // blit scaled version of docPixmap + tempPixmap onto Back Buffer #if DEBUG_KP_VIEW_RENDERER && 1 - QTime scaleTimer; scaleTimer.start (); + TQTime scaleTimer; scaleTimer.start (); #endif backBufferPainter.translate (origin ().x () - viewRect.x (), origin ().y () - viewRect.y ()); @@ -1806,7 +1806,7 @@ void kpView::paintEventDrawRect (const QRect &viewRect) if (isGridShown ()) { #if DEBUG_KP_VIEW_RENDERER && 1 - QTime gridTimer; gridTimer.start (); + TQTime gridTimer; gridTimer.start (); #endif paintEventDrawGridLines (&backBufferPainter, viewRect); #if DEBUG_KP_VIEW_RENDERER && 1 @@ -1815,7 +1815,7 @@ void kpView::paintEventDrawRect (const QRect &viewRect) } - const QRect bvsvRect = buddyViewScrollableContainerRectangle (); + const TQRect bvsvRect = buddyViewScrollableContainerRectangle (); if (!bvsvRect.isEmpty ()) { backBufferPainter.save (); @@ -1846,19 +1846,19 @@ void kpView::paintEventDrawRect (const QRect &viewRect) backBufferPainter.end (); bitBlt (this, viewRect.topLeft (), - d->m_backBuffer, QRect (0, 0, viewRect.width (), viewRect.height ())); + d->m_backBuffer, TQRect (0, 0, viewRect.width (), viewRect.height ())); } // protected virtual [base QWidget] -void kpView::paintEvent (QPaintEvent *e) +void kpView::paintEvent (TQPaintEvent *e) { // sync: kpViewPrivate // WARNING: document(), viewManager() and friends might be 0 in this method. // TODO: I'm not 100% convinced that we always check if their friends are 0. #if DEBUG_KP_VIEW_RENDERER && 1 - QTime timer; + TQTime timer; timer.start (); #endif @@ -1870,7 +1870,7 @@ void kpView::paintEvent (QPaintEvent *e) << " fastUpdates=" << (vm && vm->fastUpdates ()) << " viewRect=" << e->rect () << " erased=" << e->erased () - << " topLeft=" << QPoint (x (), y ()) + << " topLeft=" << TQPoint (x (), y ()) << endl; #endif @@ -1887,13 +1887,13 @@ void kpView::paintEvent (QPaintEvent *e) } - QRegion viewRegion = clipRegion ().intersect (e->region ()); - QMemArray <QRect> rects = viewRegion.rects (); + TQRegion viewRegion = clipRegion ().intersect (e->region ()); + TQMemArray <TQRect> rects = viewRegion.rects (); #if DEBUG_KP_VIEW_RENDERER && 1 kdDebug () << "\t#rects = " << rects.count () << endl; #endif - for (QMemArray <QRect>::ConstIterator it = rects.begin (); + for (TQMemArray <TQRect>::ConstIterator it = rects.begin (); it != rects.end (); it++) { diff --git a/kolourpaint/kpview.h b/kolourpaint/kpview.h index 0bf8c495..6464d869 100644 --- a/kolourpaint/kpview.h +++ b/kolourpaint/kpview.h @@ -30,7 +30,7 @@ #define KP_VIEW_H -#include <qwidget.h> +#include <tqwidget.h> #include <kpdefs.h> @@ -80,7 +80,7 @@ public: kpViewManager *viewManager, kpView *buddyView, kpViewScrollableContainer *scrollableContainer, - QWidget *parent, const char *name); + TQWidget *parent, const char *name); /** * Destructs this view. Informs the viewManager() that the mouse @@ -159,7 +159,7 @@ public: * @returns in views coordinates, where the top-left document() pixel * will be rendered (default: (0,0)). */ - QPoint origin () const; + TQPoint origin () const; /** * Sets the origin. @@ -168,7 +168,7 @@ public: * * If reimplementing, you must call this base implementation. */ - virtual void setOrigin (const QPoint &origin); + virtual void setOrigin (const TQPoint &origin); /** @@ -210,7 +210,7 @@ protected: * visible through buddyViewScrollableContainer(), that is being * rendered by this view. */ - QRect buddyViewScrollableContainerRectangle () const; + TQRect buddyViewScrollableContainerRectangle () const; protected slots: /** @@ -248,7 +248,7 @@ public: * @returns viewPoint transformed to document coordinates, based on the * origin(), zoomLevelX() and zoomLevelY(). */ - QPoint transformViewToDoc (const QPoint &viewPoint) const; + TQPoint transformViewToDoc (const TQPoint &viewPoint) const; /** * @param viewRect Rectangle in view coordinates. @@ -258,9 +258,9 @@ public: * * For bounding rectangles, you should use this function instead of * transformViewToDocX(), transformViewToDocY() or - * transformViewToDoc(const QPoint &) which act on coordinates only. + * transformViewToDoc(const TQPoint &) which act on coordinates only. */ - QRect transformViewToDoc (const QRect &viewRect) const; + TQRect transformViewToDoc (const TQRect &viewRect) const; /** @@ -285,7 +285,7 @@ public: * @returns docPoint transformed to view coordinates, based on the * origin(), zoomLevelX(), zoomLevelY(). */ - QPoint transformDocToView (const QPoint &docPoint) const; + TQPoint transformDocToView (const TQPoint &docPoint) const; /** * @param docRect Rectangle in document coordinates. @@ -295,9 +295,9 @@ public: * * For bounding rectangles, you should use this function instead of * transformDocToViewX(), transformDocToViewY() or - * transformDocToView(const QPoint &) which act on coordinates only. + * transformDocToView(const TQPoint &) which act on coordinates only. */ - QRect transformDocToView (const QRect &docRect) const; + TQRect transformDocToView (const TQRect &docRect) const; /** @@ -310,7 +310,7 @@ public: * zoomLevelX() and zoomLevelY(). This has less rounding * error than otherView->transformDocToView (transformViewToDoc (viewPoint)). */ - QPoint transformViewToOtherView (const QPoint &viewPoint, + TQPoint transformViewToOtherView (const TQPoint &viewPoint, const kpView *otherView); @@ -348,7 +348,7 @@ public: * * @param region Region (in view coordinates) that needs repainting. */ - void addToQueuedArea (const QRegion ®ion); + void addToQueuedArea (const TQRegion ®ion); /** * Convenience function. Same as above. @@ -359,7 +359,7 @@ public: * * @param rect Rectangle (in view coordinates) that needs repainting. */ - void addToQueuedArea (const QRect &rect); + void addToQueuedArea (const TQRect &rect); /** * Removes the dirty region that has been queued for updating. @@ -374,7 +374,7 @@ public: */ void updateQueuedArea (); - void updateMicroFocusHint (const QRect µFocusHint); + void updateMicroFocusHint (const TQRect µFocusHint); public slots: @@ -395,16 +395,16 @@ public slots: public: - QRect selectionViewRect () const; + TQRect selectionViewRect () const; - // (if <viewPoint> is KP_INVALID_POINT, it uses QCursor::pos()) + // (if <viewPoint> is KP_INVALID_POINT, it uses TQCursor::pos()) - QPoint mouseViewPoint (const QPoint &returnViewPoint = KP_INVALID_POINT) const; - QPoint mouseViewPointRelativeToSelection (const QPoint &viewPoint = KP_INVALID_POINT) const; - bool mouseOnSelection (const QPoint &viewPoint = KP_INVALID_POINT) const; + TQPoint mouseViewPoint (const TQPoint &returnViewPoint = KP_INVALID_POINT) const; + TQPoint mouseViewPointRelativeToSelection (const TQPoint &viewPoint = KP_INVALID_POINT) const; + bool mouseOnSelection (const TQPoint &viewPoint = KP_INVALID_POINT) const; int textSelectionMoveBorderAtomicSize () const; - bool mouseOnSelectionToMove (const QPoint &viewPoint = KP_INVALID_POINT) const; + bool mouseOnSelectionToMove (const TQPoint &viewPoint = KP_INVALID_POINT) const; protected: bool selectionLargeEnoughToHaveResizeHandlesIfAtomicSize (int atomicSize) const; @@ -412,7 +412,7 @@ public: int selectionResizeHandleAtomicSize () const; bool selectionLargeEnoughToHaveResizeHandles () const; - QRegion selectionResizeHandlesViewRegion (bool forRenderer = false) const; + TQRegion selectionResizeHandlesViewRegion (bool forRenderer = false) const; enum SelectionResizeType { @@ -424,9 +424,9 @@ public: }; // Returns a bitwise OR of the SelectionResizeType's - int mouseOnSelectionResizeHandle (const QPoint &viewPoint = KP_INVALID_POINT) const; + int mouseOnSelectionResizeHandle (const TQPoint &viewPoint = KP_INVALID_POINT) const; - bool mouseOnSelectionToSelectText (const QPoint &viewPoint = KP_INVALID_POINT) const; + bool mouseOnSelectionToSelectText (const TQPoint &viewPoint = KP_INVALID_POINT) const; signals: @@ -443,7 +443,7 @@ signals: * * @param size New view size. */ - void sizeChanged (const QSize &size); + void sizeChanged (const TQSize &size); /** * Convenience signal - same as above. @@ -460,42 +460,42 @@ signals: * * @param origin The new origin. */ - void originChanged (const QPoint &origin); + void originChanged (const TQPoint &origin); protected: - virtual void mouseMoveEvent (QMouseEvent *e); - virtual void mousePressEvent (QMouseEvent *e); - virtual void mouseReleaseEvent (QMouseEvent *e); + virtual void mouseMoveEvent (TQMouseEvent *e); + virtual void mousePressEvent (TQMouseEvent *e); + virtual void mouseReleaseEvent (TQMouseEvent *e); public: // (needs to be public as it may also get event from - // QScrollView::contentsWheelEvent()) - virtual void wheelEvent (QWheelEvent *e); + // TQScrollView::contentsWheelEvent()) + virtual void wheelEvent (TQWheelEvent *e); protected: - virtual void keyPressEvent (QKeyEvent *e); - virtual void keyReleaseEvent (QKeyEvent *e); + virtual void keyPressEvent (TQKeyEvent *e); + virtual void keyReleaseEvent (TQKeyEvent *e); - virtual void focusInEvent (QFocusEvent *e); - virtual void focusOutEvent (QFocusEvent *e); + virtual void focusInEvent (TQFocusEvent *e); + virtual void focusOutEvent (TQFocusEvent *e); - virtual void enterEvent (QEvent *e); - virtual void leaveEvent (QEvent *e); + virtual void enterEvent (TQEvent *e); + virtual void leaveEvent (TQEvent *e); - virtual void dragEnterEvent (QDragEnterEvent *); - virtual void dragLeaveEvent (QDragLeaveEvent *); + virtual void dragEnterEvent (TQDragEnterEvent *); + virtual void dragLeaveEvent (TQDragLeaveEvent *); - virtual void imStartEvent (QIMEvent *e); - virtual void imComposeEvent (QIMEvent *e); - virtual void imEndEvent (QIMEvent *e); + virtual void imStartEvent (TQIMEvent *e); + virtual void imComposeEvent (TQIMEvent *e); + virtual void imEndEvent (TQIMEvent *e); public: virtual void resize (int w, int h); protected: - virtual void resizeEvent (QResizeEvent *e); + virtual void resizeEvent (TQResizeEvent *e); protected: - QRect paintEventGetDocRect (const QRect &viewRect) const; + TQRect paintEventGetDocRect (const TQRect &viewRect) const; public: /** * Draws an opaque background representing transparency. Currently, @@ -511,20 +511,20 @@ public: * e.g. editing. If set, this function may render * slightly differently. */ - static void drawTransparentBackground (QPainter *painter, + static void drawTransparentBackground (TQPainter *painter, int viewWidth, int viewHeight, - const QRect &rect, + const TQRect &rect, bool isPreview = false); protected: - void paintEventDrawCheckerBoard (QPainter *painter, const QRect &viewRect); - void paintEventDrawSelection (QPixmap *destPixmap, const QRect &docRect); + void paintEventDrawCheckerBoard (TQPainter *painter, const TQRect &viewRect); + void paintEventDrawSelection (TQPixmap *destPixmap, const TQRect &docRect); bool selectionResizeHandleAtomicSizeCloseToZoomLevel () const; - void paintEventDrawSelectionResizeHandles (QPainter *painter, const QRect &viewRect); - void paintEventDrawTempPixmap (QPixmap *destPixmap, const QRect &docRect); - void paintEventDrawGridLines (QPainter *painter, const QRect &viewRect); + void paintEventDrawSelectionResizeHandles (TQPainter *painter, const TQRect &viewRect); + void paintEventDrawTempPixmap (TQPixmap *destPixmap, const TQRect &docRect); + void paintEventDrawGridLines (TQPainter *painter, const TQRect &viewRect); - void paintEventDrawRect (const QRect &viewRect); - virtual void paintEvent (QPaintEvent *e); + void paintEventDrawRect (const TQRect &viewRect); + virtual void paintEvent (TQPaintEvent *e); private: diff --git a/kolourpaint/kpviewmanager.cpp b/kolourpaint/kpviewmanager.cpp index d649f359..acff3413 100644 --- a/kolourpaint/kpviewmanager.cpp +++ b/kolourpaint/kpviewmanager.cpp @@ -31,8 +31,8 @@ #include <kpviewmanager.h> -#include <qapplication.h> -#include <qtimer.h> +#include <tqapplication.h> +#include <tqtimer.h> #include <kdebug.h> @@ -130,7 +130,7 @@ void kpViewManager::setTempPixmap (const kpTempPixmap &tempPixmap) << ")" << endl; #endif - QRect oldRect; + TQRect oldRect; if (m_tempPixmap) { @@ -157,7 +157,7 @@ void kpViewManager::invalidateTempPixmap () if (!m_tempPixmap) return; - QRect oldRect = m_tempPixmap->rect (); + TQRect oldRect = m_tempPixmap->rect (); delete m_tempPixmap; m_tempPixmap = 0; @@ -228,9 +228,9 @@ void kpViewManager::setTextCursorEnabled (bool yes) if (yes) { - m_textCursorBlinkTimer = new QTimer (this); - connect (m_textCursorBlinkTimer, SIGNAL (timeout ()), - this, SLOT (slotTextCursorBlink ())); + m_textCursorBlinkTimer = new TQTimer (this); + connect (m_textCursorBlinkTimer, TQT_SIGNAL (timeout ()), + this, TQT_SLOT (slotTextCursorBlink ())); slotTextCursorBlink (); } // TODO: What if !yes - shouldn't it clear the cursor? @@ -353,7 +353,7 @@ void kpViewManager::setTextCursorPosition (int row, int col, bool isUpdateMicroF if (m_viewUnderCursor) { // TODO: Fix code duplication: kpViewManager::{setTextCursorPosition,updateTextCursor}() & kpView::paintEventDrawSelection() - QPoint topLeft = sel->pointForTextRowCol (m_textCursorRow, m_textCursorCol); + TQPoint topLeft = sel->pointForTextRowCol (m_textCursorRow, m_textCursorCol); if (topLeft != KP_INVALID_POINT) { // TODO: I think you need to consider zooming e.g. try editing @@ -363,12 +363,12 @@ void kpViewManager::setTextCursorPosition (int row, int col, bool isUpdateMicroF // change size). // // To fix it here, I think you should call - // m_viewUnderCursor->transformDocToView(QRect). However, + // m_viewUnderCursor->transformDocToView(TQRect). However, // the rest of the InputMethod support still needs to // audited for this. // // [Bug #27] - m_viewUnderCursor->updateMicroFocusHint(QRect (topLeft.x (), topLeft.y (), 1, sel->textStyle ().fontMetrics ().height ())); + m_viewUnderCursor->updateMicroFocusHint(TQRect (topLeft.x (), topLeft.y (), 1, sel->textStyle ().fontMetrics ().height ())); } } } @@ -410,11 +410,11 @@ void kpViewManager::updateTextCursor () return; // TODO: Fix code duplication: kpViewManager::{setTextCursorPosition,updateTextCursor}() & kpView::paintEventDrawSelection() - QPoint topLeft = sel->pointForTextRowCol (m_textCursorRow, m_textCursorCol); + TQPoint topLeft = sel->pointForTextRowCol (m_textCursorRow, m_textCursorCol); if (topLeft != KP_INVALID_POINT) { setFastUpdates (); - updateViews (QRect (topLeft.x (), topLeft.y (), 1, sel->textStyle ().fontMetrics ().height ())); + updateViews (TQRect (topLeft.x (), topLeft.y (), 1, sel->textStyle ().fontMetrics ().height ())); restoreFastUpdates (); } } @@ -429,7 +429,7 @@ void kpViewManager::slotTextCursorBlink () if (m_textCursorBlinkTimer) { - m_textCursorBlinkTimer->start (QApplication::cursorFlashTime () / 2, + m_textCursorBlinkTimer->start (TQApplication::cursorFlashTime () / 2, true/*single shot*/); } @@ -438,9 +438,9 @@ void kpViewManager::slotTextCursorBlink () } -void kpViewManager::setCursor (const QCursor &cursor) +void kpViewManager::setCursor (const TQCursor &cursor) { - for (QPtrList <kpView>::const_iterator it = m_views.begin (); + for (TQPtrList <kpView>::const_iterator it = m_views.begin (); it != m_views.end (); it++) { @@ -452,14 +452,14 @@ void kpViewManager::setCursor (const QCursor &cursor) void kpViewManager::unsetCursor () { - for (QPtrList <kpView>::const_iterator it = m_views.begin (); + for (TQPtrList <kpView>::const_iterator it = m_views.begin (); it != m_views.end (); it++) { (*it)->unsetCursor (); } - m_cursor = QCursor (); + m_cursor = TQCursor (); } @@ -480,7 +480,7 @@ kpView *kpViewManager::viewUnderCursor (bool usingQt) const } else { - for (QPtrList <kpView>::const_iterator it = m_views.begin (); + for (TQPtrList <kpView>::const_iterator it = m_views.begin (); it != m_views.end (); it++) { @@ -532,7 +532,7 @@ void kpViewManager::setViewUnderCursor (kpView *view) // public kpView *kpViewManager::activeView () const { - for (QPtrList <kpView>::const_iterator it = m_views.begin (); + for (TQPtrList <kpView>::const_iterator it = m_views.begin (); it != m_views.end (); it++) { @@ -576,7 +576,7 @@ void kpViewManager::restoreQueueUpdates () if (m_queueUpdatesCounter <= 0) { - for (QPtrList <kpView>::const_iterator it = m_views.begin (); + for (TQPtrList <kpView>::const_iterator it = m_views.begin (); it != m_views.end (); it++) { @@ -620,10 +620,10 @@ void kpViewManager::restoreFastUpdates () void kpViewManager::updateView (kpView *v) { - updateView (v, QRect (0, 0, v->width (), v->height ())); + updateView (v, TQRect (0, 0, v->width (), v->height ())); } -void kpViewManager::updateView (kpView *v, const QRect &viewRect) +void kpViewManager::updateView (kpView *v, const TQRect &viewRect) { if (!queueUpdates ()) { @@ -638,10 +638,10 @@ void kpViewManager::updateView (kpView *v, const QRect &viewRect) void kpViewManager::updateView (kpView *v, int x, int y, int w, int h) { - updateView (v, QRect (x, y, w, h)); + updateView (v, TQRect (x, y, w, h)); } -void kpViewManager::updateView (kpView *v, const QRegion &viewRegion) +void kpViewManager::updateView (kpView *v, const TQRegion &viewRegion) { if (!queueUpdates ()) { @@ -654,31 +654,31 @@ void kpViewManager::updateView (kpView *v, const QRegion &viewRegion) v->addToQueuedArea (viewRegion); } -void kpViewManager::updateViewRectangleEdges (kpView *v, const QRect &viewRect) +void kpViewManager::updateViewRectangleEdges (kpView *v, const TQRect &viewRect) { if (viewRect.height () <= 0 || viewRect.width () <= 0) return; // Top line - updateView (v, QRect (viewRect.x (), viewRect.y (), + updateView (v, TQRect (viewRect.x (), viewRect.y (), viewRect.width (), 1)); if (viewRect.height () >= 2) { // Bottom line - updateView (v, QRect (viewRect.x (), viewRect.bottom (), + updateView (v, TQRect (viewRect.x (), viewRect.bottom (), viewRect.width (), 1)); if (viewRect.height () > 2) { // Left line - updateView (v, QRect (viewRect.x (), viewRect.y () + 1, + updateView (v, TQRect (viewRect.x (), viewRect.y () + 1, 1, viewRect.height () - 2)); if (viewRect.width () >= 2) { // Right line - updateView (v, QRect (viewRect.right (), viewRect.y () + 1, + updateView (v, TQRect (viewRect.right (), viewRect.y () + 1, 1, viewRect.height () - 2)); } } @@ -690,16 +690,16 @@ void kpViewManager::updateViews () { kpDocument *doc = document (); if (doc) - updateViews (QRect (0, 0, doc->width (), doc->height ())); + updateViews (TQRect (0, 0, doc->width (), doc->height ())); } -void kpViewManager::updateViews (const QRect &docRect) +void kpViewManager::updateViews (const TQRect &docRect) { #if DEBUG_KP_VIEW_MANAGER && 0 kdDebug () << "kpViewManager::updateViews (" << docRect << ")" << endl; #endif - for (QPtrList <kpView>::const_iterator it = m_views.begin (); + for (TQPtrList <kpView>::const_iterator it = m_views.begin (); it != m_views.end (); it++) { @@ -717,15 +717,15 @@ void kpViewManager::updateViews (const QRect &docRect) } else { - QRect viewRect = view->transformDocToView (docRect); + TQRect viewRect = view->transformDocToView (docRect); int diff = qRound (double (QMAX (view->zoomLevelX (), view->zoomLevelY ())) / 100.0) + 1; - QRect newRect = QRect (viewRect.x () - diff, + TQRect newRect = TQRect (viewRect.x () - diff, viewRect.y () - diff, viewRect.width () + 2 * diff, viewRect.height () + 2 * diff) - .intersect (QRect (0, 0, view->width (), view->height ())); + .intersect (TQRect (0, 0, view->width (), view->height ())); #if DEBUG_KP_VIEW_MANAGER && 0 kdDebug () << "\t\tviewRect (+compensate)=" << newRect << endl; @@ -737,7 +737,7 @@ void kpViewManager::updateViews (const QRect &docRect) void kpViewManager::updateViews (int x, int y, int w, int h) { - updateViews (QRect (x, y, w, h)); + updateViews (TQRect (x, y, w, h)); } @@ -748,7 +748,7 @@ void kpViewManager::adjustViewsToEnvironment () << " numViews=" << m_views.count () << endl; #endif - for (QPtrList <kpView>::const_iterator it = m_views.begin (); + for (TQPtrList <kpView>::const_iterator it = m_views.begin (); it != m_views.end (); it++) { diff --git a/kolourpaint/kpviewmanager.h b/kolourpaint/kpviewmanager.h index c6ea1ef0..9bb6e8b6 100644 --- a/kolourpaint/kpviewmanager.h +++ b/kolourpaint/kpviewmanager.h @@ -29,15 +29,15 @@ #ifndef __kpviewmanager_h__ #define __kpviewmanager_h__ -#include <qcursor.h> -#include <qobject.h> -#include <qptrlist.h> -#include <qrect.h> +#include <tqcursor.h> +#include <tqobject.h> +#include <tqptrlist.h> +#include <tqrect.h> -class QPixmap; -class QRect; -class QTimer; +class TQPixmap; +class TQRect; +class TQTimer; class kpDocument; class kpView; @@ -99,7 +99,7 @@ public: protected: void updateTextCursor (); - QTimer *m_textCursorBlinkTimer; + TQTimer *m_textCursorBlinkTimer; int m_textCursorRow, m_textCursorCol; bool m_textCursorBlinkState; @@ -112,7 +112,7 @@ public: // Cursors // - void setCursor (const QCursor &cursor); + void setCursor (const TQCursor &cursor); void unsetCursor (); @@ -123,9 +123,9 @@ public: kpView *viewUnderCursor (bool usingQt = false) const; // - // QWidget::hasMouse() is unreliable: + // TQWidget::hasMouse() is unreliable: // - // "bool QWidget::hasMouse () const + // "bool TQWidget::hasMouse () const // ... See the "underMouse" property for details. // . // . @@ -154,7 +154,7 @@ public: // before multiple, big, non-interactive changes to the // document to eliminate virtually all flicker. // - // This is better than QWidget::setUpdatesEnabled() because + // This is better than TQWidget::setUpdatesEnabled() because // restoreQueueUpdates() automatically restores only the regions // of the views that need to be repainted, per view. bool queueUpdates () const; @@ -163,7 +163,7 @@ public: // Controls behaviour of updateViews(): // - // Slow: Let Qt buffer paint events via QWidget::update(). + // Slow: Let Qt buffer paint events via TQWidget::update(). // Results in less flicker. Paint events are probably merged // so long-term efficiency is increased at the expense of // reduced responsiveness (default). @@ -183,13 +183,13 @@ private: public slots: // updating views void updateView (kpView *v); - void updateView (kpView *v, const QRect &viewRect); + void updateView (kpView *v, const TQRect &viewRect); void updateView (kpView *v, int x, int y, int w, int h); - void updateView (kpView *v, const QRegion &viewRegion); - void updateViewRectangleEdges (kpView *v, const QRect &viewRect); + void updateView (kpView *v, const TQRegion &viewRegion); + void updateViewRectangleEdges (kpView *v, const TQRect &viewRect); void updateViews (); - void updateViews (const QRect &docRect); + void updateViews (const TQRect &docRect); void updateViews (int x, int y, int w, int h); void adjustViewsToEnvironment (); @@ -202,8 +202,8 @@ private: kpDocument *document () const; kpMainWindow *m_mainWindow; - QPtrList <kpView> m_views; - QCursor m_cursor; + TQPtrList <kpView> m_views; + TQCursor m_cursor; kpTempPixmap *m_tempPixmap; kpView *m_viewUnderCursor; diff --git a/kolourpaint/kpviewscrollablecontainer.cpp b/kolourpaint/kpviewscrollablecontainer.cpp index 637f71b7..c3942806 100644 --- a/kolourpaint/kpviewscrollablecontainer.cpp +++ b/kolourpaint/kpviewscrollablecontainer.cpp @@ -29,11 +29,11 @@ #include <kpviewscrollablecontainer.h> -#include <qcursor.h> -#include <qpainter.h> -#include <qpen.h> -#include <qpixmap.h> -#include <qtimer.h> +#include <tqcursor.h> +#include <tqpainter.h> +#include <tqpen.h> +#include <tqpixmap.h> +#include <tqtimer.h> #include <kdebug.h> #include <klocale.h> @@ -58,8 +58,8 @@ static const int GripHandleSize = 7; kpGrip::kpGrip (GripType type, - QWidget *parent, const char *name) - : QWidget (parent, name), + TQWidget *parent, const char *name) + : TQWidget (parent, name), m_type (type), m_startPoint (KP_INVALID_POINT), m_currentPoint (KP_INVALID_POINT), @@ -85,7 +85,7 @@ kpGrip::GripType kpGrip::type () const // public static -const QCursor &kpGrip::cursorForType (GripType type) +const TQCursor &kpGrip::cursorForType (GripType type) { switch (type) { @@ -107,23 +107,23 @@ const QCursor &kpGrip::cursorForType (GripType type) // public -QRect kpGrip::hotRect (bool toGlobal) const +TQRect kpGrip::hotRect (bool toGlobal) const { - QRect ret; + TQRect ret; switch (m_type) { case Bottom: { const int handleX = (width () - GripHandleSize) / 2; - ret = QRect (handleX, 0, + ret = TQRect (handleX, 0, GripHandleSize, height ()); break; } case Right: { const int handleY = (height () - GripHandleSize) / 2; - ret = QRect (0, handleY, + ret = TQRect (0, handleY, width (), GripHandleSize); break; } @@ -133,10 +133,10 @@ QRect kpGrip::hotRect (bool toGlobal) const break; default: - return QRect (); + return TQRect (); } - return (toGlobal ? QRect (mapToGlobal (ret.topLeft ()), + return (toGlobal ? TQRect (mapToGlobal (ret.topLeft ()), mapToGlobal (ret.bottomRight ())) : ret); } @@ -150,20 +150,20 @@ bool kpGrip::isDrawing () const // public -QString kpGrip::haventBegunDrawUserMessage () const +TQString kpGrip::haventBegunDrawUserMessage () const { return i18n ("Left drag the handle to resize the image."); } // public -QString kpGrip::userMessage () const +TQString kpGrip::userMessage () const { return m_userMessage; } // public -void kpGrip::setUserMessage (const QString &message) +void kpGrip::setUserMessage (const TQString &message) { // Don't do NOP checking here since another grip might have changed // the message so an apparent NOP for this grip is not a NOP in the @@ -183,10 +183,10 @@ void kpGrip::updatePixmap () if (width () <= 0 || height () <= 0) return; - QPixmap pixmap (width (), height ()); + TQPixmap pixmap (width (), height ()); pixmap.fill (colorGroup ().highlight ()); kpPixmapFX::ensureTransparentAt (&pixmap, pixmap.rect ()); - const QRect hr = hotRect (); + const TQRect hr = hotRect (); #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER kdDebug () << "\thotRect=" << hr << endl; #endif @@ -221,7 +221,7 @@ void kpGrip::cancel () // protected virtual [base QWidget] -void kpGrip::keyReleaseEvent (QKeyEvent *e) +void kpGrip::keyReleaseEvent (TQKeyEvent *e) { if (m_startPoint != KP_INVALID_POINT && e->key () == Qt::Key_Escape) @@ -231,7 +231,7 @@ void kpGrip::keyReleaseEvent (QKeyEvent *e) } // protected virtual [base QWidget] -void kpGrip::mousePressEvent (QMouseEvent *e) +void kpGrip::mousePressEvent (TQMouseEvent *e) { if (m_startPoint == KP_INVALID_POINT && (e->stateAfter () & Qt::MouseButtonMask) == Qt::LeftButton) @@ -252,22 +252,22 @@ void kpGrip::mousePressEvent (QMouseEvent *e) } // public -QPoint kpGrip::viewDeltaPoint () const +TQPoint kpGrip::viewDeltaPoint () const { if (m_startPoint == KP_INVALID_POINT) return KP_INVALID_POINT; - const QPoint point = mapFromGlobal (QCursor::pos ()); + const TQPoint point = mapFromGlobal (TQCursor::pos ()); // TODO: this is getting out of sync with m_currentPoint - return QPoint (((m_type & Right) ? point.x () - m_startPoint.x () : 0), + return TQPoint (((m_type & Right) ? point.x () - m_startPoint.x () : 0), ((m_type & Bottom) ? point.y () - m_startPoint.y () : 0)); } // public -void kpGrip::mouseMovedTo (const QPoint &point, bool dueToDragScroll) +void kpGrip::mouseMovedTo (const TQPoint &point, bool dueToDragScroll) { if (m_startPoint == KP_INVALID_POINT) return; @@ -280,7 +280,7 @@ void kpGrip::mouseMovedTo (const QPoint &point, bool dueToDragScroll) } // protected virtual [base QWidget] -void kpGrip::mouseMoveEvent (QMouseEvent *e) +void kpGrip::mouseMoveEvent (TQMouseEvent *e) { #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER kdDebug () << "kpGrip::mouseMoveEvent() m_startPoint=" << m_startPoint @@ -299,7 +299,7 @@ void kpGrip::mouseMoveEvent (QMouseEvent *e) } // protected virtual [base QWidget] -void kpGrip::mouseReleaseEvent (QMouseEvent *e) +void kpGrip::mouseReleaseEvent (TQMouseEvent *e) { #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER kdDebug () << "kpGrip::mouseReleaseEvent() m_startPoint=" << m_startPoint @@ -323,7 +323,7 @@ void kpGrip::mouseReleaseEvent (QMouseEvent *e) if ((e->stateAfter () & Qt::MouseButtonMask) == 0) { m_shouldReleaseMouseButtons = false; - setUserMessage (QString::null); + setUserMessage (TQString::null); setCursor (cursorForType (m_type)); releaseKeyboard (); @@ -333,7 +333,7 @@ void kpGrip::mouseReleaseEvent (QMouseEvent *e) // protected virtual [base QWidget] -void kpGrip::resizeEvent (QResizeEvent *) +void kpGrip::resizeEvent (TQResizeEvent *) { #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER kdDebug () << "kpGrip::resizeEvent()" << endl; @@ -343,7 +343,7 @@ void kpGrip::resizeEvent (QResizeEvent *) // protected virtual [base QWidget] -void kpGrip::enterEvent (QEvent * /*e*/) +void kpGrip::enterEvent (TQEvent * /*e*/) { #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER kdDebug () << "kpGrip::enterEvent()" @@ -363,7 +363,7 @@ void kpGrip::enterEvent (QEvent * /*e*/) } // protected virtual [base QWidget] -void kpGrip::leaveEvent (QEvent * /*e*/) +void kpGrip::leaveEvent (TQEvent * /*e*/) { #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER kdDebug () << "kpGrip::leaveEvent()" @@ -374,25 +374,25 @@ void kpGrip::leaveEvent (QEvent * /*e*/) if (m_startPoint == KP_INVALID_POINT && !m_shouldReleaseMouseButtons) { - setUserMessage (QString::null); + setUserMessage (TQString::null); } } // protected virtual [base QWidget] -void kpGrip::paintEvent (QPaintEvent *e) +void kpGrip::paintEvent (TQPaintEvent *e) { #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER && 0 kdDebug () << "kpGrip::paintEvent(" << e->rect () << ")" << endl; #endif - QWidget::paintEvent (e); + TQWidget::paintEvent (e); } // TODO: Are we checking for m_view == 0 often enough? kpViewScrollableContainer::kpViewScrollableContainer (kpMainWindow *parent, const char *name) - : QScrollView ((QWidget *) parent, name, Qt::WStaticContents | Qt::WNoAutoErase), + : TQScrollView ((TQWidget *) parent, name, Qt::WStaticContents | Qt::WNoAutoErase), m_mainWindow (parent), m_contentsXSoon (-1), m_contentsYSoon (-1), m_view (0), @@ -400,7 +400,7 @@ kpViewScrollableContainer::kpViewScrollableContainer (kpMainWindow *parent, m_rightGrip (new kpGrip (kpGrip::Right, viewport (), "Right Grip")), m_bottomRightGrip (new kpGrip (kpGrip::BottomRight, viewport (), "BottomRight Grip")), m_docResizingGrip (0), - m_dragScrollTimer (new QTimer (this)), + m_dragScrollTimer (new TQTimer (this)), m_zoomLevel (100), m_scrollTimerRunOnce (false), m_resizeRoundedLastViewX (-1), m_resizeRoundedLastViewY (-1), @@ -424,11 +424,11 @@ kpViewScrollableContainer::kpViewScrollableContainer (kpMainWindow *parent, connectGripSignals (m_bottomRightGrip); - connect (this, SIGNAL (contentsMoving (int, int)), - this, SLOT (slotContentsMoving (int, int))); + connect (this, TQT_SIGNAL (contentsMoving (int, int)), + this, TQT_SLOT (slotContentsMoving (int, int))); - connect (m_dragScrollTimer, SIGNAL (timeout ()), - this, SLOT (slotDragScroll ())); + connect (m_dragScrollTimer, TQT_SIGNAL (timeout ()), + this, TQT_SLOT (slotDragScroll ())); } kpViewScrollableContainer::~kpViewScrollableContainer () @@ -458,25 +458,25 @@ int kpViewScrollableContainer::contentsYSoon () // protected void kpViewScrollableContainer::connectGripSignals (kpGrip *grip) { - connect (grip, SIGNAL (beganDraw ()), - this, SLOT (slotGripBeganDraw ())); - connect (grip, SIGNAL (continuedDraw (int, int, bool)), - this, SLOT (slotGripContinuedDraw (int, int, bool))); - connect (grip, SIGNAL (cancelledDraw ()), - this, SLOT (slotGripCancelledDraw ())); - connect (grip, SIGNAL (endedDraw (int, int)), - this, SLOT (slotGripEndedDraw (int, int))); + connect (grip, TQT_SIGNAL (beganDraw ()), + this, TQT_SLOT (slotGripBeganDraw ())); + connect (grip, TQT_SIGNAL (continuedDraw (int, int, bool)), + this, TQT_SLOT (slotGripContinuedDraw (int, int, bool))); + connect (grip, TQT_SIGNAL (cancelledDraw ()), + this, TQT_SLOT (slotGripCancelledDraw ())); + connect (grip, TQT_SIGNAL (endedDraw (int, int)), + this, TQT_SLOT (slotGripEndedDraw (int, int))); - connect (grip, SIGNAL (statusMessageChanged (const QString &)), - this, SLOT (slotGripStatusMessageChanged (const QString &))); + connect (grip, TQT_SIGNAL (statusMessageChanged (const TQString &)), + this, TQT_SLOT (slotGripStatusMessageChanged (const TQString &))); - connect (grip, SIGNAL (releasedAllButtons ()), - this, SLOT (recalculateStatusMessage ())); + connect (grip, TQT_SIGNAL (releasedAllButtons ()), + this, TQT_SLOT (recalculateStatusMessage ())); } // public -QSize kpViewScrollableContainer::newDocSize () const +TQSize kpViewScrollableContainer::newDocSize () const { return newDocSize (m_resizeRoundedLastViewDX, m_resizeRoundedLastViewDY); @@ -489,7 +489,7 @@ bool kpViewScrollableContainer::haveMovedFromOriginalDocSize () const } // public -QString kpViewScrollableContainer::statusMessage () const +TQString kpViewScrollableContainer::statusMessage () const { return m_gripStatusMessage; } @@ -500,25 +500,25 @@ void kpViewScrollableContainer::clearStatusMessage () #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER && 1 kdDebug () << "kpViewScrollableContainer::clearStatusMessage()" << endl; #endif - m_bottomRightGrip->setUserMessage (QString::null); - m_bottomGrip->setUserMessage (QString::null); - m_rightGrip->setUserMessage (QString::null); + m_bottomRightGrip->setUserMessage (TQString::null); + m_bottomGrip->setUserMessage (TQString::null); + m_rightGrip->setUserMessage (TQString::null); } // protected -QSize kpViewScrollableContainer::newDocSize (int viewDX, int viewDY) const +TQSize kpViewScrollableContainer::newDocSize (int viewDX, int viewDY) const { if (!m_view) - return QSize (); + return TQSize (); if (!docResizingGrip ()) - return QSize (); + return TQSize (); const int docX = (int) m_view->transformViewToDocX (m_view->width () + viewDX); const int docY = (int) m_view->transformViewToDocY (m_view->height () + viewDY); - return QSize (QMAX (1, docX), QMAX (1, docY)); + return TQSize (QMAX (1, docX), QMAX (1, docY)); } @@ -574,38 +574,38 @@ int kpViewScrollableContainer::rightResizeLineWidth () const // protected -QRect kpViewScrollableContainer::bottomResizeLineRect () const +TQRect kpViewScrollableContainer::bottomResizeLineRect () const { if (m_resizeRoundedLastViewX < 0 || m_resizeRoundedLastViewY < 0) - return QRect (); + return TQRect (); - return QRect (QPoint (0, + return TQRect (TQPoint (0, m_resizeRoundedLastViewY), - QPoint (m_resizeRoundedLastViewX - 1, + TQPoint (m_resizeRoundedLastViewX - 1, m_resizeRoundedLastViewY + bottomResizeLineWidth () - 1)); } // protected -QRect kpViewScrollableContainer::rightResizeLineRect () const +TQRect kpViewScrollableContainer::rightResizeLineRect () const { if (m_resizeRoundedLastViewX < 0 || m_resizeRoundedLastViewY < 0) - return QRect (); + return TQRect (); - return QRect (QPoint (m_resizeRoundedLastViewX, + return TQRect (TQPoint (m_resizeRoundedLastViewX, 0), - QPoint (m_resizeRoundedLastViewX + rightResizeLineWidth () - 1, + TQPoint (m_resizeRoundedLastViewX + rightResizeLineWidth () - 1, m_resizeRoundedLastViewY - 1)); } // protected -QRect kpViewScrollableContainer::bottomRightResizeLineRect () const +TQRect kpViewScrollableContainer::bottomRightResizeLineRect () const { if (m_resizeRoundedLastViewX < 0 || m_resizeRoundedLastViewY < 0) - return QRect (); + return TQRect (); - return QRect (QPoint (m_resizeRoundedLastViewX, + return TQRect (TQPoint (m_resizeRoundedLastViewX, m_resizeRoundedLastViewY), - QPoint (m_resizeRoundedLastViewX + rightResizeLineWidth () - 1, + TQPoint (m_resizeRoundedLastViewX + rightResizeLineWidth () - 1, m_resizeRoundedLastViewY + bottomResizeLineWidth () - 1)); } @@ -613,31 +613,31 @@ QRect kpViewScrollableContainer::bottomRightResizeLineRect () const // TODO: are these 2 correct? Remember that viewport()->x() == 1, viewport()->y() == 1 // protected -QPoint kpViewScrollableContainer::mapViewToViewport (const QPoint &viewPoint) +TQPoint kpViewScrollableContainer::mapViewToViewport (const TQPoint &viewPoint) { - return viewPoint - QPoint (contentsX (), contentsY ()); + return viewPoint - TQPoint (contentsX (), contentsY ()); } // protected -QRect kpViewScrollableContainer::mapViewToViewport (const QRect &viewRect) +TQRect kpViewScrollableContainer::mapViewToViewport (const TQRect &viewRect) { if (!viewRect.isValid ()) - return QRect (); + return TQRect (); - QRect ret = viewRect; + TQRect ret = viewRect; ret.moveBy (-contentsX (), -contentsY ()); return ret; } // protected -QRect kpViewScrollableContainer::mapViewportToGlobal (const QRect &viewportRect) +TQRect kpViewScrollableContainer::mapViewportToGlobal (const TQRect &viewportRect) { return kpWidgetMapper::toGlobal (viewport (), viewportRect); } // protected -QRect kpViewScrollableContainer::mapViewToGlobal (const QRect &viewRect) +TQRect kpViewScrollableContainer::mapViewToGlobal (const TQRect &viewRect) { return mapViewportToGlobal (mapViewToViewport (viewRect)); } @@ -645,16 +645,16 @@ QRect kpViewScrollableContainer::mapViewToGlobal (const QRect &viewRect) // protected void kpViewScrollableContainer::repaintWidgetAtResizeLineViewRect ( - QWidget *widget, const QRect &resizeLineViewRect) + TQWidget *widget, const TQRect &resizeLineViewRect) { - const QRect resizeLineGlobalRect = mapViewToGlobal (resizeLineViewRect); - const QRect widgetGlobalRect = kpWidgetMapper::toGlobal (widget, + const TQRect resizeLineGlobalRect = mapViewToGlobal (resizeLineViewRect); + const TQRect widgetGlobalRect = kpWidgetMapper::toGlobal (widget, widget->rect ()); - const QRect redrawGlobalRect = + const TQRect redrawGlobalRect = resizeLineGlobalRect.intersect (widgetGlobalRect); - const QRect redrawWidgetRect = + const TQRect redrawWidgetRect = kpWidgetMapper::fromGlobal (widget, redrawGlobalRect); @@ -668,7 +668,7 @@ void kpViewScrollableContainer::repaintWidgetAtResizeLineViewRect ( } // protected -void kpViewScrollableContainer::repaintWidgetAtResizeLines (QWidget *widget) +void kpViewScrollableContainer::repaintWidgetAtResizeLines (TQWidget *widget) { repaintWidgetAtResizeLineViewRect (widget, rightResizeLineRect ()); repaintWidgetAtResizeLineViewRect (widget, bottomResizeLineRect ()); @@ -701,18 +701,18 @@ void kpViewScrollableContainer::drawResizeLines () #endif - QPainter p (viewport (), true/*unclipped*/); + TQPainter p (viewport (), true/*unclipped*/); p.setRasterOp (Qt::NotROP); - const QRect rightRect = rightResizeLineRect (); + const TQRect rightRect = rightResizeLineRect (); if (rightRect.isValid ()) p.fillRect (mapViewToViewport (rightRect), Qt::white); - const QRect bottomRect = bottomResizeLineRect (); + const TQRect bottomRect = bottomResizeLineRect (); if (bottomRect.isValid ()) p.fillRect (mapViewToViewport (bottomRect), Qt::white); - const QRect bottomRightRect = bottomRightResizeLineRect (); + const TQRect bottomRightRect = bottomRightResizeLineRect (); if (bottomRightRect.isValid ()) p.fillRect (mapViewToViewport (bottomRightRect), Qt::white); @@ -802,9 +802,9 @@ void kpViewScrollableContainer::slotGripContinuedDraw (int inViewDX, int inViewD return; if (!dueToDragScroll && - beginDragScroll (QPoint (), QPoint (), m_view->zoomLevelX ())) + beginDragScroll (TQPoint (), TQPoint (), m_view->zoomLevelX ())) { - const QPoint newViewDeltaPoint = docResizingGrip ()->viewDeltaPoint (); + const TQPoint newViewDeltaPoint = docResizingGrip ()->viewDeltaPoint (); viewDX = newViewDeltaPoint.x (); viewDY = newViewDeltaPoint.y (); #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER @@ -850,7 +850,7 @@ void kpViewScrollableContainer::slotGripEndedDraw (int viewDX, int viewDY) if (!m_view) return; - const QSize newSize = newDocSize (viewDX, viewDY); + const TQSize newSize = newDocSize (viewDX, viewDY); m_haveMovedFromOriginalDocSize = false; @@ -866,7 +866,7 @@ void kpViewScrollableContainer::slotGripEndedDraw (int viewDX, int viewDY) // protected slot -void kpViewScrollableContainer::slotGripStatusMessageChanged (const QString &string) +void kpViewScrollableContainer::slotGripStatusMessageChanged (const TQString &string) { if (string == m_gripStatusMessage) return; @@ -881,10 +881,10 @@ void kpViewScrollableContainer::recalculateStatusMessage () { #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER kdDebug () << "kpViewScrollabelContainer::recalculateStatusMessage()" << endl; - kdDebug () << "\tQCursor::pos=" << QCursor::pos () + kdDebug () << "\tQCursor::pos=" << TQCursor::pos () << " global visibleRect=" << kpWidgetMapper::toGlobal (this, - QRect (0, 0, visibleWidth (), visibleHeight ())) + TQRect (0, 0, visibleWidth (), visibleHeight ())) << " brGrip.hotRect=" << m_bottomRightGrip->hotRect (true) << " bGrip.hotRect=" << m_bottomGrip->hotRect (true) << " rGrip.hotRect=" << m_rightGrip->hotRect (true) @@ -897,24 +897,24 @@ void kpViewScrollableContainer::recalculateStatusMessage () // grip. // if (kpWidgetMapper::toGlobal (this, - QRect (0, 0, visibleWidth (), visibleHeight ())) - .contains (QCursor::pos ())) + TQRect (0, 0, visibleWidth (), visibleHeight ())) + .contains (TQCursor::pos ())) { if (m_bottomRightGrip->isShown () && m_bottomRightGrip->hotRect (true/*to global*/) - .contains (QCursor::pos ())) + .contains (TQCursor::pos ())) { m_bottomRightGrip->setUserMessage (i18n ("Left drag the handle to resize the image.")); } else if (m_bottomGrip->isShown () && m_bottomGrip->hotRect (true/*to global*/) - .contains (QCursor::pos ())) + .contains (TQCursor::pos ())) { m_bottomGrip->setUserMessage (i18n ("Left drag the handle to resize the image.")); } else if (m_rightGrip->isShown () && m_rightGrip->hotRect (true/*to global*/) - .contains (QCursor::pos ())) + .contains (TQCursor::pos ())) { m_rightGrip->setUserMessage (i18n ("Left drag the handle to resize the image.")); } @@ -943,10 +943,10 @@ void kpViewScrollableContainer::slotContentsMoving (int x, int y) m_contentsXSoon = x, m_contentsYSoon = y; emit contentsMovingSoon (m_contentsXSoon, m_contentsYSoon); - // Reduce flicker - don't let QScrollView scroll to-be-erased lines + // Reduce flicker - don't let TQScrollView scroll to-be-erased lines eraseResizeLines (); - QTimer::singleShot (0, this, SLOT (slotContentsMoved ())); + TQTimer::singleShot (0, this, TQT_SLOT (slotContentsMoved ())); } // protected slot @@ -964,7 +964,7 @@ void kpViewScrollableContainer::slotContentsMoved () if (!grip) return; - grip->mouseMovedTo (grip->mapFromGlobal (QCursor::pos ()), + grip->mouseMovedTo (grip->mapFromGlobal (TQCursor::pos ()), true/*moved due to drag scroll*/); } @@ -972,31 +972,31 @@ void kpViewScrollableContainer::slotContentsMoved () // protected void kpViewScrollableContainer::disconnectViewSignals () { - disconnect (m_view, SIGNAL (sizeChanged (const QSize &)), - this, SLOT (updateGrips ())); - disconnect (m_view, SIGNAL (destroyed ()), - this, SLOT (slotViewDestroyed ())); + disconnect (m_view, TQT_SIGNAL (sizeChanged (const TQSize &)), + this, TQT_SLOT (updateGrips ())); + disconnect (m_view, TQT_SIGNAL (destroyed ()), + this, TQT_SLOT (slotViewDestroyed ())); } // protected void kpViewScrollableContainer::connectViewSignals () { - connect (m_view, SIGNAL (sizeChanged (const QSize &)), - this, SLOT (updateGrips ())); - connect (m_view, SIGNAL (destroyed ()), - this, SLOT (slotViewDestroyed ())); + connect (m_view, TQT_SIGNAL (sizeChanged (const TQSize &)), + this, TQT_SLOT (updateGrips ())); + connect (m_view, TQT_SIGNAL (destroyed ()), + this, TQT_SLOT (slotViewDestroyed ())); } // public virtual [base QScrollView] -void kpViewScrollableContainer::addChild (QWidget *widget, int x, int y) +void kpViewScrollableContainer::addChild (TQWidget *widget, int x, int y) { #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER kdDebug () << "kpViewScrollableContainer::addChild(" << widget << "," << x << "," << y << endl; #endif - QScrollView::addChild (widget, x, y); + TQScrollView::addChild (widget, x, y); kpView *view = dynamic_cast <kpView *> (widget); #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER @@ -1098,8 +1098,8 @@ void kpViewScrollableContainer::slotViewDestroyed () // public slot -bool kpViewScrollableContainer::beginDragScroll (const QPoint &/*docPoint*/, - const QPoint &/*lastDocPoint*/, +bool kpViewScrollableContainer::beginDragScroll (const TQPoint &/*docPoint*/, + const TQPoint &/*lastDocPoint*/, int zoomLevel, bool *didSomething) { @@ -1108,7 +1108,7 @@ bool kpViewScrollableContainer::beginDragScroll (const QPoint &/*docPoint*/, m_zoomLevel = zoomLevel; - const QPoint p = mapFromGlobal (QCursor::pos ()); + const TQPoint p = mapFromGlobal (TQCursor::pos ()); #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER kdDebug () << "kpViewScrollableContainer::beginDragScroll() p=" << p @@ -1147,8 +1147,8 @@ bool kpViewScrollableContainer::beginDragScroll (const QPoint &/*docPoint*/, } // public slot -bool kpViewScrollableContainer::beginDragScroll (const QPoint &docPoint, - const QPoint &lastDocPoint, +bool kpViewScrollableContainer::beginDragScroll (const TQPoint &docPoint, + const TQPoint &lastDocPoint, int zoomLevel) { return beginDragScroll (docPoint, lastDocPoint, zoomLevel, @@ -1197,8 +1197,8 @@ bool kpViewScrollableContainer::slotDragScroll (bool *didSomething) *didSomething = false; - const QRect rect = noDragScrollRect (); - const QPoint pos = mapFromGlobal (QCursor::pos ()); + const TQRect rect = noDragScrollRect (); + const TQPoint pos = mapFromGlobal (TQCursor::pos ()); #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER kdDebug () << "kpViewScrollableContainer::slotDragScroll()" @@ -1262,9 +1262,9 @@ bool kpViewScrollableContainer::slotDragScroll (bool *didSomething) if (scrolled) { - QRegion region = QRect (contentsX (), contentsY (), + TQRegion region = TQRect (contentsX (), contentsY (), visibleWidth (), visibleHeight ()); - region -= QRect (oldContentsX, oldContentsY, + region -= TQRect (oldContentsX, oldContentsY, visibleWidth (), visibleHeight ()); // Repaint newly exposed region immediately to reduce tearing @@ -1285,7 +1285,7 @@ bool kpViewScrollableContainer::slotDragScroll (bool *didSomething) } // protected virtual [base QScrollView] -void kpViewScrollableContainer::contentsDragMoveEvent (QDragMoveEvent *e) +void kpViewScrollableContainer::contentsDragMoveEvent (TQDragMoveEvent *e) { #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER kdDebug () << "kpViewScrollableContainer::contentsDragMoveEvent" @@ -1293,7 +1293,7 @@ void kpViewScrollableContainer::contentsDragMoveEvent (QDragMoveEvent *e) << endl; #endif - QScrollView::contentsDragMoveEvent (e); + TQScrollView::contentsDragMoveEvent (e); } // protected slot @@ -1304,7 +1304,7 @@ bool kpViewScrollableContainer::slotDragScroll () // protected virtual [base QScrollView] -void kpViewScrollableContainer::contentsMouseMoveEvent (QMouseEvent *e) +void kpViewScrollableContainer::contentsMouseMoveEvent (TQMouseEvent *e) { #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER kdDebug () << "kpViewScrollableContainer::contentsMouseMoveEvent" @@ -1312,11 +1312,11 @@ void kpViewScrollableContainer::contentsMouseMoveEvent (QMouseEvent *e) << endl; #endif - QScrollView::contentsMouseMoveEvent (e); + TQScrollView::contentsMouseMoveEvent (e); } // protected virtual [base QScrollView] -void kpViewScrollableContainer::mouseMoveEvent (QMouseEvent *e) +void kpViewScrollableContainer::mouseMoveEvent (TQMouseEvent *e) { #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER kdDebug () << "kpViewScrollableContainer::mouseMoveEvent" @@ -1324,12 +1324,12 @@ void kpViewScrollableContainer::mouseMoveEvent (QMouseEvent *e) << endl; #endif - QScrollView::mouseMoveEvent (e); + TQScrollView::mouseMoveEvent (e); } // protected virtual [base QScrollView] -void kpViewScrollableContainer::contentsWheelEvent (QWheelEvent *e) +void kpViewScrollableContainer::contentsWheelEvent (TQWheelEvent *e) { e->ignore (); @@ -1337,25 +1337,25 @@ void kpViewScrollableContainer::contentsWheelEvent (QWheelEvent *e) m_view->wheelEvent (e); if (!e->isAccepted ()) - QScrollView::contentsWheelEvent (e); + TQScrollView::contentsWheelEvent (e); } -QRect kpViewScrollableContainer::noDragScrollRect () const +TQRect kpViewScrollableContainer::noDragScrollRect () const { - return QRect (DragScrollLeftTopMargin, DragScrollLeftTopMargin, + return TQRect (DragScrollLeftTopMargin, DragScrollLeftTopMargin, width () - DragScrollLeftTopMargin - DragScrollRightBottomMargin, height () - DragScrollLeftTopMargin - DragScrollRightBottomMargin); } // protected virtual [base QScrollView] -bool kpViewScrollableContainer::eventFilter (QObject *watchedObject, QEvent *event) +bool kpViewScrollableContainer::eventFilter (TQObject *watchedObject, TQEvent *event) { - return QScrollView::eventFilter (watchedObject, event); + return TQScrollView::eventFilter (watchedObject, event); } // protected virtual [base QScrollView] -void kpViewScrollableContainer::viewportPaintEvent (QPaintEvent *e) +void kpViewScrollableContainer::viewportPaintEvent (TQPaintEvent *e) { #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER kdDebug () << "kpViewScrollableContainer::viewportPaintEvent(" @@ -1363,11 +1363,11 @@ void kpViewScrollableContainer::viewportPaintEvent (QPaintEvent *e) << ")" << endl; #endif - QScrollView::viewportPaintEvent (e); + TQScrollView::viewportPaintEvent (e); } // protected virtual [base QFrame] -void kpViewScrollableContainer::paintEvent (QPaintEvent *e) +void kpViewScrollableContainer::paintEvent (TQPaintEvent *e) { #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER && 0 kdDebug () << "kpViewScrollableContainer::paintEvent(" @@ -1375,13 +1375,13 @@ void kpViewScrollableContainer::paintEvent (QPaintEvent *e) << ")" << endl; #endif - QScrollView::paintEvent (e); + TQScrollView::paintEvent (e); } // protected virtual [base QScrollView] -void kpViewScrollableContainer::resizeEvent (QResizeEvent *e) +void kpViewScrollableContainer::resizeEvent (TQResizeEvent *e) { - QScrollView::resizeEvent (e); + TQScrollView::resizeEvent (e); emit resized (); } diff --git a/kolourpaint/kpviewscrollablecontainer.h b/kolourpaint/kpviewscrollablecontainer.h index 203bbd1f..ad948e9a 100644 --- a/kolourpaint/kpviewscrollablecontainer.h +++ b/kolourpaint/kpviewscrollablecontainer.h @@ -30,14 +30,14 @@ #define KP_VIEW_SCROLLABLE_CONTAINER_H -#include <qpoint.h> -#include <qscrollview.h> -#include <qsize.h> +#include <tqpoint.h> +#include <tqscrollview.h> +#include <tqsize.h> -class QCursor; -class QRect; -class QTimer; +class TQCursor; +class TQRect; +class TQTimer; class kpGrip; class kpView; @@ -57,14 +57,14 @@ public: }; kpGrip (GripType type, - QWidget *parent, const char *name = 0); + TQWidget *parent, const char *name = 0); virtual ~kpGrip (); GripType type () const; - static const QCursor &cursorForType (GripType type); + static const TQCursor &cursorForType (GripType type); - QRect hotRect (bool toGlobal = false) const; + TQRect hotRect (bool toGlobal = false) const; bool isDrawing () const; @@ -74,40 +74,40 @@ signals: void cancelledDraw (); void endedDraw (int viewDX, int viewDY); - void statusMessageChanged (const QString &string); + void statusMessageChanged (const TQString &string); void releasedAllButtons (); public: - QString haventBegunDrawUserMessage () const; + TQString haventBegunDrawUserMessage () const; - QString userMessage () const; - void setUserMessage (const QString &message); + TQString userMessage () const; + void setUserMessage (const TQString &message); protected: void updatePixmap (); void cancel (); protected: - virtual void keyReleaseEvent (QKeyEvent *e); - virtual void mousePressEvent (QMouseEvent *e); + virtual void keyReleaseEvent (TQKeyEvent *e); + virtual void mousePressEvent (TQMouseEvent *e); public: - QPoint viewDeltaPoint () const; - void mouseMovedTo (const QPoint &point, bool dueToDragScroll); + TQPoint viewDeltaPoint () const; + void mouseMovedTo (const TQPoint &point, bool dueToDragScroll); protected: - virtual void mouseMoveEvent (QMouseEvent *e); - virtual void mouseReleaseEvent (QMouseEvent *e); - virtual void resizeEvent (QResizeEvent *e); + virtual void mouseMoveEvent (TQMouseEvent *e); + virtual void mouseReleaseEvent (TQMouseEvent *e); + virtual void resizeEvent (TQResizeEvent *e); - virtual void enterEvent (QEvent *e); - virtual void leaveEvent (QEvent *e); + virtual void enterEvent (TQEvent *e); + virtual void leaveEvent (TQEvent *e); - virtual void paintEvent (QPaintEvent *e); + virtual void paintEvent (TQPaintEvent *e); protected: GripType m_type; - QPoint m_startPoint, m_currentPoint; - QString m_userMessage; + TQPoint m_startPoint, m_currentPoint; + TQString m_userMessage; bool m_shouldReleaseMouseButtons; }; @@ -133,25 +133,25 @@ signals: void contentsMovingSoon (int contentsX, int contentsY); void beganDocResize (); - void continuedDocResize (const QSize &size); + void continuedDocResize (const TQSize &size); void cancelledDocResize (); - void endedDocResize (const QSize &size); + void endedDocResize (const TQSize &size); // (string.isEmpty() if kpViewScrollableContainer has nothing to say) - void statusMessageChanged (const QString &string); + void statusMessageChanged (const TQString &string); void resized (); public: - QSize newDocSize () const; + TQSize newDocSize () const; bool haveMovedFromOriginalDocSize () const; - QString statusMessage () const; + TQString statusMessage () const; void clearStatusMessage (); protected: void connectGripSignals (kpGrip *grip); - QSize newDocSize (int viewDX, int viewDY) const; + TQSize newDocSize (int viewDX, int viewDY) const; void calculateDocResizingGrip (); kpGrip *docResizingGrip () const; @@ -159,19 +159,19 @@ protected: int bottomResizeLineWidth () const; int rightResizeLineWidth () const; - QRect bottomResizeLineRect () const; - QRect rightResizeLineRect () const; - QRect bottomRightResizeLineRect () const; + TQRect bottomResizeLineRect () const; + TQRect rightResizeLineRect () const; + TQRect bottomRightResizeLineRect () const; - QPoint mapViewToViewport (const QPoint &viewPoint); - QRect mapViewToViewport (const QRect &viewRect); + TQPoint mapViewToViewport (const TQPoint &viewPoint); + TQRect mapViewToViewport (const TQRect &viewRect); - QRect mapViewportToGlobal (const QRect &viewportRect); - QRect mapViewToGlobal (const QRect &viewRect); + TQRect mapViewportToGlobal (const TQRect &viewportRect); + TQRect mapViewToGlobal (const TQRect &viewRect); - void repaintWidgetAtResizeLineViewRect (QWidget *widget, - const QRect &resizeLineViewRect); - void repaintWidgetAtResizeLines (QWidget *widget); + void repaintWidgetAtResizeLineViewRect (TQWidget *widget, + const TQRect &resizeLineViewRect); + void repaintWidgetAtResizeLines (TQWidget *widget); void eraseResizeLines (); void drawResizeLines (); @@ -185,7 +185,7 @@ protected slots: void slotGripCancelledDraw (); void slotGripEndedDraw (int viewDX, int viewDY); - void slotGripStatusMessageChanged (const QString &string); + void slotGripStatusMessageChanged (const TQString &string); public slots: void recalculateStatusMessage (); @@ -200,7 +200,7 @@ protected: public: // Calls setView(<widget>) after adding <widget> if it's a kpView. - virtual void addChild (QWidget *widget, int x = 0, int y = 0); + virtual void addChild (TQWidget *widget, int x = 0, int y = 0); kpView *view () const; void setView (kpView *view); @@ -213,10 +213,10 @@ protected slots: public slots: // TODO: Why the QPoint's? // Why the need for view's zoomLevel? We have the view() anyway. - bool beginDragScroll (const QPoint &, const QPoint &, + bool beginDragScroll (const TQPoint &, const TQPoint &, int zoomLevel, bool *didSomething); - bool beginDragScroll (const QPoint &, const QPoint &, + bool beginDragScroll (const TQPoint &, const TQPoint &, int zoomLevel); bool endDragScroll (); @@ -225,16 +225,16 @@ protected slots: bool slotDragScroll (); protected: - QRect noDragScrollRect () const; + TQRect noDragScrollRect () const; - virtual void contentsDragMoveEvent (QDragMoveEvent *e); - virtual void contentsMouseMoveEvent (QMouseEvent *e); - virtual void contentsWheelEvent (QWheelEvent *e); - virtual void mouseMoveEvent (QMouseEvent *e); - virtual bool eventFilter (QObject *watchedObject, QEvent *e); - virtual void viewportPaintEvent (QPaintEvent *e); - virtual void paintEvent (QPaintEvent *e); - virtual void resizeEvent (QResizeEvent *e); + virtual void contentsDragMoveEvent (TQDragMoveEvent *e); + virtual void contentsMouseMoveEvent (TQMouseEvent *e); + virtual void contentsWheelEvent (TQWheelEvent *e); + virtual void mouseMoveEvent (TQMouseEvent *e); + virtual bool eventFilter (TQObject *watchedObject, TQEvent *e); + virtual void viewportPaintEvent (TQPaintEvent *e); + virtual void paintEvent (TQPaintEvent *e); + virtual void resizeEvent (TQResizeEvent *e); protected: kpMainWindow *m_mainWindow; @@ -242,13 +242,13 @@ protected: kpView *m_view; kpGrip *m_bottomGrip, *m_rightGrip, *m_bottomRightGrip; kpGrip *m_docResizingGrip; - QTimer *m_dragScrollTimer; + TQTimer *m_dragScrollTimer; int m_zoomLevel; bool m_scrollTimerRunOnce; int m_resizeRoundedLastViewX, m_resizeRoundedLastViewY; int m_resizeRoundedLastViewDX, m_resizeRoundedLastViewDY; bool m_haveMovedFromOriginalDocSize; - QString m_gripStatusMessage; + TQString m_gripStatusMessage; }; diff --git a/kolourpaint/kpwidgetmapper.cpp b/kolourpaint/kpwidgetmapper.cpp index beb2624c..8c91556b 100644 --- a/kolourpaint/kpwidgetmapper.cpp +++ b/kolourpaint/kpwidgetmapper.cpp @@ -28,16 +28,16 @@ #include <kpwidgetmapper.h> -#include <qpoint.h> -#include <qrect.h> -#include <qwidget.h> +#include <tqpoint.h> +#include <tqrect.h> +#include <tqwidget.h> namespace kpWidgetMapper { -QPoint fromGlobal (const QWidget *widget, const QPoint &point) +TQPoint fromGlobal (const TQWidget *widget, const TQPoint &point) { if (!widget) return point; @@ -45,17 +45,17 @@ QPoint fromGlobal (const QWidget *widget, const QPoint &point) return widget->mapFromGlobal (point); } -QRect fromGlobal (const QWidget *widget, const QRect &rect) +TQRect fromGlobal (const TQWidget *widget, const TQRect &rect) { if (!widget || !rect.isValid ()) return rect; - QPoint topLeft = fromGlobal (widget, rect.topLeft ()); - return QRect (topLeft.x (), topLeft.y (), rect.width (), rect.height ()); + TQPoint topLeft = fromGlobal (widget, rect.topLeft ()); + return TQRect (topLeft.x (), topLeft.y (), rect.width (), rect.height ()); } -QPoint toGlobal (const QWidget *widget, const QPoint &point) +TQPoint toGlobal (const TQWidget *widget, const TQPoint &point) { if (!widget) return point; @@ -63,13 +63,13 @@ QPoint toGlobal (const QWidget *widget, const QPoint &point) return widget->mapToGlobal (point); } -QRect toGlobal (const QWidget *widget, const QRect &rect) +TQRect toGlobal (const TQWidget *widget, const TQRect &rect) { if (!widget || !rect.isValid ()) return rect; - QPoint topLeft = toGlobal (widget, rect.topLeft ()); - return QRect (topLeft.x (), topLeft.y (), rect.width (), rect.height ()); + TQPoint topLeft = toGlobal (widget, rect.topLeft ()); + return TQRect (topLeft.x (), topLeft.y (), rect.width (), rect.height ()); } diff --git a/kolourpaint/kpwidgetmapper.h b/kolourpaint/kpwidgetmapper.h index b5c4c412..7fad2ec6 100644 --- a/kolourpaint/kpwidgetmapper.h +++ b/kolourpaint/kpwidgetmapper.h @@ -29,18 +29,18 @@ #define KP_WIDGET_MAPPER -class QWidget; -class QPoint; -class QRect; +class TQWidget; +class TQPoint; +class TQRect; namespace kpWidgetMapper { - QPoint fromGlobal (const QWidget *widget, const QPoint &point); - QRect fromGlobal (const QWidget *widget, const QRect &rect); + TQPoint fromGlobal (const TQWidget *widget, const TQPoint &point); + TQRect fromGlobal (const TQWidget *widget, const TQRect &rect); - QPoint toGlobal (const QWidget *widget, const QPoint &point); - QRect toGlobal (const QWidget *widget, const QRect &rect); + TQPoint toGlobal (const TQWidget *widget, const TQPoint &point); + TQRect toGlobal (const TQWidget *widget, const TQRect &rect); } diff --git a/kolourpaint/pixmapfx/kpcoloreffect.cpp b/kolourpaint/pixmapfx/kpcoloreffect.cpp index 1660c1fa..b0e04496 100644 --- a/kolourpaint/pixmapfx/kpcoloreffect.cpp +++ b/kolourpaint/pixmapfx/kpcoloreffect.cpp @@ -28,8 +28,8 @@ #include <kpcoloreffect.h> -#include <qapplication.h> -#include <qpixmap.h> +#include <tqapplication.h> +#include <tqpixmap.h> #include <kdialog.h> #include <klocale.h> @@ -40,7 +40,7 @@ #include <kpselection.h> -kpColorEffectCommand::kpColorEffectCommand (const QString &name, +kpColorEffectCommand::kpColorEffectCommand (const TQString &name, bool actOnSelection, kpMainWindow *mainWindow) : kpCommand (mainWindow), @@ -57,7 +57,7 @@ kpColorEffectCommand::~kpColorEffectCommand () // public virtual [base kpCommand] -QString kpColorEffectCommand::name () const +TQString kpColorEffectCommand::name () const { if (m_actOnSelection) return i18n ("Selection: %1").arg (m_name); @@ -80,24 +80,24 @@ void kpColorEffectCommand::execute () if (!doc) return; - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); - const QPixmap oldPixmap = *doc->pixmap (m_actOnSelection); + const TQPixmap oldPixmap = *doc->pixmap (m_actOnSelection); if (!isInvertible ()) { - m_oldPixmapPtr = new QPixmap (); + m_oldPixmapPtr = new TQPixmap (); *m_oldPixmapPtr = oldPixmap; } - QPixmap newPixmap = /*pure virtual*/applyColorEffect (oldPixmap); + TQPixmap newPixmap = /*pure virtual*/applyColorEffect (oldPixmap); doc->setPixmap (m_actOnSelection, newPixmap); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } // public virtual [base kpCommand] @@ -107,10 +107,10 @@ void kpColorEffectCommand::unexecute () if (!doc) return; - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); - QPixmap newPixmap; + TQPixmap newPixmap; if (!isInvertible ()) { @@ -127,14 +127,14 @@ void kpColorEffectCommand::unexecute () delete m_oldPixmapPtr; m_oldPixmapPtr = 0; - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } kpColorEffectWidget::kpColorEffectWidget (bool actOnSelection, kpMainWindow *mainWindow, - QWidget *parent, const char *name) - : QWidget (parent, name), + TQWidget *parent, const char *name) + : TQWidget (parent, name), m_actOnSelection (actOnSelection), m_mainWindow (mainWindow) { @@ -146,9 +146,9 @@ kpColorEffectWidget::~kpColorEffectWidget () // public -QString kpColorEffectWidget::caption () const +TQString kpColorEffectWidget::caption () const { - return QString::null; + return TQString::null; } diff --git a/kolourpaint/pixmapfx/kpcoloreffect.h b/kolourpaint/pixmapfx/kpcoloreffect.h index 8b3dfd09..afd60a5e 100644 --- a/kolourpaint/pixmapfx/kpcoloreffect.h +++ b/kolourpaint/pixmapfx/kpcoloreffect.h @@ -29,12 +29,12 @@ #ifndef KP_COLOR_EFFECT_H #define KP_COLOR_EFFECT_H -#include <qstring.h> -#include <qwidget.h> +#include <tqstring.h> +#include <tqwidget.h> #include <kpcommandhistory.h> -class QPixmap; +class TQPixmap; class kpDocument; class kpMainWindow; @@ -43,12 +43,12 @@ class kpMainWindow; class kpColorEffectCommand : public kpCommand { public: - kpColorEffectCommand (const QString &name, + kpColorEffectCommand (const TQString &name, bool actOnSelection, kpMainWindow *mainWindow); virtual ~kpColorEffectCommand (); - virtual QString name () const; + virtual TQString name () const; virtual int size () const; public: @@ -61,13 +61,13 @@ public: virtual bool isInvertible () const { return false; } protected: - virtual QPixmap applyColorEffect (const QPixmap &pixmap) = 0; + virtual TQPixmap applyColorEffect (const TQPixmap &pixmap) = 0; private: - QString m_name; + TQString m_name; bool m_actOnSelection; - QPixmap *m_oldPixmapPtr; + TQPixmap *m_oldPixmapPtr; }; @@ -78,7 +78,7 @@ Q_OBJECT public: kpColorEffectWidget (bool actOnSelection, kpMainWindow *mainWindow, - QWidget *parent, const char *name = 0); + TQWidget *parent, const char *name = 0); virtual ~kpColorEffectWidget (); signals: @@ -91,10 +91,10 @@ signals: void settingsChangedDelayed (); public: - virtual QString caption () const; + virtual TQString caption () const; virtual bool isNoOp () const = 0; - virtual QPixmap applyColorEffect (const QPixmap &pixmap) = 0; + virtual TQPixmap applyColorEffect (const TQPixmap &pixmap) = 0; virtual kpColorEffectCommand *createCommand () const = 0; diff --git a/kolourpaint/pixmapfx/kpeffectbalance.cpp b/kolourpaint/pixmapfx/kpeffectbalance.cpp index f4494d29..d4e26a9c 100644 --- a/kolourpaint/pixmapfx/kpeffectbalance.cpp +++ b/kolourpaint/pixmapfx/kpeffectbalance.cpp @@ -32,12 +32,12 @@ #include <math.h> -#include <qfontmetrics.h> -#include <qimage.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpixmap.h> -#include <qpushbutton.h> +#include <tqfontmetrics.h> +#include <tqimage.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpixmap.h> +#include <tqpushbutton.h> #include <kcombobox.h> #include <kdebug.h> @@ -49,7 +49,7 @@ #if DEBUG_KP_EFFECT_BALANCE - #include <qdatetime.h> + #include <tqdatetime.h> #endif @@ -127,7 +127,7 @@ static inline QRgb brightnessContrastGammaForRGB (QRgb rgb, // public static -QPixmap kpEffectBalanceCommand::applyColorEffect (const QPixmap &pixmap, +TQPixmap kpEffectBalanceCommand::applyColorEffect (const TQPixmap &pixmap, int channels, int brightness, int contrast, int gamma) { @@ -138,10 +138,10 @@ QPixmap kpEffectBalanceCommand::applyColorEffect (const QPixmap &pixmap, << ",contrast=" << contrast << ",gamma=" << gamma << ")" << endl; - QTime timer; timer.start (); + TQTime timer; timer.start (); #endif - QImage image = kpPixmapFX::convertToImage (pixmap); + TQImage image = kpPixmapFX::convertToImage (pixmap); #if DEBUG_KP_EFFECT_BALANCE kdDebug () << "\tconvertToImage=" << timer.restart () << endl; #endif @@ -234,7 +234,7 @@ QPixmap kpEffectBalanceCommand::applyColorEffect (const QPixmap &pixmap, kdDebug () << "\teffect=" << timer.restart () << endl; #endif - const QPixmap retPixmap = kpPixmapFX::convertToPixmap (image); + const TQPixmap retPixmap = kpPixmapFX::convertToPixmap (image); #if DEBUG_KP_EFFECT_BALANCE kdDebug () << "\tconvertToPixmap=" << timer.restart () << endl; #endif @@ -243,7 +243,7 @@ QPixmap kpEffectBalanceCommand::applyColorEffect (const QPixmap &pixmap, } // protected virtual [base kpColorEffectCommand] -QPixmap kpEffectBalanceCommand::applyColorEffect (const QPixmap &pixmap) +TQPixmap kpEffectBalanceCommand::applyColorEffect (const TQPixmap &pixmap) { return applyColorEffect (pixmap, m_channels, m_brightness, m_contrast, m_gamma); @@ -253,39 +253,39 @@ QPixmap kpEffectBalanceCommand::applyColorEffect (const QPixmap &pixmap) kpEffectBalanceWidget::kpEffectBalanceWidget (bool actOnSelection, kpMainWindow *mainWindow, - QWidget *parent, const char *name) + TQWidget *parent, const char *name) : kpColorEffectWidget (actOnSelection, mainWindow, parent, name) { - QGridLayout *lay = new QGridLayout (this, 5, 5, marginHint (), spacingHint ()); + TQGridLayout *lay = new TQGridLayout (this, 5, 5, marginHint (), spacingHint ()); - QLabel *brightnessLabel = new QLabel (i18n ("&Brightness:"), this); + TQLabel *brightnessLabel = new TQLabel (i18n ("&Brightness:"), this); m_brightnessInput = new KIntNumInput (0/*value*/, this); m_brightnessInput->setRange (-50, 50, 1/*step*/, true/*slider*/); - QPushButton *brightnessResetPushButton = new QPushButton (i18n ("Re&set"), this); + TQPushButton *brightnessResetPushButton = new TQPushButton (i18n ("Re&set"), this); - QLabel *contrastLabel = new QLabel (i18n ("Co&ntrast:"), this); + TQLabel *contrastLabel = new TQLabel (i18n ("Co&ntrast:"), this); m_contrastInput = new KIntNumInput (0/*value*/, this); m_contrastInput->setRange (-50, 50, 1/*step*/, true/*slider*/); - QPushButton *contrastResetPushButton = new QPushButton (i18n ("&Reset"), this); + TQPushButton *contrastResetPushButton = new TQPushButton (i18n ("&Reset"), this); - QLabel *gammaLabel = new QLabel (i18n ("&Gamma:"), this); + TQLabel *gammaLabel = new TQLabel (i18n ("&Gamma:"), this); m_gammaInput = new KIntNumInput (0/*value*/, this); m_gammaInput->setRange (-50, 50, 1/*step*/, true/*slider*/); // TODO: This is what should be shown in the m_gammaInput spinbox - m_gammaLabel = new QLabel (this); + m_gammaLabel = new TQLabel (this); // TODO: This doesn't seem to be wide enough with some fonts so the // whole layout moves when we drag the gamma slider. m_gammaLabel->setMinimumWidth (m_gammaLabel->fontMetrics ().width (" 10.00 ")); m_gammaLabel->setAlignment (m_gammaLabel->alignment () | Qt::AlignRight); - QPushButton *gammaResetPushButton = new QPushButton (i18n ("Rese&t"), this); + TQPushButton *gammaResetPushButton = new TQPushButton (i18n ("Rese&t"), this); - QWidget *spaceWidget = new QLabel (this); + TQWidget *spaceWidget = new TQLabel (this); spaceWidget->setFixedSize (1, spacingHint ()); - QLabel *channelLabel = new QLabel (i18n ("C&hannels:"), this); + TQLabel *channelLabel = new TQLabel (i18n ("C&hannels:"), this); m_channelsComboBox = new KComboBox (this); m_channelsComboBox->insertItem (i18n ("All")); m_channelsComboBox->insertItem (i18n ("Red")); @@ -293,7 +293,7 @@ kpEffectBalanceWidget::kpEffectBalanceWidget (bool actOnSelection, m_channelsComboBox->insertItem (i18n ("Blue")); - QPushButton *resetPushButton = new QPushButton (i18n ("Reset &All Values"), this); + TQPushButton *resetPushButton = new TQPushButton (i18n ("Reset &All Values"), this); brightnessLabel->setBuddy (m_brightnessInput); @@ -327,28 +327,28 @@ kpEffectBalanceWidget::kpEffectBalanceWidget (bool actOnSelection, // (no need for settingsChangedDelayed() since BCG effect is so fast :)) - connect (m_brightnessInput, SIGNAL (valueChanged (int)), - this, SIGNAL (settingsChangedNoWaitCursor ())); - connect (m_contrastInput, SIGNAL (valueChanged (int)), - this, SIGNAL (settingsChangedNoWaitCursor ())); + connect (m_brightnessInput, TQT_SIGNAL (valueChanged (int)), + this, TQT_SIGNAL (settingsChangedNoWaitCursor ())); + connect (m_contrastInput, TQT_SIGNAL (valueChanged (int)), + this, TQT_SIGNAL (settingsChangedNoWaitCursor ())); - connect (m_gammaInput, SIGNAL (valueChanged (int)), - this, SLOT (recalculateGammaLabel ())); - connect (m_gammaInput, SIGNAL (valueChanged (int)), - this, SIGNAL (settingsChangedNoWaitCursor ())); + connect (m_gammaInput, TQT_SIGNAL (valueChanged (int)), + this, TQT_SLOT (recalculateGammaLabel ())); + connect (m_gammaInput, TQT_SIGNAL (valueChanged (int)), + this, TQT_SIGNAL (settingsChangedNoWaitCursor ())); - connect (m_channelsComboBox, SIGNAL (activated (int)), - this, SIGNAL (settingsChanged ())); + connect (m_channelsComboBox, TQT_SIGNAL (activated (int)), + this, TQT_SIGNAL (settingsChanged ())); - connect (brightnessResetPushButton, SIGNAL (clicked ()), - this, SLOT (resetBrightness ())); - connect (contrastResetPushButton, SIGNAL (clicked ()), - this, SLOT (resetContrast ())); - connect (gammaResetPushButton, SIGNAL (clicked ()), - this, SLOT (resetGamma ())); + connect (brightnessResetPushButton, TQT_SIGNAL (clicked ()), + this, TQT_SLOT (resetBrightness ())); + connect (contrastResetPushButton, TQT_SIGNAL (clicked ()), + this, TQT_SLOT (resetContrast ())); + connect (gammaResetPushButton, TQT_SIGNAL (clicked ()), + this, TQT_SLOT (resetGamma ())); - connect (resetPushButton, SIGNAL (clicked ()), - this, SLOT (resetAll ())); + connect (resetPushButton, TQT_SIGNAL (clicked ()), + this, TQT_SLOT (resetAll ())); recalculateGammaLabel (); @@ -360,7 +360,7 @@ kpEffectBalanceWidget::~kpEffectBalanceWidget () // public virtual [base kpColorEffectWidget] -QString kpEffectBalanceWidget::caption () const +TQString kpEffectBalanceWidget::caption () const { return i18n ("Settings"); } @@ -373,7 +373,7 @@ bool kpEffectBalanceWidget::isNoOp () const } // public virtual [base kpColorEffectWidget] -QPixmap kpEffectBalanceWidget::applyColorEffect (const QPixmap &pixmap) +TQPixmap kpEffectBalanceWidget::applyColorEffect (const TQPixmap &pixmap) { return kpEffectBalanceCommand::applyColorEffect (pixmap, channels (), brightness (), contrast (), gamma ()); @@ -434,7 +434,7 @@ void kpEffectBalanceWidget::recalculateGammaLabel () { m_gammaLabel->setText ( " " + - QString::number (pow (10, gamma () / 50.0), + TQString::number (pow (10, gamma () / 50.0), 'f'/*[-]9.9*/, 2/*precision*/) + " "); diff --git a/kolourpaint/pixmapfx/kpeffectbalance.h b/kolourpaint/pixmapfx/kpeffectbalance.h index b045159f..e80bb7a6 100644 --- a/kolourpaint/pixmapfx/kpeffectbalance.h +++ b/kolourpaint/pixmapfx/kpeffectbalance.h @@ -32,7 +32,7 @@ #include <kpcoloreffect.h> -class QLabel; +class TQLabel; class KComboBox; class KIntNumInput; @@ -58,12 +58,12 @@ public: kpMainWindow *mainWindow); virtual ~kpEffectBalanceCommand (); - static QPixmap applyColorEffect (const QPixmap &pixmap, + static TQPixmap applyColorEffect (const TQPixmap &pixmap, int channels, int brightness, int contrast, int gamma); protected: - virtual QPixmap applyColorEffect (const QPixmap &pixmap); + virtual TQPixmap applyColorEffect (const TQPixmap &pixmap); protected: int m_channels; @@ -78,13 +78,13 @@ Q_OBJECT public: kpEffectBalanceWidget (bool actOnSelection, kpMainWindow *mainWindow, - QWidget *parent, const char *name = 0); + TQWidget *parent, const char *name = 0); virtual ~kpEffectBalanceWidget (); - virtual QString caption () const; + virtual TQString caption () const; virtual bool isNoOp () const; - virtual QPixmap applyColorEffect (const QPixmap &pixmap); + virtual TQPixmap applyColorEffect (const TQPixmap &pixmap); virtual kpColorEffectCommand *createCommand () const; @@ -108,7 +108,7 @@ protected: KIntNumInput *m_brightnessInput, *m_contrastInput, *m_gammaInput; - QLabel *m_gammaLabel; + TQLabel *m_gammaLabel; KComboBox *m_channelsComboBox; }; diff --git a/kolourpaint/pixmapfx/kpeffectblursharpen.cpp b/kolourpaint/pixmapfx/kpeffectblursharpen.cpp index 50c0b27d..9986df4f 100644 --- a/kolourpaint/pixmapfx/kpeffectblursharpen.cpp +++ b/kolourpaint/pixmapfx/kpeffectblursharpen.cpp @@ -30,11 +30,11 @@ #include <kpeffectblursharpen.h> -#include <qimage.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpixmap.h> -#include <qpushbutton.h> +#include <tqimage.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpixmap.h> +#include <tqpushbutton.h> #include <kdebug.h> #include <kimageeffect.h> @@ -45,14 +45,14 @@ #include <kppixmapfx.h> -static QString nameForType (kpEffectBlurSharpenCommand::Type type) +static TQString nameForType (kpEffectBlurSharpenCommand::Type type) { if (type == kpEffectBlurSharpenCommand::Blur) return i18n ("Soften"); else if (type == kpEffectBlurSharpenCommand::Sharpen) return i18n ("Sharpen"); else - return QString::null; + return TQString::null; } @@ -74,7 +74,7 @@ kpEffectBlurSharpenCommand::~kpEffectBlurSharpenCommand () // public static -QPixmap kpEffectBlurSharpenCommand::apply (const QPixmap &pixmap, +TQPixmap kpEffectBlurSharpenCommand::apply (const TQPixmap &pixmap, Type type, double radius, double sigma, int repeat) { @@ -89,12 +89,12 @@ QPixmap kpEffectBlurSharpenCommand::apply (const QPixmap &pixmap, #endif // (KImageEffect::(blur|sharpen)() ignores mask) - QPixmap usePixmap = kpPixmapFX::pixmapWithDefinedTransparentPixels ( + TQPixmap usePixmap = kpPixmapFX::pixmapWithDefinedTransparentPixels ( pixmap, Qt::white/*arbitrarily chosen*/); - QImage image = kpPixmapFX::convertToImage (usePixmap); + TQImage image = kpPixmapFX::convertToImage (usePixmap); for (int i = 0; i < repeat; i++) { @@ -104,7 +104,7 @@ QPixmap kpEffectBlurSharpenCommand::apply (const QPixmap &pixmap, image = KImageEffect::sharpen (image, radius, sigma); } - QPixmap retPixmap = kpPixmapFX::convertToPixmap (image); + TQPixmap retPixmap = kpPixmapFX::convertToPixmap (image); // KImageEffect::(blur|sharpen)() nukes mask - restore it @@ -116,7 +116,7 @@ QPixmap kpEffectBlurSharpenCommand::apply (const QPixmap &pixmap, } // protected virtual [base kpColorEffectCommand] -QPixmap kpEffectBlurSharpenCommand::applyColorEffect (const QPixmap &pixmap) +TQPixmap kpEffectBlurSharpenCommand::applyColorEffect (const TQPixmap &pixmap) { return apply (pixmap, m_type, m_radius, m_sigma, m_repeat); } @@ -125,17 +125,17 @@ QPixmap kpEffectBlurSharpenCommand::applyColorEffect (const QPixmap &pixmap) kpEffectBlurSharpenWidget::kpEffectBlurSharpenWidget (bool actOnSelection, kpMainWindow *mainWindow, - QWidget *parent, const char *name) + TQWidget *parent, const char *name) : kpColorEffectWidget (actOnSelection, mainWindow, parent, name) { - QGridLayout *lay = new QGridLayout (this, 4, 2, marginHint (), spacingHint ()); + TQGridLayout *lay = new TQGridLayout (this, 4, 2, marginHint (), spacingHint ()); - QLabel *amountLabel = new QLabel (i18n ("&Amount:"), this); + TQLabel *amountLabel = new TQLabel (i18n ("&Amount:"), this); m_amountInput = new KIntNumInput (this); m_amountInput->setRange (-10, 10, 1/*step*/, true/*slider*/); - m_typeLabel = new QLabel (this); + m_typeLabel = new TQLabel (this); amountLabel->setBuddy (m_amountInput); @@ -149,11 +149,11 @@ kpEffectBlurSharpenWidget::kpEffectBlurSharpenWidget (bool actOnSelection, lay->setColStretch (1, 1); - connect (m_amountInput, SIGNAL (valueChanged (int)), - this, SIGNAL (settingsChangedDelayed ())); + connect (m_amountInput, TQT_SIGNAL (valueChanged (int)), + this, TQT_SIGNAL (settingsChangedDelayed ())); - connect (m_amountInput, SIGNAL (valueChanged (int)), - this, SLOT (slotUpdateTypeLabel ())); + connect (m_amountInput, TQT_SIGNAL (valueChanged (int)), + this, TQT_SLOT (slotUpdateTypeLabel ())); } kpEffectBlurSharpenWidget::~kpEffectBlurSharpenWidget () @@ -162,9 +162,9 @@ kpEffectBlurSharpenWidget::~kpEffectBlurSharpenWidget () // public virtual [base kpColorEffectWidget] -QString kpEffectBlurSharpenWidget::caption () const +TQString kpEffectBlurSharpenWidget::caption () const { - return QString::null; + return TQString::null; } @@ -175,7 +175,7 @@ bool kpEffectBlurSharpenWidget::isNoOp () const } // public virtual [base kpColorEffectWidget] -QPixmap kpEffectBlurSharpenWidget::applyColorEffect (const QPixmap &pixmap) +TQPixmap kpEffectBlurSharpenWidget::applyColorEffect (const TQPixmap &pixmap) { return kpEffectBlurSharpenCommand::apply (pixmap, type (), radius (), sigma (), repeat ()); @@ -193,7 +193,7 @@ kpColorEffectCommand *kpEffectBlurSharpenWidget::createCommand () const // protected slot void kpEffectBlurSharpenWidget::slotUpdateTypeLabel () { - QString text = ::nameForType (type ()); + TQString text = ::nameForType (type ()); #if DEBUG_KP_EFFECT_BLUR_SHARPEN kdDebug () << "kpEffectBlurSharpenWidget::slotUpdateTypeLabel() text=" diff --git a/kolourpaint/pixmapfx/kpeffectblursharpen.h b/kolourpaint/pixmapfx/kpeffectblursharpen.h index 3b12def1..54b9c993 100644 --- a/kolourpaint/pixmapfx/kpeffectblursharpen.h +++ b/kolourpaint/pixmapfx/kpeffectblursharpen.h @@ -35,7 +35,7 @@ #include <kpcoloreffect.h> -class QLabel; +class TQLabel; class KIntNumInput; @@ -57,12 +57,12 @@ public: kpMainWindow *mainWindow); virtual ~kpEffectBlurSharpenCommand (); - static QPixmap apply (const QPixmap &pixmap, + static TQPixmap apply (const TQPixmap &pixmap, Type type, double radius, double sigma, int repeat); protected: - virtual QPixmap applyColorEffect (const QPixmap &pixmap); + virtual TQPixmap applyColorEffect (const TQPixmap &pixmap); protected: Type m_type; @@ -78,13 +78,13 @@ Q_OBJECT public: kpEffectBlurSharpenWidget (bool actOnSelection, kpMainWindow *mainWindow, - QWidget *parent, const char *name = 0); + TQWidget *parent, const char *name = 0); virtual ~kpEffectBlurSharpenWidget (); - virtual QString caption () const; + virtual TQString caption () const; virtual bool isNoOp () const; - virtual QPixmap applyColorEffect (const QPixmap &pixmap); + virtual TQPixmap applyColorEffect (const TQPixmap &pixmap); virtual kpColorEffectCommand *createCommand () const; @@ -98,7 +98,7 @@ protected: int repeat () const; KIntNumInput *m_amountInput; - QLabel *m_typeLabel; + TQLabel *m_typeLabel; }; diff --git a/kolourpaint/pixmapfx/kpeffectemboss.cpp b/kolourpaint/pixmapfx/kpeffectemboss.cpp index e33f3a42..f58f248a 100644 --- a/kolourpaint/pixmapfx/kpeffectemboss.cpp +++ b/kolourpaint/pixmapfx/kpeffectemboss.cpp @@ -30,12 +30,12 @@ #include <kpeffectemboss.h> -#include <qcheckbox.h> -#include <qimage.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpixmap.h> -#include <qpushbutton.h> +#include <tqcheckbox.h> +#include <tqimage.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpixmap.h> +#include <tqpushbutton.h> #include <kdebug.h> #include <kimageeffect.h> @@ -62,7 +62,7 @@ kpEffectEmbossCommand::~kpEffectEmbossCommand () // public static -QPixmap kpEffectEmbossCommand::apply (const QPixmap &pixmap, +TQPixmap kpEffectEmbossCommand::apply (const TQPixmap &pixmap, double radius, double sigma, int repeat) { @@ -76,19 +76,19 @@ QPixmap kpEffectEmbossCommand::apply (const QPixmap &pixmap, #endif // (KImageEffect::emboss() ignores mask) - QPixmap usePixmap = kpPixmapFX::pixmapWithDefinedTransparentPixels ( + TQPixmap usePixmap = kpPixmapFX::pixmapWithDefinedTransparentPixels ( pixmap, Qt::white/*arbitrarily chosen*/); - QImage image = kpPixmapFX::convertToImage (usePixmap); + TQImage image = kpPixmapFX::convertToImage (usePixmap); for (int i = 0; i < repeat; i++) { image = KImageEffect::emboss (image, radius, sigma); } - QPixmap retPixmap = kpPixmapFX::convertToPixmap (image); + TQPixmap retPixmap = kpPixmapFX::convertToPixmap (image); // KImageEffect::emboss() nukes mask - restore it @@ -100,7 +100,7 @@ QPixmap kpEffectEmbossCommand::apply (const QPixmap &pixmap, } // protected virtual [base kpColorEffectCommand] -QPixmap kpEffectEmbossCommand::applyColorEffect (const QPixmap &pixmap) +TQPixmap kpEffectEmbossCommand::applyColorEffect (const TQPixmap &pixmap) { return apply (pixmap, m_radius, m_sigma, m_repeat); } @@ -109,14 +109,14 @@ QPixmap kpEffectEmbossCommand::applyColorEffect (const QPixmap &pixmap) kpEffectEmbossWidget::kpEffectEmbossWidget (bool actOnSelection, kpMainWindow *mainWindow, - QWidget *parent, const char *name) + TQWidget *parent, const char *name) : kpColorEffectWidget (actOnSelection, mainWindow, parent, name) { - QGridLayout *lay = new QGridLayout (this, 4, 2, marginHint (), spacingHint ()); + TQGridLayout *lay = new TQGridLayout (this, 4, 2, marginHint (), spacingHint ()); #if 0 - QLabel *amountLabel = new QLabel (i18n ("&Amount:"), this); + TQLabel *amountLabel = new TQLabel (i18n ("&Amount:"), this); m_amountInput = new KIntNumInput (this); m_amountInput->setRange (0, 10, 1/*step*/, true/*slider*/); m_amountInput->setSpecialValueText (i18n ("None")); @@ -131,11 +131,11 @@ kpEffectEmbossWidget::kpEffectEmbossWidget (bool actOnSelection, lay->setColStretch (1, 1); - connect (m_amountInput, SIGNAL (valueChanged (int)), - this, SIGNAL (settingsChanged ())); + connect (m_amountInput, TQT_SIGNAL (valueChanged (int)), + this, TQT_SIGNAL (settingsChanged ())); #endif - m_enableCheckBox = new QCheckBox (i18n ("E&nable"), this); + m_enableCheckBox = new TQCheckBox (i18n ("E&nable"), this); lay->addMultiCellWidget (m_enableCheckBox, 0, 0, 0, 1, Qt::AlignCenter); @@ -144,8 +144,8 @@ kpEffectEmbossWidget::kpEffectEmbossWidget (bool actOnSelection, // (settingsChangedDelayed() instead of settingsChanged() so that the // user can quickly press OK to apply effect to document directly and // not have to wait for the also slow preview) - connect (m_enableCheckBox, SIGNAL (toggled (bool)), - this, SIGNAL (settingsChangedDelayed ())); + connect (m_enableCheckBox, TQT_SIGNAL (toggled (bool)), + this, TQT_SIGNAL (settingsChangedDelayed ())); } kpEffectEmbossWidget::~kpEffectEmbossWidget () @@ -154,9 +154,9 @@ kpEffectEmbossWidget::~kpEffectEmbossWidget () // public virtual [base kpColorEffectWidget] -QString kpEffectEmbossWidget::caption () const +TQString kpEffectEmbossWidget::caption () const { - return QString::null; + return TQString::null; } @@ -168,7 +168,7 @@ bool kpEffectEmbossWidget::isNoOp () const } // public virtual [base kpColorEffectWidget] -QPixmap kpEffectEmbossWidget::applyColorEffect (const QPixmap &pixmap) +TQPixmap kpEffectEmbossWidget::applyColorEffect (const TQPixmap &pixmap) { if (isNoOp ()) return pixmap; diff --git a/kolourpaint/pixmapfx/kpeffectemboss.h b/kolourpaint/pixmapfx/kpeffectemboss.h index 0234627f..b77f69e7 100644 --- a/kolourpaint/pixmapfx/kpeffectemboss.h +++ b/kolourpaint/pixmapfx/kpeffectemboss.h @@ -35,7 +35,7 @@ #include <kpcoloreffect.h> -class QCheckBox; +class TQCheckBox; class KIntNumInput; class kpMainWindow; @@ -50,12 +50,12 @@ public: kpMainWindow *mainWindow); virtual ~kpEffectEmbossCommand (); - static QPixmap apply (const QPixmap &pixmap, + static TQPixmap apply (const TQPixmap &pixmap, double radius, double sigma, int repeat); protected: - virtual QPixmap applyColorEffect (const QPixmap &pixmap); + virtual TQPixmap applyColorEffect (const TQPixmap &pixmap); protected: double m_radius, m_sigma; @@ -70,13 +70,13 @@ Q_OBJECT public: kpEffectEmbossWidget (bool actOnSelection, kpMainWindow *mainWindow, - QWidget *parent, const char *name = 0); + TQWidget *parent, const char *name = 0); virtual ~kpEffectEmbossWidget (); - virtual QString caption () const; + virtual TQString caption () const; virtual bool isNoOp () const; - virtual QPixmap applyColorEffect (const QPixmap &pixmap); + virtual TQPixmap applyColorEffect (const TQPixmap &pixmap); virtual kpColorEffectCommand *createCommand () const; @@ -86,7 +86,7 @@ protected: int repeat () const; //KIntNumInput *m_amountInput; - QCheckBox *m_enableCheckBox; + TQCheckBox *m_enableCheckBox; }; diff --git a/kolourpaint/pixmapfx/kpeffectflatten.cpp b/kolourpaint/pixmapfx/kpeffectflatten.cpp index 6a81bca0..b8dee16c 100644 --- a/kolourpaint/pixmapfx/kpeffectflatten.cpp +++ b/kolourpaint/pixmapfx/kpeffectflatten.cpp @@ -30,11 +30,11 @@ #include <kpeffectflatten.h> -#include <qcheckbox.h> -#include <qimage.h> -#include <qlayout.h> -#include <qpixmap.h> -#include <qvbox.h> +#include <tqcheckbox.h> +#include <tqimage.h> +#include <tqlayout.h> +#include <tqpixmap.h> +#include <tqvbox.h> #include <kcolorbutton.h> #include <kconfig.h> @@ -52,8 +52,8 @@ // kpEffectFlattenCommand // -kpEffectFlattenCommand::kpEffectFlattenCommand (const QColor &color1, - const QColor &color2, +kpEffectFlattenCommand::kpEffectFlattenCommand (const TQColor &color1, + const TQColor &color2, bool actOnSelection, kpMainWindow *mainWindow) : kpColorEffectCommand (i18n ("Flatten"), actOnSelection, mainWindow), @@ -67,29 +67,29 @@ kpEffectFlattenCommand::~kpEffectFlattenCommand () // public static -void kpEffectFlattenCommand::apply (QPixmap *destPixmapPtr, - const QColor &color1, const QColor &color2) +void kpEffectFlattenCommand::apply (TQPixmap *destPixmapPtr, + const TQColor &color1, const TQColor &color2) { if (!destPixmapPtr) return; - QImage image = kpPixmapFX::convertToImage (*destPixmapPtr); + TQImage image = kpPixmapFX::convertToImage (*destPixmapPtr); apply (&image, color1, color2); *destPixmapPtr = kpPixmapFX::convertToPixmap (image); } // public static -QPixmap kpEffectFlattenCommand::apply (const QPixmap &pm, - const QColor &color1, const QColor &color2) +TQPixmap kpEffectFlattenCommand::apply (const TQPixmap &pm, + const TQColor &color1, const TQColor &color2) { - QImage image = kpPixmapFX::convertToImage (pm); + TQImage image = kpPixmapFX::convertToImage (pm); apply (&image, color1, color2); return kpPixmapFX::convertToPixmap (image); } // public static -void kpEffectFlattenCommand::apply (QImage *destImagePtr, - const QColor &color1, const QColor &color2) +void kpEffectFlattenCommand::apply (TQImage *destImagePtr, + const TQColor &color1, const TQColor &color2) { if (!destImagePtr) return; @@ -98,10 +98,10 @@ void kpEffectFlattenCommand::apply (QImage *destImagePtr, } // public static -QImage kpEffectFlattenCommand::apply (const QImage &img, - const QColor &color1, const QColor &color2) +TQImage kpEffectFlattenCommand::apply (const TQImage &img, + const TQColor &color1, const TQColor &color2) { - QImage retImage = img; + TQImage retImage = img; apply (&retImage, color1, color2); return retImage; } @@ -112,7 +112,7 @@ QImage kpEffectFlattenCommand::apply (const QImage &img, // // protected virtual [base kpColorEffectCommand] -QPixmap kpEffectFlattenCommand::applyColorEffect (const QPixmap &pixmap) +TQPixmap kpEffectFlattenCommand::applyColorEffect (const TQPixmap &pixmap) { return apply (pixmap, m_color1, m_color2); } @@ -126,12 +126,12 @@ QPixmap kpEffectFlattenCommand::applyColorEffect (const QPixmap &pixmap) // Don't initialise globally when we probably don't have a colour // allocation context. This way, the colours aren't sometimes invalid // (e.g. at 8-bit). -QColor kpEffectFlattenWidget::s_lastColor1; -QColor kpEffectFlattenWidget::s_lastColor2; +TQColor kpEffectFlattenWidget::s_lastColor1; +TQColor kpEffectFlattenWidget::s_lastColor2; kpEffectFlattenWidget::kpEffectFlattenWidget (bool actOnSelection, kpMainWindow *mainWindow, - QWidget *parent, + TQWidget *parent, const char *name) : kpColorEffectWidget (actOnSelection, mainWindow, parent, name) { @@ -150,9 +150,9 @@ kpEffectFlattenWidget::kpEffectFlattenWidget (bool actOnSelection, } - m_enableCheckBox = new QCheckBox (i18n ("E&nable"), this); + m_enableCheckBox = new TQCheckBox (i18n ("E&nable"), this); - QVBox *colorButtonContainer = new QVBox (this); + TQVBox *colorButtonContainer = new TQVBox (this); colorButtonContainer->setMargin (KDialog::marginHint () / 2); colorButtonContainer->setSpacing (spacingHint ()); m_color1Button = new KColorButton (s_lastColor1, colorButtonContainer); @@ -163,18 +163,18 @@ kpEffectFlattenWidget::kpEffectFlattenWidget (bool actOnSelection, m_color2Button->setEnabled (false); - QVBoxLayout *lay = new QVBoxLayout (this, marginHint (), spacingHint ()); + TQVBoxLayout *lay = new TQVBoxLayout (this, marginHint (), spacingHint ()); lay->addWidget (m_enableCheckBox); lay->addWidget (colorButtonContainer); - connect (m_enableCheckBox, SIGNAL (toggled (bool)), - this, SLOT (slotEnableChanged (bool))); + connect (m_enableCheckBox, TQT_SIGNAL (toggled (bool)), + this, TQT_SLOT (slotEnableChanged (bool))); - connect (m_color1Button, SIGNAL (changed (const QColor &)), - this, SIGNAL (settingsChanged ())); - connect (m_color2Button, SIGNAL (changed (const QColor &)), - this, SIGNAL (settingsChanged ())); + connect (m_color1Button, TQT_SIGNAL (changed (const TQColor &)), + this, TQT_SIGNAL (settingsChanged ())); + connect (m_color2Button, TQT_SIGNAL (changed (const TQColor &)), + this, TQT_SIGNAL (settingsChanged ())); } kpEffectFlattenWidget::~kpEffectFlattenWidget () @@ -193,13 +193,13 @@ kpEffectFlattenWidget::~kpEffectFlattenWidget () // public -QColor kpEffectFlattenWidget::color1 () const +TQColor kpEffectFlattenWidget::color1 () const { return m_color1Button->color (); } // public -QColor kpEffectFlattenWidget::color2 () const +TQColor kpEffectFlattenWidget::color2 () const { return m_color2Button->color (); } @@ -210,7 +210,7 @@ QColor kpEffectFlattenWidget::color2 () const // // public virtual [base kpColorEffectWidget] -QString kpEffectFlattenWidget::caption () const +TQString kpEffectFlattenWidget::caption () const { return i18n ("Colors"); } @@ -223,7 +223,7 @@ bool kpEffectFlattenWidget::isNoOp () const } // public virtual [base kpColorEffectWidget] -QPixmap kpEffectFlattenWidget::applyColorEffect (const QPixmap &pixmap) +TQPixmap kpEffectFlattenWidget::applyColorEffect (const TQPixmap &pixmap) { #if DEBUG_KP_EFFECT_FLATTEN kdDebug () << "kpEffectFlattenWidget::applyColorEffect() nop=" diff --git a/kolourpaint/pixmapfx/kpeffectflatten.h b/kolourpaint/pixmapfx/kpeffectflatten.h index 79c9bbaf..a4f06af9 100644 --- a/kolourpaint/pixmapfx/kpeffectflatten.h +++ b/kolourpaint/pixmapfx/kpeffectflatten.h @@ -30,13 +30,13 @@ #define KP_EFFECT_FLATTEN_H -#include <qcolor.h> +#include <tqcolor.h> #include <kpcoloreffect.h> -class QCheckBox; -class QImage; +class TQCheckBox; +class TQImage; class KColorButton; @@ -46,20 +46,20 @@ class kpMainWindow; class kpEffectFlattenCommand : public kpColorEffectCommand { public: - kpEffectFlattenCommand (const QColor &color1, const QColor &color2, + kpEffectFlattenCommand (const TQColor &color1, const TQColor &color2, bool actOnSelection, kpMainWindow *mainWindow); virtual ~kpEffectFlattenCommand (); - static void apply (QPixmap *destPixmapPtr, - const QColor &color1, const QColor &color2); - static QPixmap apply (const QPixmap &pm, - const QColor &color1, const QColor &color2); - static void apply (QImage *destImagePtr, - const QColor &color1, const QColor &color2); - static QImage apply (const QImage &img, - const QColor &color1, const QColor &color2); + static void apply (TQPixmap *destPixmapPtr, + const TQColor &color1, const TQColor &color2); + static TQPixmap apply (const TQPixmap &pm, + const TQColor &color1, const TQColor &color2); + static void apply (TQImage *destImagePtr, + const TQColor &color1, const TQColor &color2); + static TQImage apply (const TQImage &img, + const TQColor &color1, const TQColor &color2); // @@ -67,9 +67,9 @@ public: // protected: - virtual QPixmap applyColorEffect (const QPixmap &pixmap); + virtual TQPixmap applyColorEffect (const TQPixmap &pixmap); - QColor m_color1, m_color2; + TQColor m_color1, m_color2; }; @@ -80,25 +80,25 @@ Q_OBJECT public: kpEffectFlattenWidget (bool actOnSelection, kpMainWindow *mainWindow, - QWidget *parent, const char *name = 0); + TQWidget *parent, const char *name = 0); virtual ~kpEffectFlattenWidget (); - static QColor s_lastColor1, s_lastColor2; + static TQColor s_lastColor1, s_lastColor2; - QColor color1 () const; - QColor color2 () const; + TQColor color1 () const; + TQColor color2 () const; // // kpColorEffectWidget interface // - virtual QString caption () const; + virtual TQString caption () const; virtual bool isNoOp () const; - virtual QPixmap applyColorEffect (const QPixmap &pixmap); + virtual TQPixmap applyColorEffect (const TQPixmap &pixmap); virtual kpColorEffectCommand *createCommand () const; @@ -106,7 +106,7 @@ protected slots: void slotEnableChanged (bool enable); protected: - QCheckBox *m_enableCheckBox; + TQCheckBox *m_enableCheckBox; KColorButton *m_color1Button, *m_color2Button; }; diff --git a/kolourpaint/pixmapfx/kpeffectinvert.cpp b/kolourpaint/pixmapfx/kpeffectinvert.cpp index b9bb00a8..67c1d6d0 100644 --- a/kolourpaint/pixmapfx/kpeffectinvert.cpp +++ b/kolourpaint/pixmapfx/kpeffectinvert.cpp @@ -30,10 +30,10 @@ #include <kpeffectinvert.h> -#include <qcheckbox.h> -#include <qimage.h> -#include <qlayout.h> -#include <qpixmap.h> +#include <tqcheckbox.h> +#include <tqimage.h> +#include <tqlayout.h> +#include <tqpixmap.h> #include <kdebug.h> #include <klocale.h> @@ -68,23 +68,23 @@ kpEffectInvertCommand::~kpEffectInvertCommand () // public static -void kpEffectInvertCommand::apply (QPixmap *destPixmapPtr, int channels) +void kpEffectInvertCommand::apply (TQPixmap *destPixmapPtr, int channels) { - QImage image = kpPixmapFX::convertToImage (*destPixmapPtr); + TQImage image = kpPixmapFX::convertToImage (*destPixmapPtr); apply (&image, channels); *destPixmapPtr = kpPixmapFX::convertToPixmap (image); } // public static -QPixmap kpEffectInvertCommand::apply (const QPixmap &pm, int channels) +TQPixmap kpEffectInvertCommand::apply (const TQPixmap &pm, int channels) { - QImage image = kpPixmapFX::convertToImage (pm); + TQImage image = kpPixmapFX::convertToImage (pm); apply (&image, channels); return kpPixmapFX::convertToPixmap (image); } // public static -void kpEffectInvertCommand::apply (QImage *destImagePtr, int channels) +void kpEffectInvertCommand::apply (TQImage *destImagePtr, int channels) { QRgb mask = qRgba ((channels & Red) ? 0xFF : 0, (channels & Green) ? 0xFF : 0, @@ -124,9 +124,9 @@ void kpEffectInvertCommand::apply (QImage *destImagePtr, int channels) } // public static -QImage kpEffectInvertCommand::apply (const QImage &img, int channels) +TQImage kpEffectInvertCommand::apply (const TQImage &img, int channels) { - QImage retImage = img; + TQImage retImage = img; apply (&retImage, channels); return retImage; } @@ -137,7 +137,7 @@ QImage kpEffectInvertCommand::apply (const QImage &img, int channels) // // protected virtual [base kpColorEffectCommand] -QPixmap kpEffectInvertCommand::applyColorEffect (const QPixmap &pixmap) +TQPixmap kpEffectInvertCommand::applyColorEffect (const TQPixmap &pixmap) { return apply (pixmap, m_channels); } @@ -149,30 +149,30 @@ QPixmap kpEffectInvertCommand::applyColorEffect (const QPixmap &pixmap) kpEffectInvertWidget::kpEffectInvertWidget (bool actOnSelection, kpMainWindow *mainWindow, - QWidget *parent, + TQWidget *parent, const char *name) : kpColorEffectWidget (actOnSelection, mainWindow, parent, name) { - QVBoxLayout *topLevelLay = new QVBoxLayout (this, marginHint (), spacingHint ()); + TQVBoxLayout *topLevelLay = new TQVBoxLayout (this, marginHint (), spacingHint ()); - QWidget *centerWidget = new QWidget (this); + TQWidget *centerWidget = new TQWidget (this); topLevelLay->addWidget (centerWidget, 0/*stretch*/, Qt::AlignCenter); - QVBoxLayout *centerWidgetLay = new QVBoxLayout (centerWidget, + TQVBoxLayout *centerWidgetLay = new TQVBoxLayout (centerWidget, 0/*margin*/, spacingHint ()); - m_redCheckBox = new QCheckBox (i18n ("&Red"), centerWidget); - m_greenCheckBox = new QCheckBox (i18n ("&Green"), centerWidget); - m_blueCheckBox = new QCheckBox (i18n ("&Blue"), centerWidget); + m_redCheckBox = new TQCheckBox (i18n ("&Red"), centerWidget); + m_greenCheckBox = new TQCheckBox (i18n ("&Green"), centerWidget); + m_blueCheckBox = new TQCheckBox (i18n ("&Blue"), centerWidget); - QWidget *spaceWidget = new QWidget (centerWidget); + TQWidget *spaceWidget = new TQWidget (centerWidget); spaceWidget->setFixedSize (1, spacingHint ()); - m_allCheckBox = new QCheckBox (i18n ("&All"), centerWidget); + m_allCheckBox = new TQCheckBox (i18n ("&All"), centerWidget); m_redCheckBox->setChecked (false); @@ -192,15 +192,15 @@ kpEffectInvertWidget::kpEffectInvertWidget (bool actOnSelection, m_inSignalHandler = false; - connect (m_redCheckBox, SIGNAL (toggled (bool)), - this, SLOT (slotRGBCheckBoxToggled ())); - connect (m_greenCheckBox, SIGNAL (toggled (bool)), - this, SLOT (slotRGBCheckBoxToggled ())); - connect (m_blueCheckBox, SIGNAL (toggled (bool)), - this, SLOT (slotRGBCheckBoxToggled ())); - - connect (m_allCheckBox, SIGNAL (toggled (bool)), - this, SLOT (slotAllCheckBoxToggled ())); + connect (m_redCheckBox, TQT_SIGNAL (toggled (bool)), + this, TQT_SLOT (slotRGBCheckBoxToggled ())); + connect (m_greenCheckBox, TQT_SIGNAL (toggled (bool)), + this, TQT_SLOT (slotRGBCheckBoxToggled ())); + connect (m_blueCheckBox, TQT_SIGNAL (toggled (bool)), + this, TQT_SLOT (slotRGBCheckBoxToggled ())); + + connect (m_allCheckBox, TQT_SIGNAL (toggled (bool)), + this, TQT_SLOT (slotAllCheckBoxToggled ())); } kpEffectInvertWidget::~kpEffectInvertWidget () @@ -244,7 +244,7 @@ int kpEffectInvertWidget::channels () const // // public virtual [base kpColorEffectWidget] -QString kpEffectInvertWidget::caption () const +TQString kpEffectInvertWidget::caption () const { return i18n ("Channels"); } @@ -257,7 +257,7 @@ bool kpEffectInvertWidget::isNoOp () const } // public virtual [base kpColorEffectWidget] -QPixmap kpEffectInvertWidget::applyColorEffect (const QPixmap &pixmap) +TQPixmap kpEffectInvertWidget::applyColorEffect (const TQPixmap &pixmap) { return kpEffectInvertCommand::apply (pixmap, channels ()); } diff --git a/kolourpaint/pixmapfx/kpeffectinvert.h b/kolourpaint/pixmapfx/kpeffectinvert.h index 61d6cfda..a63237df 100644 --- a/kolourpaint/pixmapfx/kpeffectinvert.h +++ b/kolourpaint/pixmapfx/kpeffectinvert.h @@ -33,8 +33,8 @@ #include <kpcoloreffect.h> -class QCheckBox; -class QImage; +class TQCheckBox; +class TQImage; class kpMainWindow; @@ -59,7 +59,7 @@ public: // // Inverts the colours of each pixel in the given image. - // These functions differ from QImage::invertPixels() in the following ways: + // These functions differ from TQImage::invertPixels() in the following ways: // // 1. for 8-bit images, it inverts the colours of the Colour Table // (this means that you would get visually similar results to inversion @@ -68,10 +68,10 @@ public: // 2. never inverts the Alpha Buffer // - static void apply (QPixmap *destPixmapPtr, int channels = RGB); - static QPixmap apply (const QPixmap &pm, int channels = RGB); - static void apply (QImage *destImagePtr, int channels = RGB); - static QImage apply (const QImage &img, int channels = RGB); + static void apply (TQPixmap *destPixmapPtr, int channels = RGB); + static TQPixmap apply (const TQPixmap &pm, int channels = RGB); + static void apply (TQImage *destImagePtr, int channels = RGB); + static TQImage apply (const TQImage &img, int channels = RGB); // @@ -82,7 +82,7 @@ public: virtual bool isInvertible () const { return true; } protected: - virtual QPixmap applyColorEffect (const QPixmap &pixmap); + virtual TQPixmap applyColorEffect (const TQPixmap &pixmap); int m_channels; }; @@ -95,7 +95,7 @@ Q_OBJECT public: kpEffectInvertWidget (bool actOnSelection, kpMainWindow *mainWindow, - QWidget *parent, const char *name = 0); + TQWidget *parent, const char *name = 0); virtual ~kpEffectInvertWidget (); @@ -106,10 +106,10 @@ public: // kpColorEffectWidget interface // - virtual QString caption () const; + virtual TQString caption () const; virtual bool isNoOp () const; - virtual QPixmap applyColorEffect (const QPixmap &pixmap); + virtual TQPixmap applyColorEffect (const TQPixmap &pixmap); virtual kpColorEffectCommand *createCommand () const; @@ -118,7 +118,7 @@ protected slots: void slotAllCheckBoxToggled (); protected: - QCheckBox *m_redCheckBox, *m_greenCheckBox, *m_blueCheckBox, + TQCheckBox *m_redCheckBox, *m_greenCheckBox, *m_blueCheckBox, *m_allCheckBox; // blockSignals() didn't seem to work diff --git a/kolourpaint/pixmapfx/kpeffectreducecolors.cpp b/kolourpaint/pixmapfx/kpeffectreducecolors.cpp index b6eb7a42..44fd7ea7 100644 --- a/kolourpaint/pixmapfx/kpeffectreducecolors.cpp +++ b/kolourpaint/pixmapfx/kpeffectreducecolors.cpp @@ -30,12 +30,12 @@ #include <kpeffectreducecolors.h> -#include <qbuttongroup.h> -#include <qcheckbox.h> -#include <qimage.h> -#include <qlayout.h> -#include <qpixmap.h> -#include <qradiobutton.h> +#include <tqbuttongroup.h> +#include <tqcheckbox.h> +#include <tqimage.h> +#include <tqlayout.h> +#include <tqpixmap.h> +#include <tqradiobutton.h> #include <kdebug.h> #include <klocale.h> @@ -43,7 +43,7 @@ #include <kppixmapfx.h> -QImage convertImageDepth (const QImage &image, int depth, bool dither) +TQImage convertImageDepth (const TQImage &image, int depth, bool dither) { #if DEBUG_KP_EFFECT_REDUCE_COLORS kdDebug () << "::convertImageDepth() changing image (w=" << image.width () @@ -73,7 +73,7 @@ QImage convertImageDepth (const QImage &image, int depth, bool dither) #endif - // Hack around Qt's braindead QImage::convertDepth(1, ...) (with + // Hack around Qt's braindead TQImage::convertDepth(1, ...) (with // dithering off) which produces pathetic results with an image that // only has 2 colours - sometimes it just gives a completely black // result. Instead, we simply preserve the 2 colours. One use case @@ -89,8 +89,8 @@ QImage convertImageDepth (const QImage &image, int depth, bool dither) bool moreThan2Colors = false; - QImage monoImage (image.width (), image.height (), - 1/*depth*/, 2/*numColors*/, QImage::LittleEndian); + TQImage monoImage (image.width (), image.height (), + 1/*depth*/, 2/*numColors*/, TQImage::LittleEndian); #if DEBUG_KP_EFFECT_REDUCE_COLORS kdDebug () << "\t\tinitialising output image w=" << monoImage.width () << ",h=" << monoImage.height () @@ -153,7 +153,7 @@ QImage convertImageDepth (const QImage &image, int depth, bool dither) } - QImage retImage = image.convertDepth (depth, + TQImage retImage = image.convertDepth (depth, Qt::AutoColor | (dither ? Qt::DiffuseDither : Qt::ThresholdDither) | Qt::ThresholdAlphaDither | @@ -193,7 +193,7 @@ kpEffectReduceColorsCommand::~kpEffectReduceColorsCommand () // public -QString kpEffectReduceColorsCommand::commandName (int depth, int dither) const +TQString kpEffectReduceColorsCommand::commandName (int depth, int dither) const { if (depth == 1) { @@ -211,13 +211,13 @@ QString kpEffectReduceColorsCommand::commandName (int depth, int dither) const } else { - return QString::null; + return TQString::null; } } // public static -void kpEffectReduceColorsCommand::apply (QPixmap *destPixmapPtr, int depth, bool dither) +void kpEffectReduceColorsCommand::apply (TQPixmap *destPixmapPtr, int depth, bool dither) { if (!destPixmapPtr) return; @@ -226,7 +226,7 @@ void kpEffectReduceColorsCommand::apply (QPixmap *destPixmapPtr, int depth, bool return; - QImage image = kpPixmapFX::convertToImage (*destPixmapPtr); + TQImage image = kpPixmapFX::convertToImage (*destPixmapPtr); image = ::convertImageDepth (image, depth, dither); @@ -235,12 +235,12 @@ void kpEffectReduceColorsCommand::apply (QPixmap *destPixmapPtr, int depth, bool return; - QPixmap pixmap = kpPixmapFX::convertToPixmap (image, false/*no dither*/); + TQPixmap pixmap = kpPixmapFX::convertToPixmap (image, false/*no dither*/); // HACK: The above "image.convertDepth()" erases the Alpha Channel // (at least for monochrome). - // qpixmap.html says "alpha masks on monochrome images are ignored." + // tqpixmap.html says "alpha masks on monochrome images are ignored." // // Put the mask back. // @@ -251,9 +251,9 @@ void kpEffectReduceColorsCommand::apply (QPixmap *destPixmapPtr, int depth, bool } // public static -QPixmap kpEffectReduceColorsCommand::apply (const QPixmap &pm, int depth, bool dither) +TQPixmap kpEffectReduceColorsCommand::apply (const TQPixmap &pm, int depth, bool dither) { - QPixmap ret = pm; + TQPixmap ret = pm; apply (&ret, depth, dither); return ret; } @@ -264,7 +264,7 @@ QPixmap kpEffectReduceColorsCommand::apply (const QPixmap &pm, int depth, bool d // // protected virtual [base kpColorEffectCommand] -QPixmap kpEffectReduceColorsCommand::applyColorEffect (const QPixmap &pixmap) +TQPixmap kpEffectReduceColorsCommand::applyColorEffect (const TQPixmap &pixmap) { return apply (pixmap, m_depth, m_dither); } @@ -276,27 +276,27 @@ QPixmap kpEffectReduceColorsCommand::applyColorEffect (const QPixmap &pixmap) kpEffectReduceColorsWidget::kpEffectReduceColorsWidget (bool actOnSelection, kpMainWindow *mainWindow, - QWidget *parent, + TQWidget *parent, const char *name) : kpColorEffectWidget (actOnSelection, mainWindow, parent, name) { - QVBoxLayout *lay = new QVBoxLayout (this, marginHint (), spacingHint ()); + TQVBoxLayout *lay = new TQVBoxLayout (this, marginHint (), spacingHint ()); m_blackAndWhiteRadioButton = - new QRadioButton (i18n ("&Monochrome"), this); + new TQRadioButton (i18n ("&Monochrome"), this); m_blackAndWhiteDitheredRadioButton = - new QRadioButton (i18n ("Mo&nochrome (dithered)"), this); + new TQRadioButton (i18n ("Mo&nochrome (dithered)"), this); - m_8BitRadioButton = new QRadioButton (i18n ("256 co&lor"), this); + m_8BitRadioButton = new TQRadioButton (i18n ("256 co&lor"), this); - m_8BitDitheredRadioButton = new QRadioButton (i18n ("256 colo&r (dithered)"), this); + m_8BitDitheredRadioButton = new TQRadioButton (i18n ("256 colo&r (dithered)"), this); - m_24BitRadioButton = new QRadioButton (i18n ("24-&bit color"), this); + m_24BitRadioButton = new TQRadioButton (i18n ("24-&bit color"), this); - QButtonGroup *buttonGroup = new QButtonGroup (this); + TQButtonGroup *buttonGroup = new TQButtonGroup (this); buttonGroup->hide (); buttonGroup->insert (m_blackAndWhiteRadioButton); @@ -306,7 +306,7 @@ kpEffectReduceColorsWidget::kpEffectReduceColorsWidget (bool actOnSelection, buttonGroup->insert (m_24BitRadioButton); - const int screenDepth = QPixmap::defaultDepth (); + const int screenDepth = TQPixmap::defaultDepth (); #if DEBUG_KP_EFFECT_REDUCE_COLORS kdDebug () << "kpEffectReduceColorsWidget::<ctor> screenDepth=" << screenDepth @@ -361,16 +361,16 @@ kpEffectReduceColorsWidget::kpEffectReduceColorsWidget (bool actOnSelection, lay->addWidget (m_24BitRadioButton); - connect (m_blackAndWhiteRadioButton, SIGNAL (toggled (bool)), - this, SIGNAL (settingsChanged ())); - connect (m_blackAndWhiteDitheredRadioButton, SIGNAL (toggled (bool)), - this, SIGNAL (settingsChanged ())); - connect (m_8BitRadioButton, SIGNAL (toggled (bool)), - this, SIGNAL (settingsChanged ())); - connect (m_8BitDitheredRadioButton, SIGNAL (toggled (bool)), - this, SIGNAL (settingsChanged ())); - connect (m_24BitRadioButton, SIGNAL (toggled (bool)), - this, SIGNAL (settingsChanged ())); + connect (m_blackAndWhiteRadioButton, TQT_SIGNAL (toggled (bool)), + this, TQT_SIGNAL (settingsChanged ())); + connect (m_blackAndWhiteDitheredRadioButton, TQT_SIGNAL (toggled (bool)), + this, TQT_SIGNAL (settingsChanged ())); + connect (m_8BitRadioButton, TQT_SIGNAL (toggled (bool)), + this, TQT_SIGNAL (settingsChanged ())); + connect (m_8BitDitheredRadioButton, TQT_SIGNAL (toggled (bool)), + this, TQT_SIGNAL (settingsChanged ())); + connect (m_24BitRadioButton, TQT_SIGNAL (toggled (bool)), + this, TQT_SIGNAL (settingsChanged ())); } kpEffectReduceColorsWidget::~kpEffectReduceColorsWidget () @@ -414,7 +414,7 @@ bool kpEffectReduceColorsWidget::dither () const // // public virtual [base kpColorEffectWidget] -QString kpEffectReduceColorsWidget::caption () const +TQString kpEffectReduceColorsWidget::caption () const { return i18n ("Reduce To"); } @@ -427,7 +427,7 @@ bool kpEffectReduceColorsWidget::isNoOp () const } // public virtual [base kpColorEffectWidget] -QPixmap kpEffectReduceColorsWidget::applyColorEffect (const QPixmap &pixmap) +TQPixmap kpEffectReduceColorsWidget::applyColorEffect (const TQPixmap &pixmap) { return kpEffectReduceColorsCommand::apply (pixmap, depth (), dither ()); } diff --git a/kolourpaint/pixmapfx/kpeffectreducecolors.h b/kolourpaint/pixmapfx/kpeffectreducecolors.h index a14cffc7..bf44ef3e 100644 --- a/kolourpaint/pixmapfx/kpeffectreducecolors.h +++ b/kolourpaint/pixmapfx/kpeffectreducecolors.h @@ -33,13 +33,13 @@ #include <kpcoloreffect.h> -class QRadioButton; -class QImage; +class TQRadioButton; +class TQImage; class kpMainWindow; -QImage convertImageDepth (const QImage &image, int depth, bool dither); +TQImage convertImageDepth (const TQImage &image, int depth, bool dither); class kpEffectReduceColorsCommand : public kpColorEffectCommand @@ -51,11 +51,11 @@ public: kpMainWindow *mainWindow); virtual ~kpEffectReduceColorsCommand (); - QString commandName (int depth, int dither) const; + TQString commandName (int depth, int dither) const; // (always preserves mask) - static void apply (QPixmap *destPixmapPtr, int depth, bool dither); - static QPixmap apply (const QPixmap &pm, int depth, bool dither); + static void apply (TQPixmap *destPixmapPtr, int depth, bool dither); + static TQPixmap apply (const TQPixmap &pm, int depth, bool dither); // @@ -63,7 +63,7 @@ public: // protected: - virtual QPixmap applyColorEffect (const QPixmap &pixmap); + virtual TQPixmap applyColorEffect (const TQPixmap &pixmap); int m_depth; bool m_dither; @@ -77,7 +77,7 @@ Q_OBJECT public: kpEffectReduceColorsWidget (bool actOnSelection, kpMainWindow *mainWindow, - QWidget *parent, const char *name = 0); + TQWidget *parent, const char *name = 0); virtual ~kpEffectReduceColorsWidget (); @@ -89,20 +89,20 @@ public: // kpColorEffectWidget interface // - virtual QString caption () const; + virtual TQString caption () const; virtual bool isNoOp () const; - virtual QPixmap applyColorEffect (const QPixmap &pixmap); + virtual TQPixmap applyColorEffect (const TQPixmap &pixmap); virtual kpColorEffectCommand *createCommand () const; protected: - QRadioButton *m_blackAndWhiteRadioButton, + TQRadioButton *m_blackAndWhiteRadioButton, *m_blackAndWhiteDitheredRadioButton, *m_8BitRadioButton, *m_8BitDitheredRadioButton, *m_24BitRadioButton; - QRadioButton *m_defaultRadioButton; + TQRadioButton *m_defaultRadioButton; }; diff --git a/kolourpaint/pixmapfx/kpeffectsdialog.cpp b/kolourpaint/pixmapfx/kpeffectsdialog.cpp index 666f81cf..90dfbd32 100644 --- a/kolourpaint/pixmapfx/kpeffectsdialog.cpp +++ b/kolourpaint/pixmapfx/kpeffectsdialog.cpp @@ -30,11 +30,11 @@ #include <kpeffectsdialog.h> -#include <qgroupbox.h> -#include <qhbox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qtimer.h> +#include <tqgroupbox.h> +#include <tqhbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqtimer.h> #include <kapplication.h> #include <kcombobox.h> @@ -63,12 +63,12 @@ kpEffectsDialog::kpEffectsDialog (bool actOnSelection, const char *name) : kpToolPreviewDialog (kpToolPreviewDialog::Preview, true/*reserve top row*/, - QString::null/*caption*/, - QString::null/*afterActionText (no Dimensions Group Box)*/, + TQString::null/*caption*/, + TQString::null/*afterActionText (no Dimensions Group Box)*/, actOnSelection, parent, name), - m_delayedUpdateTimer (new QTimer (this)), + m_delayedUpdateTimer (new TQTimer (this)), m_effectsComboBox (0), m_settingsGroupBox (0), m_settingsLayout (0), @@ -84,16 +84,16 @@ kpEffectsDialog::kpEffectsDialog (bool actOnSelection, setCaption (i18n ("More Image Effects")); - connect (m_delayedUpdateTimer, SIGNAL (timeout ()), - this, SLOT (slotUpdateWithWaitCursor ())); + connect (m_delayedUpdateTimer, TQT_SIGNAL (timeout ()), + this, TQT_SLOT (slotUpdateWithWaitCursor ())); - QHBox *effectContainer = new QHBox (mainWidget ()); + TQHBox *effectContainer = new TQHBox (mainWidget ()); effectContainer->setSpacing (spacingHint () * 4 - /*need more space for QGroupBox titles*/); + /*need more space for TQGroupBox titles*/); effectContainer->setMargin (0); - QLabel *label = new QLabel (i18n ("&Effect:"), effectContainer); + TQLabel *label = new TQLabel (i18n ("&Effect:"), effectContainer); m_effectsComboBox = new KComboBox (effectContainer); m_effectsComboBox->insertItem (i18n ("Balance")); @@ -109,15 +109,15 @@ kpEffectsDialog::kpEffectsDialog (bool actOnSelection, addCustomWidgetToFront (effectContainer); - m_settingsGroupBox = new QGroupBox (mainWidget ()); - m_settingsLayout = new QVBoxLayout (m_settingsGroupBox, + m_settingsGroupBox = new TQGroupBox (mainWidget ()); + m_settingsLayout = new TQVBoxLayout (m_settingsGroupBox, marginHint () * 2, spacingHint ()); addCustomWidgetToBack (m_settingsGroupBox); - connect (m_effectsComboBox, SIGNAL (activated (int)), - this, SLOT (selectEffect (int))); + connect (m_effectsComboBox, TQT_SIGNAL (activated (int)), + this, TQT_SLOT (selectEffect (int))); selectEffect (0); @@ -157,21 +157,21 @@ kpColorEffectCommand *kpEffectsDialog::createCommand () const // protected virtual [base kpToolPreviewDialog] -QSize kpEffectsDialog::newDimensions () const +TQSize kpEffectsDialog::newDimensions () const { kpDocument *doc = document (); if (!doc) - return QSize (); + return TQSize (); - return QSize (doc->width (m_actOnSelection), + return TQSize (doc->width (m_actOnSelection), doc->height (m_actOnSelection)); } // protected virtual [base kpToolPreviewDialog] -QPixmap kpEffectsDialog::transformPixmap (const QPixmap &pixmap, +TQPixmap kpEffectsDialog::transformPixmap (const TQPixmap &pixmap, int targetWidth, int targetHeight) const { - QPixmap pixmapWithEffect; + TQPixmap pixmapWithEffect; if (m_colorEffectWidget) pixmapWithEffect = m_colorEffectWidget->applyColorEffect (pixmap); @@ -209,7 +209,7 @@ void kpEffectsDialog::selectEffect (int which) m_colorEffectWidget = 0; - m_settingsGroupBox->setCaption (QString::null); + m_settingsGroupBox->setCaption (TQString::null); #define CREATE_EFFECT_WIDGET(name) \ m_colorEffectWidget = new name (m_actOnSelection, \ @@ -255,12 +255,12 @@ void kpEffectsDialog::selectEffect (int which) // Don't resize the preview when showing the widget: // TODO: actually work - QSize previewGroupBoxMinSize = m_previewGroupBox->minimumSize (); - QSize previewGroupBoxMaxSize = m_previewGroupBox->maximumSize (); - QLayout::ResizeMode previewGroupBoxResizeMode = + TQSize previewGroupBoxMinSize = m_previewGroupBox->minimumSize (); + TQSize previewGroupBoxMaxSize = m_previewGroupBox->maximumSize (); + TQLayout::ResizeMode previewGroupBoxResizeMode = m_previewGroupBox->layout () ? m_previewGroupBox->layout ()->resizeMode () : - QLayout::Auto; + TQLayout::Auto; #if DEBUG_KP_EFFECTS_DIALOG kdDebug () << "\tpreviewGroupBox: minSize=" << previewGroupBoxMinSize << " maxSize=" << previewGroupBoxMaxSize @@ -271,7 +271,7 @@ void kpEffectsDialog::selectEffect (int which) #endif if (m_previewGroupBox->layout ()) - m_previewGroupBox->layout ()->setResizeMode (QLayout::FreeResize); + m_previewGroupBox->layout ()->setResizeMode (TQLayout::FreeResize); #if DEBUG_KP_EFFECTS_DIALOG kdDebug () << "\tafter set resizeMode, previewGroupBox.size=" << m_previewGroupBox->size () << endl; @@ -308,12 +308,12 @@ void kpEffectsDialog::selectEffect (int which) #endif - connect (m_colorEffectWidget, SIGNAL (settingsChangedNoWaitCursor ()), - this, SLOT (slotUpdate ())); - connect (m_colorEffectWidget, SIGNAL (settingsChanged ()), - this, SLOT (slotUpdateWithWaitCursor ())); - connect (m_colorEffectWidget, SIGNAL (settingsChangedDelayed ()), - this, SLOT (slotDelayedUpdate ())); + connect (m_colorEffectWidget, TQT_SIGNAL (settingsChangedNoWaitCursor ()), + this, TQT_SLOT (slotUpdate ())); + connect (m_colorEffectWidget, TQT_SIGNAL (settingsChanged ()), + this, TQT_SLOT (slotUpdateWithWaitCursor ())); + connect (m_colorEffectWidget, TQT_SIGNAL (settingsChangedDelayed ()), + this, TQT_SLOT (slotDelayedUpdate ())); slotUpdateWithWaitCursor (); #if DEBUG_KP_EFFECTS_DIALOG kdDebug () << "\tafter slotUpdateWithWaitCursor, previewGroupBox.size=" diff --git a/kolourpaint/pixmapfx/kpeffectsdialog.h b/kolourpaint/pixmapfx/kpeffectsdialog.h index fe7265cc..c0086cbb 100644 --- a/kolourpaint/pixmapfx/kpeffectsdialog.h +++ b/kolourpaint/pixmapfx/kpeffectsdialog.h @@ -33,10 +33,10 @@ #include <kptoolpreviewdialog.h> -class QGroupBox; -class QStringList; -class QTimer; -class QVBoxLayout; +class TQGroupBox; +class TQStringList; +class TQTimer; +class TQVBoxLayout; class KComboBox; @@ -59,8 +59,8 @@ public: kpColorEffectCommand *createCommand () const; protected: - 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; public: @@ -77,11 +77,11 @@ protected slots: protected: static int s_lastWidth, s_lastHeight; - QTimer *m_delayedUpdateTimer; + TQTimer *m_delayedUpdateTimer; KComboBox *m_effectsComboBox; - QGroupBox *m_settingsGroupBox; - QVBoxLayout *m_settingsLayout; + TQGroupBox *m_settingsGroupBox; + TQVBoxLayout *m_settingsLayout; kpColorEffectWidget *m_colorEffectWidget; }; diff --git a/kolourpaint/pixmapfx/kpfloodfill.cpp b/kolourpaint/pixmapfx/kpfloodfill.cpp index 602e8acf..55238f2d 100644 --- a/kolourpaint/pixmapfx/kpfloodfill.cpp +++ b/kolourpaint/pixmapfx/kpfloodfill.cpp @@ -31,10 +31,10 @@ #include <kpfloodfill.h> -#include <qapplication.h> -#include <qbitmap.h> -#include <qpainter.h> -#include <qpixmap.h> +#include <tqapplication.h> +#include <tqbitmap.h> +#include <tqpainter.h> +#include <tqpixmap.h> #include <kdebug.h> #include <kpdefs.h> @@ -43,7 +43,7 @@ #include <kptool.h> -kpFloodFill::kpFloodFill (QPixmap *pixmap, int x, int y, +kpFloodFill::kpFloodFill (TQPixmap *pixmap, int x, int y, const kpColor &color, int processedColorSimilarity) : m_pixmapPtr (pixmap), m_x (x), m_y (y), m_color (color), m_processedColorSimilarity (processedColorSimilarity), @@ -57,7 +57,7 @@ kpFloodFill::~kpFloodFill () // private -int kpFloodFill::fillLinesListSize (const QValueList <kpFloodFill::FillLine> &fillLines) const +int kpFloodFill::fillLinesListSize (const TQValueList <kpFloodFill::FillLine> &fillLines) const { return (fillLines.size () * kpFloodFill::FillLine::size ()); } @@ -66,7 +66,7 @@ int kpFloodFill::fillLinesListSize (const QValueList <kpFloodFill::FillLine> &fi int kpFloodFill::size () const { int fillLinesCacheSize = 0; - for (QValueVector < QValueList <kpFloodFill::FillLine > >::const_iterator it = m_fillLinesCache.begin (); + for (TQValueVector < TQValueList <kpFloodFill::FillLine > >::const_iterator it = m_fillLinesCache.begin (); it != m_fillLinesCache.end (); it++) { @@ -79,7 +79,7 @@ int kpFloodFill::size () const } -QRect kpFloodFill::boundingRect () const +TQRect kpFloodFill::boundingRect () const { return m_boundingRect; } @@ -95,10 +95,10 @@ bool kpFloodFill::fill () // not trying to do a NOP fill if (m_boundingRect.isValid ()) { - QApplication::setOverrideCursor (Qt::waitCursor); + TQApplication::setOverrideCursor (Qt::waitCursor); - QPainter painter, maskPainter; - QBitmap maskBitmap; + TQPainter painter, maskPainter; + TQBitmap maskBitmap; if (m_pixmapPtr->mask () || m_color.isTransparent ()) { @@ -113,13 +113,13 @@ bool kpFloodFill::fill () painter.setPen (m_color.toQColor ()); } - const QValueList <FillLine>::ConstIterator fillLinesEnd = m_fillLines.end (); - for (QValueList <FillLine>::ConstIterator it = m_fillLines.begin (); + const TQValueList <FillLine>::ConstIterator fillLinesEnd = m_fillLines.end (); + for (TQValueList <FillLine>::ConstIterator it = m_fillLines.begin (); it != fillLinesEnd; it++) { - QPoint p1 = QPoint ((*it).m_x1, (*it).m_y); - QPoint p2 = QPoint ((*it).m_x2, (*it).m_y); + TQPoint p1 = TQPoint ((*it).m_x1, (*it).m_y); + TQPoint p2 = TQPoint ((*it).m_x2, (*it).m_y); if (painter.isActive ()) painter.drawLine (p1, p2); @@ -137,7 +137,7 @@ bool kpFloodFill::fill () if (!maskBitmap.isNull ()) m_pixmapPtr->setMask (maskBitmap); - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } else { @@ -155,7 +155,7 @@ bool kpFloodFill::prepareColorToChange () kdDebug () << "kpFloodFill::prepareColorToChange" << endl; #endif - m_colorToChange = kpPixmapFX::getColorAtPixel (*m_pixmapPtr, QPoint (m_x, m_y)); + m_colorToChange = kpPixmapFX::getColorAtPixel (*m_pixmapPtr, TQPoint (m_x, m_y)); if (m_colorToChange.isOpaque ()) { @@ -184,7 +184,7 @@ bool kpFloodFill::prepare () #if DEBUG_KP_FLOOD_FILL && 1 kdDebug () << "kpFloodFill::prepare()" << endl; #endif - m_boundingRect = QRect (); + m_boundingRect = TQRect (); if (m_initState < 1 && !prepareColorToChange ()) { @@ -213,7 +213,7 @@ bool kpFloodFill::prepare () m_image = kpPixmapFX::convertToImage (*m_pixmapPtr); if (m_image.isNull ()) { - kdError () << "kpFloodFill::prepare() could not convert to QImage" << endl; + kdError () << "kpFloodFill::prepare() could not convert to TQImage" << endl; return false; } @@ -231,7 +231,7 @@ bool kpFloodFill::prepare () // draw initial line addLine (m_y, findMinX (m_y, m_x), findMaxX (m_y, m_x)); - for (QValueList <FillLine>::ConstIterator it = m_fillLines.begin (); + for (TQValueList <FillLine>::ConstIterator it = m_fillLines.begin (); it != m_fillLines.end (); it++) { @@ -267,7 +267,7 @@ void kpFloodFill::addLine (int y, int x1, int x2) m_fillLines.append (FillLine (y, x1, x2)); m_fillLinesCache [y].append (FillLine (y /* OPT */, x1, x2)); - m_boundingRect = m_boundingRect.unite (QRect (QPoint (x1, y), QPoint (x2, y))); + m_boundingRect = m_boundingRect.unite (TQRect (TQPoint (x1, y), TQPoint (x2, y))); } kpColor kpFloodFill::pixelColor (int x, int y, bool *beenHere) const @@ -283,8 +283,8 @@ kpColor kpFloodFill::pixelColor (int x, int y, bool *beenHere) const return kpColor::invalid; } - const QValueList <FillLine>::ConstIterator theEnd = m_fillLinesCache [y].end (); - for (QValueList <FillLine>::ConstIterator it = m_fillLinesCache [y].begin (); + const TQValueList <FillLine>::ConstIterator theEnd = m_fillLinesCache [y].end (); + for (TQValueList <FillLine>::ConstIterator it = m_fillLinesCache [y].begin (); it != theEnd; it++) { @@ -296,7 +296,7 @@ kpColor kpFloodFill::pixelColor (int x, int y, bool *beenHere) const } } - return kpPixmapFX::getColorAtPixel (m_image, QPoint (x, y)); + return kpPixmapFX::getColorAtPixel (m_image, TQPoint (x, y)); } bool kpFloodFill::shouldGoTo (int x, int y) const diff --git a/kolourpaint/pixmapfx/kpfloodfill.h b/kolourpaint/pixmapfx/kpfloodfill.h index 5c0d8001..57cb5648 100644 --- a/kolourpaint/pixmapfx/kpfloodfill.h +++ b/kolourpaint/pixmapfx/kpfloodfill.h @@ -29,18 +29,18 @@ #ifndef __kpfloodfill_h__ #define __kpfloodfill_h__ -#include <qimage.h> -#include <qvaluelist.h> -#include <qvaluevector.h> +#include <tqimage.h> +#include <tqvaluelist.h> +#include <tqvaluevector.h> #include <kpcolor.h> -class QPixmap; +class TQPixmap; class kpFloodFill { public: - kpFloodFill (QPixmap *pixmap, int x, int y, + kpFloodFill (TQPixmap *pixmap, int x, int y, const kpColor &color, int processedColorSimilarity); ~kpFloodFill (); @@ -57,19 +57,19 @@ public: kpColor colorToChange () const { return m_colorToChange; }; bool prepare (); - QRect boundingRect () const; // only valid after prepare() + TQRect boundingRect () const; // only valid after prepare() bool fill (); private: - QPixmap *m_pixmapPtr; + TQPixmap *m_pixmapPtr; int m_x, m_y; kpColor m_color; int m_processedColorSimilarity; int m_initState; - QRect m_boundingRect; + TQRect m_boundingRect; struct FillLine { @@ -86,7 +86,7 @@ private: int m_y, m_x1, m_x2; }; - int fillLinesListSize (const QValueList <kpFloodFill::FillLine> &fillLines) const; + int fillLinesListSize (const TQValueList <kpFloodFill::FillLine> &fillLines) const; void addLine (int y, int x1, int x2); kpColor pixelColor (int x, int y, bool *beenHere = 0) const; @@ -95,11 +95,11 @@ private: int findMinX (int y, int x) const; int findMaxX (int y, int x) const; - QValueList <FillLine> m_fillLines; + TQValueList <FillLine> m_fillLines; // Init info - QImage m_image; - QValueVector < QValueList <FillLine> > m_fillLinesCache; + TQImage m_image; + TQValueVector < TQValueList <FillLine> > m_fillLinesCache; kpColor m_colorToChange; }; diff --git a/kolourpaint/pixmapfx/kppixmapfx.cpp b/kolourpaint/pixmapfx/kppixmapfx.cpp index 1bd0b173..5457ef50 100644 --- a/kolourpaint/pixmapfx/kppixmapfx.cpp +++ b/kolourpaint/pixmapfx/kppixmapfx.cpp @@ -33,15 +33,15 @@ #include <math.h> -#include <qapplication.h> -#include <qbitmap.h> -#include <qdatetime.h> -#include <qimage.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qpoint.h> -#include <qpointarray.h> -#include <qrect.h> +#include <tqapplication.h> +#include <tqbitmap.h> +#include <tqdatetime.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqpoint.h> +#include <tqpointarray.h> +#include <tqrect.h> #include <kconfig.h> #include <kdebug.h> @@ -87,17 +87,17 @@ int kpPixmapFX::multiplyDimensions (int lhs, int rhs) // -// QPixmap Statistics +// TQPixmap Statistics // // public static -int kpPixmapFX::pixmapArea (const QPixmap &pixmap) +int kpPixmapFX::pixmapArea (const TQPixmap &pixmap) { return kpPixmapFX::pixmapArea (pixmap.width (), pixmap.height ()); } // public static -int kpPixmapFX::pixmapArea (const QPixmap *pixmap) +int kpPixmapFX::pixmapArea (const TQPixmap *pixmap) { return (pixmap ? kpPixmapFX::pixmapArea (*pixmap) : 0); } @@ -110,14 +110,14 @@ int kpPixmapFX::pixmapArea (int width, int height) // public static -int kpPixmapFX::pixmapSize (const QPixmap &pixmap) +int kpPixmapFX::pixmapSize (const TQPixmap &pixmap) { return kpPixmapFX::pixmapSize (pixmap.width (), pixmap.height (), pixmap.depth ()); } // public static -int kpPixmapFX::pixmapSize (const QPixmap *pixmap) +int kpPixmapFX::pixmapSize (const TQPixmap *pixmap) { return (pixmap ? kpPixmapFX::pixmapSize (*pixmap) : 0); } @@ -142,13 +142,13 @@ int kpPixmapFX::pixmapSize (int width, int height, int depth) // public static -int kpPixmapFX::imageSize (const QImage &image) +int kpPixmapFX::imageSize (const TQImage &image) { return kpPixmapFX::imageSize (image.width (), image.height (), image.depth ()); } // public static -int kpPixmapFX::imageSize (const QImage *image) +int kpPixmapFX::imageSize (const TQImage *image) { return (image ? kpPixmapFX::imageSize (*image) : 0); } @@ -187,49 +187,49 @@ int kpPixmapFX::selectionSize (const kpSelection *sel) // public static -int kpPixmapFX::stringSize (const QString &string) +int kpPixmapFX::stringSize (const TQString &string) { #if DEBUG_KP_PIXMAP_FX && 1 kdDebug () << "kpPixmapFX::stringSize(" << string << ")" << " len=" << string.length () - << " sizeof(QChar)=" << sizeof (QChar) + << " sizeof(TQChar)=" << sizeof (TQChar) << endl; #endif - return string.length () * sizeof (QChar); + return string.length () * sizeof (TQChar); } // public static -int kpPixmapFX::pointArraySize (const QPointArray &points) +int kpPixmapFX::pointArraySize (const TQPointArray &points) { #if DEBUG_KP_PIXMAP_FX && 1 kdDebug () << "kpPixmapFX::pointArraySize() points.size=" << points.size () - << " sizeof(QPoint)=" << sizeof (QPoint) + << " sizeof(TQPoint)=" << sizeof (TQPoint) << endl; #endif - return (points.size () * sizeof (QPoint)); + return (points.size () * sizeof (TQPoint)); } // -// QPixmap/QImage Conversion Functions +// QPixmap/TQImage Conversion Functions // // public static -QImage kpPixmapFX::convertToImage (const QPixmap &pixmap) +TQImage kpPixmapFX::convertToImage (const TQPixmap &pixmap) { if (pixmap.isNull ()) - return QImage (); + return TQImage (); return pixmap.convertToImage (); } // Returns true if <image> contains translucency (rather than just transparency) -// QPixmap::hasAlphaChannel() appears to give incorrect results -static bool imageHasAlphaChannel (const QImage &image) +// TQPixmap::hasAlphaChannel() appears to give incorrect results +static bool imageHasAlphaChannel (const TQImage &image) { if (image.depth () < 32) return false; @@ -248,9 +248,9 @@ static bool imageHasAlphaChannel (const QImage &image) return false; } -static int imageNumColorsUpTo (const QImage &image, int max) +static int imageNumColorsUpTo (const TQImage &image, int max) { - QMap <QRgb, bool> rgbMap; + TQMap <QRgb, bool> rgbMap; if (image.depth () <= 8) { @@ -273,22 +273,22 @@ static int imageNumColorsUpTo (const QImage &image, int max) return rgbMap.size (); } -static void convertToPixmapWarnAboutLoss (const QImage &image, +static void convertToPixmapWarnAboutLoss (const TQImage &image, const kpPixmapFX::WarnAboutLossInfo &wali) { if (!wali.isValid ()) return; - const QString colorDepthTranslucencyDontAskAgain = + const TQString colorDepthTranslucencyDontAskAgain = wali.m_dontAskAgainPrefix + "_ColorDepthTranslucency"; - const QString colorDepthDontAskAgain = + const TQString colorDepthDontAskAgain = wali.m_dontAskAgainPrefix + "_ColorDepth"; - const QString translucencyDontAskAgain = + const TQString translucencyDontAskAgain = wali.m_dontAskAgainPrefix + "_Translucency"; #if DEBUG_KP_PIXMAP_FX && 1 - QTime timer; + TQTime timer; timer.start (); #endif @@ -303,8 +303,8 @@ static void convertToPixmapWarnAboutLoss (const QImage &image, bool moreColorsThanDisplay = (KMessageBox::shouldBeShownContinue (colorDepthDontAskAgain) && - image.depth () > QColor::numBitPlanes () && - QColor::numBitPlanes () < 24); // 32 indicates alpha channel + image.depth () > TQColor::numBitPlanes () && + TQColor::numBitPlanes () < 24); // 32 indicates alpha channel int screenDepthNeeded = 0; @@ -322,7 +322,7 @@ static void convertToPixmapWarnAboutLoss (const QImage &image, << endl << "\timage.depth()=" << image.depth () << endl - << "\tscreenDepth=" << QColor::numBitPlanes () + << "\tscreenDepth=" << TQColor::numBitPlanes () << endl << "\tmoreColorsThanDisplay=" << moreColorsThanDisplay << endl @@ -331,14 +331,14 @@ static void convertToPixmapWarnAboutLoss (const QImage &image, #endif - QApplication::setOverrideCursor (Qt::arrowCursor); + TQApplication::setOverrideCursor (Qt::arrowCursor); if (moreColorsThanDisplay && hasAlphaChannel) { KMessageBox::information (wali.m_parent, wali.m_moreColorsThanDisplayAndHasAlphaChannelMessage .arg (screenDepthNeeded), - QString::null, // or would you prefer "Low Screen Depth and Image Contains Transparency"? :) + TQString::null, // or would you prefer "Low Screen Depth and Image Contains Transparency"? :) colorDepthTranslucencyDontAskAgain); if (!KMessageBox::shouldBeShownContinue (colorDepthTranslucencyDontAskAgain)) @@ -363,26 +363,26 @@ static void convertToPixmapWarnAboutLoss (const QImage &image, translucencyDontAskAgain); } - QApplication::restoreOverrideCursor (); + TQApplication::restoreOverrideCursor (); } // public static -QPixmap kpPixmapFX::convertToPixmap (const QImage &image, bool pretty, +TQPixmap kpPixmapFX::convertToPixmap (const TQImage &image, bool pretty, const WarnAboutLossInfo &wali) { #if DEBUG_KP_PIXMAP_FX && 1 kdDebug () << "kpPixmapFX::convertToPixmap(image,pretty=" << pretty << ",warnAboutLossInfo.isValid=" << wali.isValid () << ")" << endl; - QTime timer; + TQTime timer; timer.start (); #endif if (image.isNull ()) - return QPixmap (); + return TQPixmap (); - QPixmap destPixmap; + TQPixmap destPixmap; if (!pretty) { @@ -417,29 +417,29 @@ QPixmap kpPixmapFX::convertToPixmap (const QImage &image, bool pretty, // TODO: don't dup convertToPixmap() code // public static -QPixmap kpPixmapFX::convertToPixmapAsLosslessAsPossible (const QImage &image, +TQPixmap kpPixmapFX::convertToPixmapAsLosslessAsPossible (const TQImage &image, const WarnAboutLossInfo &wali) { #if DEBUG_KP_PIXMAP_FX && 1 kdDebug () << "kpPixmapFX::convertToPixmapAsLosslessAsPossible(image depth=" << image.depth () << ",warnAboutLossInfo.isValid=" << wali.isValid () - << ") screenDepth=" << QPixmap::defaultDepth () + << ") screenDepth=" << TQPixmap::defaultDepth () << " imageNumColorsUpTo257=" << imageNumColorsUpTo (image, 257) << endl; - QTime timer; + TQTime timer; timer.start (); #endif if (image.isNull ()) - return QPixmap (); + return TQPixmap (); - const int screenDepth = (QPixmap::defaultDepth () >= 24 ? + const int screenDepth = (TQPixmap::defaultDepth () >= 24 ? 32 : - QPixmap::defaultDepth ()); + TQPixmap::defaultDepth ()); - QPixmap destPixmap; + TQPixmap destPixmap; int ditherFlags = 0; if (image.depth () <= screenDepth) @@ -553,17 +553,17 @@ QPixmap kpPixmapFX::convertToPixmapAsLosslessAsPossible (const QImage &image, // public static -QPixmap kpPixmapFX::pixmapWithDefinedTransparentPixels (const QPixmap &pixmap, - const QColor &transparentColor) +TQPixmap kpPixmapFX::pixmapWithDefinedTransparentPixels (const TQPixmap &pixmap, + const TQColor &transparentColor) { if (!pixmap.mask ()) return pixmap; - QPixmap retPixmap (pixmap.width (), pixmap.height ()); + TQPixmap retPixmap (pixmap.width (), pixmap.height ()); retPixmap.fill (transparentColor); - QPainter p (&retPixmap); - p.drawPixmap (QPoint (0, 0), pixmap); + TQPainter p (&retPixmap); + p.drawPixmap (TQPoint (0, 0), pixmap); p.end (); retPixmap.setMask (*pixmap.mask ()); @@ -577,9 +577,9 @@ QPixmap kpPixmapFX::pixmapWithDefinedTransparentPixels (const QPixmap &pixmap, // public static -QPixmap kpPixmapFX::getPixmapAt (const QPixmap &pm, const QRect &rect) +TQPixmap kpPixmapFX::getPixmapAt (const TQPixmap &pm, const TQRect &rect) { - QPixmap retPixmap (rect.width (), rect.height ()); + TQPixmap retPixmap (rect.width (), rect.height ()); #if DEBUG_KP_PIXMAP_FX && 0 kdDebug () << "kpPixmapFX::getPixmapAt(pm.hasMask=" @@ -590,7 +590,7 @@ QPixmap kpPixmapFX::getPixmapAt (const QPixmap &pm, const QRect &rect) << endl; #endif - const QRect validSrcRect = pm.rect ().intersect (rect); + const TQRect validSrcRect = pm.rect ().intersect (rect); const bool wouldHaveUndefinedPixels = (validSrcRect != rect); if (wouldHaveUndefinedPixels) @@ -598,7 +598,7 @@ QPixmap kpPixmapFX::getPixmapAt (const QPixmap &pm, const QRect &rect) #if DEBUG_KP_PIXMAP_FX && 0 kdDebug () << "\tret would contain undefined pixels - setting them to transparent" << endl; #endif - QBitmap transparentMask (rect.width (), rect.height ()); + TQBitmap transparentMask (rect.width (), rect.height ()); transparentMask.fill (Qt::color0/*transparent*/); retPixmap.setMask (transparentMask); } @@ -612,7 +612,7 @@ QPixmap kpPixmapFX::getPixmapAt (const QPixmap &pm, const QRect &rect) } - const QPoint destTopLeft = validSrcRect.topLeft () - rect.topLeft (); + const TQPoint destTopLeft = validSrcRect.topLeft () - rect.topLeft (); // copy data _and_ mask (if avail) copyBlt (&retPixmap, /* dest */ @@ -627,7 +627,7 @@ QPixmap kpPixmapFX::getPixmapAt (const QPixmap &pm, const QRect &rect) kdDebug () << "\tensure opaque in valid region" << endl; #endif kpPixmapFX::ensureOpaqueAt (&retPixmap, - QRect (destTopLeft.x (), destTopLeft.y (), + TQRect (destTopLeft.x (), destTopLeft.y (), validSrcRect.width (), validSrcRect.height ())); } @@ -642,8 +642,8 @@ QPixmap kpPixmapFX::getPixmapAt (const QPixmap &pm, const QRect &rect) // public static -void kpPixmapFX::setPixmapAt (QPixmap *destPixmapPtr, const QRect &destRect, - const QPixmap &srcPixmap) +void kpPixmapFX::setPixmapAt (TQPixmap *destPixmapPtr, const TQRect &destRect, + const TQPixmap &srcPixmap) { if (!destPixmapPtr) return; @@ -666,7 +666,7 @@ void kpPixmapFX::setPixmapAt (QPixmap *destPixmapPtr, const QRect &destRect, #if DEBUG_KP_PIXMAP_FX && 0 if (destPixmapPtr->mask ()) { - QImage image = kpPixmapFX::convertToImage (*destPixmapPtr); + TQImage image = kpPixmapFX::convertToImage (*destPixmapPtr); int numTrans = 0; for (int y = 0; y < image.height (); y++) @@ -704,7 +704,7 @@ void kpPixmapFX::setPixmapAt (QPixmap *destPixmapPtr, const QRect &destRect, if (srcPixmap.mask ()) { - QBitmap mask = getNonNullMask (*destPixmapPtr); + TQBitmap mask = getNonNullMask (*destPixmapPtr); bitBlt (&mask, destRect.x (), destRect.y (), srcPixmap.mask (), @@ -730,7 +730,7 @@ void kpPixmapFX::setPixmapAt (QPixmap *destPixmapPtr, const QRect &destRect, << endl; if (destPixmapPtr->mask ()) { - QImage image = kpPixmapFX::convertToImage (*destPixmapPtr); + TQImage image = kpPixmapFX::convertToImage (*destPixmapPtr); int numTrans = 0; for (int y = 0; y < image.height (); y++) @@ -748,26 +748,26 @@ void kpPixmapFX::setPixmapAt (QPixmap *destPixmapPtr, const QRect &destRect, } // public static -void kpPixmapFX::setPixmapAt (QPixmap *destPixmapPtr, const QPoint &destAt, - const QPixmap &srcPixmap) +void kpPixmapFX::setPixmapAt (TQPixmap *destPixmapPtr, const TQPoint &destAt, + const TQPixmap &srcPixmap) { kpPixmapFX::setPixmapAt (destPixmapPtr, - QRect (destAt.x (), destAt.y (), + TQRect (destAt.x (), destAt.y (), srcPixmap.width (), srcPixmap.height ()), srcPixmap); } // public static -void kpPixmapFX::setPixmapAt (QPixmap *destPixmapPtr, int destX, int destY, - const QPixmap &srcPixmap) +void kpPixmapFX::setPixmapAt (TQPixmap *destPixmapPtr, int destX, int destY, + const TQPixmap &srcPixmap) { - kpPixmapFX::setPixmapAt (destPixmapPtr, QPoint (destX, destY), srcPixmap); + kpPixmapFX::setPixmapAt (destPixmapPtr, TQPoint (destX, destY), srcPixmap); } // public static -void kpPixmapFX::paintPixmapAt (QPixmap *destPixmapPtr, const QPoint &destAt, - const QPixmap &srcPixmap) +void kpPixmapFX::paintPixmapAt (TQPixmap *destPixmapPtr, const TQPoint &destAt, + const TQPixmap &srcPixmap) { if (!destPixmapPtr) return; @@ -782,15 +782,15 @@ void kpPixmapFX::paintPixmapAt (QPixmap *destPixmapPtr, const QPoint &destAt, } // public static -void kpPixmapFX::paintPixmapAt (QPixmap *destPixmapPtr, int destX, int destY, - const QPixmap &srcPixmap) +void kpPixmapFX::paintPixmapAt (TQPixmap *destPixmapPtr, int destX, int destY, + const TQPixmap &srcPixmap) { - kpPixmapFX::paintPixmapAt (destPixmapPtr, QPoint (destX, destY), srcPixmap); + kpPixmapFX::paintPixmapAt (destPixmapPtr, TQPoint (destX, destY), srcPixmap); } // public static -kpColor kpPixmapFX::getColorAtPixel (const QPixmap &pm, const QPoint &at) +kpColor kpPixmapFX::getColorAtPixel (const TQPixmap &pm, const TQPoint &at) { #if DEBUG_KP_PIXMAP_FX && 0 kdDebug () << "kpToolColorPicker::colorAtPixel" << p << endl; @@ -802,25 +802,25 @@ kpColor kpPixmapFX::getColorAtPixel (const QPixmap &pm, const QPoint &at) return kpColor::invalid; } - QPixmap pixmap = getPixmapAt (pm, QRect (at, at)); - QImage image = kpPixmapFX::convertToImage (pixmap); + TQPixmap pixmap = getPixmapAt (pm, TQRect (at, at)); + TQImage image = kpPixmapFX::convertToImage (pixmap); if (image.isNull ()) { - kdError () << "kpPixmapFX::getColorAtPixel(QPixmap) could not convert to QImage" << endl; + kdError () << "kpPixmapFX::getColorAtPixel(TQPixmap) could not convert to TQImage" << endl; return kpColor::invalid; } - return getColorAtPixel (image, QPoint (0, 0)); + return getColorAtPixel (image, TQPoint (0, 0)); } // public static -kpColor kpPixmapFX::getColorAtPixel (const QPixmap &pm, int x, int y) +kpColor kpPixmapFX::getColorAtPixel (const TQPixmap &pm, int x, int y) { - return kpPixmapFX::getColorAtPixel (pm, QPoint (x, y)); + return kpPixmapFX::getColorAtPixel (pm, TQPoint (x, y)); } // public static -kpColor kpPixmapFX::getColorAtPixel (const QImage &img, const QPoint &at) +kpColor kpPixmapFX::getColorAtPixel (const TQImage &img, const TQPoint &at) { if (!img.valid (at.x (), at.y ())) return kpColor::invalid; @@ -830,9 +830,9 @@ kpColor kpPixmapFX::getColorAtPixel (const QImage &img, const QPoint &at) } // public static -kpColor kpPixmapFX::getColorAtPixel (const QImage &img, int x, int y) +kpColor kpPixmapFX::getColorAtPixel (const TQImage &img, int x, int y) { - return kpPixmapFX::getColorAtPixel (img, QPoint (x, y)); + return kpPixmapFX::getColorAtPixel (img, TQPoint (x, y)); } @@ -842,7 +842,7 @@ kpColor kpPixmapFX::getColorAtPixel (const QImage &img, int x, int y) // public static -void kpPixmapFX::ensureNoAlphaChannel (QPixmap *destPixmapPtr) +void kpPixmapFX::ensureNoAlphaChannel (TQPixmap *destPixmapPtr) { if (destPixmapPtr->hasAlphaChannel ()) destPixmapPtr->setMask (kpPixmapFX::getNonNullMask/*just in case*/ (*destPixmapPtr)); @@ -850,13 +850,13 @@ void kpPixmapFX::ensureNoAlphaChannel (QPixmap *destPixmapPtr) // public static -QBitmap kpPixmapFX::getNonNullMask (const QPixmap &pm) +TQBitmap kpPixmapFX::getNonNullMask (const TQPixmap &pm) { if (pm.mask ()) return *pm.mask (); else { - QBitmap maskBitmap (pm.width (), pm.height ()); + TQBitmap maskBitmap (pm.width (), pm.height ()); maskBitmap.fill (Qt::color1/*opaque*/); return maskBitmap; @@ -865,14 +865,14 @@ QBitmap kpPixmapFX::getNonNullMask (const QPixmap &pm) // public static -void kpPixmapFX::ensureTransparentAt (QPixmap *destPixmapPtr, const QRect &destRect) +void kpPixmapFX::ensureTransparentAt (TQPixmap *destPixmapPtr, const TQRect &destRect) { if (!destPixmapPtr) return; - QBitmap maskBitmap = getNonNullMask (*destPixmapPtr); + TQBitmap maskBitmap = getNonNullMask (*destPixmapPtr); - QPainter p (&maskBitmap); + TQPainter p (&maskBitmap); p.setPen (Qt::color0/*transparent*/); p.setBrush (Qt::color0/*transparent*/); @@ -886,8 +886,8 @@ void kpPixmapFX::ensureTransparentAt (QPixmap *destPixmapPtr, const QRect &destR // public static -void kpPixmapFX::paintMaskTransparentWithBrush (QPixmap *destPixmapPtr, const QPoint &destAt, - const QPixmap &brushBitmap) +void kpPixmapFX::paintMaskTransparentWithBrush (TQPixmap *destPixmapPtr, const TQPoint &destAt, + const TQPixmap &brushBitmap) { if (!destPixmapPtr) return; @@ -898,7 +898,7 @@ void kpPixmapFX::paintMaskTransparentWithBrush (QPixmap *destPixmapPtr, const QP return; } - QBitmap destMaskBitmap = kpPixmapFX::getNonNullMask (*destPixmapPtr); + TQBitmap destMaskBitmap = kpPixmapFX::getNonNullMask (*destPixmapPtr); // Src // Dest Mask Brush Bitmap = Result @@ -922,24 +922,24 @@ void kpPixmapFX::paintMaskTransparentWithBrush (QPixmap *destPixmapPtr, const QP } // public static -void kpPixmapFX::paintMaskTransparentWithBrush (QPixmap *destPixmapPtr, int destX, int destY, - const QPixmap &brushBitmap) +void kpPixmapFX::paintMaskTransparentWithBrush (TQPixmap *destPixmapPtr, int destX, int destY, + const TQPixmap &brushBitmap) { kpPixmapFX::paintMaskTransparentWithBrush (destPixmapPtr, - QPoint (destX, destY), + TQPoint (destX, destY), brushBitmap); } // public static -void kpPixmapFX::ensureOpaqueAt (QPixmap *destPixmapPtr, const QRect &destRect) +void kpPixmapFX::ensureOpaqueAt (TQPixmap *destPixmapPtr, const TQRect &destRect) { if (!destPixmapPtr || !destPixmapPtr->mask ()/*already opaque*/) return; - QBitmap maskBitmap = *destPixmapPtr->mask (); + TQBitmap maskBitmap = *destPixmapPtr->mask (); - QPainter p (&maskBitmap); + TQPainter p (&maskBitmap); p.setPen (Qt::color1/*opaque*/); p.setBrush (Qt::color1/*opaque*/); @@ -952,25 +952,25 @@ void kpPixmapFX::ensureOpaqueAt (QPixmap *destPixmapPtr, const QRect &destRect) } // public static -void kpPixmapFX::ensureOpaqueAt (QPixmap *destPixmapPtr, const QPoint &destAt, - const QPixmap &srcPixmap) +void kpPixmapFX::ensureOpaqueAt (TQPixmap *destPixmapPtr, const TQPoint &destAt, + const TQPixmap &srcPixmap) { if (!destPixmapPtr || !destPixmapPtr->mask ()/*already opaque*/) return; - QBitmap destMask = *destPixmapPtr->mask (); + TQBitmap destMask = *destPixmapPtr->mask (); if (srcPixmap.mask ()) { bitBlt (&destMask, /* dest */ destAt, /* dest pt */ srcPixmap.mask (), /* src */ - QRect (0, 0, srcPixmap.width (), srcPixmap.height ()), /* src rect */ + TQRect (0, 0, srcPixmap.width (), srcPixmap.height ()), /* src rect */ Qt::OrROP/*if either is opaque, it's opaque*/); } else { - QPainter p (&destMask); + TQPainter p (&destMask); p.setPen (Qt::color1/*opaque*/); p.setBrush (Qt::color1/*opaque*/); @@ -985,10 +985,10 @@ void kpPixmapFX::ensureOpaqueAt (QPixmap *destPixmapPtr, const QPoint &destAt, } // public static -void kpPixmapFX::ensureOpaqueAt (QPixmap *destPixmapPtr, int destX, int destY, - const QPixmap &srcPixmap) +void kpPixmapFX::ensureOpaqueAt (TQPixmap *destPixmapPtr, int destX, int destY, + const TQPixmap &srcPixmap) { - kpPixmapFX::ensureOpaqueAt (destPixmapPtr, QPoint (destX, destY), srcPixmap); + kpPixmapFX::ensureOpaqueAt (destPixmapPtr, TQPoint (destX, destY), srcPixmap); } @@ -997,17 +997,17 @@ void kpPixmapFX::ensureOpaqueAt (QPixmap *destPixmapPtr, int destX, int destY, // // public static -void kpPixmapFX::convertToGrayscale (QPixmap *destPixmapPtr) +void kpPixmapFX::convertToGrayscale (TQPixmap *destPixmapPtr) { - QImage image = kpPixmapFX::convertToImage (*destPixmapPtr); + TQImage image = kpPixmapFX::convertToImage (*destPixmapPtr); kpPixmapFX::convertToGrayscale (&image); *destPixmapPtr = kpPixmapFX::convertToPixmap (image); } // public static -QPixmap kpPixmapFX::convertToGrayscale (const QPixmap &pm) +TQPixmap kpPixmapFX::convertToGrayscale (const TQPixmap &pm) { - QImage image = kpPixmapFX::convertToImage (pm); + TQImage image = kpPixmapFX::convertToImage (pm); kpPixmapFX::convertToGrayscale (&image); return kpPixmapFX::convertToPixmap (image); } @@ -1025,7 +1025,7 @@ static QRgb toGray (QRgb rgb) } // public static -void kpPixmapFX::convertToGrayscale (QImage *destImagePtr) +void kpPixmapFX::convertToGrayscale (TQImage *destImagePtr) { if (destImagePtr->depth () > 8) { @@ -1048,23 +1048,23 @@ void kpPixmapFX::convertToGrayscale (QImage *destImagePtr) } // public static -QImage kpPixmapFX::convertToGrayscale (const QImage &img) +TQImage kpPixmapFX::convertToGrayscale (const TQImage &img) { - QImage retImage = img; + TQImage retImage = img; kpPixmapFX::convertToGrayscale (&retImage); return retImage; } // public static -void kpPixmapFX::fill (QPixmap *destPixmapPtr, const kpColor &color) +void kpPixmapFX::fill (TQPixmap *destPixmapPtr, const kpColor &color) { if (!destPixmapPtr) return; if (color.isOpaque ()) { - destPixmapPtr->setMask (QBitmap ()); // no mask = opaque + destPixmapPtr->setMask (TQBitmap ()); // no mask = opaque destPixmapPtr->fill (color.toQColor ()); } else @@ -1074,16 +1074,16 @@ void kpPixmapFX::fill (QPixmap *destPixmapPtr, const kpColor &color) } // public static -QPixmap kpPixmapFX::fill (const QPixmap &pm, const kpColor &color) +TQPixmap kpPixmapFX::fill (const TQPixmap &pm, const kpColor &color) { - QPixmap ret = pm; + TQPixmap ret = pm; kpPixmapFX::fill (&ret, color); return ret; } // public static -void kpPixmapFX::resize (QPixmap *destPixmapPtr, int w, int h, +void kpPixmapFX::resize (TQPixmap *destPixmapPtr, int w, int h, const kpColor &backgroundColor, bool fillNewAreas) { #if DEBUG_KP_PIXMAP_FX && 1 @@ -1107,8 +1107,8 @@ void kpPixmapFX::resize (QPixmap *destPixmapPtr, int w, int h, #if DEBUG_KP_PIXMAP_FX && 1 kdDebug () << "\tfilling in new areas" << endl; #endif - QBitmap maskBitmap; - QPainter painter, maskPainter; + TQBitmap maskBitmap; + TQPainter painter, maskPainter; if (backgroundColor.isOpaque ()) { @@ -1152,17 +1152,17 @@ void kpPixmapFX::resize (QPixmap *destPixmapPtr, int w, int h, } // public static -QPixmap kpPixmapFX::resize (const QPixmap &pm, int w, int h, +TQPixmap kpPixmapFX::resize (const TQPixmap &pm, int w, int h, const kpColor &backgroundColor, bool fillNewAreas) { - QPixmap ret = pm; + TQPixmap ret = pm; kpPixmapFX::resize (&ret, w, h, backgroundColor, fillNewAreas); return ret; } // public static -void kpPixmapFX::scale (QPixmap *destPixmapPtr, int w, int h, bool pretty) +void kpPixmapFX::scale (TQPixmap *destPixmapPtr, int w, int h, bool pretty) { if (!destPixmapPtr) return; @@ -1171,7 +1171,7 @@ void kpPixmapFX::scale (QPixmap *destPixmapPtr, int w, int h, bool pretty) } // public static -QPixmap kpPixmapFX::scale (const QPixmap &pm, int w, int h, bool pretty) +TQPixmap kpPixmapFX::scale (const TQPixmap &pm, int w, int h, bool pretty) { #if DEBUG_KP_PIXMAP_FX && 0 kdDebug () << "kpPixmapFX::scale(oldRect=" << pm.rect () @@ -1187,7 +1187,7 @@ QPixmap kpPixmapFX::scale (const QPixmap &pm, int w, int h, bool pretty) if (pretty) { - QImage image = kpPixmapFX::convertToImage (pm); + TQImage image = kpPixmapFX::convertToImage (pm); #if DEBUG_KP_PIXMAP_FX && 0 kdDebug () << "\tBefore smooth scale:" << endl; @@ -1219,7 +1219,7 @@ QPixmap kpPixmapFX::scale (const QPixmap &pm, int w, int h, bool pretty) } else { - QWMatrix matrix; + TQWMatrix matrix; matrix.scale (double (w) / double (pm.width ()), double (h) / double (pm.height ())); @@ -1235,7 +1235,7 @@ double kpPixmapFX::AngleInDegreesEpsilon = / (2.0/*max error allowed*/ * 2.0/*for good measure*/); -static QWMatrix matrixWithZeroOrigin (const QWMatrix &matrix, int width, int height) +static TQWMatrix matrixWithZeroOrigin (const TQWMatrix &matrix, int width, int height) { #if DEBUG_KP_PIXMAP_FX kdDebug () << "matrixWithZeroOrigin(w=" << width << ",h=" << height << ")" << endl; @@ -1247,23 +1247,23 @@ static QWMatrix matrixWithZeroOrigin (const QWMatrix &matrix, int width, int hei << " dy=" << matrix.dy () << endl; #endif - // TODO: Should we be using QWMatrix::Areas? - QRect newRect = matrix.mapRect (QRect (0, 0, width, height)); + // TODO: Should we be using TQWMatrix::Areas? + TQRect newRect = matrix.mapRect (TQRect (0, 0, width, height)); #if DEBUG_KP_PIXMAP_FX kdDebug () << "\tnewRect=" << newRect << endl; #endif - QWMatrix translatedMatrix (matrix.m11 (), matrix.m12 (), matrix.m21 (), matrix.m22 (), + TQWMatrix translatedMatrix (matrix.m11 (), matrix.m12 (), matrix.m21 (), matrix.m22 (), matrix.dx () - newRect.left (), matrix.dy () - newRect.top ()); return translatedMatrix; } -static QPixmap xForm (const QPixmap &pm, const QWMatrix &transformMatrix_, +static TQPixmap xForm (const TQPixmap &pm, const TQWMatrix &transformMatrix_, const kpColor &backgroundColor, int targetWidth, int targetHeight) { - QWMatrix transformMatrix = transformMatrix_; + TQWMatrix transformMatrix = transformMatrix_; #if DEBUG_KP_PIXMAP_FX && 1 kdDebug () << "kppixmapfx.cpp: xForm(pm.size=" << pm.size () @@ -1272,14 +1272,14 @@ static QPixmap xForm (const QPixmap &pm, const QWMatrix &transformMatrix_, << ")" << endl; #endif - // TODO: Should we be using QWMatrix::Areas? - QRect newRect = transformMatrix.map (pm.rect ()); + // TODO: Should we be using TQWMatrix::Areas? + TQRect newRect = transformMatrix.map (pm.rect ()); #if DEBUG_KP_PIXMAP_FX && 1 kdDebug () << "\tmappedRect=" << newRect << endl; #endif - QWMatrix scaleMatrix; + TQWMatrix scaleMatrix; if (targetWidth > 0 && targetWidth != newRect.width ()) { #if DEBUG_KP_PIXMAP_FX && 1 @@ -1300,16 +1300,16 @@ static QPixmap xForm (const QPixmap &pm, const QWMatrix &transformMatrix_, { #if DEBUG_KP_PIXMAP_FX && 1 // TODO: What is going on here??? Why isn't matrix * working properly? - QWMatrix wrongMatrix = transformMatrix * scaleMatrix; - QWMatrix oldHat = transformMatrix; + TQWMatrix wrongMatrix = transformMatrix * scaleMatrix; + TQWMatrix oldHat = transformMatrix; if (targetWidth > 0 && targetWidth != newRect.width ()) oldHat.scale (double (targetWidth) / double (newRect.width ()), 1); if (targetHeight > 0 && targetHeight != newRect.height ()) oldHat.scale (1, double (targetHeight) / double (newRect.height ())); - QWMatrix altHat = transformMatrix; + TQWMatrix altHat = transformMatrix; altHat.scale ((targetWidth > 0 && targetWidth != newRect.width ()) ? double (targetWidth) / double (newRect.width ()) : 1, (targetHeight > 0 && targetHeight != newRect.height ()) ? double (targetHeight) / double (newRect.height ()) : 1); - QWMatrix correctMatrix = scaleMatrix * transformMatrix; + TQWMatrix correctMatrix = scaleMatrix * transformMatrix; kdDebug () << "\tsupposedlyWrongMatrix: m11=" << wrongMatrix.m11 () // <<<---- this is the correct matrix??? << " m12=" << wrongMatrix.m12 () @@ -1347,7 +1347,7 @@ static QPixmap xForm (const QPixmap &pm, const QWMatrix &transformMatrix_, transformMatrix = transformMatrix * scaleMatrix; - // TODO: Should we be using QWMatrix::Areas? + // TODO: Should we be using TQWMatrix::Areas? newRect = transformMatrix.map (pm.rect ()); #if DEBUG_KP_PIXMAP_FX && 1 kdDebug () << "\tnewRect after targetWidth,targetHeight adjust=" << newRect << endl; @@ -1355,7 +1355,7 @@ static QPixmap xForm (const QPixmap &pm, const QWMatrix &transformMatrix_, } - QPixmap newPixmap (targetWidth > 0 ? targetWidth : newRect.width (), + TQPixmap newPixmap (targetWidth > 0 ? targetWidth : newRect.width (), targetHeight > 0 ? targetHeight : newRect.height ()); if ((targetWidth > 0 && targetWidth != newRect.width ()) || (targetHeight > 0 && targetHeight != newRect.height ())) @@ -1370,7 +1370,7 @@ static QPixmap xForm (const QPixmap &pm, const QWMatrix &transformMatrix_, #endif } - QBitmap newBitmapMask; + TQBitmap newBitmapMask; if (backgroundColor.isOpaque ()) newPixmap.fill (backgroundColor.toQColor ()); @@ -1381,7 +1381,7 @@ static QPixmap xForm (const QPixmap &pm, const QWMatrix &transformMatrix_, newBitmapMask.fill (backgroundColor.maskColor ()); } - QPainter painter (&newPixmap); + TQPainter painter (&newPixmap); #if DEBUG_KP_PIXMAP_FX && 1 kdDebug () << "\tmatrix: m11=" << transformMatrix.m11 () << " m12=" << transformMatrix.m12 () @@ -1390,7 +1390,7 @@ static QPixmap xForm (const QPixmap &pm, const QWMatrix &transformMatrix_, << " dx=" << transformMatrix.dx () << " dy=" << transformMatrix.dy () << endl; - const QWMatrix trueMatrix = QPixmap::trueMatrix (transformMatrix, + const TQWMatrix trueMatrix = TQPixmap::trueMatrix (transformMatrix, pm.width (), pm.height ()); kdDebug () << "\ttrue matrix: m11=" << trueMatrix.m11 () << " m12=" << trueMatrix.m12 () @@ -1402,7 +1402,7 @@ static QPixmap xForm (const QPixmap &pm, const QWMatrix &transformMatrix_, #endif painter.setWorldMatrix (transformMatrix); #if DEBUG_KP_PIXMAP_FX && 0 - kdDebug () << "\ttranslate top=" << painter.xForm (QPoint (0, 0)) << endl; + kdDebug () << "\ttranslate top=" << painter.xForm (TQPoint (0, 0)) << endl; kdDebug () << "\tmatrix: m11=" << painter.worldMatrix ().m11 () << " m12=" << painter.worldMatrix ().m12 () << " m21=" << painter.worldMatrix ().m21 () @@ -1411,14 +1411,14 @@ static QPixmap xForm (const QPixmap &pm, const QWMatrix &transformMatrix_, << " dy=" << painter.worldMatrix ().dy () << endl; #endif - painter.drawPixmap (QPoint (0, 0), pm); + painter.drawPixmap (TQPoint (0, 0), pm); painter.end (); if (!newBitmapMask.isNull ()) { - QPainter maskPainter (&newBitmapMask); + TQPainter maskPainter (&newBitmapMask); maskPainter.setWorldMatrix (transformMatrix); - maskPainter.drawPixmap (QPoint (0, 0), kpPixmapFX::getNonNullMask (pm)); + maskPainter.drawPixmap (TQPoint (0, 0), kpPixmapFX::getNonNullMask (pm)); maskPainter.end (); newPixmap.setMask (newBitmapMask); } @@ -1427,12 +1427,12 @@ static QPixmap xForm (const QPixmap &pm, const QWMatrix &transformMatrix_, } // public static -QWMatrix kpPixmapFX::skewMatrix (int width, int height, double hangle, double vangle) +TQWMatrix kpPixmapFX::skewMatrix (int width, int height, double hangle, double vangle) { if (fabs (hangle - 0) < kpPixmapFX::AngleInDegreesEpsilon && fabs (vangle - 0) < kpPixmapFX::AngleInDegreesEpsilon) { - return QWMatrix (); + return TQWMatrix (); } @@ -1464,9 +1464,9 @@ QWMatrix kpPixmapFX::skewMatrix (int width, int height, double hangle, double va * */ - //QWMatrix matrix (1, tan (KP_DEGREES_TO_RADIANS (vangle)), tan (KP_DEGREES_TO_RADIANS (hangle)), 1, 0, 0); + //TQWMatrix matrix (1, tan (KP_DEGREES_TO_RADIANS (vangle)), tan (KP_DEGREES_TO_RADIANS (hangle)), 1, 0, 0); // I think this is clearer than above :) - QWMatrix matrix; + TQWMatrix matrix; matrix.shear (tan (KP_DEGREES_TO_RADIANS (hangle)), tan (KP_DEGREES_TO_RADIANS (vangle))); @@ -1474,14 +1474,14 @@ QWMatrix kpPixmapFX::skewMatrix (int width, int height, double hangle, double va } // public static -QWMatrix kpPixmapFX::skewMatrix (const QPixmap &pixmap, double hangle, double vangle) +TQWMatrix kpPixmapFX::skewMatrix (const TQPixmap &pixmap, double hangle, double vangle) { return kpPixmapFX::skewMatrix (pixmap.width (), pixmap.height (), hangle, vangle); } // public static -void kpPixmapFX::skew (QPixmap *destPixmapPtr, double hangle, double vangle, +void kpPixmapFX::skew (TQPixmap *destPixmapPtr, double hangle, double vangle, const kpColor &backgroundColor, int targetWidth, int targetHeight) { @@ -1494,7 +1494,7 @@ void kpPixmapFX::skew (QPixmap *destPixmapPtr, double hangle, double vangle, } // public static -QPixmap kpPixmapFX::skew (const QPixmap &pm, double hangle, double vangle, +TQPixmap kpPixmapFX::skew (const TQPixmap &pm, double hangle, double vangle, const kpColor &backgroundColor, int targetWidth, int targetHeight) { @@ -1523,21 +1523,21 @@ QPixmap kpPixmapFX::skew (const QPixmap &pm, double hangle, double vangle, } - QWMatrix matrix = skewMatrix (pm, hangle, vangle); + TQWMatrix matrix = skewMatrix (pm, hangle, vangle); return ::xForm (pm, matrix, backgroundColor, targetWidth, targetHeight); } // public static -QWMatrix kpPixmapFX::rotateMatrix (int width, int height, double angle) +TQWMatrix kpPixmapFX::rotateMatrix (int width, int height, double angle) { if (fabs (angle - 0) < kpPixmapFX::AngleInDegreesEpsilon) { - return QWMatrix (); + return TQWMatrix (); } - QWMatrix matrix; + TQWMatrix matrix; matrix.translate (width / 2, height / 2); matrix.rotate (angle); @@ -1545,7 +1545,7 @@ QWMatrix kpPixmapFX::rotateMatrix (int width, int height, double angle) } // public static -QWMatrix kpPixmapFX::rotateMatrix (const QPixmap &pixmap, double angle) +TQWMatrix kpPixmapFX::rotateMatrix (const TQPixmap &pixmap, double angle) { return kpPixmapFX::rotateMatrix (pixmap.width (), pixmap.height (), angle); } @@ -1585,7 +1585,7 @@ bool kpPixmapFX::isLosslessRotation (double angle) // public static -void kpPixmapFX::rotate (QPixmap *destPixmapPtr, double angle, +void kpPixmapFX::rotate (TQPixmap *destPixmapPtr, double angle, const kpColor &backgroundColor, int targetWidth, int targetHeight) { @@ -1598,7 +1598,7 @@ void kpPixmapFX::rotate (QPixmap *destPixmapPtr, double angle, } // public static -QPixmap kpPixmapFX::rotate (const QPixmap &pm, double angle, +TQPixmap kpPixmapFX::rotate (const TQPixmap &pm, double angle, const kpColor &backgroundColor, int targetWidth, int targetHeight) { @@ -1609,22 +1609,22 @@ QPixmap kpPixmapFX::rotate (const QPixmap &pm, double angle, } - QWMatrix matrix = rotateMatrix (pm, angle); + TQWMatrix matrix = rotateMatrix (pm, angle); return ::xForm (pm, matrix, backgroundColor, targetWidth, targetHeight); } // public static -QWMatrix kpPixmapFX::flipMatrix (int width, int height, bool horz, bool vert) +TQWMatrix kpPixmapFX::flipMatrix (int width, int height, bool horz, bool vert) { if (width <= 0 || height <= 0) { kdError () << "kpPixmapFX::flipMatrix() passed invalid dimensions" << endl; - return QWMatrix (); + return TQWMatrix (); } - return QWMatrix (horz ? -1 : +1, // m11 + return TQWMatrix (horz ? -1 : +1, // m11 0, // m12 0, // m21 vert ? -1 : +1, // m22 @@ -1633,7 +1633,7 @@ QWMatrix kpPixmapFX::flipMatrix (int width, int height, bool horz, bool vert) } // public static -QWMatrix kpPixmapFX::flipMatrix (const QPixmap &pixmap, bool horz, bool vert) +TQWMatrix kpPixmapFX::flipMatrix (const TQPixmap &pixmap, bool horz, bool vert) { return kpPixmapFX::flipMatrix (pixmap.width (), pixmap.height (), horz, vert); @@ -1641,7 +1641,7 @@ QWMatrix kpPixmapFX::flipMatrix (const QPixmap &pixmap, bool horz, bool vert) // public static -void kpPixmapFX::flip (QPixmap *destPixmapPtr, bool horz, bool vert) +void kpPixmapFX::flip (TQPixmap *destPixmapPtr, bool horz, bool vert) { if (!horz && !vert) return; @@ -1650,7 +1650,7 @@ void kpPixmapFX::flip (QPixmap *destPixmapPtr, bool horz, bool vert) } // public static -QPixmap kpPixmapFX::flip (const QPixmap &pm, bool horz, bool vert) +TQPixmap kpPixmapFX::flip (const TQPixmap &pm, bool horz, bool vert) { if (!horz && !vert) return pm; @@ -1659,7 +1659,7 @@ QPixmap kpPixmapFX::flip (const QPixmap &pm, bool horz, bool vert) } // public static -void kpPixmapFX::flip (QImage *destImagePtr, bool horz, bool vert) +void kpPixmapFX::flip (TQImage *destImagePtr, bool horz, bool vert) { if (!horz && !vert) return; @@ -1668,7 +1668,7 @@ void kpPixmapFX::flip (QImage *destImagePtr, bool horz, bool vert) } // public static -QImage kpPixmapFX::flip (const QImage &img, bool horz, bool vert) +TQImage kpPixmapFX::flip (const TQImage &img, bool horz, bool vert) { if (!horz && !vert) return img; diff --git a/kolourpaint/pixmapfx/kppixmapfx.h b/kolourpaint/pixmapfx/kppixmapfx.h index c083ee43..ac52e992 100644 --- a/kolourpaint/pixmapfx/kppixmapfx.h +++ b/kolourpaint/pixmapfx/kppixmapfx.h @@ -30,19 +30,19 @@ #define KP_PIXMAP_FX_H -#include <qstring.h> +#include <tqstring.h> -class QBitmap; -class QColor; -class QImage; -class QPointArray; -class QPixmap; -class QPoint; -class QRect; -class QString; -class QWidget; -class QWMatrix; +class TQBitmap; +class TQColor; +class TQImage; +class TQPointArray; +class TQPixmap; +class TQPoint; +class TQRect; +class TQString; +class TQWidget; +class TQWMatrix; class kpColor; class kpSelection; @@ -61,56 +61,56 @@ public: // - // QPixmap Statistics + // TQPixmap Statistics // // Returns the width * height. - static int pixmapArea (const QPixmap &pixmap); - static int pixmapArea (const QPixmap *pixmap); + static int pixmapArea (const TQPixmap &pixmap); + static int pixmapArea (const TQPixmap *pixmap); static int pixmapArea (int width, int height); // Returns the estimated size of <pixmap> in pixmap memory. - static int pixmapSize (const QPixmap &pixmap); - static int pixmapSize (const QPixmap *pixmap); + static int pixmapSize (const TQPixmap &pixmap); + static int pixmapSize (const TQPixmap *pixmap); static int pixmapSize (int width, int height, int depth); - static int imageSize (const QImage &image); - static int imageSize (const QImage *image); + static int imageSize (const TQImage &image); + static int imageSize (const TQImage *image); static int imageSize (int width, int height, int depth); static int selectionSize (const kpSelection &sel); static int selectionSize (const kpSelection *sel); - static int stringSize (const QString &string); + static int stringSize (const TQString &string); - static int pointArraySize (const QPointArray &points); + static int pointArraySize (const TQPointArray &points); // - // QPixmap/QImage Conversion Functions + // QPixmap/TQImage Conversion Functions // // - // Converts <pixmap> to a QImage and returns it. + // Converts <pixmap> to a TQImage and returns it. // // WARNING: On an 8-bit screen: // - // QPixmap result = convertToPixmap (convertToImage (pixmap)); + // TQPixmap result = convertToPixmap (convertToImage (pixmap)); // // <result> is slightly differently colored to <pixmap>. // - // KolourPaint needs to convert to QImage occasionally as - // QImage allows KolourPaint to read pixels and because the QImage + // KolourPaint needs to convert to TQImage occasionally as + // TQImage allows KolourPaint to read pixels and because the QImage // methods give reliable results and pixel-identical results on - // all platforms. The QPixmap paint engine has no such guarantee + // all platforms. The TQPixmap paint engine has no such guarantee // and even depends on the quality of the video driver. // // As a result, KolourPaint should not be used on an 8-bit screen. // HITODO: Add warning on startup, like in KolourPaint/KDE4. // // This bug will be fixed when KolourPaint gets a proper image library, - // where QPixmap -> QImage -> QPixmap transitions will be not be needed. - static QImage convertToImage (const QPixmap &pixmap); + // where TQPixmap -> TQImage -> TQPixmap transitions will be not be needed. + static TQImage convertToImage (const TQPixmap &pixmap); // // Dialog info for warning about data loss with convertToPixmap(). @@ -150,11 +150,11 @@ public: // // Dialog parent // - WarnAboutLossInfo (const QString &moreColorsThanDisplayAndHasAlphaChannelMessage, - const QString &moreColorsThanDisplayMessage, - const QString &hasAlphaChannelMessage, - const QString &dontAskAgainPrefix, - QWidget *parent) + WarnAboutLossInfo (const TQString &moreColorsThanDisplayAndHasAlphaChannelMessage, + const TQString &moreColorsThanDisplayMessage, + const TQString &hasAlphaChannelMessage, + const TQString &dontAskAgainPrefix, + TQWidget *parent) : m_moreColorsThanDisplayAndHasAlphaChannelMessage ( moreColorsThanDisplayAndHasAlphaChannelMessage), @@ -183,16 +183,16 @@ public: bool isValid () const { return m_isValid; } - QString m_moreColorsThanDisplayAndHasAlphaChannelMessage, + TQString m_moreColorsThanDisplayAndHasAlphaChannelMessage, m_moreColorsThanDisplayMessage, m_hasAlphaChannelMessage; - QString m_dontAskAgainPrefix; - QWidget *m_parent; + TQString m_dontAskAgainPrefix; + TQWidget *m_parent; bool m_isValid; }; // - // Converts <image> to a QPixmap of the current display's depth and + // Converts <image> to a TQPixmap of the current display's depth and // returns it. // // If the flag <pretty> is set, it will dither the image making the @@ -202,14 +202,14 @@ public: // // This will automatically call ensureNoAlphaChannel(). // - // Never use a foreign QPixmap that is offered to you - always get the - // foreign QImage and use this function to convert it to a sane QPixmap. + // Never use a foreign TQPixmap that is offered to you - always get the + // foreign TQImage and use this function to convert it to a sane TQPixmap. // // <wali>, if specified, describes parameters for the dialog that comes // up warning the user of data loss if the <image> contains translucency // and/or more colors than the current display. // - static QPixmap convertToPixmap (const QImage &image, bool pretty = false, + static TQPixmap convertToPixmap (const TQImage &image, bool pretty = false, const WarnAboutLossInfo &wali = WarnAboutLossInfo ()); // Same as convertToPixmap() but tries as hard as possible to make the @@ -221,15 +221,15 @@ public: // instead. If you know for sure that <image> cannot be displayed // losslessly, then call convertToPixmap() with <pretty> = true. // - static QPixmap convertToPixmapAsLosslessAsPossible (const QImage &image, + static TQPixmap convertToPixmapAsLosslessAsPossible (const TQImage &image, const WarnAboutLossInfo &wali = WarnAboutLossInfo ()); // Sets the RGB values of the pixels where <pixmap> is transparent to // <transparentColor>. This has visually no effect on the <pixmap> // unless the mask is lost. - static QPixmap pixmapWithDefinedTransparentPixels (const QPixmap &pixmap, - const QColor &transparentColor); + static TQPixmap pixmapWithDefinedTransparentPixels (const TQPixmap &pixmap, + const TQColor &transparentColor); // @@ -240,50 +240,50 @@ public: // // Returns the pixel and mask data found at the <rect> in <pm>. // - static QPixmap getPixmapAt (const QPixmap &pm, const QRect &rect); + static TQPixmap getPixmapAt (const TQPixmap &pm, const TQRect &rect); // // Sets the pixel and mask data at <destRect> in <*destPixmapPtr> // to <srcPixmap>. // - static void setPixmapAt (QPixmap *destPixmapPtr, const QRect &destRect, - const QPixmap &srcPixmap); + static void setPixmapAt (TQPixmap *destPixmapPtr, const TQRect &destRect, + const TQPixmap &srcPixmap); // // Sets the pixel and mask data at the rectangle in <*destPixmapPtr>, // with the top-left <destAt> and dimensions <srcPixmap.rect()>, // to <srcPixmap>. // - static void setPixmapAt (QPixmap *destPixmapPtr, const QPoint &destAt, - const QPixmap &srcPixmap); - static void setPixmapAt (QPixmap *destPixmapPtr, int destX, int destY, - const QPixmap &srcPixmap); + static void setPixmapAt (TQPixmap *destPixmapPtr, const TQPoint &destAt, + const TQPixmap &srcPixmap); + static void setPixmapAt (TQPixmap *destPixmapPtr, int destX, int destY, + const TQPixmap &srcPixmap); // // Draws <srcPixmap> on top of <*destPixmapPtr> at <destAt>. // The mask of <*destPixmapPtr> is adjusted so that all opaque // pixels in <srcPixmap> will be opaque in <*destPixmapPtr>. // - static void paintPixmapAt (QPixmap *destPixmapPtr, const QPoint &destAt, - const QPixmap &srcPixmap); - static void paintPixmapAt (QPixmap *destPixmapPtr, int destX, int destY, - const QPixmap &srcPixmap); + static void paintPixmapAt (TQPixmap *destPixmapPtr, const TQPoint &destAt, + const TQPixmap &srcPixmap); + static void paintPixmapAt (TQPixmap *destPixmapPtr, int destX, int destY, + const TQPixmap &srcPixmap); // // Returns the colour of the pixel at <at> in <pm>. // If the pixel is transparent, a value is returned such that // kpTool::isColorTransparent(<return_value>) will return true. // - static kpColor getColorAtPixel (const QPixmap &pm, const QPoint &at); - static kpColor getColorAtPixel (const QPixmap &pm, int x, int y); + static kpColor getColorAtPixel (const TQPixmap &pm, const TQPoint &at); + static kpColor getColorAtPixel (const TQPixmap &pm, int x, int y); // // Returns the color of the pixel at <at> in <img>. // If the pixel is transparent, a value is returned such that // kpTool::isColorTransparent(<return_value>) will return true. // - static kpColor getColorAtPixel (const QImage &img, const QPoint &at); - static kpColor getColorAtPixel (const QImage &img, int x, int y); + static kpColor getColorAtPixel (const TQImage &img, const TQPoint &at); + static kpColor getColorAtPixel (const TQImage &img, int x, int y); // @@ -293,49 +293,49 @@ public: // // Removes <*destPixmapPtr>'s Alpha Channel and attempts to convert it - // to a mask. KolourPaint - and QPixmap to a great extent - does not + // to a mask. KolourPaint - and TQPixmap to a great extent - does not // support Alpha Channels - only masks. Call this whenever you get // a pixmap from a foreign source; else all KolourPaint code will // exhibit "undefined behaviour". // - static void ensureNoAlphaChannel (QPixmap *destPixmapPtr); + static void ensureNoAlphaChannel (TQPixmap *destPixmapPtr); // // Returns <pm>'s mask or a fully opaque mask (with <pm>'s dimensions) // if <pm> does not have a mask. // - static QBitmap getNonNullMask (const QPixmap &pm); + static TQBitmap getNonNullMask (const TQPixmap &pm); // // Ensures that <*destPixmapPtr> is transparent at <rect>. // - static void ensureTransparentAt (QPixmap *destPixmapPtr, const QRect &destRect); + static void ensureTransparentAt (TQPixmap *destPixmapPtr, const TQRect &destRect); // // Sets the mask of <*destPixmapPtr> at the rectangle, with the // top-left <destAt> and dimensions <srcMaskBitmap.rect()>, // to transparent where <brushBitmap> is opaque. // - // <brushPixmap> must be a QPixmap of depth 1 (or a QBitmap). + // <brushPixmap> must be a TQPixmap of depth 1 (or a TQBitmap). // - static void paintMaskTransparentWithBrush (QPixmap *destPixmapPtr, const QPoint &destAt, - const QPixmap &brushBitmap); - static void paintMaskTransparentWithBrush (QPixmap *destPixmapPtr, int destX, int destY, - const QPixmap &brushBitmap); + static void paintMaskTransparentWithBrush (TQPixmap *destPixmapPtr, const TQPoint &destAt, + const TQPixmap &brushBitmap); + static void paintMaskTransparentWithBrush (TQPixmap *destPixmapPtr, int destX, int destY, + const TQPixmap &brushBitmap); // // Ensures that <*destPixmapPtr> is opaque at <rect>. // - static void ensureOpaqueAt (QPixmap *destPixmapPtr, const QRect &destRect); + static void ensureOpaqueAt (TQPixmap *destPixmapPtr, const TQRect &destRect); // // Ensures that <srcPixmap>'s opaque pixels will be opaque if // painted onto <*destPixmapPtr> at <destAt>. // - static void ensureOpaqueAt (QPixmap *destPixmapPtr, const QPoint &destAt, - const QPixmap &srcPixmap); - static void ensureOpaqueAt (QPixmap *destPixmapPtr, int destX, int destY, - const QPixmap &srcPixmap); + static void ensureOpaqueAt (TQPixmap *destPixmapPtr, const TQPoint &destAt, + const TQPixmap &srcPixmap); + static void ensureOpaqueAt (TQPixmap *destPixmapPtr, int destX, int destY, + const TQPixmap &srcPixmap); // @@ -346,32 +346,32 @@ public: // // Converts the image to grayscale. // - static void convertToGrayscale (QPixmap *destPixmapPtr); - static QPixmap convertToGrayscale (const QPixmap &pm); - static void convertToGrayscale (QImage *destImagePtr); - static QImage convertToGrayscale (const QImage &img); + static void convertToGrayscale (TQPixmap *destPixmapPtr); + static TQPixmap convertToGrayscale (const TQPixmap &pm); + static void convertToGrayscale (TQImage *destImagePtr); + static TQImage convertToGrayscale (const TQImage &img); // // Fills an image in the given color. // - static void fill (QPixmap *destPixmapPtr, const kpColor &color); - static QPixmap fill (const QPixmap &pm, const kpColor &color); + static void fill (TQPixmap *destPixmapPtr, const kpColor &color); + static TQPixmap fill (const TQPixmap &pm, const kpColor &color); // // Resizes an image to the given width and height, // filling any new areas with <backgroundColor> if <fillNewAreas> is set. // - static void resize (QPixmap *destPixmapPtr, int w, int h, + static void resize (TQPixmap *destPixmapPtr, int w, int h, const kpColor &backgroundColor, bool fillNewAreas = true); - static QPixmap resize (const QPixmap &pm, int w, int h, + static TQPixmap resize (const TQPixmap &pm, int w, int h, const kpColor &backgroundColor, bool fillNewAreas = true); // // Scales an image to the given width and height. // If <pretty> is true, a smooth scale will be used. // - static void scale (QPixmap *destPixmapPtr, int w, int h, bool pretty = false); - static QPixmap scale (const QPixmap &pm, int w, int h, bool pretty = false); + static void scale (TQPixmap *destPixmapPtr, int w, int h, bool pretty = false); + static TQPixmap scale (const TQPixmap &pm, int w, int h, bool pretty = false); // The minimum difference between 2 angles (in degrees) such that they are @@ -395,13 +395,13 @@ public: // Using <targetWidth> & <targetHeight> to generate preview pixmaps is // significantly more efficient than skewing and then scaling yourself. // - static QWMatrix skewMatrix (int width, int height, double hangle, double vangle); - static QWMatrix skewMatrix (const QPixmap &pixmap, double hangle, double vangle); + static TQWMatrix skewMatrix (int width, int height, double hangle, double vangle); + static TQWMatrix skewMatrix (const TQPixmap &pixmap, double hangle, double vangle); - static void skew (QPixmap *destPixmapPtr, double hangle, double vangle, + static void skew (TQPixmap *destPixmapPtr, double hangle, double vangle, const kpColor &backgroundColor, int targetWidth = -1, int targetHeight = -1); - static QPixmap skew (const QPixmap &pm, double hangle, double vangle, + static TQPixmap skew (const TQPixmap &pm, double hangle, double vangle, const kpColor &backgroundColor, int targetWidth = -1, int targetHeight = -1); @@ -416,15 +416,15 @@ public: // Using <targetWidth> & <targetHeight> to generate preview pixmaps is // significantly more efficient than rotating and then scaling yourself. // - static QWMatrix rotateMatrix (int width, int height, double angle); - static QWMatrix rotateMatrix (const QPixmap &pixmap, double angle); + static TQWMatrix rotateMatrix (int width, int height, double angle); + static TQWMatrix rotateMatrix (const TQPixmap &pixmap, double angle); static bool isLosslessRotation (double angle); - static void rotate (QPixmap *destPixmapPtr, double angle, + static void rotate (TQPixmap *destPixmapPtr, double angle, const kpColor &backgroundColor, int targetWidth = -1, int targetHeight = -1); - static QPixmap rotate (const QPixmap &pm, double angle, + static TQPixmap rotate (const TQPixmap &pm, double angle, const kpColor &backgroundColor, int targetWidth = -1, int targetHeight = -1); @@ -432,18 +432,18 @@ public: // // Flips an image in the given directions. // - static QWMatrix flipMatrix (int width, int height, bool horz, bool vert); - static QWMatrix flipMatrix (const QPixmap &pixmap, bool horz, bool vert); + static TQWMatrix flipMatrix (int width, int height, bool horz, bool vert); + static TQWMatrix flipMatrix (const TQPixmap &pixmap, bool horz, bool vert); // TODO: this kind of overloading is error prone - // e.g. QPixmap pixmap; + // e.g. TQPixmap pixmap; // kpPixmapFX::flip (pixmap, false, true); // looks like it will flip vertically but does absolutely nothing! // (should be &pixmap) - static void flip (QPixmap *destPixmapPtr, bool horz, bool vert); - static QPixmap flip (const QPixmap &pm, bool horz, bool vert); - static void flip (QImage *destImagePtr, bool horz, bool vert); - static QImage flip (const QImage &img, bool horz, bool vert); + static void flip (TQPixmap *destPixmapPtr, bool horz, bool vert); + static TQPixmap flip (const TQPixmap &pm, bool horz, bool vert); + static void flip (TQImage *destImagePtr, bool horz, bool vert); + static TQImage flip (const TQImage &img, bool horz, bool vert); }; 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__ diff --git a/kolourpaint/views/kpthumbnailview.cpp b/kolourpaint/views/kpthumbnailview.cpp index 32c54376..179f7c92 100644 --- a/kolourpaint/views/kpthumbnailview.cpp +++ b/kolourpaint/views/kpthumbnailview.cpp @@ -39,7 +39,7 @@ kpThumbnailView::kpThumbnailView (kpDocument *document, kpViewManager *viewManager, kpView *buddyView, kpViewScrollableContainer *scrollableContainer, - QWidget *parent, const char *name) + TQWidget *parent, const char *name) : kpView (document, toolToolBar, viewManager, buddyView, @@ -64,13 +64,13 @@ void kpThumbnailView::setMaskToCoverDocument () << endl; #endif - setMask (QRegion (QRect (origin ().x (), origin ().y (), + setMask (TQRegion (TQRect (origin ().x (), origin ().y (), zoomedDocWidth (), zoomedDocHeight ()))); } // protected virtual [base kpView] -void kpThumbnailView::resizeEvent (QResizeEvent *e) +void kpThumbnailView::resizeEvent (TQResizeEvent *e) { #if DEBUG_KP_THUMBNAIL_VIEW kdDebug () << "kpThumbnailView(" << name () << ")::resizeEvent()" diff --git a/kolourpaint/views/kpthumbnailview.h b/kolourpaint/views/kpthumbnailview.h index c3420833..9bc4dad8 100644 --- a/kolourpaint/views/kpthumbnailview.h +++ b/kolourpaint/views/kpthumbnailview.h @@ -53,7 +53,7 @@ public: kpViewManager *viewManager, kpView *buddyView, kpViewScrollableContainer *scrollableContainer, - QWidget *parent, const char *name); + TQWidget *parent, const char *name); /** * Destructs this thumbnail view. @@ -64,7 +64,7 @@ public: /** * @returns the caption to display in an enclosing thumbnail window. */ - virtual QString caption () const = 0; + virtual TQString caption () const = 0; protected: @@ -83,7 +83,7 @@ protected: * * Extends @ref kpView. */ - virtual void resizeEvent (QResizeEvent *e); + virtual void resizeEvent (TQResizeEvent *e); }; diff --git a/kolourpaint/views/kpunzoomedthumbnailview.cpp b/kolourpaint/views/kpunzoomedthumbnailview.cpp index 09d5aed1..4f019905 100644 --- a/kolourpaint/views/kpunzoomedthumbnailview.cpp +++ b/kolourpaint/views/kpunzoomedthumbnailview.cpp @@ -50,7 +50,7 @@ kpUnzoomedThumbnailView::kpUnzoomedThumbnailView ( kpViewManager *viewManager, kpView *buddyView, kpViewScrollableContainer *scrollableContainer, - QWidget *parent, const char *name) + TQWidget *parent, const char *name) : kpThumbnailView (document, toolToolBar, viewManager, buddyView, @@ -61,9 +61,9 @@ kpUnzoomedThumbnailView::kpUnzoomedThumbnailView ( if (buddyViewScrollableContainer ()) { connect (buddyViewScrollableContainer (), - SIGNAL (contentsMovingSoon (int, int)), + TQT_SIGNAL (contentsMovingSoon (int, int)), this, - SLOT (adjustToEnvironment ())); + TQT_SLOT (adjustToEnvironment ())); } // Call to virtual function - this is why the class is sealed @@ -78,7 +78,7 @@ kpUnzoomedThumbnailView::~kpUnzoomedThumbnailView () // public virtual [base kpThumbnailView] -QString kpUnzoomedThumbnailView::caption () const +TQString kpUnzoomedThumbnailView::caption () const { return i18n ("Unzoomed Mode - Thumbnail"); } @@ -160,8 +160,8 @@ void kpUnzoomedThumbnailView::adjustToEnvironment () if (!buddyViewScrollableContainer ()) return; - QRect docRect = buddyView ()->transformViewToDoc ( - QRect (buddyViewScrollableContainer ()->contentsXSoon (), + TQRect docRect = buddyView ()->transformViewToDoc ( + TQRect (buddyViewScrollableContainer ()->contentsXSoon (), buddyViewScrollableContainer ()->contentsYSoon (), QMIN (buddyView ()->width (), buddyViewScrollableContainer ()->visibleWidth ()), QMIN (buddyView ()->height (), buddyViewScrollableContainer ()->visibleHeight ()))); @@ -192,7 +192,7 @@ void kpUnzoomedThumbnailView::adjustToEnvironment () { // OPT: scrollView impl would be much, much faster - setOrigin (QPoint (-x, -y)); + setOrigin (TQPoint (-x, -y)); setMaskToCoverDocument (); // Above might be a NOP even if e.g. doc size changed so force diff --git a/kolourpaint/views/kpunzoomedthumbnailview.h b/kolourpaint/views/kpunzoomedthumbnailview.h index 0f7ccf53..cff6bdab 100644 --- a/kolourpaint/views/kpunzoomedthumbnailview.h +++ b/kolourpaint/views/kpunzoomedthumbnailview.h @@ -65,7 +65,7 @@ public: kpViewManager *viewManager, kpView *buddyView, kpViewScrollableContainer *scrollableContainer, - QWidget *parent, const char *name); + TQWidget *parent, const char *name); /** * Destructs an unzoomed thumbnail view. @@ -76,7 +76,7 @@ public: /** * Implements @ref kpThumbnailView. */ - QString caption () const; + TQString caption () const; public slots: diff --git a/kolourpaint/views/kpzoomedthumbnailview.cpp b/kolourpaint/views/kpzoomedthumbnailview.cpp index ecbfd317..c5bde48d 100644 --- a/kolourpaint/views/kpzoomedthumbnailview.cpp +++ b/kolourpaint/views/kpzoomedthumbnailview.cpp @@ -43,7 +43,7 @@ kpZoomedThumbnailView::kpZoomedThumbnailView (kpDocument *document, kpViewManager *viewManager, kpView *buddyView, kpViewScrollableContainer *scrollableContainer, - QWidget *parent, const char *name) + TQWidget *parent, const char *name) : kpThumbnailView (document, toolToolBar, viewManager, buddyView, @@ -61,7 +61,7 @@ kpZoomedThumbnailView::~kpZoomedThumbnailView () // public virtual [base kpThumbnailView] -QString kpZoomedThumbnailView::caption () const +TQString kpZoomedThumbnailView::caption () const { return i18n ("%1% - Thumbnail").arg (zoomLevelX ()); } @@ -124,7 +124,7 @@ void kpZoomedThumbnailView::adjustToEnvironment () { setZoomLevel (hzoom, vzoom); - setOrigin (QPoint ((width () - zoomedDocWidth ()) / 2, + setOrigin (TQPoint ((width () - zoomedDocWidth ()) / 2, (height () - zoomedDocHeight ()) / 2)); setMaskToCoverDocument (); diff --git a/kolourpaint/views/kpzoomedthumbnailview.h b/kolourpaint/views/kpzoomedthumbnailview.h index 0bcb367c..882c6d08 100644 --- a/kolourpaint/views/kpzoomedthumbnailview.h +++ b/kolourpaint/views/kpzoomedthumbnailview.h @@ -60,7 +60,7 @@ public: kpViewManager *viewManager, kpView *buddyView, kpViewScrollableContainer *scrollableContainer, - QWidget *parent, const char *name); + TQWidget *parent, const char *name); /** * Destructs a zoomed thumbnail view. @@ -71,7 +71,7 @@ public: /** * Implements @ref kpThumbnailView. */ - QString caption () const; + TQString caption () const; public slots: diff --git a/kolourpaint/views/kpzoomedview.cpp b/kolourpaint/views/kpzoomedview.cpp index ef1d6981..c2b1f47d 100644 --- a/kolourpaint/views/kpzoomedview.cpp +++ b/kolourpaint/views/kpzoomedview.cpp @@ -43,7 +43,7 @@ kpZoomedView::kpZoomedView (kpDocument *document, kpViewManager *viewManager, kpView *buddyView, kpViewScrollableContainer *scrollableContainer, - QWidget *parent, const char *name) + TQWidget *parent, const char *name) : kpView (document, toolToolBar, viewManager, buddyView, diff --git a/kolourpaint/views/kpzoomedview.h b/kolourpaint/views/kpzoomedview.h index c3729282..12565ab4 100644 --- a/kolourpaint/views/kpzoomedview.h +++ b/kolourpaint/views/kpzoomedview.h @@ -61,7 +61,7 @@ public: kpViewManager *viewManager, kpView *buddyView, kpViewScrollableContainer *scrollableContainer, - QWidget *parent, const char *name); + TQWidget *parent, const char *name); /** * Destructs an unzoomed view. diff --git a/kolourpaint/widgets/kpcolorsimilaritycube.cpp b/kolourpaint/widgets/kpcolorsimilaritycube.cpp index 9fe3f29b..c09e495a 100644 --- a/kolourpaint/widgets/kpcolorsimilaritycube.cpp +++ b/kolourpaint/widgets/kpcolorsimilaritycube.cpp @@ -32,9 +32,9 @@ #include <math.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qwhatsthis.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqwhatsthis.h> #include <kdebug.h> #include <klocale.h> @@ -49,14 +49,14 @@ const double kpColorSimilarityCube::colorCubeDiagonalDistance = kpColorSimilarityCube::kpColorSimilarityCube (int look, kpMainWindow *mainWindow, - QWidget *parent, + TQWidget *parent, const char *name) - : QFrame (parent, name, Qt::WNoAutoErase/*no flicker*/), + : TQFrame (parent, name, Qt::WNoAutoErase/*no flicker*/), m_mainWindow (mainWindow), m_colorSimilarity (-1) { if (look & Depressed) - setFrameStyle (QFrame::Panel | QFrame::Sunken); + setFrameStyle (TQFrame::Panel | TQFrame::Sunken); setColorSimilarity (0); @@ -66,7 +66,7 @@ kpColorSimilarityCube::kpColorSimilarityCube (int look, if (look & DoubleClickInstructions) { - QWhatsThis::add (this, + TQWhatsThis::add (this, i18n ("<qt><p><b>Color Similarity</b> is how close " "colors must be in the RGB Color Cube " "to be considered the same.</p>" @@ -87,7 +87,7 @@ kpColorSimilarityCube::kpColorSimilarityCube (int look, } else { - QWhatsThis::add (this, + TQWhatsThis::add (this, i18n ("<qt><p><b>Color Similarity</b> is how close " "colors must be in the RGB Color Cube " "to be considered the same.</p>" @@ -138,14 +138,14 @@ void kpColorSimilarityCube::setColorSimilarity (double similarity) // protected virtual [base QWidget] -QSize kpColorSimilarityCube::sizeHint () const +TQSize kpColorSimilarityCube::sizeHint () const { - return QSize (52, 52); + return TQSize (52, 52); } // protected -QColor kpColorSimilarityCube::color (int redOrGreenOrBlue, +TQColor kpColorSimilarityCube::color (int redOrGreenOrBlue, int baseBrightness, int similarityDirection) const { @@ -161,26 +161,26 @@ QColor kpColorSimilarityCube::color (int redOrGreenOrBlue, switch (redOrGreenOrBlue) { default: - case 0: return QColor (brightness, 0, 0); - case 1: return QColor (0, brightness, 0); - case 2: return QColor (0, 0, brightness); + case 0: return TQColor (brightness, 0, 0); + case 1: return TQColor (0, brightness, 0); + case 2: return TQColor (0, 0, brightness); } } -static QPoint pointBetween (const QPoint &p, const QPoint &q) +static TQPoint pointBetween (const TQPoint &p, const TQPoint &q) { - return QPoint ((p.x () + q.x ()) / 2, (p.y () + q.y ()) / 2); + return TQPoint ((p.x () + q.x ()) / 2, (p.y () + q.y ()) / 2); } -static void drawQuadrant (QPainter *p, - const QColor &col, - const QPoint &p1, const QPoint &p2, const QPoint &p3, - const QPoint pointNotOnOutline) +static void drawQuadrant (TQPainter *p, + const TQColor &col, + const TQPoint &p1, const TQPoint &p2, const TQPoint &p3, + const TQPoint pointNotOnOutline) { p->save (); - QPointArray points (4); + TQPointArray points (4); points [0] = p1; points [1] = p2; points [2] = p3; @@ -202,10 +202,10 @@ static void drawQuadrant (QPainter *p, } // protected -void kpColorSimilarityCube::drawFace (QPainter *p, +void kpColorSimilarityCube::drawFace (TQPainter *p, int redOrGreenOrBlue, - const QPoint &tl, const QPoint &tr, - const QPoint &bl, const QPoint &br) + const TQPoint &tl, const TQPoint &tr, + const TQPoint &bl, const TQPoint &br) { #if DEBUG_KP_COLOR_SIMILARITY_CUBE kdDebug () << "kpColorSimilarityCube(RorGorB=" << redOrGreenOrBlue @@ -225,18 +225,18 @@ void kpColorSimilarityCube::drawFace (QPainter *p, // | | | // bl --- bm --- br - const QPoint tm (::pointBetween (tl, tr)); - const QPoint bm (::pointBetween (bl, br)); + const TQPoint tm (::pointBetween (tl, tr)); + const TQPoint bm (::pointBetween (bl, br)); - const QPoint ml (::pointBetween (tl, bl)); - const QPoint mr (::pointBetween (tr, br)); - const QPoint mm (::pointBetween (ml, mr)); + const TQPoint ml (::pointBetween (tl, bl)); + const TQPoint mr (::pointBetween (tr, br)); + const TQPoint mm (::pointBetween (ml, mr)); const int baseBrightness = QMAX (127, 255 - int (kpColorSimilarityDialog::maximumColorSimilarity * kpColorSimilarityCube::colorCubeDiagonalDistance / 2)); - QColor colors [2] = + TQColor colors [2] = { color (redOrGreenOrBlue, baseBrightness, -1), color (redOrGreenOrBlue, baseBrightness, +1) @@ -269,14 +269,14 @@ void kpColorSimilarityCube::drawFace (QPainter *p, } // protected virtual [base QFrame] -void kpColorSimilarityCube::drawContents (QPainter *p) +void kpColorSimilarityCube::drawContents (TQPainter *p) { - QRect cr (contentsRect ()); + TQRect cr (contentsRect ()); - QPixmap backBuffer (cr.width (), cr.height ()); + TQPixmap backBuffer (cr.width (), cr.height ()); backBuffer.fill (colorGroup ().background ()); - QPainter backBufferPainter (&backBuffer); + TQPainter backBufferPainter (&backBuffer); int cubeRectSize = QMIN (cr.width () * 6 / 8, cr.height () * 6 / 8); int dx = (cr.width () - cubeRectSize) / 2, @@ -304,13 +304,13 @@ void kpColorSimilarityCube::drawContents (QPainter *p) const double side = double (cubeRectSize) / (1 + sin (angle)); - const QPoint pointP ((int) (side * cos (angle)), 0); - const QPoint pointQ ((int) (side * cos (angle) + side), 0); - const QPoint pointR (0, (int) (side * sin (angle))); - const QPoint pointS ((int) (side), (int) (side * sin (angle))); - const QPoint pointU (0, (int) (side * sin (angle) + side)); - const QPoint pointT ((int) (side + side * cos (angle)), (int) (side)); - const QPoint pointV ((int) (side), (int) (side * sin (angle) + side)); + const TQPoint pointP ((int) (side * cos (angle)), 0); + const TQPoint pointQ ((int) (side * cos (angle) + side), 0); + const TQPoint pointR (0, (int) (side * sin (angle))); + const TQPoint pointS ((int) (side), (int) (side * sin (angle))); + const TQPoint pointU (0, (int) (side * sin (angle) + side)); + const TQPoint pointT ((int) (side + side * cos (angle)), (int) (side)); + const TQPoint pointV ((int) (side), (int) (side * sin (angle) + side)); // Top Face diff --git a/kolourpaint/widgets/kpcolorsimilaritycube.h b/kolourpaint/widgets/kpcolorsimilaritycube.h index 358d4b3a..ee074d55 100644 --- a/kolourpaint/widgets/kpcolorsimilaritycube.h +++ b/kolourpaint/widgets/kpcolorsimilaritycube.h @@ -29,7 +29,7 @@ #ifndef __kp_color_similarity_cube_h__ #define __kp_color_similarity_cube_h__ -#include <qframe.h> +#include <tqframe.h> class kpColor; class kpMainWindow; @@ -46,7 +46,7 @@ public: kpColorSimilarityCube (int look, kpMainWindow *mainWindow, - QWidget *parent, + TQWidget *parent, const char *name = 0); virtual ~kpColorSimilarityCube (); @@ -55,15 +55,15 @@ public: double colorSimilarity () const; void setColorSimilarity (double similarity); - virtual QSize sizeHint () const; + virtual TQSize sizeHint () const; protected: - QColor color (int redOrGreenOrBlue, int baseBrightness, int similarityDirection) const; - void drawFace (QPainter *p, + TQColor color (int redOrGreenOrBlue, int baseBrightness, int similarityDirection) const; + void drawFace (TQPainter *p, int redOrGreenOrBlue, - const QPoint &tl, const QPoint &tr, - const QPoint &bl, const QPoint &br); - virtual void drawContents (QPainter *p); + const TQPoint &tl, const TQPoint &tr, + const TQPoint &bl, const TQPoint &br); + virtual void drawContents (TQPainter *p); kpMainWindow *m_mainWindow; double m_colorSimilarity; diff --git a/kolourpaint/widgets/kpcolorsimilaritydialog.cpp b/kolourpaint/widgets/kpcolorsimilaritydialog.cpp index d2766568..5831c62f 100644 --- a/kolourpaint/widgets/kpcolorsimilaritydialog.cpp +++ b/kolourpaint/widgets/kpcolorsimilaritydialog.cpp @@ -28,10 +28,10 @@ #include <kpcolorsimilaritydialog.h> -#include <qgroupbox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpushbutton.h> +#include <tqgroupbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpushbutton.h> #include <klocale.h> #include <knuminput.h> @@ -44,36 +44,36 @@ const double kpColorSimilarityDialog::maximumColorSimilarity = .30; kpColorSimilarityDialog::kpColorSimilarityDialog (kpMainWindow *mainWindow, - QWidget *parent, + TQWidget *parent, const char *name) : KDialogBase (parent, name, true/*modal*/, i18n ("Color Similarity"), KDialogBase::Ok | KDialogBase::Cancel), m_mainWindow (mainWindow) { - QWidget *baseWidget = new QWidget (this); + TQWidget *baseWidget = new TQWidget (this); setMainWidget (baseWidget); - QGroupBox *cubeGroupBox = new QGroupBox (i18n ("Preview"), baseWidget); + TQGroupBox *cubeGroupBox = new TQGroupBox (i18n ("Preview"), baseWidget); m_colorSimilarityCube = new kpColorSimilarityCube (kpColorSimilarityCube::Plain, mainWindow, cubeGroupBox); m_colorSimilarityCube->setMinimumSize (240, 180); - QPushButton *updatePushButton = new QPushButton (i18n ("&Update"), cubeGroupBox); + TQPushButton *updatePushButton = new TQPushButton (i18n ("&Update"), cubeGroupBox); - QVBoxLayout *cubeLayout = new QVBoxLayout (cubeGroupBox, marginHint () * 2, spacingHint ()); + TQVBoxLayout *cubeLayout = new TQVBoxLayout (cubeGroupBox, marginHint () * 2, spacingHint ()); cubeLayout->addWidget (m_colorSimilarityCube, 1/*stretch*/); cubeLayout->addWidget (updatePushButton, 0/*stretch*/, Qt::AlignHCenter); - connect (updatePushButton, SIGNAL (clicked ()), - this, SLOT (slotColorSimilarityValueChanged ())); + connect (updatePushButton, TQT_SIGNAL (clicked ()), + this, TQT_SLOT (slotColorSimilarityValueChanged ())); - QGroupBox *inputGroupBox = new QGroupBox (i18n ("RGB Color Cube Distance"), baseWidget); + TQGroupBox *inputGroupBox = new TQGroupBox (i18n ("RGB Color Cube Distance"), baseWidget); m_colorSimilarityInput = new KIntNumInput (inputGroupBox); m_colorSimilarityInput->setRange (0, int (kpColorSimilarityDialog::maximumColorSimilarity * 100 + .1/*don't floor below target int*/), @@ -82,15 +82,15 @@ kpColorSimilarityDialog::kpColorSimilarityDialog (kpMainWindow *mainWindow, m_colorSimilarityInput->setSpecialValueText (i18n ("Exact Match")); - QVBoxLayout *inputLayout = new QVBoxLayout (inputGroupBox, marginHint () * 2, spacingHint ()); + TQVBoxLayout *inputLayout = new TQVBoxLayout (inputGroupBox, marginHint () * 2, spacingHint ()); inputLayout->addWidget (m_colorSimilarityInput); - connect (m_colorSimilarityInput, SIGNAL (valueChanged (int)), - this, SLOT (slotColorSimilarityValueChanged ())); + connect (m_colorSimilarityInput, TQT_SIGNAL (valueChanged (int)), + this, TQT_SLOT (slotColorSimilarityValueChanged ())); - QVBoxLayout *baseLayout = new QVBoxLayout (baseWidget, 0/*margin*/, spacingHint () * 2); + TQVBoxLayout *baseLayout = new TQVBoxLayout (baseWidget, 0/*margin*/, spacingHint () * 2); baseLayout->addWidget (cubeGroupBox, 1/*stretch*/); baseLayout->addWidget (inputGroupBox); } diff --git a/kolourpaint/widgets/kpcolorsimilaritydialog.h b/kolourpaint/widgets/kpcolorsimilaritydialog.h index fd70ecd0..7dee17b8 100644 --- a/kolourpaint/widgets/kpcolorsimilaritydialog.h +++ b/kolourpaint/widgets/kpcolorsimilaritydialog.h @@ -41,7 +41,7 @@ Q_OBJECT public: kpColorSimilarityDialog (kpMainWindow *mainWindow, - QWidget *parent, + TQWidget *parent, const char *name = 0); virtual ~kpColorSimilarityDialog (); diff --git a/kolourpaint/widgets/kpcolortoolbar.cpp b/kolourpaint/widgets/kpcolortoolbar.cpp index cba73b4f..327229df 100644 --- a/kolourpaint/widgets/kpcolortoolbar.cpp +++ b/kolourpaint/widgets/kpcolortoolbar.cpp @@ -31,14 +31,14 @@ #include <kpcolortoolbar.h> -#include <qbitmap.h> -#include <qdrawutil.h> -#include <qframe.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qsize.h> -#include <qtooltip.h> -#include <qwidget.h> +#include <tqbitmap.h> +#include <tqdrawutil.h> +#include <tqframe.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqsize.h> +#include <tqtooltip.h> +#include <tqwidget.h> #include <kapplication.h> #include <kcolordialog.h> @@ -61,12 +61,12 @@ */ kpDualColorButton::kpDualColorButton (kpMainWindow *mainWindow, - QWidget *parent, const char *name) - : QFrame (parent, name, Qt::WNoAutoErase/*no flicker*/), + TQWidget *parent, const char *name) + : TQFrame (parent, name, Qt::WNoAutoErase/*no flicker*/), m_mainWindow (mainWindow), m_backBuffer (0) { - setFrameStyle (QFrame::Panel | QFrame::Sunken); + setFrameStyle (TQFrame::Panel | TQFrame::Sunken); m_color [0] = kpColor (0, 0, 0); // black m_color [1] = kpColor (255, 255, 255); // white @@ -150,48 +150,48 @@ kpColor kpDualColorButton::oldBackgroundColor () const // public virtual [base QWidget] -QSize kpDualColorButton::sizeHint () const +TQSize kpDualColorButton::sizeHint () const { - return QSize (52, 52); + return TQSize (52, 52); } // protected -QRect kpDualColorButton::swapPixmapRect () const +TQRect kpDualColorButton::swapPixmapRect () const { - QPixmap swapPixmap = UserIcon ("colorbutton_swap_16x16"); + TQPixmap swapPixmap = UserIcon ("colorbutton_swap_16x16"); - return QRect (contentsRect ().width () - swapPixmap.width (), + return TQRect (contentsRect ().width () - swapPixmap.width (), 0, swapPixmap.width (), swapPixmap.height ()); } // protected -QRect kpDualColorButton::foregroundBackgroundRect () const +TQRect kpDualColorButton::foregroundBackgroundRect () const { - QRect cr (contentsRect ()); - return QRect (cr.width () / 8, + TQRect cr (contentsRect ()); + return TQRect (cr.width () / 8, cr.height () / 8, cr.width () * 6 / 8, cr.height () * 6 / 8); } // protected -QRect kpDualColorButton::foregroundRect () const +TQRect kpDualColorButton::foregroundRect () const { - QRect fbr (foregroundBackgroundRect ()); - return QRect (fbr.x (), + TQRect fbr (foregroundBackgroundRect ()); + return TQRect (fbr.x (), fbr.y (), fbr.width () * 3 / 4, fbr.height () * 3 / 4); } // protected -QRect kpDualColorButton::backgroundRect () const +TQRect kpDualColorButton::backgroundRect () const { - QRect fbr (foregroundBackgroundRect ()); - return QRect (fbr.x () + fbr.width () / 4, + TQRect fbr (foregroundBackgroundRect ()); + return TQRect (fbr.x () + fbr.width () / 4, fbr.y () + fbr.height () / 4, fbr.width () * 3 / 4, fbr.height () * 3 / 4); @@ -201,7 +201,7 @@ QRect kpDualColorButton::backgroundRect () const // TODO: drag a colour from this widget // protected virtual [base QWidget] -void kpDualColorButton::dragMoveEvent (QDragMoveEvent *e) +void kpDualColorButton::dragMoveEvent (TQDragMoveEvent *e) { e->accept ((foregroundRect ().contains (e->pos ()) || backgroundRect ().contains (e->pos ())) && @@ -209,9 +209,9 @@ void kpDualColorButton::dragMoveEvent (QDragMoveEvent *e) } // protected virtual [base QWidget] -void kpDualColorButton::dropEvent (QDropEvent *e) +void kpDualColorButton::dropEvent (TQDropEvent *e) { - QColor col; + TQColor col; KColorDrag::decode (e, col/*ref*/); if (col.isValid ()) @@ -225,13 +225,13 @@ void kpDualColorButton::dropEvent (QDropEvent *e) // protected virtual [base QWidget] -void kpDualColorButton::mousePressEvent (QMouseEvent * /*e*/) +void kpDualColorButton::mousePressEvent (TQMouseEvent * /*e*/) { // eat right-mouse click to prevent it from getting to the toolbar } // protected virtual [base QWidget] -void kpDualColorButton::mouseDoubleClickEvent (QMouseEvent *e) +void kpDualColorButton::mouseDoubleClickEvent (TQMouseEvent *e) { int whichColor = -1; @@ -242,7 +242,7 @@ void kpDualColorButton::mouseDoubleClickEvent (QMouseEvent *e) if (whichColor == 0 || whichColor == 1) { - QColor col = Qt::black; + TQColor col = Qt::black; if (color (whichColor).isOpaque ()) col = color (whichColor).toQColor (); else @@ -264,7 +264,7 @@ void kpDualColorButton::mouseDoubleClickEvent (QMouseEvent *e) } // protected virtual [base QWidget] -void kpDualColorButton::mouseReleaseEvent (QMouseEvent *e) +void kpDualColorButton::mouseReleaseEvent (TQMouseEvent *e) { if (swapPixmapRect ().contains (e->pos ()) && m_color [0] != m_color [1]) @@ -289,7 +289,7 @@ void kpDualColorButton::mouseReleaseEvent (QMouseEvent *e) // protected virtual [base QFrame] -void kpDualColorButton::drawContents (QPainter *p) +void kpDualColorButton::drawContents (TQPainter *p) { #if DEBUG_KP_COLOR_TOOL_BAR && 1 kdDebug () << "kpDualColorButton::draw() rect=" << rect () @@ -302,11 +302,11 @@ void kpDualColorButton::drawContents (QPainter *p) m_backBuffer->height () != contentsRect ().height ()) { delete m_backBuffer; - m_backBuffer = new QPixmap (contentsRect ().width (), contentsRect ().height ()); + m_backBuffer = new TQPixmap (contentsRect ().width (), contentsRect ().height ()); } - QPainter backBufferPainter (m_backBuffer); + TQPainter backBufferPainter (m_backBuffer); if (isEnabled () && m_mainWindow) { @@ -318,21 +318,21 @@ void kpDualColorButton::drawContents (QPainter *p) else { backBufferPainter.fillRect (m_backBuffer->rect (), - colorGroup ().color (QColorGroup::Background)); + colorGroup ().color (TQColorGroup::Background)); } - QPixmap swapPixmap = UserIcon ("colorbutton_swap_16x16"); + TQPixmap swapPixmap = UserIcon ("colorbutton_swap_16x16"); if (!isEnabled ()) { // swapPixmap has a mask after all - swapPixmap.fill (colorGroup ().color (QColorGroup::Dark)); + swapPixmap.fill (colorGroup ().color (TQColorGroup::Dark)); } backBufferPainter.drawPixmap (swapPixmapRect ().topLeft (), swapPixmap); // foreground patch must be drawn after background patch // as it overlaps on top of background patch - QRect bgRect = backgroundRect (); - QRect bgRectInside = QRect (bgRect.x () + 2, bgRect.y () + 2, + TQRect bgRect = backgroundRect (); + TQRect bgRectInside = TQRect (bgRect.x () + 2, bgRect.y () + 2, bgRect.width () - 4, bgRect.height () - 4); if (isEnabled ()) { @@ -346,13 +346,13 @@ void kpDualColorButton::drawContents (QPainter *p) backBufferPainter.drawPixmap (bgRectInside, UserIcon ("color_transparent_26x26")); } else - backBufferPainter.fillRect (bgRectInside, colorGroup ().color (QColorGroup::Button)); + backBufferPainter.fillRect (bgRectInside, colorGroup ().color (TQColorGroup::Button)); qDrawShadePanel (&backBufferPainter, bgRect, colorGroup (), false/*not sunken*/, 2/*lineWidth*/, 0/*never fill*/); - QRect fgRect = foregroundRect (); - QRect fgRectInside = QRect (fgRect.x () + 2, fgRect.y () + 2, + TQRect fgRect = foregroundRect (); + TQRect fgRectInside = TQRect (fgRect.x () + 2, fgRect.y () + 2, fgRect.width () - 4, fgRect.height () - 4); if (isEnabled ()) { @@ -366,7 +366,7 @@ void kpDualColorButton::drawContents (QPainter *p) backBufferPainter.drawPixmap (fgRectInside, UserIcon ("color_transparent_26x26")); } else - backBufferPainter.fillRect (fgRectInside, colorGroup ().color (QColorGroup::Button)); + backBufferPainter.fillRect (fgRectInside, colorGroup ().color (TQColorGroup::Button)); qDrawShadePanel (&backBufferPainter, fgRect, colorGroup (), false/*not sunken*/, 2/*lineWidth*/, 0/*never fill*/); @@ -404,14 +404,14 @@ enum blendAdd = 100 }; -static QColor blend (const QColor &a, const QColor &b, int percent = blendNormal) +static TQColor blend (const TQColor &a, const TQColor &b, int percent = blendNormal) { - return QColor (btwn0_255 (roundUp2 (a.red () + b.red ()) * percent / 100), + return TQColor (btwn0_255 (roundUp2 (a.red () + b.red ()) * percent / 100), btwn0_255 (roundUp2 (a.green () + b.green ()) * percent / 100), btwn0_255 (roundUp2 (a.blue () + b.blue ()) * percent / 100)); } -static QColor add (const QColor &a, const QColor &b) +static TQColor add (const TQColor &a, const TQColor &b) { return blend (a, b, blendAdd); } @@ -426,33 +426,33 @@ static QColor add (const QColor &a, const QColor &b) // // primary colors + B&W -static QColor kpRed; -static QColor kpGreen; -static QColor kpBlue; -static QColor kpBlack; -static QColor kpWhite; +static TQColor kpRed; +static TQColor kpGreen; +static TQColor kpBlue; +static TQColor kpBlack; +static TQColor kpWhite; // intentionally _not_ an HSV darkener -static QColor dark (const QColor &color) +static TQColor dark (const TQColor &color) { return blend (color, kpBlack); } // full-brightness colors -static QColor kpYellow; -static QColor kpPurple; -static QColor kpAqua; +static TQColor kpYellow; +static TQColor kpPurple; +static TQColor kpAqua; // mixed colors -static QColor kpGrey; -static QColor kpLightGrey; -static QColor kpOrange; +static TQColor kpGrey; +static TQColor kpLightGrey; +static TQColor kpOrange; // pastel colors -static QColor kpPink; -static QColor kpLightGreen; -static QColor kpLightBlue; -static QColor kpTan; +static TQColor kpPink; +static TQColor kpLightGreen; +static TQColor kpLightBlue; +static TQColor kpTan; static bool ownColorsInitialised = false; @@ -461,7 +461,7 @@ static bool ownColorsInitialised = false; */ #define rows 2 #define cols 11 -kpColorCells::kpColorCells (QWidget *parent, +kpColorCells::kpColorCells (TQWidget *parent, Qt::Orientation o, const char *name) : KColorCells (parent, rows, cols), @@ -476,8 +476,8 @@ kpColorCells::kpColorCells (QWidget *parent, setAcceptDrops (true); setAcceptDrags (true); - connect (this, SIGNAL (colorDoubleClicked (int)), - SLOT (slotColorDoubleClicked (int))); + connect (this, TQT_SIGNAL (colorDoubleClicked (int)), + TQT_SLOT (slotColorDoubleClicked (int))); if (!ownColorsInitialised) { @@ -485,11 +485,11 @@ kpColorCells::kpColorCells (QWidget *parent, // allocation context. This way, the colours aren't sometimes // invalid (e.g. at 8-bit). - kpRed = QColor (255, 0, 0); - kpGreen = QColor (0, 255, 0); - kpBlue = QColor (0, 0, 255); - kpBlack = QColor (0, 0, 0); - kpWhite = QColor (255, 255, 255); + kpRed = TQColor (255, 0, 0); + kpGreen = TQColor (0, 255, 0); + kpBlue = TQColor (0, 0, 255); + kpBlack = TQColor (0, 0, 0); + kpWhite = TQColor (255, 255, 255); kpYellow = add (kpRed, kpGreen); kpPurple = add (kpRed, kpBlue); @@ -553,7 +553,7 @@ void kpColorCells::setOrientation (Qt::Orientation o) kdDebug () << "\tsizeof (colors)=" << sizeof (colors) << " sizeof (colors [0])=" << sizeof (colors [0]) << endl;*/ - QColor colors [] = + TQColor colors [] = { kpBlack, kpGrey, @@ -603,14 +603,14 @@ void kpColorCells::setOrientation (Qt::Orientation o) } KColorCells::setColor (pos, colors [i]); - //QToolTip::add (this, cellGeometry (y, x), colors [i].name ()); + //TQToolTip::add (this, cellGeometry (y, x), colors [i].name ()); } m_orientation = o; } // virtual protected [base KColorCells] -void kpColorCells::dropEvent (QDropEvent *e) +void kpColorCells::dropEvent (TQDropEvent *e) { // Eat event so that: // @@ -622,9 +622,9 @@ void kpColorCells::dropEvent (QDropEvent *e) } // virtual protected -void kpColorCells::paintCell (QPainter *painter, int row, int col) +void kpColorCells::paintCell (TQPainter *painter, int row, int col) { - QColor oldColor; + TQColor oldColor; int cellNo; if (!isEnabled ()) @@ -653,7 +653,7 @@ void kpColorCells::paintCell (QPainter *painter, int row, int col) } // virtual protected -void kpColorCells::mouseReleaseEvent (QMouseEvent *e) +void kpColorCells::mouseReleaseEvent (TQMouseEvent *e) { m_mouseButton = -1; @@ -674,9 +674,9 @@ void kpColorCells::mouseReleaseEvent (QMouseEvent *e) m_mouseButton = 1; } - connect (this, SIGNAL (colorSelected (int)), this, SLOT (slotColorSelected (int))); + connect (this, TQT_SIGNAL (colorSelected (int)), this, TQT_SLOT (slotColorSelected (int))); KColorCells::mouseReleaseEvent (e); - disconnect (this, SIGNAL (colorSelected (int)), this, SLOT (slotColorSelected (int))); + disconnect (this, TQT_SIGNAL (colorSelected (int)), this, TQT_SLOT (slotColorSelected (int))); #if DEBUG_KP_COLOR_TOOL_BAR kdDebug () << "kpColorCells::mouseReleaseEvent() setting m_mouseButton back to -1" << endl; @@ -685,7 +685,7 @@ void kpColorCells::mouseReleaseEvent (QMouseEvent *e) } // protected virtual [base KColorCells] -void kpColorCells::resizeEvent (QResizeEvent *e) +void kpColorCells::resizeEvent (TQResizeEvent *e) { // KColorCells::resizeEvent() tries to adjust the cellWidth and cellHeight // to the current dimensions but doesn't take into account @@ -703,7 +703,7 @@ void kpColorCells::slotColorSelected (int cell) kdDebug () << "kpColorCells::slotColorSelected(cell=" << cell << ") mouseButton = " << m_mouseButton << endl; #endif - QColor c = KColorCells::color (cell); + TQColor c = KColorCells::color (cell); if (m_mouseButton == 0) { @@ -727,7 +727,7 @@ void kpColorCells::slotColorDoubleClicked (int cell) << cell << ")" << endl; #endif - QColor color = KColorCells::color (cell); + TQColor color = KColorCells::color (cell); // TODO: parent if (KColorDialog::getColor (color/*ref*/)) @@ -739,14 +739,14 @@ void kpColorCells::slotColorDoubleClicked (int cell) * kpTransparentColorCell */ -kpTransparentColorCell::kpTransparentColorCell (QWidget *parent, const char *name) - : QFrame (parent, name) +kpTransparentColorCell::kpTransparentColorCell (TQWidget *parent, const char *name) + : TQFrame (parent, name) { #if DEBUG_KP_COLOR_TOOL_BAR kdDebug () << "kpTransparentColorCell::kpTransparentColorCell()" << endl; #endif - setFrameStyle (QFrame::Panel | QFrame::Sunken); + setFrameStyle (TQFrame::Panel | TQFrame::Sunken); #if DEBUG_KP_COLOR_TOOL_BAR && 0 kdDebug () << "\tdefault line width=" << lineWidth () << " frame width=" << frameWidth () << endl; @@ -759,7 +759,7 @@ kpTransparentColorCell::kpTransparentColorCell (QWidget *parent, const char *nam m_pixmap = UserIcon ("color_transparent_26x26"); - QToolTip::add (this, i18n ("Transparent")); + TQToolTip::add (this, i18n ("Transparent")); } kpTransparentColorCell::~kpTransparentColorCell () @@ -768,20 +768,20 @@ kpTransparentColorCell::~kpTransparentColorCell () // public virtual [base QWidget] -QSize kpTransparentColorCell::sizeHint () const +TQSize kpTransparentColorCell::sizeHint () const { - return QSize (m_pixmap.width () + frameWidth () * 2, + return TQSize (m_pixmap.width () + frameWidth () * 2, m_pixmap.height () + frameWidth () * 2); } // protected virtual [base QWidget] -void kpTransparentColorCell::mousePressEvent (QMouseEvent * /*e*/) +void kpTransparentColorCell::mousePressEvent (TQMouseEvent * /*e*/) { // eat right-mouse click to prevent it from getting to the toolbar } // protected virtual [base QWidget] -void kpTransparentColorCell::mouseReleaseEvent (QMouseEvent *e) +void kpTransparentColorCell::mouseReleaseEvent (TQMouseEvent *e) { if (rect ().contains (e->pos ())) { @@ -799,9 +799,9 @@ void kpTransparentColorCell::mouseReleaseEvent (QMouseEvent *e) } // protected virtual [base QFrame] -void kpTransparentColorCell::drawContents (QPainter *p) +void kpTransparentColorCell::drawContents (TQPainter *p) { - QFrame::drawContents (p); + TQFrame::drawContents (p); if (isEnabled ()) { #if DEBUG_KP_COLOR_TOOL_BAR @@ -818,10 +818,10 @@ void kpTransparentColorCell::drawContents (QPainter *p) * kpColorPalette */ -kpColorPalette::kpColorPalette (QWidget *parent, +kpColorPalette::kpColorPalette (TQWidget *parent, Qt::Orientation o, const char *name) - : QWidget (parent, name), + : TQWidget (parent, name), m_boxLayout (0) { #if DEBUG_KP_COLOR_TOOL_BAR @@ -829,17 +829,17 @@ kpColorPalette::kpColorPalette (QWidget *parent, #endif m_transparentColorCell = new kpTransparentColorCell (this); - m_transparentColorCell->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed); - connect (m_transparentColorCell, SIGNAL (foregroundColorChanged (const kpColor &)), - this, SIGNAL (foregroundColorChanged (const kpColor &))); - connect (m_transparentColorCell, SIGNAL (backgroundColorChanged (const kpColor &)), - this, SIGNAL (backgroundColorChanged (const kpColor &))); + m_transparentColorCell->setSizePolicy (TQSizePolicy::Fixed, TQSizePolicy::Fixed); + connect (m_transparentColorCell, TQT_SIGNAL (foregroundColorChanged (const kpColor &)), + this, TQT_SIGNAL (foregroundColorChanged (const kpColor &))); + connect (m_transparentColorCell, TQT_SIGNAL (backgroundColorChanged (const kpColor &)), + this, TQT_SIGNAL (backgroundColorChanged (const kpColor &))); m_colorCells = new kpColorCells (this); - connect (m_colorCells, SIGNAL (foregroundColorChanged (const kpColor &)), - this, SIGNAL (foregroundColorChanged (const kpColor &))); - connect (m_colorCells, SIGNAL (backgroundColorChanged (const kpColor &)), - this, SIGNAL (backgroundColorChanged (const kpColor &))); + connect (m_colorCells, TQT_SIGNAL (foregroundColorChanged (const kpColor &)), + this, TQT_SIGNAL (foregroundColorChanged (const kpColor &))); + connect (m_colorCells, TQT_SIGNAL (backgroundColorChanged (const kpColor &)), + this, TQT_SIGNAL (backgroundColorChanged (const kpColor &))); setOrientation (o); } @@ -862,13 +862,13 @@ void kpColorPalette::setOrientation (Qt::Orientation o) if (o == Qt::Horizontal) { - m_boxLayout = new QBoxLayout (this, QBoxLayout::LeftToRight, 0/*margin*/, 5/*spacing*/); + m_boxLayout = new TQBoxLayout (this, TQBoxLayout::LeftToRight, 0/*margin*/, 5/*spacing*/); m_boxLayout->addWidget (m_transparentColorCell, 0/*stretch*/, Qt::AlignVCenter); m_boxLayout->addWidget (m_colorCells); } else { - m_boxLayout = new QBoxLayout (this, QBoxLayout::TopToBottom, 0/*margin*/, 5/*spacing*/); + m_boxLayout = new TQBoxLayout (this, TQBoxLayout::TopToBottom, 0/*margin*/, 5/*spacing*/); m_boxLayout->addWidget (m_transparentColorCell, 0/*stretch*/, Qt::AlignHCenter); m_boxLayout->addWidget (m_colorCells); } @@ -882,7 +882,7 @@ void kpColorPalette::setOrientation (Qt::Orientation o) */ kpColorSimilarityToolBarItem::kpColorSimilarityToolBarItem (kpMainWindow *mainWindow, - QWidget *parent, + TQWidget *parent, const char *name) : kpColorSimilarityCube (kpColorSimilarityCube::Depressed | kpColorSimilarityCube::DoubleClickInstructions, @@ -912,9 +912,9 @@ void kpColorSimilarityToolBarItem::setColorSimilarity (double similarity) kpColorSimilarityCube::setColorSimilarity (similarity); if (similarity > 0) - QToolTip::add (this, i18n ("Color similarity: %1%").arg (qRound (similarity * 100))); + TQToolTip::add (this, i18n ("Color similarity: %1%").arg (qRound (similarity * 100))); else - QToolTip::add (this, i18n ("Color similarity: Exact")); + TQToolTip::add (this, i18n ("Color similarity: Exact")); m_processedColorSimilarity = kpColor::processSimilarity (colorSimilarity ()); @@ -931,13 +931,13 @@ double kpColorSimilarityToolBarItem::oldColorSimilarity () const // private virtual [base QWidget] -void kpColorSimilarityToolBarItem::mousePressEvent (QMouseEvent * /*e*/) +void kpColorSimilarityToolBarItem::mousePressEvent (TQMouseEvent * /*e*/) { // eat right-mouse click to prevent it from getting to the toolbar } // private virtual [base QWidget] -void kpColorSimilarityToolBarItem::mouseDoubleClickEvent (QMouseEvent * /*e*/) +void kpColorSimilarityToolBarItem::mouseDoubleClickEvent (TQMouseEvent * /*e*/) { kpColorSimilarityDialog dialog (m_mainWindow, this); dialog.setColorSimilarity (colorSimilarity ()); @@ -952,42 +952,42 @@ void kpColorSimilarityToolBarItem::mouseDoubleClickEvent (QMouseEvent * /*e*/) * kpColorToolBar */ -kpColorToolBar::kpColorToolBar (const QString &label, kpMainWindow *mainWindow, const char *name) +kpColorToolBar::kpColorToolBar (const TQString &label, kpMainWindow *mainWindow, const char *name) : KToolBar (mainWindow, name), m_mainWindow (mainWindow) { setText (label); - QWidget *base = new QWidget (this); - m_boxLayout = new QBoxLayout (base, QBoxLayout::LeftToRight, + TQWidget *base = new TQWidget (this); + m_boxLayout = new TQBoxLayout (base, TQBoxLayout::LeftToRight, 5/*margin*/, (10 * 4)/*spacing*/); m_dualColorButton = new kpDualColorButton (mainWindow, base); - m_dualColorButton->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed); - connect (m_dualColorButton, SIGNAL (colorsSwapped (const kpColor &, const kpColor &)), - this, SIGNAL (colorsSwapped (const kpColor &, const kpColor &))); - connect (m_dualColorButton, SIGNAL (foregroundColorChanged (const kpColor &)), - this, SIGNAL (foregroundColorChanged (const kpColor &))); - connect (m_dualColorButton, SIGNAL (backgroundColorChanged (const kpColor &)), - this, SIGNAL (backgroundColorChanged (const kpColor &))); + m_dualColorButton->setSizePolicy (TQSizePolicy::Fixed, TQSizePolicy::Fixed); + connect (m_dualColorButton, TQT_SIGNAL (colorsSwapped (const kpColor &, const kpColor &)), + this, TQT_SIGNAL (colorsSwapped (const kpColor &, const kpColor &))); + connect (m_dualColorButton, TQT_SIGNAL (foregroundColorChanged (const kpColor &)), + this, TQT_SIGNAL (foregroundColorChanged (const kpColor &))); + connect (m_dualColorButton, TQT_SIGNAL (backgroundColorChanged (const kpColor &)), + this, TQT_SIGNAL (backgroundColorChanged (const kpColor &))); m_boxLayout->addWidget (m_dualColorButton, 0/*stretch*/); m_colorPalette = new kpColorPalette (base); - connect (m_colorPalette, SIGNAL (foregroundColorChanged (const kpColor &)), - m_dualColorButton, SLOT (setForegroundColor (const kpColor &))); - connect (m_colorPalette, SIGNAL (backgroundColorChanged (const kpColor &)), - m_dualColorButton, SLOT (setBackgroundColor (const kpColor &))); + connect (m_colorPalette, TQT_SIGNAL (foregroundColorChanged (const kpColor &)), + m_dualColorButton, TQT_SLOT (setForegroundColor (const kpColor &))); + connect (m_colorPalette, TQT_SIGNAL (backgroundColorChanged (const kpColor &)), + m_dualColorButton, TQT_SLOT (setBackgroundColor (const kpColor &))); m_boxLayout->addWidget (m_colorPalette, 0/*stretch*/); m_colorSimilarityToolBarItem = new kpColorSimilarityToolBarItem (mainWindow, base); - m_colorSimilarityToolBarItem->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed); - connect (m_colorSimilarityToolBarItem, SIGNAL (colorSimilarityChanged (double, int)), - this, SIGNAL (colorSimilarityChanged (double, int))); + m_colorSimilarityToolBarItem->setSizePolicy (TQSizePolicy::Fixed, TQSizePolicy::Fixed); + connect (m_colorSimilarityToolBarItem, TQT_SIGNAL (colorSimilarityChanged (double, int)), + this, TQT_SIGNAL (colorSimilarityChanged (double, int))); m_boxLayout->addWidget (m_colorSimilarityToolBarItem, 0/*stretch*/); - // HACK: couldn't get QSpacerItem to work - QWidget *fakeSpacer = new QWidget (base); + // HACK: couldn't get TQSpacerItem to work + TQWidget *fakeSpacer = new TQWidget (base); m_boxLayout->addWidget (fakeSpacer, 1/*stretch*/); m_lastDockedOrientationSet = false; @@ -999,8 +999,8 @@ kpColorToolBar::kpColorToolBar (const QString &label, kpMainWindow *mainWindow, // virtual void kpColorToolBar::setOrientation (Qt::Orientation o) { - // (QDockWindow::undock() calls us) - bool isOutsideDock = (place () == QDockWindow::OutsideDock); + // (TQDockWindow::undock() calls us) + bool isOutsideDock = (place () == TQDockWindow::OutsideDock); if (!m_lastDockedOrientationSet || !isOutsideDock) { @@ -1016,11 +1016,11 @@ void kpColorToolBar::setOrientation (Qt::Orientation o) if (o == Qt::Horizontal) { - m_boxLayout->setDirection (QBoxLayout::LeftToRight); + m_boxLayout->setDirection (TQBoxLayout::LeftToRight); } else { - m_boxLayout->setDirection (QBoxLayout::TopToBottom); + m_boxLayout->setDirection (TQBoxLayout::TopToBottom); } m_colorPalette->setOrientation (o); diff --git a/kolourpaint/widgets/kpcolortoolbar.h b/kolourpaint/widgets/kpcolortoolbar.h index b4a77bfb..3b50c825 100644 --- a/kolourpaint/widgets/kpcolortoolbar.h +++ b/kolourpaint/widgets/kpcolortoolbar.h @@ -30,8 +30,8 @@ #define __kp_color_toolbar_h__ -#include <qframe.h> -#include <qwidget.h> +#include <tqframe.h> +#include <tqwidget.h> #include <kcolordialog.h> #include <ktoolbar.h> @@ -40,7 +40,7 @@ #include <kpcolorsimilaritycube.h> -class QGridLayout; +class TQGridLayout; class KColorButton; class kpColorSimilarityCube; @@ -62,7 +62,7 @@ Q_OBJECT public: kpDualColorButton (kpMainWindow *mainWindow, - QWidget *parent, const char *name = 0); + TQWidget *parent, const char *name = 0); virtual ~kpDualColorButton (); kpColor color (int which) const; @@ -90,28 +90,28 @@ public: kpColor oldBackgroundColor () const; public: - virtual QSize sizeHint () const; + virtual TQSize sizeHint () const; protected: - QRect swapPixmapRect () const; - QRect foregroundBackgroundRect () const; - QRect foregroundRect () const; - QRect backgroundRect () const; + TQRect swapPixmapRect () const; + TQRect foregroundBackgroundRect () const; + TQRect foregroundRect () const; + TQRect backgroundRect () const; - //virtual void dragEnterEvent (QDragEnterEvent *e); - virtual void dragMoveEvent (QDragMoveEvent *e); - virtual void dropEvent (QDropEvent *e); + //virtual void dragEnterEvent (TQDragEnterEvent *e); + virtual void dragMoveEvent (TQDragMoveEvent *e); + virtual void dropEvent (TQDropEvent *e); - virtual void mousePressEvent (QMouseEvent *e); - virtual void mouseDoubleClickEvent (QMouseEvent *e); - virtual void mouseReleaseEvent (QMouseEvent *e); + virtual void mousePressEvent (TQMouseEvent *e); + virtual void mouseDoubleClickEvent (TQMouseEvent *e); + virtual void mouseReleaseEvent (TQMouseEvent *e); - virtual void drawContents (QPainter *p); + virtual void drawContents (TQPainter *p); kpMainWindow *m_mainWindow; kpColor m_color [2]; kpColor m_oldColor [2]; - QPixmap *m_backBuffer; + TQPixmap *m_backBuffer; }; @@ -120,7 +120,7 @@ class kpColorCells : public KColorCells Q_OBJECT public: - kpColorCells (QWidget *parent, + kpColorCells (TQWidget *parent, Qt::Orientation o = Qt::Horizontal, const char *name = 0); virtual ~kpColorCells (); @@ -129,8 +129,8 @@ public: void setOrientation (Qt::Orientation o); signals: - void foregroundColorChanged (const QColor &color); - void backgroundColorChanged (const QColor &color); + void foregroundColorChanged (const TQColor &color); + void backgroundColorChanged (const TQColor &color); // lazy void foregroundColorChanged (const kpColor &color); @@ -139,10 +139,10 @@ signals: protected: Qt::Orientation m_orientation; - virtual void dropEvent (QDropEvent *e); - virtual void paintCell (QPainter *painter, int row, int col); - virtual void mouseReleaseEvent (QMouseEvent *e); - virtual void resizeEvent (QResizeEvent *e); + virtual void dropEvent (TQDropEvent *e); + virtual void paintCell (TQPainter *painter, int row, int col); + virtual void mouseReleaseEvent (TQMouseEvent *e); + virtual void resizeEvent (TQResizeEvent *e); int m_mouseButton; @@ -157,10 +157,10 @@ class kpTransparentColorCell : public QFrame Q_OBJECT public: - kpTransparentColorCell (QWidget *parent, const char *name = 0); + kpTransparentColorCell (TQWidget *parent, const char *name = 0); virtual ~kpTransparentColorCell (); - virtual QSize sizeHint () const; + virtual TQSize sizeHint () const; signals: void transparentColorSelected (int mouseButton); @@ -170,12 +170,12 @@ signals: void backgroundColorChanged (const kpColor &color); protected: - virtual void mousePressEvent (QMouseEvent *e); - virtual void mouseReleaseEvent (QMouseEvent *e); + virtual void mousePressEvent (TQMouseEvent *e); + virtual void mouseReleaseEvent (TQMouseEvent *e); - virtual void drawContents (QPainter *p); + virtual void drawContents (TQPainter *p); - QPixmap m_pixmap; + TQPixmap m_pixmap; }; @@ -184,7 +184,7 @@ class kpColorPalette : public QWidget Q_OBJECT public: - kpColorPalette (QWidget *parent, + kpColorPalette (TQWidget *parent, Qt::Orientation o = Qt::Horizontal, const char *name = 0); virtual ~kpColorPalette (); @@ -199,7 +199,7 @@ signals: protected: Qt::Orientation m_orientation; - QBoxLayout *m_boxLayout; + TQBoxLayout *m_boxLayout; kpTransparentColorCell *m_transparentColorCell; kpColorCells *m_colorCells; }; @@ -211,7 +211,7 @@ Q_OBJECT public: kpColorSimilarityToolBarItem (kpMainWindow *mainWindow, - QWidget *parent, + TQWidget *parent, const char *name = 0); virtual ~kpColorSimilarityToolBarItem (); @@ -229,8 +229,8 @@ public: double oldColorSimilarity () const; private: - virtual void mousePressEvent (QMouseEvent *e); - virtual void mouseDoubleClickEvent (QMouseEvent *e); + virtual void mousePressEvent (TQMouseEvent *e); + virtual void mouseDoubleClickEvent (TQMouseEvent *e); private: kpMainWindow *m_mainWindow; @@ -245,7 +245,7 @@ class kpColorToolBar : public KToolBar Q_OBJECT public: - kpColorToolBar (const QString &label, kpMainWindow *mainWindow, const char *name = 0); + kpColorToolBar (const TQString &label, kpMainWindow *mainWindow, const char *name = 0); virtual ~kpColorToolBar (); kpColor color (int which) const; @@ -288,7 +288,7 @@ private: bool m_lastDockedOrientationSet; virtual void setOrientation (Qt::Orientation o); - QBoxLayout *m_boxLayout; + TQBoxLayout *m_boxLayout; kpDualColorButton *m_dualColorButton; kpColorPalette *m_colorPalette; kpColorSimilarityToolBarItem *m_colorSimilarityToolBarItem; diff --git a/kolourpaint/widgets/kpresizesignallinglabel.cpp b/kolourpaint/widgets/kpresizesignallinglabel.cpp index 77d0ad2b..cb5a2311 100644 --- a/kolourpaint/widgets/kpresizesignallinglabel.cpp +++ b/kolourpaint/widgets/kpresizesignallinglabel.cpp @@ -33,16 +33,16 @@ #include <kdebug.h> -kpResizeSignallingLabel::kpResizeSignallingLabel (const QString &string, - QWidget *parent, +kpResizeSignallingLabel::kpResizeSignallingLabel (const TQString &string, + TQWidget *parent, const char *name) - : QLabel (string, parent, name) + : TQLabel (string, parent, name) { } -kpResizeSignallingLabel::kpResizeSignallingLabel (QWidget *parent, +kpResizeSignallingLabel::kpResizeSignallingLabel (TQWidget *parent, const char *name) - : QLabel (parent, name) + : TQLabel (parent, name) { } @@ -52,13 +52,13 @@ kpResizeSignallingLabel::~kpResizeSignallingLabel () // protected virtual [base QLabel] -void kpResizeSignallingLabel::resizeEvent (QResizeEvent *e) +void kpResizeSignallingLabel::resizeEvent (TQResizeEvent *e) { #if DEBUG_KP_RESIZE_SIGNALLING_LABEL kdDebug () << "kpResizeSignallingLabel::resizeEvent() newSize=" << e->size () << " oldSize=" << e->oldSize () << endl; #endif - QLabel::resizeEvent (e); + TQLabel::resizeEvent (e); emit resized (); } diff --git a/kolourpaint/widgets/kpresizesignallinglabel.h b/kolourpaint/widgets/kpresizesignallinglabel.h index 6cd3beba..5a53dcf2 100644 --- a/kolourpaint/widgets/kpresizesignallinglabel.h +++ b/kolourpaint/widgets/kpresizesignallinglabel.h @@ -29,7 +29,7 @@ #define KP_RESIZE_SIGNALLING_LABEL -#include <qlabel.h> +#include <tqlabel.h> class kpResizeSignallingLabel : public QLabel @@ -37,15 +37,15 @@ class kpResizeSignallingLabel : public QLabel Q_OBJECT public: - kpResizeSignallingLabel (const QString &string, QWidget *parent, const char *name = 0); - kpResizeSignallingLabel (QWidget *parent, const char *name = 0); + kpResizeSignallingLabel (const TQString &string, TQWidget *parent, const char *name = 0); + kpResizeSignallingLabel (TQWidget *parent, const char *name = 0); virtual ~kpResizeSignallingLabel (); signals: void resized (); protected: - virtual void resizeEvent (QResizeEvent *e); + virtual void resizeEvent (TQResizeEvent *e); }; diff --git a/kolourpaint/widgets/kpsqueezedtextlabel.cpp b/kolourpaint/widgets/kpsqueezedtextlabel.cpp index 53fd85c9..613c93a9 100644 --- a/kolourpaint/widgets/kpsqueezedtextlabel.cpp +++ b/kolourpaint/widgets/kpsqueezedtextlabel.cpp @@ -30,22 +30,22 @@ #include <kpsqueezedtextlabel.h> -#include <qfont.h> -#include <qfontmetrics.h> -#include <qstring.h> +#include <tqfont.h> +#include <tqfontmetrics.h> +#include <tqstring.h> #include <kdebug.h> #include <klocale.h> -kpSqueezedTextLabel::kpSqueezedTextLabel (QWidget *parent, const char *name) - : QLabel (parent, name), +kpSqueezedTextLabel::kpSqueezedTextLabel (TQWidget *parent, const char *name) + : TQLabel (parent, name), m_showEllipsis (true) { } -kpSqueezedTextLabel::kpSqueezedTextLabel (const QString &text, QWidget *parent, const char *name) - : QLabel (parent, name), +kpSqueezedTextLabel::kpSqueezedTextLabel (const TQString &text, TQWidget *parent, const char *name) + : TQLabel (parent, name), m_showEllipsis (true) { setText (text); @@ -53,18 +53,18 @@ kpSqueezedTextLabel::kpSqueezedTextLabel (const QString &text, QWidget *parent, // public virtual -QSize kpSqueezedTextLabel::minimumSizeHint () const +TQSize kpSqueezedTextLabel::minimumSizeHint () const { #if DEBUG_KP_SQUEEZED_TEXT_LABEL && 1 kdDebug () << "kpSqueezedTextLabel::minimumSizeHint() qLabel prefers" - << QLabel::minimumSizeHint () << endl; + << TQLabel::minimumSizeHint () << endl; #endif - return QSize (-1/*no minimum width*/, QLabel::minimumHeight ()); + return TQSize (-1/*no minimum width*/, TQLabel::minimumHeight ()); } // public -QString kpSqueezedTextLabel::fullText () const +TQString kpSqueezedTextLabel::fullText () const { return m_fullText; } @@ -89,7 +89,7 @@ void kpSqueezedTextLabel::setShowEllipsis (bool yes) // public slots virtual [base QLabel] -void kpSqueezedTextLabel::setText (const QString &text) +void kpSqueezedTextLabel::setText (const TQString &text) { m_fullText = text; squeezeText (); @@ -97,7 +97,7 @@ void kpSqueezedTextLabel::setText (const QString &text) // protected virtual [base QWidget] -void kpSqueezedTextLabel::resizeEvent (QResizeEvent *e) +void kpSqueezedTextLabel::resizeEvent (TQResizeEvent *e) { #if DEBUG_KP_SQUEEZED_TEXT_LABEL && 1 kdDebug () << "kpSqueezedTextLabeL::resizeEvent() size=" << e->size () @@ -109,9 +109,9 @@ void kpSqueezedTextLabel::resizeEvent (QResizeEvent *e) // protected -QString kpSqueezedTextLabel::ellipsisText () const +TQString kpSqueezedTextLabel::ellipsisText () const { - return m_showEllipsis ? i18n ("...") : QString::null; + return m_showEllipsis ? i18n ("...") : TQString::null; } // protected @@ -121,7 +121,7 @@ void kpSqueezedTextLabel::squeezeText () kdDebug () << "kpSqueezedTextLabeL::squeezeText" << endl; #endif - QFontMetrics fontMetrics (font ()); + TQFontMetrics fontMetrics (font ()); int fullTextWidth = fontMetrics.width (m_fullText); #if DEBUG_KP_SQUEEZED_TEXT_LABEL && 1 kdDebug () << "\tfullText=" << m_fullText @@ -135,7 +135,7 @@ void kpSqueezedTextLabel::squeezeText () #if DEBUG_KP_SQUEEZED_TEXT_LABEL && 1 kdDebug () << "\tfullText will fit - display" << endl; #endif - QLabel::setText (m_fullText); + TQLabel::setText (m_fullText); } else { @@ -151,7 +151,7 @@ void kpSqueezedTextLabel::squeezeText () #if DEBUG_KP_SQUEEZED_TEXT_LABEL && 1 kdDebug () << "\t\t\tcan't even fit \"...\" - forget it" << endl; #endif - QLabel::setText (QString::null); + TQLabel::setText (TQString::null); return; } @@ -208,7 +208,7 @@ void kpSqueezedTextLabel::squeezeText () } } - QLabel::setText (m_fullText.left (numLettersToUse) + ellipsisText ()); + TQLabel::setText (m_fullText.left (numLettersToUse) + ellipsisText ()); } } diff --git a/kolourpaint/widgets/kpsqueezedtextlabel.h b/kolourpaint/widgets/kpsqueezedtextlabel.h index 57aa7b2f..f4bd320d 100644 --- a/kolourpaint/widgets/kpsqueezedtextlabel.h +++ b/kolourpaint/widgets/kpsqueezedtextlabel.h @@ -28,8 +28,8 @@ #ifndef __kp_squeezed_text_label_h__ #define __kp_squeezed_text_label_h__ -#include <qlabel.h> -#include <qstring.h> +#include <tqlabel.h> +#include <tqstring.h> // KSqueezedTextLabel done properly - squeeze at the end of the string, @@ -39,26 +39,26 @@ class kpSqueezedTextLabel : public QLabel Q_OBJECT public: - kpSqueezedTextLabel (QWidget *parent, const char *name = 0); - kpSqueezedTextLabel (const QString &text, QWidget *parent, const char *name = 0); + kpSqueezedTextLabel (TQWidget *parent, const char *name = 0); + kpSqueezedTextLabel (const TQString &text, TQWidget *parent, const char *name = 0); - virtual QSize minimumSizeHint () const; + virtual TQSize minimumSizeHint () const; // TODO: maybe text() should return the full text? - QString fullText () const; + TQString fullText () const; bool showEllipsis () const; void setShowEllipsis (bool yes = true); public slots: - virtual void setText (const QString &text); + virtual void setText (const TQString &text); protected: - virtual void resizeEvent (QResizeEvent *); - QString ellipsisText () const; + virtual void resizeEvent (TQResizeEvent *); + TQString ellipsisText () const; void squeezeText (); - QString m_fullText; + TQString m_fullText; bool m_showEllipsis; }; diff --git a/kolourpaint/widgets/kptooltoolbar.cpp b/kolourpaint/widgets/kptooltoolbar.cpp index b8d1985c..26c610e9 100644 --- a/kolourpaint/widgets/kptooltoolbar.cpp +++ b/kolourpaint/widgets/kptooltoolbar.cpp @@ -31,13 +31,13 @@ #include <kptooltoolbar.h> -#include <qbuttongroup.h> -#include <qlayout.h> -#include <qdatetime.h> -#include <qtoolbutton.h> -#include <qtooltip.h> -#include <qwidget.h> -#include <qwhatsthis.h> +#include <tqbuttongroup.h> +#include <tqlayout.h> +#include <tqdatetime.h> +#include <tqtoolbutton.h> +#include <tqtooltip.h> +#include <tqwidget.h> +#include <tqwhatsthis.h> #include <kconfig.h> #include <kdebug.h> @@ -58,8 +58,8 @@ class kpToolButton : public QToolButton { public: - kpToolButton (kpTool *tool, QWidget *parent) - : QToolButton (parent), + kpToolButton (kpTool *tool, TQWidget *parent) + : TQToolButton (parent), m_tool (tool) { } @@ -70,7 +70,7 @@ public: protected: // virtual [base QWidget] - void mouseDoubleClickEvent (QMouseEvent *e) + void mouseDoubleClickEvent (TQMouseEvent *e) { if (e->button () == Qt::LeftButton && m_tool) m_tool->globalDraw (); @@ -80,8 +80,8 @@ protected: }; -kpToolToolBar::kpToolToolBar (const QString &label, kpMainWindow *mainWindow, int colsOrRows, const char *name) - : KToolBar ((QWidget *) mainWindow, name, false/*don't use global toolBar settings*/, true/*readConfig*/), +kpToolToolBar::kpToolToolBar (const TQString &label, kpMainWindow *mainWindow, int colsOrRows, const char *name) + : KToolBar ((TQWidget *) mainWindow, name, false/*don't use global toolBar settings*/, true/*readConfig*/), m_vertCols (colsOrRows), m_buttonGroup (0), m_baseWidget (0), @@ -102,10 +102,10 @@ kpToolToolBar::kpToolToolBar (const QString &label, kpMainWindow *mainWindow, in //setVerticallyStretchable (false); - m_baseWidget = new QWidget (this); + m_baseWidget = new TQWidget (this); #if DEBUG_KP_TOOL_TOOL_BAR - QTime timer; + TQTime timer; timer.start (); #endif @@ -127,12 +127,12 @@ kpToolToolBar::kpToolToolBar (const QString &label, kpMainWindow *mainWindow, in << timer.restart () << endl; #endif - for (QValueVector <kpToolWidgetBase *>::const_iterator it = m_toolWidgets.begin (); + for (TQValueVector <kpToolWidgetBase *>::const_iterator it = m_toolWidgets.begin (); it != m_toolWidgets.end (); it++) { - connect (*it, SIGNAL (optionSelected (int, int)), - this, SIGNAL (toolWidgetOptionSelected ())); + connect (*it, TQT_SIGNAL (optionSelected (int, int)), + this, TQT_SIGNAL (toolWidgetOptionSelected ())); } #if DEBUG_KP_TOOL_TOOL_BAR @@ -148,10 +148,10 @@ kpToolToolBar::kpToolToolBar (const QString &label, kpMainWindow *mainWindow, in << timer.elapsed () << endl; #endif - m_buttonGroup = new QButtonGroup (); // invisible + m_buttonGroup = new TQButtonGroup (); // invisible m_buttonGroup->setExclusive (true); - connect (m_buttonGroup, SIGNAL (clicked (int)), SLOT (slotToolButtonClicked ())); + connect (m_buttonGroup, TQT_SIGNAL (clicked (int)), TQT_SLOT (slotToolButtonClicked ())); hideAllToolWidgets (); } @@ -200,7 +200,7 @@ int kpToolToolBar::defaultIconSize () if (m_defaultIconSize <= 0) { // Adapt according to screen geometry - const QRect desktopSize = KGlobalSettings::desktopGeometry (this); + const TQRect desktopSize = KGlobalSettings::desktopGeometry (this); #if DEBUG_KP_TOOL_TOOL_BAR kdDebug () << "\tadapting to screen size=" << desktopSize << endl; #endif @@ -221,7 +221,7 @@ int kpToolToolBar::defaultIconSize () // public void kpToolToolBar::registerTool (kpTool *tool) { - for (QValueVector <kpButtonToolPair>::const_iterator it = m_buttonToolPairs.begin (); + for (TQValueVector <kpButtonToolPair>::const_iterator it = m_buttonToolPairs.begin (); it != m_buttonToolPairs.end (); it++) { @@ -230,7 +230,7 @@ void kpToolToolBar::registerTool (kpTool *tool) } int num = m_buttonToolPairs.count (); - QToolButton *b = new kpToolButton (tool, m_baseWidget); + TQToolButton *b = new kpToolButton (tool, m_baseWidget); b->setAutoRaise (true); b->setUsesBigPixmap (false); b->setUsesTextLabel (false); @@ -238,8 +238,8 @@ void kpToolToolBar::registerTool (kpTool *tool) b->setText (tool->text ()); b->setIconSet (tool->iconSet (defaultIconSize ())); - QToolTip::add (b, tool->toolTip ()); - QWhatsThis::add (b, tool->description ()); + TQToolTip::add (b, tool->toolTip ()); + TQWhatsThis::add (b, tool->description ()); m_buttonGroup->insert (b); addButton (b, orientation (), num); @@ -247,16 +247,16 @@ void kpToolToolBar::registerTool (kpTool *tool) m_buttonToolPairs.append (kpButtonToolPair (b, tool)); - connect (tool, SIGNAL (actionActivated ()), - this, SLOT (slotToolActionActivated ())); - connect (tool, SIGNAL (actionToolTipChanged (const QString &)), - this, SLOT (slotToolActionToolTipChanged ())); + connect (tool, TQT_SIGNAL (actionActivated ()), + this, TQT_SLOT (slotToolActionActivated ())); + connect (tool, TQT_SIGNAL (actionToolTipChanged (const TQString &)), + this, TQT_SLOT (slotToolActionToolTipChanged ())); } // public void kpToolToolBar::unregisterTool (kpTool *tool) { - for (QValueVector <kpButtonToolPair>::iterator it = m_buttonToolPairs.begin (); + for (TQValueVector <kpButtonToolPair>::iterator it = m_buttonToolPairs.begin (); it != m_buttonToolPairs.end (); it++) { @@ -265,10 +265,10 @@ void kpToolToolBar::unregisterTool (kpTool *tool) delete ((*it).m_button); m_buttonToolPairs.erase (it); - disconnect (tool, SIGNAL (actionActivated ()), - this, SLOT (slotToolActionActivated ())); - disconnect (tool, SIGNAL (actionToolTipChanged (const QString &)), - this, SLOT (slotToolActionToolTipChanged ())); + disconnect (tool, TQT_SIGNAL (actionActivated ()), + this, TQT_SLOT (slotToolActionActivated ())); + disconnect (tool, TQT_SIGNAL (actionToolTipChanged (const TQString &)), + this, TQT_SLOT (slotToolActionToolTipChanged ())); break; } } @@ -277,7 +277,7 @@ void kpToolToolBar::unregisterTool (kpTool *tool) // public void kpToolToolBar::unregisterAllTools () { - for (QValueVector <kpButtonToolPair>::iterator it = m_buttonToolPairs.begin (); + for (TQValueVector <kpButtonToolPair>::iterator it = m_buttonToolPairs.begin (); it != m_buttonToolPairs.end (); it++) { @@ -308,7 +308,7 @@ void kpToolToolBar::selectTool (const kpTool *tool, bool reselectIfSameTool) if (tool) { - for (QValueVector <kpButtonToolPair>::iterator it = m_buttonToolPairs.begin (); + for (TQValueVector <kpButtonToolPair>::iterator it = m_buttonToolPairs.begin (); it != m_buttonToolPairs.end (); it++) { @@ -322,7 +322,7 @@ void kpToolToolBar::selectTool (const kpTool *tool, bool reselectIfSameTool) } else { - QButton *b = m_buttonGroup->selected (); + TQButton *b = m_buttonGroup->selected (); #if DEBUG_KP_TOOL_TOOL_BAR kdDebug () << "\twant to select no tool - button selected=" << b << endl; #endif @@ -351,7 +351,7 @@ void kpToolToolBar::selectPreviousTool () // public void kpToolToolBar::hideAllToolWidgets () { - for (QValueVector <kpToolWidgetBase *>::const_iterator it = m_toolWidgets.begin (); + for (TQValueVector <kpToolWidgetBase *>::const_iterator it = m_toolWidgets.begin (); it != m_toolWidgets.end (); it++) { @@ -368,7 +368,7 @@ int kpToolToolBar::numShownToolWidgets () const int ret = 0; - for (QValueVector <kpToolWidgetBase *>::const_iterator it = m_toolWidgets.begin (); + for (TQValueVector <kpToolWidgetBase *>::const_iterator it = m_toolWidgets.begin (); it != m_toolWidgets.end (); it++) { @@ -389,7 +389,7 @@ kpToolWidgetBase *kpToolToolBar::shownToolWidget (int which) const { int uptoVisibleWidget = 0; - for (QValueVector <kpToolWidgetBase *>::const_iterator it = m_toolWidgets.begin (); + for (TQValueVector <kpToolWidgetBase *>::const_iterator it = m_toolWidgets.begin (); it != m_toolWidgets.end (); it++) { @@ -409,7 +409,7 @@ kpToolWidgetBase *kpToolToolBar::shownToolWidget (int which) const // public bool kpToolToolBar::toolsSingleKeyTriggersEnabled () const { - for (QValueVector <kpButtonToolPair>::const_iterator it = m_buttonToolPairs.begin (); + for (TQValueVector <kpButtonToolPair>::const_iterator it = m_buttonToolPairs.begin (); it != m_buttonToolPairs.end (); it++) { @@ -427,7 +427,7 @@ void kpToolToolBar::enableToolsSingleKeyTriggers (bool enable) kdDebug () << "kpToolToolBar::enableToolsSingleKeyTriggers(" << enable << ")" << endl; #endif - for (QValueVector <kpButtonToolPair>::const_iterator it = m_buttonToolPairs.begin (); + for (TQValueVector <kpButtonToolPair>::const_iterator it = m_buttonToolPairs.begin (); it != m_buttonToolPairs.end (); it++) { @@ -439,14 +439,14 @@ void kpToolToolBar::enableToolsSingleKeyTriggers (bool enable) // private slot void kpToolToolBar::slotToolButtonClicked () { - QButton *b = m_buttonGroup->selected (); + TQButton *b = m_buttonGroup->selected (); #if DEBUG_KP_TOOL_TOOL_BAR kdDebug () << "kpToolToolBar::slotToolButtonClicked() button=" << b << endl; #endif kpTool *tool = 0; - for (QValueVector <kpButtonToolPair>::iterator it = m_buttonToolPairs.begin (); + for (TQValueVector <kpButtonToolPair>::iterator it = m_buttonToolPairs.begin (); it != m_buttonToolPairs.end (); it++) { @@ -534,13 +534,13 @@ void kpToolToolBar::slotToolActionToolTipChanged () if (!tool) return; - for (QValueVector <kpButtonToolPair>::const_iterator it = m_buttonToolPairs.begin (); + for (TQValueVector <kpButtonToolPair>::const_iterator it = m_buttonToolPairs.begin (); it != m_buttonToolPairs.end (); it++) { if (tool == (*it).m_tool) { - QToolTip::add ((*it).m_button, tool->toolTip ()); + TQToolTip::add ((*it).m_button, tool->toolTip ()); return; } } @@ -556,8 +556,8 @@ void kpToolToolBar::setOrientation (Qt::Orientation o) << ") called!" << endl; #endif - // (QDockWindow::undock() calls us) - bool isOutsideDock = (place () == QDockWindow::OutsideDock); + // (TQDockWindow::undock() calls us) + bool isOutsideDock = (place () == TQDockWindow::OutsideDock); if (!m_lastDockedOrientationSet || !isOutsideDock) { @@ -577,10 +577,10 @@ void kpToolToolBar::setOrientation (Qt::Orientation o) delete m_baseLayout; if (o == Qt::Vertical) { - m_baseLayout = new QBoxLayout (m_baseWidget, QBoxLayout::TopToBottom, + m_baseLayout = new TQBoxLayout (m_baseWidget, TQBoxLayout::TopToBottom, 5/*margin*/, 10/*spacing*/); - m_toolLayout = new QGridLayout (m_baseLayout, + m_toolLayout = new TQGridLayout (m_baseLayout, 5/*arbitrary rows since toolBar auto-expands*/, m_vertCols, 0/*margin*/, @@ -588,10 +588,10 @@ void kpToolToolBar::setOrientation (Qt::Orientation o) } else // if (o == Qt::Horizontal) { - m_baseLayout = new QBoxLayout (m_baseWidget, QBoxLayout::LeftToRight, + m_baseLayout = new TQBoxLayout (m_baseWidget, TQBoxLayout::LeftToRight, 5/*margin*/, 10/*spacing*/); - m_toolLayout = new QGridLayout (m_baseLayout, + m_toolLayout = new TQGridLayout (m_baseLayout, m_vertCols/*rows in this case, since horiz*/, 5/*arbitrary cols since toolBar auto-expands*/, 0/*margin*/, @@ -600,7 +600,7 @@ void kpToolToolBar::setOrientation (Qt::Orientation o) int num = 0; - for (QValueVector <kpButtonToolPair>::iterator it = m_buttonToolPairs.begin (); + for (TQValueVector <kpButtonToolPair>::iterator it = m_buttonToolPairs.begin (); it != m_buttonToolPairs.end (); it++) { @@ -608,7 +608,7 @@ void kpToolToolBar::setOrientation (Qt::Orientation o) num++; } - for (QValueVector <kpToolWidgetBase *>::const_iterator it = m_toolWidgets.begin (); + for (TQValueVector <kpToolWidgetBase *>::const_iterator it = m_toolWidgets.begin (); it != m_toolWidgets.end (); it++) { @@ -624,7 +624,7 @@ void kpToolToolBar::setOrientation (Qt::Orientation o) } // private -void kpToolToolBar::addButton (QButton *button, Qt::Orientation o, int num) +void kpToolToolBar::addButton (TQButton *button, Qt::Orientation o, int num) { if (o == Qt::Vertical) m_toolLayout->addWidget (button, num / m_vertCols, num % m_vertCols); diff --git a/kolourpaint/widgets/kptooltoolbar.h b/kolourpaint/widgets/kptooltoolbar.h index c3a7d1b7..417ae022 100644 --- a/kolourpaint/widgets/kptooltoolbar.h +++ b/kolourpaint/widgets/kptooltoolbar.h @@ -29,16 +29,16 @@ #ifndef __kp_tool_tool_bar_h__ #define __kp_tool_tool_bar_h__ -#include <qvaluevector.h> +#include <tqvaluevector.h> #include <ktoolbar.h> -class QBoxLayout; -class QButton; -class QButtonGroup; -class QWidget; -class QGridLayout; +class TQBoxLayout; +class TQButton; +class TQButtonGroup; +class TQWidget; +class TQGridLayout; class kpMainWindow; class kpTool; @@ -56,7 +56,7 @@ class kpToolToolBar : public KToolBar Q_OBJECT public: - kpToolToolBar (const QString &label, kpMainWindow *mainWindow, int colsOrRows = 2, const char *name = 0); + kpToolToolBar (const TQString &label, kpMainWindow *mainWindow, int colsOrRows = 2, const char *name = 0); virtual ~kpToolToolBar (); private: @@ -102,16 +102,16 @@ public slots: virtual void setOrientation (Qt::Orientation o); private: - void addButton (QButton *button, Qt::Orientation o, int num); + void addButton (TQButton *button, Qt::Orientation o, int num); Qt::Orientation m_lastDockedOrientation; bool m_lastDockedOrientationSet; int m_vertCols; - QButtonGroup *m_buttonGroup; - QWidget *m_baseWidget; - QBoxLayout *m_baseLayout; - QGridLayout *m_toolLayout; + TQButtonGroup *m_buttonGroup; + TQWidget *m_baseWidget; + TQBoxLayout *m_baseLayout; + TQGridLayout *m_toolLayout; kpToolWidgetBrush *m_toolWidgetBrush; kpToolWidgetEraserSize *m_toolWidgetEraserSize; @@ -120,12 +120,12 @@ private: kpToolWidgetOpaqueOrTransparent *m_toolWidgetOpaqueOrTransparent; kpToolWidgetSpraycanSize *m_toolWidgetSpraycanSize; - QValueVector <kpToolWidgetBase *> m_toolWidgets; + TQValueVector <kpToolWidgetBase *> m_toolWidgets; private: struct kpButtonToolPair { - kpButtonToolPair (QButton *button, kpTool *tool) + kpButtonToolPair (TQButton *button, kpTool *tool) : m_button (button), m_tool (tool) { } @@ -135,11 +135,11 @@ private: { } - QButton *m_button; + TQButton *m_button; kpTool *m_tool; }; - QValueVector <kpButtonToolPair> m_buttonToolPairs; + TQValueVector <kpButtonToolPair> m_buttonToolPairs; kpTool *m_previousTool, *m_currentTool; diff --git a/kolourpaint/widgets/kptoolwidgetbase.cpp b/kolourpaint/widgets/kptoolwidgetbase.cpp index a0042dbc..0d0a9245 100644 --- a/kolourpaint/widgets/kptoolwidgetbase.cpp +++ b/kolourpaint/widgets/kptoolwidgetbase.cpp @@ -31,11 +31,11 @@ #include <kptoolwidgetbase.h> -#include <qbitmap.h> -#include <qcolor.h> -#include <qimage.h> -#include <qpainter.h> -#include <qtooltip.h> +#include <tqbitmap.h> +#include <tqcolor.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqtooltip.h> #include <kapplication.h> #include <kconfig.h> @@ -45,15 +45,15 @@ #include <kpeffectinvert.h> -kpToolWidgetBase::kpToolWidgetBase (QWidget *parent, const char *name) - : QFrame (parent, name), +kpToolWidgetBase::kpToolWidgetBase (TQWidget *parent, const char *name) + : TQFrame (parent, name), m_invertSelectedPixmap (true), m_selectedRow (-1), m_selectedCol (-1) { if (!name) kdError () << "kpToolWidgetBase::kpToolWidgetBase() without name" << endl; - setFrameStyle (QFrame::Panel | QFrame::Sunken); + setFrameStyle (TQFrame::Panel | TQFrame::Sunken); setFixedSize (44, 66); } @@ -63,13 +63,13 @@ kpToolWidgetBase::~kpToolWidgetBase () // public -void kpToolWidgetBase::addOption (const QPixmap &pixmap, const QString &toolTip) +void kpToolWidgetBase::addOption (const TQPixmap &pixmap, const TQString &toolTip) { if (m_pixmaps.isEmpty ()) startNewOptionRow (); m_pixmaps.last ().append (pixmap); - m_pixmapRects.last ().append (QRect ()); + m_pixmapRects.last ().append (TQRect ()); m_toolTips.last ().append (toolTip); } @@ -110,14 +110,14 @@ void kpToolWidgetBase::finishConstruction (int fallBackRow, int fallBackCol) // private -QValueVector <int> kpToolWidgetBase::spreadOutElements (const QValueVector <int> &sizes, int max) +TQValueVector <int> kpToolWidgetBase::spreadOutElements (const TQValueVector <int> &sizes, int max) { if (sizes.count () == 0) - return QValueVector <int> (); + return TQValueVector <int> (); else if (sizes.count () == 1) - return QValueVector <int> (1, sizes.first () > max ? 0 : 1/*margin*/); + return TQValueVector <int> (1, sizes.first () > max ? 0 : 1/*margin*/); - QValueVector <int> retOffsets (sizes.count ()); + TQValueVector <int> retOffsets (sizes.count ()); int totalSize = 0; for (int i = 0; i < (int) sizes.count (); i++) @@ -175,10 +175,10 @@ QPair <int, int> kpToolWidgetBase::defaultSelectedRowAndCol () const KConfigGroupSaver cfgGroupSaver (kapp->config (), kpSettingsGroupTools); KConfigBase *cfg = cfgGroupSaver.config (); - QString nameString = QString::fromLatin1 (name ()); + TQString nameString = TQString::fromLatin1 (name ()); - row = cfg->readNumEntry (nameString + QString::fromLatin1 (" Row"), -1); - col = cfg->readNumEntry (nameString + QString::fromLatin1 (" Col"), -1); + row = cfg->readNumEntry (nameString + TQString::fromLatin1 (" Row"), -1); + col = cfg->readNumEntry (nameString + TQString::fromLatin1 (" Col"), -1); } #if DEBUG_KP_TOOL_WIDGET_BASE @@ -218,9 +218,9 @@ void kpToolWidgetBase::saveSelectedAsDefault () const KConfigGroupSaver cfgGroupSaver (kapp->config (), kpSettingsGroupTools); KConfigBase *cfg = cfgGroupSaver.config (); - QString nameString = QString::fromLatin1 (name ()); - cfg->writeEntry (nameString + QString::fromLatin1 (" Row"), m_selectedRow); - cfg->writeEntry (nameString + QString::fromLatin1 (" Col"), m_selectedCol); + TQString nameString = TQString::fromLatin1 (name ()); + cfg->writeEntry (nameString + TQString::fromLatin1 (" Row"), m_selectedRow); + cfg->writeEntry (nameString + TQString::fromLatin1 (" Col"), m_selectedCol); cfg->sync (); } @@ -250,7 +250,7 @@ void kpToolWidgetBase::relayoutOptions () kdDebug () << "\tfinding heights of rows:" << endl; #endif - QValueVector <int> maxHeightOfRow (m_pixmaps.count ()); + TQValueVector <int> maxHeightOfRow (m_pixmaps.count ()); for (int r = 0; r < (int) m_pixmaps.count (); r++) { @@ -264,7 +264,7 @@ void kpToolWidgetBase::relayoutOptions () #endif } - QValueVector <int> rowYOffset = spreadOutElements (maxHeightOfRow, height ()); + TQValueVector <int> rowYOffset = spreadOutElements (maxHeightOfRow, height ()); #if DEBUG_KP_TOOL_WIDGET_BASE kdDebug () << "\tspread out offsets of rows:" << endl; for (int r = 0; r < (int) rowYOffset.count (); r++) @@ -277,7 +277,7 @@ void kpToolWidgetBase::relayoutOptions () kdDebug () << "\tlaying out row " << r << ":" << endl; #endif - QValueVector <int> widths (m_pixmaps [r].count ()); + TQValueVector <int> widths (m_pixmaps [r].count ()); for (int c = 0; c < (int) m_pixmaps [r].count (); c++) widths [c] = m_pixmaps [r][c].width (); #if DEBUG_KP_TOOL_WIDGET_BASE @@ -286,7 +286,7 @@ void kpToolWidgetBase::relayoutOptions () kdDebug () << "\t\t\t" << c << ": " << widths [c] << endl; #endif - QValueVector <int> colXOffset = spreadOutElements (widths, width ()); + TQValueVector <int> colXOffset = spreadOutElements (widths, width ()); #if DEBUG_KP_TOOL_WIDGET_BASE kdDebug () << "\t\tspread out offsets of cols:" << endl; for (int c = 0; c < (int) colXOffset.count (); c++) @@ -319,10 +319,10 @@ void kpToolWidgetBase::relayoutOptions () else h = rowYOffset [r + 1] - y; - m_pixmapRects [r][c] = QRect (x, y, w, h); + m_pixmapRects [r][c] = TQRect (x, y, w, h); if (!m_toolTips [r][c].isEmpty ()) - QToolTip::add (this, m_pixmapRects [r][c], m_toolTips [r][c]); + TQToolTip::add (this, m_pixmapRects [r][c], m_toolTips [r][c]); } } @@ -537,7 +537,7 @@ bool kpToolWidgetBase::selectNextOption () // protected virtual [base QWidget] -void kpToolWidgetBase::mousePressEvent (QMouseEvent *e) +void kpToolWidgetBase::mousePressEvent (TQMouseEvent *e) { e->ignore (); @@ -560,7 +560,7 @@ void kpToolWidgetBase::mousePressEvent (QMouseEvent *e) } // protected virtual [base QFrame] -void kpToolWidgetBase::drawContents (QPainter *painter) +void kpToolWidgetBase::drawContents (TQPainter *painter) { #if DEBUG_KP_TOOL_WIDGET_BASE && 1 kdDebug () << "kpToolWidgetBase::drawContents(): rect=" << contentsRect () << endl; @@ -574,8 +574,8 @@ void kpToolWidgetBase::drawContents (QPainter *painter) for (int j = 0; j < (int) m_pixmaps [i].count (); j++) { - QRect rect = m_pixmapRects [i][j]; - QPixmap pixmap = m_pixmaps [i][j]; + TQRect rect = m_pixmapRects [i][j]; + TQPixmap pixmap = m_pixmaps [i][j]; #if DEBUG_KP_TOOL_WIDGET_BASE && 1 kdDebug () << "\t\tCol: " << j << " rect=" << rect << endl; @@ -598,7 +598,7 @@ void kpToolWidgetBase::drawContents (QPainter *painter) #endif - painter->drawPixmap (QPoint (rect.x () + (rect.width () - pixmap.width ()) / 2, + painter->drawPixmap (TQPoint (rect.x () + (rect.width () - pixmap.width ()) / 2, rect.y () + (rect.height () - pixmap.height ()) / 2), pixmap); } diff --git a/kolourpaint/widgets/kptoolwidgetbase.h b/kolourpaint/widgets/kptoolwidgetbase.h index a23f9a16..1a4c8a6f 100644 --- a/kolourpaint/widgets/kptoolwidgetbase.h +++ b/kolourpaint/widgets/kptoolwidgetbase.h @@ -29,15 +29,15 @@ #ifndef __kp_tool_widget_base_h__ #define __kp_tool_widget_base_h__ -#include <qframe.h> -#include <qpair.h> -#include <qpixmap.h> -#include <qrect.h> -#include <qvaluevector.h> -#include <qwidget.h> +#include <tqframe.h> +#include <tqpair.h> +#include <tqpixmap.h> +#include <tqrect.h> +#include <tqvaluevector.h> +#include <tqwidget.h> -class QPainter; +class TQPainter; // TODO: frame becomes a combobox when its parent kpToolToolBar becomes too small @@ -46,11 +46,11 @@ class kpToolWidgetBase : public QFrame Q_OBJECT public: - kpToolWidgetBase (QWidget *parent, const char *name); // must provide a name for config to work + kpToolWidgetBase (TQWidget *parent, const char *name); // must provide a name for config to work virtual ~kpToolWidgetBase (); public: - void addOption (const QPixmap &pixmap, const QString &toolTip = QString::null); + void addOption (const TQPixmap &pixmap, const TQString &toolTip = TQString::null); void startNewOptionRow (); // Call this at the end of your constructor. @@ -59,7 +59,7 @@ public: void finishConstruction (int fallBackRow, int fallBackCol); private: - QValueVector <int> spreadOutElements (const QValueVector <int> &sizes, int maxSize); + TQValueVector <int> spreadOutElements (const TQValueVector <int> &sizes, int maxSize); public: // (only have to use these if you don't use finishConstruction()) // (rereads from config file) @@ -92,19 +92,19 @@ signals: void optionSelected (int row, int col); protected: - virtual void mousePressEvent (QMouseEvent *e); - virtual void drawContents (QPainter *painter); + virtual void mousePressEvent (TQMouseEvent *e); + virtual void drawContents (TQPainter *painter); void setInvertSelectedPixmap (bool yes = true) { m_invertSelectedPixmap = yes; } bool m_invertSelectedPixmap; - // coulbe be a QFrame or a ComboBox - QWidget *m_baseWidget; + // coulbe be a TQFrame or a ComboBox + TQWidget *m_baseWidget; - QValueVector < QValueVector <QPixmap> > m_pixmaps; - QValueVector < QValueVector <QString> > m_toolTips; + TQValueVector < TQValueVector <TQPixmap> > m_pixmaps; + TQValueVector < TQValueVector <TQString> > m_toolTips; - QValueVector < QValueVector <QRect> > m_pixmapRects; + TQValueVector < TQValueVector <TQRect> > m_pixmapRects; int m_selectedRow, m_selectedCol; }; diff --git a/kolourpaint/widgets/kptoolwidgetbrush.cpp b/kolourpaint/widgets/kptoolwidgetbrush.cpp index 046dc8b5..1e53891e 100644 --- a/kolourpaint/widgets/kptoolwidgetbrush.cpp +++ b/kolourpaint/widgets/kptoolwidgetbrush.cpp @@ -31,8 +31,8 @@ #include <kptoolwidgetbrush.h> -#include <qbitmap.h> -#include <qpainter.h> +#include <tqbitmap.h> +#include <tqpainter.h> #include <kdebug.h> #include <klocale.h> @@ -52,12 +52,12 @@ static int brushSize [][3] = #define BRUSH_SIZE_NUM_COLS (int (sizeof (brushSize [0]) / sizeof (brushSize [0][0]))) #define BRUSH_SIZE_NUM_ROWS (int (sizeof (brushSize) / sizeof (brushSize [0]))) -kpToolWidgetBrush::kpToolWidgetBrush (QWidget *parent, const char *name) +kpToolWidgetBrush::kpToolWidgetBrush (TQWidget *parent, const char *name) : kpToolWidgetBase (parent, name) { setInvertSelectedPixmap (); - QPixmap *pm = m_brushBitmaps; + TQPixmap *pm = m_brushBitmaps; for (int shape = 0; shape < BRUSH_SIZE_NUM_ROWS; shape++) { @@ -69,13 +69,13 @@ kpToolWidgetBrush::kpToolWidgetBrush (QWidget *parent, const char *name) (h <= 0 ? height () : h)); const int s = brushSize [shape][i]; - QRect rect; + TQRect rect; if (s >= pm->width () || s >= pm->height ()) - rect = QRect (0, 0, pm->width (), pm->height ()); + rect = TQRect (0, 0, pm->width (), pm->height ()); else { - rect = QRect ((pm->width () - s) / 2, + rect = TQRect ((pm->width () - s) / 2, (pm->height () - s) / 2, s, s); @@ -87,7 +87,7 @@ kpToolWidgetBrush::kpToolWidgetBrush (QWidget *parent, const char *name) pm->fill (Qt::white); - QPainter painter (pm); + TQPainter painter (pm); painter.setPen (Qt::black); painter.setBrush (Qt::black); @@ -127,14 +127,14 @@ kpToolWidgetBrush::~kpToolWidgetBrush () // private -QString kpToolWidgetBrush::brushName (int shape, int whichSize) +TQString kpToolWidgetBrush::brushName (int shape, int whichSize) { int s = brushSize [shape][whichSize]; if (s == 1) return i18n ("1x1"); - QString shapeName; + TQString shapeName; // sync: <brushes> switch (shape) @@ -156,12 +156,12 @@ QString kpToolWidgetBrush::brushName (int shape, int whichSize) } if (shapeName.isEmpty ()) - return QString::null; + return TQString::null; return i18n ("%1x%2 %3").arg (s).arg (s).arg (shapeName); } -QPixmap kpToolWidgetBrush::brush () const +TQPixmap kpToolWidgetBrush::brush () const { return m_brushBitmaps [selectedRow () * BRUSH_SIZE_NUM_COLS + selectedCol ()]; } diff --git a/kolourpaint/widgets/kptoolwidgetbrush.h b/kolourpaint/widgets/kptoolwidgetbrush.h index db222e79..563d9625 100644 --- a/kolourpaint/widgets/kptoolwidgetbrush.h +++ b/kolourpaint/widgets/kptoolwidgetbrush.h @@ -29,7 +29,7 @@ #ifndef __kptoolwidgetbrush_h__ #define __kptoolwidgetbrush_h__ -#include <qpixmap.h> +#include <tqpixmap.h> #include <kptoolwidgetbase.h> @@ -38,24 +38,24 @@ class kpToolWidgetBrush : public kpToolWidgetBase Q_OBJECT public: - kpToolWidgetBrush (QWidget *parent, const char *name); + kpToolWidgetBrush (TQWidget *parent, const char *name); virtual ~kpToolWidgetBrush (); private: - QString brushName (int shape, int whichSize); + TQString brushName (int shape, int whichSize); public: - QPixmap brush () const; + TQPixmap brush () const; bool brushIsDiagonalLine () const; signals: - void brushChanged (const QPixmap &pixmap, bool isDiagonalLine); + void brushChanged (const TQPixmap &pixmap, bool isDiagonalLine); protected slots: virtual bool setSelected (int row, int col, bool saveAsDefault); private: - QPixmap m_brushBitmaps [16]; + TQPixmap m_brushBitmaps [16]; }; #endif // __kptoolwidgetbrush_h__ diff --git a/kolourpaint/widgets/kptoolwidgeterasersize.cpp b/kolourpaint/widgets/kptoolwidgeterasersize.cpp index cc58c0d1..9b9ffe8a 100644 --- a/kolourpaint/widgets/kptoolwidgeterasersize.cpp +++ b/kolourpaint/widgets/kptoolwidgeterasersize.cpp @@ -30,8 +30,8 @@ #include <kptoolwidgeterasersize.h> -#include <qbitmap.h> -#include <qpainter.h> +#include <tqbitmap.h> +#include <tqpainter.h> #include <kdebug.h> #include <klocale.h> @@ -44,13 +44,13 @@ static int eraserSizes [] = {2, 3, 5, 9, 17, 29}; static const int numEraserSizes = int (sizeof (eraserSizes) / sizeof (eraserSizes [0])); -kpToolWidgetEraserSize::kpToolWidgetEraserSize (QWidget *parent, const char *name) +kpToolWidgetEraserSize::kpToolWidgetEraserSize (TQWidget *parent, const char *name) : kpToolWidgetBase (parent, name) { setInvertSelectedPixmap (); - m_cursorPixmaps = new QPixmap [numEraserSizes]; - QPixmap *cursorPixmap = m_cursorPixmaps; + m_cursorPixmaps = new TQPixmap [numEraserSizes]; + TQPixmap *cursorPixmap = m_cursorPixmaps; for (int i = 0; i < numEraserSizes; i++) { @@ -63,22 +63,22 @@ kpToolWidgetEraserSize::kpToolWidgetEraserSize (QWidget *parent, const char *nam cursorPixmap->fill (Qt::black); - QPixmap previewPixmap (s, s); + TQPixmap previewPixmap (s, s); if (i < 3) { // HACK: kpToolWidgetBase's layout code sucks and gives uneven spacing previewPixmap.resize ((width () - 4) / 3, 9); } - QPainter painter (&previewPixmap); - QRect rect ((previewPixmap.width () - s) / 2, (previewPixmap.height () - s) / 2, s, s); + TQPainter painter (&previewPixmap); + TQRect rect ((previewPixmap.width () - s) / 2, (previewPixmap.height () - s) / 2, s, s); painter.fillRect (rect, Qt::black); painter.end (); - QBitmap mask (previewPixmap.width (), previewPixmap.height ()); + TQBitmap mask (previewPixmap.width (), previewPixmap.height ()); mask.fill (Qt::color0/*transparent*/); - QPainter maskPainter (&mask); + TQPainter maskPainter (&mask); maskPainter.fillRect (rect, Qt::color1/*opaque*/); maskPainter.end (); @@ -104,7 +104,7 @@ int kpToolWidgetEraserSize::eraserSize () const return eraserSizes [selected ()]; } -QPixmap kpToolWidgetEraserSize::cursorPixmap (const kpColor &color) const +TQPixmap kpToolWidgetEraserSize::cursorPixmap (const kpColor &color) const { #if DEBUG_KP_TOOL_WIDGET_ERASER_SIZE kdDebug () << "kpToolWidgetEraseSize::cursorPixmap() selected=" << selected () @@ -113,7 +113,7 @@ QPixmap kpToolWidgetEraserSize::cursorPixmap (const kpColor &color) const #endif // TODO: why are we even storing m_cursorPixmaps? - QPixmap pixmap = m_cursorPixmaps [selected ()]; + TQPixmap pixmap = m_cursorPixmaps [selected ()]; if (color.isOpaque ()) pixmap.fill (color.toQColor ()); @@ -122,7 +122,7 @@ QPixmap kpToolWidgetEraserSize::cursorPixmap (const kpColor &color) const if (showBorder) { - QPainter painter (&pixmap); + TQPainter painter (&pixmap); painter.setPen (Qt::black); painter.drawRect (pixmap.rect ()); } @@ -130,13 +130,13 @@ QPixmap kpToolWidgetEraserSize::cursorPixmap (const kpColor &color) const if (color.isTransparent ()) { - QBitmap maskBitmap (pixmap.width (), pixmap.height ()); + TQBitmap maskBitmap (pixmap.width (), pixmap.height ()); maskBitmap.fill (Qt::color0/*transparent*/); if (showBorder) { - QPainter maskBitmapPainter (&maskBitmap); + TQPainter maskBitmapPainter (&maskBitmap); maskBitmapPainter.setPen (Qt::color1/*opaque*/); maskBitmapPainter.drawRect (maskBitmap.rect ()); } diff --git a/kolourpaint/widgets/kptoolwidgeterasersize.h b/kolourpaint/widgets/kptoolwidgeterasersize.h index 71093fd6..09b8c0f8 100644 --- a/kolourpaint/widgets/kptoolwidgeterasersize.h +++ b/kolourpaint/widgets/kptoolwidgeterasersize.h @@ -29,7 +29,7 @@ #ifndef __kptoolwidgeterasersize_h__ #define __kptoolwidgeterasersize_h__ -#include <qpixmap.h> +#include <tqpixmap.h> #include <kptoolwidgetbase.h> @@ -40,11 +40,11 @@ class kpToolWidgetEraserSize : public kpToolWidgetBase Q_OBJECT public: - kpToolWidgetEraserSize (QWidget *parent, const char *name); + kpToolWidgetEraserSize (TQWidget *parent, const char *name); virtual ~kpToolWidgetEraserSize (); int eraserSize () const; - QPixmap cursorPixmap (const kpColor &color) const; + TQPixmap cursorPixmap (const kpColor &color) const; signals: void eraserSizeChanged (int size); @@ -53,7 +53,7 @@ protected slots: virtual bool setSelected (int row, int col, bool saveAsDefault); private: - QPixmap *m_cursorPixmaps; + TQPixmap *m_cursorPixmaps; }; #endif // __kptoolwidgeterasersize_h__ diff --git a/kolourpaint/widgets/kptoolwidgetfillstyle.cpp b/kolourpaint/widgets/kptoolwidgetfillstyle.cpp index 74c174ce..9b780b3f 100644 --- a/kolourpaint/widgets/kptoolwidgetfillstyle.cpp +++ b/kolourpaint/widgets/kptoolwidgetfillstyle.cpp @@ -30,9 +30,9 @@ #include <kptoolwidgetfillstyle.h> -#include <qbitmap.h> -#include <qbrush.h> -#include <qpainter.h> +#include <tqbitmap.h> +#include <tqbrush.h> +#include <tqpainter.h> #include <kdebug.h> #include <klocale.h> @@ -42,14 +42,14 @@ #include <kptool.h> -kpToolWidgetFillStyle::kpToolWidgetFillStyle (QWidget *parent, const char *name) +kpToolWidgetFillStyle::kpToolWidgetFillStyle (TQWidget *parent, const char *name) : kpToolWidgetBase (parent, name) { setInvertSelectedPixmap (); for (int i = 0; i < (int) FillStyleNum; i++) { - QPixmap pixmap; + TQPixmap pixmap; pixmap = fillStylePixmap ((FillStyle) i, (width () - 2/*margin*/) * 3 / 4, @@ -68,14 +68,14 @@ kpToolWidgetFillStyle::~kpToolWidgetFillStyle () // private -QPixmap kpToolWidgetFillStyle::fillStylePixmap (FillStyle fs, int w, int h) +TQPixmap kpToolWidgetFillStyle::fillStylePixmap (FillStyle fs, int w, int h) { - QPixmap pixmap ((w <= 0 ? width () : w), (h <= 0 ? height () : h)); + TQPixmap pixmap ((w <= 0 ? width () : w), (h <= 0 ? height () : h)); pixmap.fill (Qt::white); - QPainter painter (&pixmap); + TQPainter painter (&pixmap); - painter.setPen (QPen (Qt::black, 2)); + painter.setPen (TQPen (Qt::black, 2)); painter.setBrush (brushForFillStyle (fs, kpColor (Qt::black.rgb ())/*foreground*/, kpColor (Qt::gray.rgb ())/*background*/)); @@ -85,11 +85,11 @@ QPixmap kpToolWidgetFillStyle::fillStylePixmap (FillStyle fs, int w, int h) painter.end (); - QBitmap mask (pixmap.width (), pixmap.height ()); + TQBitmap mask (pixmap.width (), pixmap.height ()); mask.fill (Qt::color0); painter.begin (&mask); - painter.setPen (QPen (Qt::color1, 2)); + painter.setPen (TQPen (Qt::color1, 2)); if (fs == FillWithBackground || fs == FillWithForeground) painter.setBrush (Qt::color1); @@ -104,7 +104,7 @@ QPixmap kpToolWidgetFillStyle::fillStylePixmap (FillStyle fs, int w, int h) } // private -QString kpToolWidgetFillStyle::fillStyleName (FillStyle fs) const +TQString kpToolWidgetFillStyle::fillStyleName (FillStyle fs) const { // do not complain about the "useless" breaks // as the return statements might not be return statements one day @@ -121,7 +121,7 @@ QString kpToolWidgetFillStyle::fillStyleName (FillStyle fs) const return i18n ("Fill with Foreground Color"); break; default: - return QString::null; + return TQString::null; break; } } @@ -139,7 +139,7 @@ kpToolWidgetFillStyle::FillStyle kpToolWidgetFillStyle::fillStyle () const } // public static -QBrush kpToolWidgetFillStyle::maskBrushForFillStyle (FillStyle fs, +TQBrush kpToolWidgetFillStyle::maskBrushForFillStyle (FillStyle fs, const kpColor &foregroundColor, const kpColor &backgroundColor) { @@ -152,10 +152,10 @@ QBrush kpToolWidgetFillStyle::maskBrushForFillStyle (FillStyle fs, return Qt::NoBrush; break; case FillWithBackground: - return QBrush (backgroundColor.maskColor ()); + return TQBrush (backgroundColor.maskColor ()); break; case FillWithForeground: - return QBrush (foregroundColor.maskColor ()); + return TQBrush (foregroundColor.maskColor ()); break; default: return Qt::NoBrush; @@ -163,14 +163,14 @@ QBrush kpToolWidgetFillStyle::maskBrushForFillStyle (FillStyle fs, } } -QBrush kpToolWidgetFillStyle::maskBrush (const kpColor &foregroundColor, +TQBrush kpToolWidgetFillStyle::maskBrush (const kpColor &foregroundColor, const kpColor &backgroundColor) { return maskBrushForFillStyle (fillStyle (), foregroundColor, backgroundColor); } // public static -QBrush kpToolWidgetFillStyle::brushForFillStyle (FillStyle fs, +TQBrush kpToolWidgetFillStyle::brushForFillStyle (FillStyle fs, const kpColor &foregroundColor, const kpColor &backgroundColor) { @@ -186,13 +186,13 @@ QBrush kpToolWidgetFillStyle::brushForFillStyle (FillStyle fs, break; case FillWithBackground: if (backgroundColor.isOpaque ()) - return QBrush (backgroundColor.toQColor ()); + return TQBrush (backgroundColor.toQColor ()); else return Qt::NoBrush; break; case FillWithForeground: if (foregroundColor.isOpaque ()) - return QBrush (foregroundColor.toQColor ()); + return TQBrush (foregroundColor.toQColor ()); else return Qt::NoBrush; break; @@ -203,7 +203,7 @@ QBrush kpToolWidgetFillStyle::brushForFillStyle (FillStyle fs, } // public -QBrush kpToolWidgetFillStyle::brush (const kpColor &foregroundColor, +TQBrush kpToolWidgetFillStyle::brush (const kpColor &foregroundColor, const kpColor &backgroundColor) { return brushForFillStyle (fillStyle (), foregroundColor, backgroundColor); diff --git a/kolourpaint/widgets/kptoolwidgetfillstyle.h b/kolourpaint/widgets/kptoolwidgetfillstyle.h index 219d47f2..86a47270 100644 --- a/kolourpaint/widgets/kptoolwidgetfillstyle.h +++ b/kolourpaint/widgets/kptoolwidgetfillstyle.h @@ -31,7 +31,7 @@ #include <kptoolwidgetbase.h> -class QBrush; +class TQBrush; class kpColor; @@ -40,7 +40,7 @@ class kpToolWidgetFillStyle : public kpToolWidgetBase Q_OBJECT public: - kpToolWidgetFillStyle (QWidget *parent, const char *name); + kpToolWidgetFillStyle (TQWidget *parent, const char *name); virtual ~kpToolWidgetFillStyle (); enum FillStyle @@ -52,22 +52,22 @@ public: }; private: - QPixmap fillStylePixmap (FillStyle fs, int width, int height); - QString fillStyleName (FillStyle fs) const; + TQPixmap fillStylePixmap (FillStyle fs, int width, int height); + TQString fillStyleName (FillStyle fs) const; public: FillStyle fillStyle () const; - static QBrush maskBrushForFillStyle (FillStyle fs, + static TQBrush maskBrushForFillStyle (FillStyle fs, const kpColor &foregroundColor, const kpColor &backgroundColor); - QBrush maskBrush (const kpColor &foregroundColor, + TQBrush maskBrush (const kpColor &foregroundColor, const kpColor &backgroundColor); - static QBrush brushForFillStyle (FillStyle fs, + static TQBrush brushForFillStyle (FillStyle fs, const kpColor &foregroundColor, const kpColor &backgroundColor); - QBrush brush (const kpColor &foregroundColor, + TQBrush brush (const kpColor &foregroundColor, const kpColor &backgroundColor); signals: diff --git a/kolourpaint/widgets/kptoolwidgetlinewidth.cpp b/kolourpaint/widgets/kptoolwidgetlinewidth.cpp index 27e34ecb..ded51a03 100644 --- a/kolourpaint/widgets/kptoolwidgetlinewidth.cpp +++ b/kolourpaint/widgets/kptoolwidgetlinewidth.cpp @@ -28,15 +28,15 @@ #include <kptoolwidgetlinewidth.h> -#include <qbitmap.h> -#include <qpainter.h> +#include <tqbitmap.h> +#include <tqpainter.h> #include <klocale.h> static int lineWidths [] = {1, 2, 3, 5, 8}; -kpToolWidgetLineWidth::kpToolWidgetLineWidth (QWidget *parent, const char *name) +kpToolWidgetLineWidth::kpToolWidgetLineWidth (TQWidget *parent, const char *name) : kpToolWidgetBase (parent, name) { setInvertSelectedPixmap (); @@ -48,19 +48,19 @@ kpToolWidgetLineWidth::kpToolWidgetLineWidth (QWidget *parent, const char *name) for (int i = 0; i < numLineWidths; i++) { - QPixmap pixmap ((w <= 0 ? width () : w), + TQPixmap pixmap ((w <= 0 ? width () : w), (h <= 0 ? height () : h)); pixmap.fill (Qt::white); - QBitmap maskBitmap (pixmap.width (), pixmap.height ()); + TQBitmap maskBitmap (pixmap.width (), pixmap.height ()); maskBitmap.fill (Qt::color0/*transparent*/); - QPainter painter (&pixmap), maskPainter (&maskBitmap); + TQPainter painter (&pixmap), maskPainter (&maskBitmap); painter.setPen (Qt::black), maskPainter.setPen (Qt::color1/*opaque*/); painter.setBrush (Qt::black), maskPainter.setBrush (Qt::color1/*opaque*/); - QRect rect = QRect (0, (pixmap.height () - lineWidths [i]) / 2, + TQRect rect = TQRect (0, (pixmap.height () - lineWidths [i]) / 2, pixmap.width (), lineWidths [i]); painter.drawRect (rect), maskPainter.drawRect (rect); @@ -69,7 +69,7 @@ kpToolWidgetLineWidth::kpToolWidgetLineWidth (QWidget *parent, const char *name) pixmap.setMask (maskBitmap); - addOption (pixmap, QString::number (lineWidths [i])); + addOption (pixmap, TQString::number (lineWidths [i])); startNewOptionRow (); } diff --git a/kolourpaint/widgets/kptoolwidgetlinewidth.h b/kolourpaint/widgets/kptoolwidgetlinewidth.h index 3255e443..8fa041a0 100644 --- a/kolourpaint/widgets/kptoolwidgetlinewidth.h +++ b/kolourpaint/widgets/kptoolwidgetlinewidth.h @@ -36,7 +36,7 @@ class kpToolWidgetLineWidth : public kpToolWidgetBase Q_OBJECT public: - kpToolWidgetLineWidth (QWidget *parent, const char *name); + kpToolWidgetLineWidth (TQWidget *parent, const char *name); virtual ~kpToolWidgetLineWidth (); int lineWidth () const; diff --git a/kolourpaint/widgets/kptoolwidgetopaqueortransparent.cpp b/kolourpaint/widgets/kptoolwidgetopaqueortransparent.cpp index 41b55d0f..4cd5b6f6 100644 --- a/kolourpaint/widgets/kptoolwidgetopaqueortransparent.cpp +++ b/kolourpaint/widgets/kptoolwidgetopaqueortransparent.cpp @@ -35,7 +35,7 @@ #include <klocale.h> -kpToolWidgetOpaqueOrTransparent::kpToolWidgetOpaqueOrTransparent (QWidget *parent, const char *name) +kpToolWidgetOpaqueOrTransparent::kpToolWidgetOpaqueOrTransparent (TQWidget *parent, const char *name) : kpToolWidgetBase (parent, name) { setInvertSelectedPixmap (false); diff --git a/kolourpaint/widgets/kptoolwidgetopaqueortransparent.h b/kolourpaint/widgets/kptoolwidgetopaqueortransparent.h index c24cd308..82ea3f50 100644 --- a/kolourpaint/widgets/kptoolwidgetopaqueortransparent.h +++ b/kolourpaint/widgets/kptoolwidgetopaqueortransparent.h @@ -37,7 +37,7 @@ class kpToolWidgetOpaqueOrTransparent : public kpToolWidgetBase Q_OBJECT public: - kpToolWidgetOpaqueOrTransparent (QWidget *parent, const char *name); + kpToolWidgetOpaqueOrTransparent (TQWidget *parent, const char *name); virtual ~kpToolWidgetOpaqueOrTransparent (); bool isOpaque () const; diff --git a/kolourpaint/widgets/kptoolwidgetspraycansize.cpp b/kolourpaint/widgets/kptoolwidgetspraycansize.cpp index 161e5015..2f426df5 100644 --- a/kolourpaint/widgets/kptoolwidgetspraycansize.cpp +++ b/kolourpaint/widgets/kptoolwidgetspraycansize.cpp @@ -31,9 +31,9 @@ #include <kptoolwidgetspraycansize.h> -#include <qbitmap.h> -#include <qimage.h> -#include <qpainter.h> +#include <tqbitmap.h> +#include <tqimage.h> +#include <tqpainter.h> #include <kdebug.h> #include <kiconloader.h> @@ -44,7 +44,7 @@ static int spraycanSizes [] = {9, 17, 29}; -kpToolWidgetSpraycanSize::kpToolWidgetSpraycanSize (QWidget *parent, const char *name) +kpToolWidgetSpraycanSize::kpToolWidgetSpraycanSize (TQWidget *parent, const char *name) : kpToolWidgetBase (parent, name) { #if DEBUG_KP_TOOL_WIDGET_SPRAYCAN_SIZE @@ -54,22 +54,22 @@ kpToolWidgetSpraycanSize::kpToolWidgetSpraycanSize (QWidget *parent, const char for (int i = 0; i < int (sizeof (spraycanSizes) / sizeof (spraycanSizes [0])); i++) { int s = spraycanSizes [i]; - QString iconName = QString ("tool_spraycan_%1x%1").arg (s).arg(s); + TQString iconName = TQString ("tool_spraycan_%1x%1").arg (s).arg(s); #if DEBUG_KP_TOOL_WIDGET_SPRAYCAN_SIZE kdDebug () << "\ticonName=" << iconName << endl; #endif - QPixmap pixmap (s, s); + TQPixmap pixmap (s, s); pixmap.fill (Qt::white); - QPainter painter (&pixmap); + TQPainter painter (&pixmap); painter.drawPixmap (0, 0, UserIcon (iconName)); painter.end (); - QImage image = kpPixmapFX::convertToImage (pixmap); + TQImage image = kpPixmapFX::convertToImage (pixmap); - QBitmap mask (pixmap.width (), pixmap.height ()); + TQBitmap mask (pixmap.width (), pixmap.height ()); mask.fill (Qt::color0); painter.begin (&mask); diff --git a/kolourpaint/widgets/kptoolwidgetspraycansize.h b/kolourpaint/widgets/kptoolwidgetspraycansize.h index b4233a80..6cc7d11e 100644 --- a/kolourpaint/widgets/kptoolwidgetspraycansize.h +++ b/kolourpaint/widgets/kptoolwidgetspraycansize.h @@ -36,7 +36,7 @@ class kpToolWidgetSpraycanSize : public kpToolWidgetBase Q_OBJECT public: - kpToolWidgetSpraycanSize (QWidget *parent, const char *name); + kpToolWidgetSpraycanSize (TQWidget *parent, const char *name); virtual ~kpToolWidgetSpraycanSize (); int spraycanSize () const; |