summaryrefslogtreecommitdiffstats
path: root/kimagemapeditor
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:54:04 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:54:04 +0000
commitdc6b8e72fed2586239e3514819238c520636c9d9 (patch)
tree88b200df0a0b7fab9d6f147596173556f1ed9a13 /kimagemapeditor
parent6927d4436e54551917f600b706a8d6109e49de1c (diff)
downloadtdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.tar.gz
tdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1157656 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kimagemapeditor')
-rw-r--r--kimagemapeditor/arealistview.cpp24
-rw-r--r--kimagemapeditor/arealistview.h10
-rw-r--r--kimagemapeditor/drawzone.cpp192
-rw-r--r--kimagemapeditor/drawzone.h78
-rw-r--r--kimagemapeditor/imagemap.cpp112
-rw-r--r--kimagemapeditor/imagemap.h50
-rw-r--r--kimagemapeditor/imageslistview.cpp24
-rw-r--r--kimagemapeditor/imageslistview.h6
-rw-r--r--kimagemapeditor/kimagemapeditor.cpp542
-rw-r--r--kimagemapeditor/kimagemapeditor.h88
-rw-r--r--kimagemapeditor/kimearea.cpp412
-rw-r--r--kimagemapeditor/kimearea.h196
-rw-r--r--kimagemapeditor/kimecommands.cpp8
-rw-r--r--kimagemapeditor/kimecommands.h10
-rw-r--r--kimagemapeditor/kimedialogs.cpp340
-rw-r--r--kimagemapeditor/kimedialogs.h102
-rw-r--r--kimagemapeditor/kimeshell.cpp36
-rw-r--r--kimagemapeditor/mapslistview.cpp70
-rw-r--r--kimagemapeditor/mapslistview.h34
-rw-r--r--kimagemapeditor/qextfileinfo.cpp84
-rw-r--r--kimagemapeditor/qextfileinfo.h22
21 files changed, 1220 insertions, 1220 deletions
diff --git a/kimagemapeditor/arealistview.cpp b/kimagemapeditor/arealistview.cpp
index 80cd3265..203a741f 100644
--- a/kimagemapeditor/arealistview.cpp
+++ b/kimagemapeditor/arealistview.cpp
@@ -17,10 +17,10 @@
// QT
#include <klistview.h>
-#include <qpushbutton.h>
-#include <qhbox.h>
-#include <qwhatsthis.h>
-#include <qtooltip.h>
+#include <tqpushbutton.h>
+#include <tqhbox.h>
+#include <tqwhatsthis.h>
+#include <tqtooltip.h>
// KDE
#include <kiconloader.h>
@@ -31,30 +31,30 @@
#include "arealistview.h"
-AreaListView::AreaListView(QWidget *parent, const char *name)
- : QVBox(parent, name)
+AreaListView::AreaListView(TQWidget *parent, const char *name)
+ : TQVBox(parent, name)
{
listView = new KListView(this);
listView->addColumn(i18n("Areas"));
listView->addColumn(i18n("Preview"));
listView->setMultiSelection(true);
- listView->setSelectionMode( QListView::Extended );
+ listView->setSelectionMode( TQListView::Extended );
listView->setSorting(-1); // The user can't sort by clicking on the header
listView->setFullWidth(true);
- QWhatsThis::add( listView, i18n("<h3>Area List</h3>The area list shows you all areas of the map.<br>"
+ TQWhatsThis::add( listView, i18n("<h3>Area List</h3>The area list shows you all areas of the map.<br>"
"The left column shows the link associated with the area; the right "
"column shows the part of the image that is covered by the area.<br>"
"The maximum size of the preview images can be configured."));
- QToolTip::add( listView, i18n("A list of all areas"));
+ TQToolTip::add( listView, i18n("A list of all areas"));
- QHBox *hbox= new QHBox(this);
- upBtn= new QPushButton("",hbox);
+ TQHBox *hbox= new TQHBox(this);
+ upBtn= new TQPushButton("",hbox);
upBtn->setIconSet(SmallIconSet("up"));
- downBtn= new QPushButton("",hbox);
+ downBtn= new TQPushButton("",hbox);
downBtn->setIconSet(SmallIconSet("down"));
}
diff --git a/kimagemapeditor/arealistview.h b/kimagemapeditor/arealistview.h
index 6037f5ee..9171cd44 100644
--- a/kimagemapeditor/arealistview.h
+++ b/kimagemapeditor/arealistview.h
@@ -18,8 +18,8 @@
#ifndef _AREALISTVIEW_H_
#define _AREALISTVIEW_H_
-#include <qwidget.h>
-#include <qvbox.h>
+#include <tqwidget.h>
+#include <tqvbox.h>
class KListView;
class QPushButton;
@@ -35,12 +35,12 @@ class AreaListView : public QVBox
Q_OBJECT
public:
- AreaListView(QWidget *parent, const char *name);
+ AreaListView(TQWidget *parent, const char *name);
~AreaListView();
KListView* listView;
- QPushButton *upBtn;
- QPushButton *downBtn;
+ TQPushButton *upBtn;
+ TQPushButton *downBtn;
};
diff --git a/kimagemapeditor/drawzone.cpp b/kimagemapeditor/drawzone.cpp
index a5bf5612..60b6fe9f 100644
--- a/kimagemapeditor/drawzone.cpp
+++ b/kimagemapeditor/drawzone.cpp
@@ -16,10 +16,10 @@
***************************************************************************/
// QT
-#include <qbitmap.h>
-#include <qpainter.h>
-#include <qdragobject.h>
-#include <qpixmap.h>
+#include <tqbitmap.h>
+#include <tqpainter.h>
+#include <tqdragobject.h>
+#include <tqpixmap.h>
// KDE
#include <kdebug.h>
@@ -37,11 +37,11 @@
#include "kimecommon.h"
-DrawZone::DrawZone(QWidget *parent,KImageMapEditor* _imageMapEditor)
- : QScrollView(parent)
+DrawZone::DrawZone(TQWidget *parent,KImageMapEditor* _imageMapEditor)
+ : TQScrollView(parent)
{
imageMapEditor=_imageMapEditor;
-// setPicture(QImage());
+// setPicture(TQImage());
currentAction=None;
currentArea=0L;
oldArea=0L;
@@ -57,9 +57,9 @@ DrawZone::DrawZone(QWidget *parent,KImageMapEditor* _imageMapEditor)
setDragAutoScroll(true);
// The cross rectangle cursor
- QBitmap b(32,32,true);
- QBitmap b2(32,32,true);
- QPainter p(&b);
+ TQBitmap b(32,32,true);
+ TQBitmap b2(32,32,true);
+ TQPainter p(&b);
// the cross
p.drawLine(0,8,6,8);
p.drawLine(10,8,16,8);
@@ -96,12 +96,12 @@ DrawZone::DrawZone(QWidget *parent,KImageMapEditor* _imageMapEditor)
p.end();
- RectangleCursor = QCursor(b,b2,8,8);
+ RectangleCursor = TQCursor(b,b2,8,8);
// The cross circle cursor
- b = QBitmap(32,32,true);
- b2 = QBitmap(32,32,true);
+ b = TQBitmap(32,32,true);
+ b2 = TQBitmap(32,32,true);
p.begin(&b);
// the cross
p.drawLine(0,8,6,8);
@@ -139,25 +139,25 @@ DrawZone::DrawZone(QWidget *parent,KImageMapEditor* _imageMapEditor)
p.end();
- CircleCursor = QCursor(b,b2,8,8);
+ CircleCursor = TQCursor(b,b2,8,8);
- QString path = KGlobal::dirs()->findResourceDir( "data", "kimagemapeditor/polygoncursor.png" ) + "kimagemapeditor/polygoncursor.png";
- PolygonCursor = QCursor(QPixmap(path),8,8);
+ TQString path = KGlobal::dirs()->findResourceDir( "data", "kimagemapeditor/polygoncursor.png" ) + "kimagemapeditor/polygoncursor.png";
+ PolygonCursor = TQCursor(TQPixmap(path),8,8);
path = KGlobal::dirs()->findResourceDir( "data", "kimagemapeditor/freehandcursor.png" ) + "kimagemapeditor/freehandcursor.png";
- FreehandCursor = QCursor(QPixmap(path),8,8);
+ FreehandCursor = TQCursor(TQPixmap(path),8,8);
path = KGlobal::dirs()->findResourceDir( "data", "kimagemapeditor/addpointcursor.png" ) + "kimagemapeditor/addpointcursor.png";
- AddPointCursor = QCursor(QPixmap(path),8,8);
+ AddPointCursor = TQCursor(TQPixmap(path),8,8);
path = KGlobal::dirs()->findResourceDir( "data", "kimagemapeditor/removepointcursor.png" ) + "kimagemapeditor/removepointcursor.png";
- RemovePointCursor = QCursor(QPixmap(path),8,8);
+ RemovePointCursor = TQCursor(TQPixmap(path),8,8);
}
DrawZone::~DrawZone(){
}
-void DrawZone::setPicture(const QImage &_image) {
+void DrawZone::setPicture(const TQImage &_image) {
image=_image;
//- zoomedImage.convertFromImage(image);
setZoom(_zoom);
@@ -168,22 +168,22 @@ void DrawZone::setZoom(double z)
_zoom=z;
imageRect.setHeight(myround(image.height()*_zoom));
imageRect.setWidth(myround(image.width()*_zoom));
- zoomedImage=QPixmap(imageRect.width(),imageRect.height());
- QPainter p(&zoomedImage);
+ zoomedImage=TQPixmap(imageRect.width(),imageRect.height());
+ TQPainter p(&zoomedImage);
p.scale(z,z);
- QPixmap pix;
+ TQPixmap pix;
pix.convertFromImage(image);
// if the picture has transparent areas,
// fill them with Gimp like background
if (pix.mask()) {
- QPixmap backPix(32,32);
- QPainter p2(&backPix);
- p2.fillRect(0,0,32,32,QColor(156,149,156));
- p2.fillRect(0,16,16,16,QColor(98,105,98));
- p2.fillRect(16,0,16,16,QColor(98,105,98));
+ TQPixmap backPix(32,32);
+ TQPainter p2(&backPix);
+ p2.fillRect(0,0,32,32,TQColor(156,149,156));
+ p2.fillRect(0,16,16,16,TQColor(98,105,98));
+ p2.fillRect(16,0,16,16,TQColor(98,105,98));
p2.flush();
- p.setPen(QPen());
- p.fillRect(imageRect.left(),imageRect.top(),imageRect.width(),imageRect.height(),QBrush(QColor("black"),backPix));
+ p.setPen(TQPen());
+ p.fillRect(imageRect.left(),imageRect.top(),imageRect.width(),imageRect.height(),TQBrush(TQColor("black"),backPix));
}
p.drawPixmap(imageRect.left(),imageRect.top(),pix);
p.flush();
@@ -192,31 +192,31 @@ void DrawZone::setZoom(double z)
repaintContents(0,0,contentsWidth(),contentsHeight(),true);
}
-QPoint DrawZone::translateFromZoom(const QPoint & p) const {
- return QPoint((int)(p.x()/_zoom),(int)(p.y()/_zoom));
+TQPoint DrawZone::translateFromZoom(const TQPoint & p) const {
+ return TQPoint((int)(p.x()/_zoom),(int)(p.y()/_zoom));
}
-QRect DrawZone::translateFromZoom(const QRect & p) const {
- return QRect((int)(p.x()/_zoom),(int) (p.y()/_zoom),
+TQRect DrawZone::translateFromZoom(const TQRect & p) const {
+ return TQRect((int)(p.x()/_zoom),(int) (p.y()/_zoom),
(int)(p.width()/_zoom),(int)(p.height()/_zoom));
}
-QPoint DrawZone::translateToZoom(const QPoint & p) const {
- return QPoint(myround(p.x()*_zoom),myround(p.y()*_zoom));
+TQPoint DrawZone::translateToZoom(const TQPoint & p) const {
+ return TQPoint(myround(p.x()*_zoom),myround(p.y()*_zoom));
}
-QRect DrawZone::translateToZoom(const QRect & r) const {
-// return QRect(round(r.x()*_zoom),round(r.y()*_zoom),
+TQRect DrawZone::translateToZoom(const TQRect & r) const {
+// return TQRect(round(r.x()*_zoom),round(r.y()*_zoom),
// round(r.width()*_zoom),round(r.height()*_zoom));
- return QRect((int)(r.x()*_zoom),(int)(r.y()*_zoom),
+ return TQRect((int)(r.x()*_zoom),(int)(r.y()*_zoom),
(int)(r.width()*_zoom+2),(int)(r.height()*_zoom+2));
}
-void DrawZone::contentsMouseDoubleClickEvent(QMouseEvent* e) {
+void DrawZone::contentsMouseDoubleClickEvent(TQMouseEvent* e) {
if ( ! imageMapEditor->isReadWrite())
return;
- QPoint point=e->pos();
+ TQPoint point=e->pos();
point-=imageRect.topLeft();
point=translateFromZoom(point);
if ( currentAction==None &&
@@ -230,7 +230,7 @@ void DrawZone::contentsMouseDoubleClickEvent(QMouseEvent* e) {
}
-void DrawZone::contentsMousePressEvent(QMouseEvent* e)
+void DrawZone::contentsMousePressEvent(TQMouseEvent* e)
{
if ( ! imageMapEditor->isReadWrite())
return;
@@ -251,7 +251,7 @@ void DrawZone::contentsMousePressEvent(QMouseEvent* e)
// Translate it to picture coordinates
drawStart-=imageRect.topLeft();
- QPoint zoomedPoint = drawStart;
+ TQPoint zoomedPoint = drawStart;
drawStart=translateFromZoom(drawStart);
delete oldArea;
oldArea=0L;
@@ -339,7 +339,7 @@ void DrawZone::contentsMousePressEvent(QMouseEvent* e)
{
currentArea=AreaCreator::create(imageMapEditor->currentToolType());
- currentArea->setRect(QRect(drawStart,drawStart));
+ currentArea->setRect(TQRect(drawStart,drawStart));
currentArea->setSelected(false);
imageMapEditor->deselectAll();
@@ -374,7 +374,7 @@ void DrawZone::contentsMousePressEvent(QMouseEvent* e)
}
- QRect r;
+ TQRect r;
if (oldArea)
r=oldArea->selectionRect();
if (currentArea) {
@@ -385,11 +385,11 @@ void DrawZone::contentsMousePressEvent(QMouseEvent* e)
}
-void DrawZone::contentsMouseReleaseEvent(QMouseEvent *e) {
+void DrawZone::contentsMouseReleaseEvent(TQMouseEvent *e) {
if ( ! imageMapEditor->isReadWrite())
return;
- QPoint drawEnd=e->pos();
+ TQPoint drawEnd=e->pos();
// Check if it's on picture if not
// move it to the picture's border
@@ -405,7 +405,7 @@ void DrawZone::contentsMouseReleaseEvent(QMouseEvent *e) {
}
// Translate it to picture coordinates
drawEnd-=imageRect.topLeft();
- QPoint zoomedPoint=drawEnd;
+ TQPoint zoomedPoint=drawEnd;
drawEnd=translateFromZoom(drawEnd);
@@ -441,8 +441,8 @@ void DrawZone::contentsMouseReleaseEvent(QMouseEvent *e) {
new CreateCommand( imageMapEditor, currentArea ), true);
} else
if (currentAction==MoveArea) {
- QPoint p1 = oldArea->rect().topLeft();
- QPoint p2 = imageMapEditor->selected()->rect().topLeft();
+ TQPoint p1 = oldArea->rect().topLeft();
+ TQPoint p2 = imageMapEditor->selected()->rect().topLeft();
if (p1 != p2)
{
@@ -484,7 +484,7 @@ void DrawZone::contentsMouseReleaseEvent(QMouseEvent *e) {
if (currentAction==DoSelect) {
currentAction=None;
- QRect r(drawStart.x(),drawStart.y(),drawCurrent.x()-drawStart.x(),drawCurrent.y()-drawStart.y());
+ TQRect r(drawStart.x(),drawStart.y(),drawCurrent.x()-drawStart.x(),drawCurrent.y()-drawStart.y());
r = r.normalize();
AreaListIterator it=imageMapEditor->areaList();
@@ -518,7 +518,7 @@ void DrawZone::contentsMouseReleaseEvent(QMouseEvent *e) {
}
-void DrawZone::contentsMouseMoveEvent(QMouseEvent *e)
+void DrawZone::contentsMouseMoveEvent(TQMouseEvent *e)
{
if ( ! imageMapEditor->isReadWrite())
return;
@@ -541,20 +541,20 @@ void DrawZone::contentsMouseMoveEvent(QMouseEvent *e)
// Translate to image coordinates
drawCurrent-=imageRect.topLeft();
- QPoint zoomedPoint=drawCurrent;
+ TQPoint zoomedPoint=drawCurrent;
drawCurrent=translateFromZoom(drawCurrent);
if (currentAction==DrawRectangle) {
// To avoid flicker, only repaint the minimum rect
- QRect oldRect=translateToZoom(currentArea->rect());
- currentArea->setRect(QRect(drawStart,drawCurrent).normalize());
- QRect newRect=translateToZoom(currentArea->selectionRect());
- QRect r=oldRect | newRect;
+ TQRect oldRect=translateToZoom(currentArea->rect());
+ currentArea->setRect(TQRect(drawStart,drawCurrent).normalize());
+ TQRect newRect=translateToZoom(currentArea->selectionRect());
+ TQRect r=oldRect | newRect;
repaintContents(r,false);
imageMapEditor->slotUpdateSelectionCoords( currentArea->rect() );
} else
if (currentAction==DrawCircle) {
- QRect oldRect=translateToZoom(currentArea->rect());
+ TQRect oldRect=translateToZoom(currentArea->rect());
// We don't want ellipses
int maxDistance=myabs(drawStart.x()-drawCurrent.x()) >
@@ -571,49 +571,49 @@ void DrawZone::contentsMouseMoveEvent(QMouseEvent *e)
if ( drawStart.y()-drawCurrent.y() > 0)
yDiff=-yDiff;
- QPoint endPoint( drawStart.x()+xDiff, drawStart.y()+yDiff);
+ TQPoint endPoint( drawStart.x()+xDiff, drawStart.y()+yDiff);
- currentArea->setRect(QRect(drawStart,endPoint).normalize());
- QRect newRect=translateToZoom(currentArea->rect());
- QRect r=oldRect | newRect;
+ currentArea->setRect(TQRect(drawStart,endPoint).normalize());
+ TQRect newRect=translateToZoom(currentArea->rect());
+ TQRect r=oldRect | newRect;
repaintContents(r,false);
imageMapEditor->slotUpdateSelectionCoords( currentArea->rect() );
} else
if ( currentAction==DrawPolygon ) {
- QRect oldRect=translateToZoom(currentArea->rect());
+ TQRect oldRect=translateToZoom(currentArea->rect());
currentArea->moveSelectionPoint(currentSelectionPoint,drawCurrent);
- QRect newRect=translateToZoom(currentArea->rect());
- QRect r=oldRect | newRect;
+ TQRect newRect=translateToZoom(currentArea->rect());
+ TQRect r=oldRect | newRect;
repaintContents(r,false);
} else
if ( currentAction==DrawFreehand) {
- QRect oldRect=translateToZoom(currentArea->rect());
+ TQRect oldRect=translateToZoom(currentArea->rect());
currentArea->insertCoord(currentArea->countSelectionPoints(), drawCurrent);
- QRect newRect=translateToZoom(currentArea->rect());
- QRect r=oldRect | newRect;
+ TQRect newRect=translateToZoom(currentArea->rect());
+ TQRect r=oldRect | newRect;
repaintContents(r,false);
} else
if ( currentAction==MoveArea ) {
- QRect oldRect=translateToZoom(currentArea->selectionRect());
+ TQRect oldRect=translateToZoom(currentArea->selectionRect());
currentArea->moveBy((drawCurrent-drawStart).x(),(drawCurrent-drawStart).y());
- QRect newRect=translateToZoom(currentArea->selectionRect());
- QRect r=oldRect | newRect;
+ TQRect newRect=translateToZoom(currentArea->selectionRect());
+ TQRect r=oldRect | newRect;
currentArea->setMoving(true);
repaintContents(r,false);
drawStart=drawCurrent;
imageMapEditor->slotUpdateSelectionCoords();
} else
if ( currentAction==MoveSelectionPoint ) {
- QRect oldRect=translateToZoom(currentArea->selectionRect());
+ TQRect oldRect=translateToZoom(currentArea->selectionRect());
currentArea->moveSelectionPoint(currentSelectionPoint,drawCurrent);
- QRect newRect=translateToZoom(currentArea->selectionRect());
- QRect r=oldRect | newRect;
+ TQRect newRect=translateToZoom(currentArea->selectionRect());
+ TQRect r=oldRect | newRect;
repaintContents(r,false);
imageMapEditor->slotUpdateSelectionCoords();
} else
if (currentAction==DoSelect) {
- QRect r(drawStart.x(),drawStart.y(),drawCurrent.x()-drawStart.x(),drawCurrent.y()-drawStart.y());
+ TQRect r(drawStart.x(),drawStart.y(),drawCurrent.x()-drawStart.x(),drawCurrent.y()-drawStart.y());
r = r.normalize();
// r = translateFromZoom(r);
/*
@@ -634,7 +634,7 @@ void DrawZone::contentsMouseMoveEvent(QMouseEvent *e)
// So we have to create 4 rectangles for every rectangle
// which represent the borders and then repaint them.
- QRect lb,rb,tb,bb;
+ TQRect lb,rb,tb,bb;
createBorderRectangles(translateToZoom(r),lb,rb,tb,bb);
repaintContents(lb,false);
repaintContents(rb,false);
@@ -653,9 +653,9 @@ void DrawZone::contentsMouseMoveEvent(QMouseEvent *e)
//+ imageMapEditor->updateSelection();
-// QRect r(drawStart.x(),drawStart.y(),drawCurrent.x()-drawStart.x(),drawCurrent.y()-drawStart.y());
+// TQRect r(drawStart.x(),drawStart.y(),drawCurrent.x()-drawStart.x(),drawCurrent.y()-drawStart.y());
// r = r.normalize();
-// QRect r2(drawStart.x(),drawStart.y(),drawOld.x()-drawStart.x(),drawOld.y()-drawStart.y());
+// TQRect r2(drawStart.x(),drawStart.y(),drawOld.x()-drawStart.x(),drawOld.y()-drawStart.y());
// r2 = r2.normalize();
// r = translateToZoom(r | r2);
// repaintContents(r,false);
@@ -679,7 +679,7 @@ void DrawZone::contentsMouseMoveEvent(QMouseEvent *e)
}
else
{
- QPoint center=imageMapEditor->selected()->rect().center();
+ TQPoint center=imageMapEditor->selected()->rect().center();
if (drawCurrent.x() < center.x()) {
if (drawCurrent.y() < center.y())
viewport()->setCursor(sizeFDiagCursor);
@@ -726,7 +726,7 @@ void DrawZone::contentsMouseMoveEvent(QMouseEvent *e)
imageMapEditor->slotChangeStatusCoords(drawCurrent.x(),drawCurrent.y());
}
-void DrawZone::createBorderRectangles(const QRect & r,QRect & rb,QRect & lb,QRect & tb,QRect & bb)
+void DrawZone::createBorderRectangles(const TQRect & r,TQRect & rb,TQRect & lb,TQRect & tb,TQRect & bb)
{
int bw;
bw = (int) (2+2*_zoom); // Border width
@@ -753,8 +753,8 @@ void DrawZone::createBorderRectangles(const QRect & r,QRect & rb,QRect & lb,QRec
}
-void DrawZone::resizeEvent(QResizeEvent* e) {
- QScrollView::resizeEvent(e);
+void DrawZone::resizeEvent(TQResizeEvent* e) {
+ TQScrollView::resizeEvent(e);
int width=(int) (image.width()*_zoom);
int height=(int) (image.height()*_zoom);
if (visibleWidth()>width)
@@ -779,7 +779,7 @@ void DrawZone::cancelDrawing()
)
{
currentAction = None;
- QRect r = translateToZoom(currentArea->selectionRect());
+ TQRect r = translateToZoom(currentArea->selectionRect());
delete currentArea;
currentArea = 0L;
repaintContents(r,false);
@@ -791,39 +791,39 @@ void DrawZone::repaintArea(const Area & a) {
repaintContents(translateToZoom(a.selectionRect()),false);
}
-void DrawZone::repaintRect(const QRect & r) {
+void DrawZone::repaintRect(const TQRect & r) {
repaintContents(translateToZoom(r),false);
}
-void DrawZone::drawContents(QPainter* p,int clipx,int clipy,int clipw,int cliph)
+void DrawZone::drawContents(TQPainter* p,int clipx,int clipy,int clipw,int cliph)
{
// Erase background without flicker
- QRect updateRect(clipx,clipy,clipw,cliph);
+ TQRect updateRect(clipx,clipy,clipw,cliph);
// Pixmap for double-buffering
- QPixmap doubleBuffer(updateRect.size());
+ TQPixmap doubleBuffer(updateRect.size());
if (doubleBuffer.isNull())
return;
- QPainter p2(&doubleBuffer);
+ TQPainter p2(&doubleBuffer);
p2.drawPixmap(0,0,zoomedImage,clipx,clipy,clipw,cliph);
p2.setBackgroundColor(p->backgroundColor());
if (zoomedImage.width() < (clipw+clipx) ) {
int eraseWidth = clipw+clipx - zoomedImage.width();
- p2.eraseRect( QRect(clipw-eraseWidth,0,eraseWidth,cliph) );
+ p2.eraseRect( TQRect(clipw-eraseWidth,0,eraseWidth,cliph) );
}
if (zoomedImage.height() < (cliph+clipy) ) {
int eraseHeight = cliph+clipy - zoomedImage.height();
- p2.eraseRect( QRect(0,cliph-eraseHeight,clipw,eraseHeight) );
+ p2.eraseRect( TQRect(0,cliph-eraseHeight,clipw,eraseHeight) );
}
p2.translate(-clipx, -clipy);
p2.scale(_zoom,_zoom);
- QRect areaUpdateRect;
+ TQRect areaUpdateRect;
areaUpdateRect.setX(myround(clipx/_zoom)-1);
areaUpdateRect.setY(myround(clipy/_zoom)-1);
areaUpdateRect.setWidth(myround(clipw/_zoom)+2);
@@ -847,12 +847,12 @@ void DrawZone::drawContents(QPainter* p,int clipx,int clipy,int clipw,int cliph)
if (currentAction == DoSelect )
{
- QPen pen = QPen(QColor("white"),1);
+ TQPen pen = TQPen(TQColor("white"),1);
p2.setRasterOp(Qt::XorROP);
pen.setStyle(Qt::DotLine);
p2.setPen(pen);
- QRect r( drawStart.x(),drawStart.y(),drawCurrent.x()-drawStart.x(),drawCurrent.y()-drawStart.y());
+ TQRect r( drawStart.x(),drawStart.y(),drawCurrent.x()-drawStart.x(),drawCurrent.y()-drawStart.y());
r = r.normalize();
p2.drawRect(r);
}
@@ -867,7 +867,7 @@ void DrawZone::drawContents(QPainter* p,int clipx,int clipy,int clipw,int cliph)
}
-void DrawZone::contentsDragEnterEvent(QDragEnterEvent*e) {
+void DrawZone::contentsDragEnterEvent(TQDragEnterEvent*e) {
if (!KURLDrag::canDecode(e))
return;
@@ -881,13 +881,13 @@ void DrawZone::contentsDragEnterEvent(QDragEnterEvent*e) {
e->accept();
}
-void DrawZone::contentsDropEvent( QDropEvent* e) {
+void DrawZone::contentsDropEvent( TQDropEvent* e) {
viewportDropEvent(e);
}
-void DrawZone::viewportDropEvent( QDropEvent* e) {
+void DrawZone::viewportDropEvent( TQDropEvent* e) {
KURL::List urlList;
// A file from konqueror was dropped
if (KURLDrag::decode(e,urlList)) {
diff --git a/kimagemapeditor/drawzone.h b/kimagemapeditor/drawzone.h
index 764e6951..58887288 100644
--- a/kimagemapeditor/drawzone.h
+++ b/kimagemapeditor/drawzone.h
@@ -18,11 +18,11 @@
#ifndef IMAGEMAP_H
#define IMAGEMAP_H
-#include <qscrollview.h>
-#include <qimage.h>
-#include <qpoint.h>
-#include <qrect.h>
-#include <qcursor.h>
+#include <tqscrollview.h>
+#include <tqimage.h>
+#include <tqpoint.h>
+#include <tqrect.h>
+#include <tqcursor.h>
#include "kdeversion.h"
@@ -35,39 +35,39 @@ class Area;
*@internal
*@see Area
*/
-class DrawZone : public QScrollView {
+class DrawZone : public TQScrollView {
public:
- DrawZone(QWidget *parent,KImageMapEditor* _imageMapEditor);
+ DrawZone(TQWidget *parent,KImageMapEditor* _imageMapEditor);
~DrawZone();
- QImage picture() const;
+ TQImage picture() const;
void repaintArea(const Area & a);
- void repaintRect(const QRect & r);
+ void repaintRect(const TQRect & r);
void cancelDrawing();
- void setPicture(const QImage &_image);
+ void setPicture(const TQImage &_image);
void setZoom(double z);
- QPoint translateFromZoom(const QPoint & p) const;
- QRect translateFromZoom(const QRect & p) const;
- QPoint translateToZoom(const QPoint & p) const;
- QRect translateToZoom(const QRect & p) const;
+ TQPoint translateFromZoom(const TQPoint & p) const;
+ TQRect translateFromZoom(const TQRect & p) const;
+ TQPoint translateToZoom(const TQPoint & p) const;
+ TQRect translateToZoom(const TQRect & p) const;
- QRect getImageRect() const { return image.rect(); }
+ TQRect getImageRect() const { return image.rect(); }
protected:
- virtual void contentsMouseDoubleClickEvent(QMouseEvent*);
- virtual void contentsMousePressEvent(QMouseEvent*);
- virtual void contentsMouseReleaseEvent(QMouseEvent*);
- virtual void contentsMouseMoveEvent(QMouseEvent*);
- virtual void resizeEvent(QResizeEvent*);
- virtual void drawContents(QPainter*,int,int,int,int);
- virtual void viewportDropEvent(QDropEvent*);
- virtual void contentsDragEnterEvent(QDragEnterEvent*);
- virtual void contentsDropEvent(QDropEvent*);
+ virtual void contentsMouseDoubleClickEvent(TQMouseEvent*);
+ virtual void contentsMousePressEvent(TQMouseEvent*);
+ virtual void contentsMouseReleaseEvent(TQMouseEvent*);
+ virtual void contentsMouseMoveEvent(TQMouseEvent*);
+ virtual void resizeEvent(TQResizeEvent*);
+ virtual void drawContents(TQPainter*,int,int,int,int);
+ virtual void viewportDropEvent(TQDropEvent*);
+ virtual void contentsDragEnterEvent(TQDragEnterEvent*);
+ virtual void contentsDropEvent(TQDropEvent*);
/**
* Represents whats currently going on
@@ -80,7 +80,7 @@ protected:
*/
enum DrawAction { None, DrawCircle, DrawRectangle, DrawPolygon, DrawFreehand, MoveSelectionPoint, MoveArea, DoSelect, RemovePoint, AddPoint };
- void createBorderRectangles(const QRect & r,QRect & rb,QRect & lb,QRect & tb,QRect & bb);
+ void createBorderRectangles(const TQRect & r,TQRect & rb,TQRect & lb,TQRect & tb,TQRect & bb);
private:
@@ -88,33 +88,33 @@ private:
// The currently drawing area
Area *currentArea;
// Needed when moving selectionpoints
- QRect *currentSelectionPoint;
+ TQRect *currentSelectionPoint;
// The point where the user clicked the mouse
- QPoint drawStart;
- QPoint drawCurrent;
+ TQPoint drawStart;
+ TQPoint drawCurrent;
// The original image
- QImage image;
+ TQImage image;
KImageMapEditor *imageMapEditor;
// Only the rect of the zoomed image, perhaps redundant
- QRect imageRect;
+ TQRect imageRect;
// Only for repaint issues
Area *oldArea;
- QRect oldSelectionRect;
+ TQRect oldSelectionRect;
// Holds the zoomed image for efficiency reasons
- QPixmap zoomedImage;
+ TQPixmap zoomedImage;
// The current zoom-factor
double _zoom;
- QCursor RectangleCursor;
- QCursor CircleCursor;
- QCursor PolygonCursor;
- QCursor FreehandCursor;
- QCursor AddPointCursor;
- QCursor RemovePointCursor;
+ TQCursor RectangleCursor;
+ TQCursor CircleCursor;
+ TQCursor PolygonCursor;
+ TQCursor FreehandCursor;
+ TQCursor AddPointCursor;
+ TQCursor RemovePointCursor;
};
-inline QImage DrawZone::picture() const {
+inline TQImage DrawZone::picture() const {
return image;
}
diff --git a/kimagemapeditor/imagemap.cpp b/kimagemapeditor/imagemap.cpp
index 665ef000..4489508d 100644
--- a/kimagemapeditor/imagemap.cpp
+++ b/kimagemapeditor/imagemap.cpp
@@ -17,9 +17,9 @@
#include "imagemap.h"
#include "kimagemapeditor.h"
-#include "qpainter.h"
+#include "tqpainter.h"
#include "kdebug.h"
-#include <qbitmap.h>
+#include <tqbitmap.h>
int round(double d) {
if ( (d-((int) d)) < 0.5 )
@@ -28,11 +28,11 @@ int round(double d) {
return ((int) d)+1;
}
-ImageMap::ImageMap(QWidget *parent,KImageMapEditor* _imageMapEditor)
- : QScrollView(parent)
+ImageMap::ImageMap(TQWidget *parent,KImageMapEditor* _imageMapEditor)
+ : TQScrollView(parent)
{
imageMapEditor=_imageMapEditor;
-// setPicture(QImage());
+// setPicture(TQImage());
currentAction=None;
currentArea=0L;
eraseOldArea=false;
@@ -46,7 +46,7 @@ ImageMap::ImageMap(QWidget *parent,KImageMapEditor* _imageMapEditor)
ImageMap::~ImageMap(){
}
-void ImageMap::setPicture(const QImage &_image) {
+void ImageMap::setPicture(const TQImage &_image) {
image=_image;
zoomedImage.convertFromImage(image);
setZoom(_zoom);
@@ -56,22 +56,22 @@ void ImageMap::setZoom(double z) {
_zoom=z;
imageRect.setHeight(image.height()*_zoom);
imageRect.setWidth(image.width()*_zoom);
- zoomedImage=QPixmap(imageRect.width(),imageRect.height());
- QPainter p(&zoomedImage);
+ zoomedImage=TQPixmap(imageRect.width(),imageRect.height());
+ TQPainter p(&zoomedImage);
p.scale(z,z);
- QPixmap pix;
+ TQPixmap pix;
pix.convertFromImage(image);
// if the picture has transparent areas,
// fill them with Gimp like background
if (pix.mask()) {
- QPixmap backPix(32,32);
- QPainter p2(&backPix);
- p2.fillRect(0,0,32,32,QColor(156,149,156));
- p2.fillRect(0,16,16,16,QColor(98,105,98));
- p2.fillRect(16,0,16,16,QColor(98,105,98));
+ TQPixmap backPix(32,32);
+ TQPainter p2(&backPix);
+ p2.fillRect(0,0,32,32,TQColor(156,149,156));
+ p2.fillRect(0,16,16,16,TQColor(98,105,98));
+ p2.fillRect(16,0,16,16,TQColor(98,105,98));
p2.flush();
- p.setPen(QPen());
- p.fillRect(imageRect.left(),imageRect.top(),imageRect.width(),imageRect.height(),QBrush(QColor("black"),backPix));
+ p.setPen(TQPen());
+ p.fillRect(imageRect.left(),imageRect.top(),imageRect.width(),imageRect.height(),TQBrush(TQColor("black"),backPix));
}
p.drawPixmap(imageRect.left(),imageRect.top(),pix);
p.flush();
@@ -80,21 +80,21 @@ void ImageMap::setZoom(double z) {
repaintContents(0,0,contentsWidth(),contentsHeight(),true);
}
-QPoint ImageMap::translateFromZoom(const QPoint & p) const {
- return QPoint(p.x()/_zoom,p.y()/_zoom);
+TQPoint ImageMap::translateFromZoom(const TQPoint & p) const {
+ return TQPoint(p.x()/_zoom,p.y()/_zoom);
}
-QPoint ImageMap::translateToZoom(const QPoint & p) const {
- return QPoint(round(p.x()*_zoom),round(p.y()*_zoom));
+TQPoint ImageMap::translateToZoom(const TQPoint & p) const {
+ return TQPoint(round(p.x()*_zoom),round(p.y()*_zoom));
}
-QRect ImageMap::translateToZoom(const QRect & r) const {
- return QRect(round(r.x()*_zoom),round(r.y()*_zoom),
+TQRect ImageMap::translateToZoom(const TQRect & r) const {
+ return TQRect(round(r.x()*_zoom),round(r.y()*_zoom),
round(r.width()*_zoom),round(r.height()*_zoom));
}
-void ImageMap::contentsMouseDoubleClickEvent(QMouseEvent* e) {
- QPoint point=e->pos();
+void ImageMap::contentsMouseDoubleClickEvent(TQMouseEvent* e) {
+ TQPoint point=e->pos();
point-=imageRect.topLeft();
point=translateFromZoom(point);
if ( currentAction==None &&
@@ -103,7 +103,7 @@ void ImageMap::contentsMouseDoubleClickEvent(QMouseEvent* e) {
}
-void ImageMap::contentsMousePressEvent(QMouseEvent* e) {
+void ImageMap::contentsMousePressEvent(TQMouseEvent* e) {
drawStart=e->pos();
// Check if it's on picture if not
// move it to the picture's border
@@ -141,7 +141,7 @@ void ImageMap::contentsMousePressEvent(QMouseEvent* e) {
} else
if (imageMapEditor->currentShapeType()!=Area::None) {
currentArea=new Area(imageMapEditor->currentShapeType());
- currentArea->setRect(QRect(drawStart,drawStart));
+ currentArea->setRect(TQRect(drawStart,drawStart));
currentArea->setSelected(false);
if (imageMapEditor->selected())
imageMapEditor->selected()->setSelected(false);
@@ -167,7 +167,7 @@ void ImageMap::contentsMousePressEvent(QMouseEvent* e) {
}
- QRect r;
+ TQRect r;
if (oldArea)
r=oldArea->selectionRect();
if (currentArea) {
@@ -177,7 +177,7 @@ void ImageMap::contentsMousePressEvent(QMouseEvent* e) {
}
-void ImageMap::contentsMouseReleaseEvent(QMouseEvent *e) {
+void ImageMap::contentsMouseReleaseEvent(TQMouseEvent *e) {
drawEnd=e->pos();
// Check if it's on picture if not
@@ -238,7 +238,7 @@ void ImageMap::contentsMouseReleaseEvent(QMouseEvent *e) {
}
-void ImageMap::contentsMouseMoveEvent(QMouseEvent *e) {
+void ImageMap::contentsMouseMoveEvent(TQMouseEvent *e) {
drawCurrent=e->pos();
// If outside the image
@@ -260,51 +260,51 @@ void ImageMap::contentsMouseMoveEvent(QMouseEvent *e) {
if (currentAction==DrawRectangle) {
// To avoid flicker, only repaint the minimum rect
- QRect oldRect=translateToZoom(currentArea->rect());
- currentArea->setRect(QRect(drawStart,drawCurrent).normalize());
- QRect newRect=translateToZoom(currentArea->rect());
- QRect r=oldRect | newRect;
+ TQRect oldRect=translateToZoom(currentArea->rect());
+ currentArea->setRect(TQRect(drawStart,drawCurrent).normalize());
+ TQRect newRect=translateToZoom(currentArea->rect());
+ TQRect r=oldRect | newRect;
repaintContents(r,false);
imageMapEditor->slotUpdateSelectionCoords(currentArea->rect());
} else
if (currentAction==DrawCircle) {
- QRect oldRect=translateToZoom(currentArea->rect());
- currentArea->setRect(QRect(drawStart,drawCurrent).normalize());
- QRect newRect=translateToZoom(currentArea->rect());
- QRect r=oldRect | newRect;
+ TQRect oldRect=translateToZoom(currentArea->rect());
+ currentArea->setRect(TQRect(drawStart,drawCurrent).normalize());
+ TQRect newRect=translateToZoom(currentArea->rect());
+ TQRect r=oldRect | newRect;
repaintContents(r,false);
imageMapEditor->slotUpdateSelectionCoords(currentArea->rect());
} else
if ( currentAction==DrawPolygon ) {
- QRect oldRect=translateToZoom(currentArea->rect());
+ TQRect oldRect=translateToZoom(currentArea->rect());
currentArea->moveSelectionPoint(currentSelectionPoint,drawCurrent);
- QRect newRect=translateToZoom(currentArea->rect());
- QRect r=oldRect | newRect;
+ TQRect newRect=translateToZoom(currentArea->rect());
+ TQRect r=oldRect | newRect;
repaintContents(r,false);
imageMapEditor->slotUpdateSelectionCoords(currentArea->rect());
} else
if ( currentAction==MoveArea ) {
- QRect oldRect=translateToZoom(currentArea->selectionRect());
+ TQRect oldRect=translateToZoom(currentArea->selectionRect());
currentArea->moveBy((drawCurrent-drawStart).x(),(drawCurrent-drawStart).y());
- QRect newRect=translateToZoom(currentArea->selectionRect());
- QRect r=oldRect | newRect;
+ TQRect newRect=translateToZoom(currentArea->selectionRect());
+ TQRect r=oldRect | newRect;
repaintContents(r,false);
drawStart=drawCurrent;
imageMapEditor->slotUpdateSelectionCoords();
} else
if ( currentAction==MoveSelectionPoint ) {
- QRect oldRect=translateToZoom(currentArea->selectionRect());
+ TQRect oldRect=translateToZoom(currentArea->selectionRect());
currentArea->moveSelectionPoint(currentSelectionPoint,drawCurrent);
- QRect newRect=translateToZoom(currentArea->selectionRect());
- QRect r=oldRect | newRect;
+ TQRect newRect=translateToZoom(currentArea->selectionRect());
+ TQRect r=oldRect | newRect;
repaintContents(r,false);
imageMapEditor->slotUpdateSelectionCoords();
}
imageMapEditor->slotChangeStatusCoords(drawCurrent.x(),drawCurrent.y());
}
-void ImageMap::resizeEvent(QResizeEvent* e) {
- QScrollView::resizeEvent(e);
+void ImageMap::resizeEvent(TQResizeEvent* e) {
+ TQScrollView::resizeEvent(e);
int width=(int) (image.width()*_zoom);
int height=(int) (image.height()*_zoom);
if (visibleWidth()>width)
@@ -325,7 +325,7 @@ void ImageMap::repaintArea(const Area & a) {
repaintContents(translateToZoom(a.selectionRect()),false);
}
-void ImageMap::drawContents(QPainter* p,int clipx,int clipy,int clipw,int cliph) {
+void ImageMap::drawContents(TQPainter* p,int clipx,int clipy,int clipw,int cliph) {
// kdDebug() << "drawing\n" << endl;
// p.scale(rect.width()*2,rect.height()*2);
// if (e->rect()!=rect()) {
@@ -334,16 +334,16 @@ void ImageMap::drawContents(QPainter* p,int clipx,int clipy,int clipw,int cliph)
// } else
/* if (currentAction==DrawRectangle) {
p->setClipping(true);
- QRect r(currentArea->rect());
+ TQRect r(currentArea->rect());
r.moveBy(imageRect.left()-5,imageRect.top()-5);
- r.setSize(r.size()+QSize(10,10));
+ r.setSize(r.size()+TQSize(10,10));
p->setClipRegion(r);
}
*/
- QRect updateRect(clipx,clipy,clipw,cliph);
- QPixmap doubleBuffer(updateRect.size()); // Pixmap for double-buffering
- QPainter p2(&doubleBuffer);
+ TQRect updateRect(clipx,clipy,clipw,cliph);
+ TQPixmap doubleBuffer(updateRect.size()); // Pixmap for double-buffering
+ TQPainter p2(&doubleBuffer);
p2.drawPixmap(0,0,zoomedImage,clipx,clipy,clipw,cliph);
p2.translate(-updateRect.x(), -updateRect.y());
p2.scale(_zoom,_zoom);
@@ -365,8 +365,8 @@ void ImageMap::drawContents(QPainter* p,int clipx,int clipy,int clipw,int cliph)
// Copy the double buffer into the widget
p->drawPixmap(clipx,clipy,doubleBuffer);
// Erase background without flicker
- QRegion region(contentsX(),contentsY(),visibleWidth(),visibleHeight());
- region=region.subtract(QRegion(imageRect));
+ TQRegion region(contentsX(),contentsY(),visibleWidth(),visibleHeight());
+ region=region.subtract(TQRegion(imageRect));
for (int i=0;i<region.rects().count();i++) {
p->eraseRect(region.rects()[i]);
}
diff --git a/kimagemapeditor/imagemap.h b/kimagemapeditor/imagemap.h
index 7576baa0..fe14c9d4 100644
--- a/kimagemapeditor/imagemap.h
+++ b/kimagemapeditor/imagemap.h
@@ -18,10 +18,10 @@
#ifndef IMAGEMAP_H
#define IMAGEMAP_H
-#include <qscrollview.h>
-#include <qimage.h>
-#include <qpoint.h>
-#include <qrect.h>
+#include <tqscrollview.h>
+#include <tqimage.h>
+#include <tqpoint.h>
+#include <tqrect.h>
#include "kdeversion.h"
@@ -31,45 +31,45 @@
class KImageMapEditor;
class Area;
-class ImageMap : public QScrollView {
+class ImageMap : public TQScrollView {
public:
enum DrawAction { None, DrawCircle, DrawRectangle, DrawPolygon, MoveSelectionPoint, MoveArea };
private:
- QRect imageRect;
- QPoint drawStart;
- QPoint drawCurrent;
- QPoint drawEnd;
+ TQRect imageRect;
+ TQPoint drawStart;
+ TQPoint drawCurrent;
+ TQPoint drawEnd;
bool eraseOldArea;
Area *oldArea;
// Holds the original image
- QImage image;
+ TQImage image;
// Holds the zoomed image for efficiency reasons
- QPixmap zoomedImage;
+ TQPixmap zoomedImage;
Area *currentArea;
DrawAction currentAction;
- QRect *currentSelectionPoint;
+ TQRect *currentSelectionPoint;
KImageMapEditor *imageMapEditor;
double _zoom;
public:
- ImageMap(QWidget *parent,KImageMapEditor* _imageMapEditor);
+ ImageMap(TQWidget *parent,KImageMapEditor* _imageMapEditor);
~ImageMap();
void setZoom(double z);
- void setPicture(const QImage &_image);
+ void setPicture(const TQImage &_image);
void repaintArea(const Area & a);
- QImage picture() const;
- QPoint translateFromZoom(const QPoint & p) const;
- QPoint translateToZoom(const QPoint & p) const;
- QRect translateToZoom(const QRect & p) const;
+ TQImage picture() const;
+ TQPoint translateFromZoom(const TQPoint & p) const;
+ TQPoint translateToZoom(const TQPoint & p) const;
+ TQRect translateToZoom(const TQRect & p) const;
protected:
- virtual void contentsMousePressEvent(QMouseEvent* e);
- virtual void contentsMouseDoubleClickEvent(QMouseEvent* e);
- virtual void contentsMouseReleaseEvent(QMouseEvent *e);
- virtual void contentsMouseMoveEvent(QMouseEvent *e);
- virtual void resizeEvent(QResizeEvent* e);
- virtual void drawContents(QPainter* p,int clipx,int clipy,int clipw,int cliph);
+ virtual void contentsMousePressEvent(TQMouseEvent* e);
+ virtual void contentsMouseDoubleClickEvent(TQMouseEvent* e);
+ virtual void contentsMouseReleaseEvent(TQMouseEvent *e);
+ virtual void contentsMouseMoveEvent(TQMouseEvent *e);
+ virtual void resizeEvent(TQResizeEvent* e);
+ virtual void drawContents(TQPainter* p,int clipx,int clipy,int clipw,int cliph);
};
-inline QImage ImageMap::picture() const {
+inline TQImage ImageMap::picture() const {
return image;
}
diff --git a/kimagemapeditor/imageslistview.cpp b/kimagemapeditor/imageslistview.cpp
index 55992101..7db15e1e 100644
--- a/kimagemapeditor/imageslistview.cpp
+++ b/kimagemapeditor/imageslistview.cpp
@@ -16,7 +16,7 @@
***************************************************************************/
// QT
-#include <qptrlist.h>
+#include <tqptrlist.h>
// KDE
@@ -27,7 +27,7 @@
#include "imageslistview.h"
ImagesListViewItem::ImagesListViewItem(ImagesListView* parent, ImageTag* tag)
- : QListViewItem(parent)
+ : TQListViewItem(parent)
{
_imageTag = tag;
update();
@@ -35,8 +35,8 @@ ImagesListViewItem::ImagesListViewItem(ImagesListView* parent, ImageTag* tag)
void ImagesListViewItem::update() {
- QString src="";
- QString usemap="";
+ TQString src="";
+ TQString usemap="";
if (_imageTag->find("src"))
src=*_imageTag->find("src");
if (_imageTag->find("usemap"))
@@ -51,7 +51,7 @@ ImageTag* ImagesListViewItem::imageTag() {
}
-ImagesListView::ImagesListView(QWidget *parent, const char *name)
+ImagesListView::ImagesListView(TQWidget *parent, const char *name)
: KListView(parent, name)
{
addColumn(i18n("Images"));
@@ -60,8 +60,8 @@ ImagesListView::ImagesListView(QWidget *parent, const char *name)
setFullWidth(true);
- connect( this, SIGNAL( selectionChanged(QListViewItem*)),
- this, SLOT( slotSelectionChanged(QListViewItem*)));
+ connect( this, TQT_SIGNAL( selectionChanged(TQListViewItem*)),
+ this, TQT_SLOT( slotSelectionChanged(TQListViewItem*)));
}
@@ -79,7 +79,7 @@ void ImagesListView::addImage(ImageTag* tag)
new ImagesListViewItem(this, tag);
}
-void ImagesListView::addImages(QPtrList<ImageTag> * images)
+void ImagesListView::addImages(TQPtrList<ImageTag> * images)
{
for (ImageTag *tag = images->first(); tag!=0L; tag=images->next()) {
addImage(tag);
@@ -87,7 +87,7 @@ void ImagesListView::addImages(QPtrList<ImageTag> * images)
}
void ImagesListView::clear() {
- QListView::clear();
+ TQListView::clear();
}
void ImagesListView::removeImage(ImageTag* tag) {
@@ -114,7 +114,7 @@ ImagesListViewItem* ImagesListView::findListViewItem(ImageTag* tag) {
kdDebug() << "ImageListView::findListViewItem: start searching ... " << endl;
- for (QListViewItem* item = firstChild(); item ; item = item->nextSibling()) {
+ for (TQListViewItem* item = firstChild(); item ; item = item->nextSibling()) {
ImagesListViewItem *imageItem = static_cast<ImagesListViewItem*>(item);
if (imageItem->imageTag() == tag) {
kdDebug() << "ImageListView::findListViewItem: found it " << endl;
@@ -128,8 +128,8 @@ ImagesListViewItem* ImagesListView::findListViewItem(ImageTag* tag) {
}
-void ImagesListView::slotSelectionChanged(QListViewItem* item) {
- QString src = item->text(0);
+void ImagesListView::slotSelectionChanged(TQListViewItem* item) {
+ TQString src = item->text(0);
emit imageSelected(KURL(_baseUrl,src));
}
diff --git a/kimagemapeditor/imageslistview.h b/kimagemapeditor/imageslistview.h
index 55680405..ede6a87b 100644
--- a/kimagemapeditor/imageslistview.h
+++ b/kimagemapeditor/imageslistview.h
@@ -49,7 +49,7 @@ class ImagesListView : public KListView
Q_OBJECT
public:
- ImagesListView(QWidget *parent, const char *name);
+ ImagesListView(TQWidget *parent, const char *name);
virtual ~ImagesListView();
/**
@@ -60,7 +60,7 @@ public:
/**
* Adds images
*/
- void addImages(QPtrList<ImageTag> *);
+ void addImages(TQPtrList<ImageTag> *);
/**
* Removes the given image from the list
@@ -93,7 +93,7 @@ public:
void setBaseUrl(const KURL & url) { _baseUrl = url; };
protected slots:
- void slotSelectionChanged(QListViewItem*);
+ void slotSelectionChanged(TQListViewItem*);
signals:
void imageSelected(const KURL &);
diff --git a/kimagemapeditor/kimagemapeditor.cpp b/kimagemapeditor/kimagemapeditor.cpp
index ebfb0c7f..6a71f3a6 100644
--- a/kimagemapeditor/kimagemapeditor.cpp
+++ b/kimagemapeditor/kimagemapeditor.cpp
@@ -19,24 +19,24 @@
#include <assert.h>
// QT
-#include <qlayout.h>
-#include <qlistview.h>
-#include <qpushbutton.h>
-#include <qvbox.h>
-#include <qpixmap.h>
-#include <qcombobox.h>
-#include <qsplitter.h>
-#include <qfileinfo.h>
-#include <qmultilineedit.h>
-#include <qtextstream.h>
-#include <qpopupmenu.h>
-#include <qdict.h>
-#include <qwhatsthis.h>
-#include <qtooltip.h>
-#include <qpainter.h>
-#include <qtabwidget.h>
-#include <qfontdatabase.h>
-#include <qfile.h>
+#include <tqlayout.h>
+#include <tqlistview.h>
+#include <tqpushbutton.h>
+#include <tqvbox.h>
+#include <tqpixmap.h>
+#include <tqcombobox.h>
+#include <tqsplitter.h>
+#include <tqfileinfo.h>
+#include <tqmultilineedit.h>
+#include <tqtextstream.h>
+#include <tqpopupmenu.h>
+#include <tqdict.h>
+#include <tqwhatsthis.h>
+#include <tqtooltip.h>
+#include <tqpainter.h>
+#include <tqtabwidget.h>
+#include <tqfontdatabase.h>
+#include <tqfile.h>
// KDE
#include <kcommand.h>
@@ -61,7 +61,7 @@
#if KDE_IS_VERSION(3,1,90)
#include <kinputdialog.h>
#else
-#include <qinputdialog.h>
+#include <tqinputdialog.h>
#endif
// local
@@ -84,8 +84,8 @@
typedef KParts::GenericFactory<KImageMapEditor> KimeFactory;
K_EXPORT_COMPONENT_FACTORY( libkimagemapeditor , KimeFactory )
-KImageMapEditor::KImageMapEditor(QWidget *parentWidget, const char *,
- QObject *parent, const char *name, const QStringList & )
+KImageMapEditor::KImageMapEditor(TQWidget *parentWidget, const char *,
+ TQObject *parent, const char *name, const TQStringList & )
: KParts::ReadWritePart(parent,name)
{
setInstance( KimeFactory::instance() );
@@ -95,7 +95,7 @@ KImageMapEditor::KImageMapEditor(QWidget *parentWidget, const char *,
// Test if the MainWindow can handle DockWindows, if so create DockWidgets
// instead of a Splitter
mainDock = dynamic_cast<KDockMainWindow*>(parent) ;
- QSplitter * splitter = 0L;
+ TQSplitter * splitter = 0L;
tabWidget = 0L;
if (mainDock) {
@@ -118,15 +118,15 @@ KImageMapEditor::KImageMapEditor(QWidget *parentWidget, const char *,
mapsDock->manualDock( (KDockWidget*) areaDock, KDockWidget::DockCenter);
imagesDock->manualDock( (KDockWidget*) mapsDock, KDockWidget::DockCenter);
- connect( mainDock->manager(), SIGNAL(change()), this, SLOT(dockingStateChanged()));
+ connect( mainDock->manager(), TQT_SIGNAL(change()), this, TQT_SLOT(dockingStateChanged()));
}
else
{
areaDock = 0L;
mapsDock = 0L;
imagesDock = 0L;
- splitter = new QSplitter(parentWidget);
- tabWidget = new QTabWidget(splitter);
+ splitter = new TQSplitter(parentWidget);
+ tabWidget = new TQTabWidget(splitter);
areaListView = new AreaListView(tabWidget,"AreaListView");
mapsListView = new MapsListView(tabWidget, "MapsListView");
imagesListView = new ImagesListView(tabWidget, "ImagesListView");
@@ -137,30 +137,30 @@ KImageMapEditor::KImageMapEditor(QWidget *parentWidget, const char *,
}
- connect( areaListView->listView, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()));
- connect( areaListView->listView, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(showTagEditor(QListViewItem*)));
- connect( areaListView->listView, SIGNAL(rightButtonPressed(QListViewItem*,const QPoint &,int)), this,
- SLOT(slotShowPopupMenu(QListViewItem*,const QPoint &)));
+ connect( areaListView->listView, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotSelectionChanged()));
+ connect( areaListView->listView, TQT_SIGNAL(doubleClicked(TQListViewItem*)), this, TQT_SLOT(showTagEditor(TQListViewItem*)));
+ connect( areaListView->listView, TQT_SIGNAL(rightButtonPressed(TQListViewItem*,const TQPoint &,int)), this,
+ TQT_SLOT(slotShowPopupMenu(TQListViewItem*,const TQPoint &)));
- connect( mapsListView, SIGNAL( mapSelected(const QString &)),
- this, SLOT( setMap(const QString &)));
+ connect( mapsListView, TQT_SIGNAL( mapSelected(const TQString &)),
+ this, TQT_SLOT( setMap(const TQString &)));
- connect( mapsListView, SIGNAL( mapRenamed(const QString &)),
- this, SLOT( setMapName(const QString &)));
+ connect( mapsListView, TQT_SIGNAL( mapRenamed(const TQString &)),
+ this, TQT_SLOT( setMapName(const TQString &)));
- connect( mapsListView->listView(), SIGNAL(rightButtonPressed(QListViewItem*,const QPoint &,int)), this,
- SLOT(slotShowMapPopupMenu(QListViewItem*,const QPoint &)));
+ connect( mapsListView->listView(), TQT_SIGNAL(rightButtonPressed(TQListViewItem*,const TQPoint &,int)), this,
+ TQT_SLOT(slotShowMapPopupMenu(TQListViewItem*,const TQPoint &)));
- connect( imagesListView, SIGNAL( imageSelected(const KURL &)),
- this, SLOT( setPicture(const KURL &)));
+ connect( imagesListView, TQT_SIGNAL( imageSelected(const KURL &)),
+ this, TQT_SLOT( setPicture(const KURL &)));
- connect( imagesListView, SIGNAL(rightButtonPressed(QListViewItem*,const QPoint &,int)), this,
- SLOT(slotShowImagePopupMenu(QListViewItem*,const QPoint &)));
+ connect( imagesListView, TQT_SIGNAL(rightButtonPressed(TQListViewItem*,const TQPoint &,int)), this,
+ TQT_SLOT(slotShowImagePopupMenu(TQListViewItem*,const TQPoint &)));
// Shows the text:
// "Drop an image or html file"
-/* QString path = KGlobal::dirs()->findResourceDir( "data", "kimagemapeditor/dropimage.png" ) + "kimagemapeditor/dropimage.png";
- if ( ! QFileInfo(path).exists() ) {
+/* TQString path = KGlobal::dirs()->findResourceDir( "data", "kimagemapeditor/dropimage.png" ) + "kimagemapeditor/dropimage.png";
+ if ( ! TQFileInfo(path).exists() ) {
kdError() << "Couldn't find needed dropimage.png file in "
"the data directory of KImageMapEditor.\n"
"Perhaps you have forgotten to do a make install !" << endl;
@@ -170,8 +170,8 @@ KImageMapEditor::KImageMapEditor(QWidget *parentWidget, const char *,
if (splitter) {
drawZone = new DrawZone(splitter,this);
- splitter->setResizeMode(drawZone,QSplitter::Stretch);
- splitter->setResizeMode(tabWidget,QSplitter::KeepSize);
+ splitter->setResizeMode(drawZone,TQSplitter::Stretch);
+ splitter->setResizeMode(tabWidget,TQSplitter::KeepSize);
setWidget(splitter);
} else {
drawZone = new DrawZone(parentWidget,this);
@@ -225,14 +225,14 @@ KImageMapEditor::~KImageMapEditor() {
MapTag::MapTag() {
modified = false;
- name = QString::null;
+ name = TQString::null;
}
void KImageMapEditor::init()
{
_htmlContent.clear();
- _imageUrl = QString::null;
- m_url = QString::null;
+ _imageUrl = TQString::null;
+ m_url = TQString::null;
HtmlElement* el = new HtmlElement("<html>\n");
_htmlContent.append(el);
el = new HtmlElement("<head>\n");
@@ -401,8 +401,8 @@ void KImageMapEditor::slotConfigChanged()
void KImageMapEditor::openLastURL(KConfig* config) {
KURL lastURL ( config->readPathEntry("lastopenurl") );
- QString lastMap = config->readEntry("lastactivemap");
- QString lastImage = config->readPathEntry("lastactiveimage");
+ TQString lastMap = config->readEntry("lastactivemap");
+ TQString lastImage = config->readPathEntry("lastactiveimage");
// kdDebug() << "loading from group : " << config->group() << endl;
@@ -414,7 +414,7 @@ void KImageMapEditor::openLastURL(KConfig* config) {
if ( openHTMLFile(lastURL, lastMap, lastImage) )
m_url = lastURL;
else
- m_url = QString::null;
+ m_url = TQString::null;
}
}
@@ -425,53 +425,53 @@ void KImageMapEditor::saveLastURL(KConfig* config) {
// kdDebug() << "writing entry lastopenurl : " << url().path() << endl;
// kdDebug() << "writing entry lastactivemap : " << mapName() << endl;
// kdDebug() << "writing entry lastactiveimage : " << _imageUrl.path() << endl;
- //KMessageBox::information(0L, QString("Group: %1 Saving ... %2").arg(config->group()).arg(url().path()));
+ //KMessageBox::information(0L, TQString("Group: %1 Saving ... %2").arg(config->group()).arg(url().path()));
}
void KImageMapEditor::setupActions()
{
// File Open
- KAction *temp=KStdAction::open(this, SLOT(fileOpen()), actionCollection());
- QMimeSourceFactory::defaultFactory()->setPixmap( "openimage", SmallIcon("fileopen") );
+ KAction *temp=KStdAction::open(this, TQT_SLOT(fileOpen()), actionCollection());
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "openimage", SmallIcon("fileopen") );
temp->setWhatsThis(i18n("<h3>Open File</h3>Click this to <em>open</em> a new picture or HTML file."));
temp->setToolTip(i18n("Open new picture or HTML file"));
// File Open Recent
- recentFilesAction = KStdAction::openRecent(this, SLOT(openURL(const KURL&)),
+ recentFilesAction = KStdAction::openRecent(this, TQT_SLOT(openURL(const KURL&)),
actionCollection());
// File Save
- temp =KStdAction::save(this, SLOT(fileSave()), actionCollection());
- QMimeSourceFactory::defaultFactory()->setPixmap( "saveimage", SmallIcon("filesave") );
+ temp =KStdAction::save(this, TQT_SLOT(fileSave()), actionCollection());
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "saveimage", SmallIcon("filesave") );
temp->setWhatsThis(i18n("<h3>Save File</h3>Click this to <em>save</em> the changes to the HTML file."));
temp->setToolTip(i18n("Save HTML file"));
// File Save As
- (void)KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection());
+ (void)KStdAction::saveAs(this, TQT_SLOT(fileSaveAs()), actionCollection());
// File Close
- temp=KStdAction::close(this, SLOT(fileClose()), actionCollection());
- QMimeSourceFactory::defaultFactory()->setPixmap( "closeimage", SmallIcon("fileclose") );
+ temp=KStdAction::close(this, TQT_SLOT(fileClose()), actionCollection());
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "closeimage", SmallIcon("fileclose") );
temp->setWhatsThis(i18n("<h3>Close File</h3>Click this to <em>close</em> the currently open HTML file."));
temp->setToolTip(i18n("Close HTML file"));
// Edit Copy
- copyAction=KStdAction::copy(this, SLOT(slotCopy()), actionCollection());
- QMimeSourceFactory::defaultFactory()->setPixmap( "editcopyimage", SmallIcon("editcopy") );
+ copyAction=KStdAction::copy(this, TQT_SLOT(slotCopy()), actionCollection());
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "editcopyimage", SmallIcon("editcopy") );
copyAction->setWhatsThis(i18n("<h3>Copy</h3>"
"Click this to <em>copy</em> the selected area."));
copyAction->setEnabled(false);
// Edit Cut
- cutAction=KStdAction::cut(this, SLOT(slotCut()), actionCollection());
- QMimeSourceFactory::defaultFactory()->setPixmap( "editcutimage", SmallIcon("editcut") );
+ cutAction=KStdAction::cut(this, TQT_SLOT(slotCut()), actionCollection());
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "editcutimage", SmallIcon("editcut") );
cutAction->setWhatsThis(i18n("<h3>Cut</h3>"
"Click this to <em>cut</em> the selected area."));
cutAction->setEnabled(false);
// Edit Paste
- pasteAction=KStdAction::paste(this, SLOT(slotPaste()), actionCollection());
- QMimeSourceFactory::defaultFactory()->setPixmap( "editpasteimage", SmallIcon("editpaste") );
+ pasteAction=KStdAction::paste(this, TQT_SLOT(slotPaste()), actionCollection());
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "editpasteimage", SmallIcon("editpaste") );
pasteAction->setWhatsThis(i18n("<h3>Paste</h3>"
"Click this to <em>paste</em> the copied area."));
pasteAction->setEnabled(false);
@@ -479,8 +479,8 @@ void KImageMapEditor::setupActions()
// Edit Delete
deleteAction=new KAction(i18n("&Delete"), "editdelete",
- Key_Delete,this,SLOT (slotDelete()),actionCollection(), "edit_delete");
- QMimeSourceFactory::defaultFactory()->setPixmap( "editdeleteimage", SmallIcon("editdelete") );
+ Key_Delete,this,TQT_SLOT (slotDelete()),actionCollection(), "edit_delete");
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "editdeleteimage", SmallIcon("editdelete") );
deleteAction->setWhatsThis(i18n("<h3>Delete</h3>"
"Click this to <em>delete</em> the selected area."));
deleteAction->setEnabled(false);
@@ -489,21 +489,21 @@ void KImageMapEditor::setupActions()
_commandHistory = new KCommandHistory( actionCollection(), true);
// Edit Properties
- areaPropertiesAction= new KAction(i18n("Pr&operties"),0,this,SLOT(showTagEditor()),
+ areaPropertiesAction= new KAction(i18n("Pr&operties"),0,this,TQT_SLOT(showTagEditor()),
actionCollection(), "edit_properties");
areaPropertiesAction->setEnabled(false);
// View Zoom In
- zoomInAction=KStdAction::zoomIn(this, SLOT(slotZoomIn()), actionCollection());
+ zoomInAction=KStdAction::zoomIn(this, TQT_SLOT(slotZoomIn()), actionCollection());
// View Zoom Out
- zoomOutAction=KStdAction::zoomOut(this, SLOT(slotZoomOut()), actionCollection());
+ zoomOutAction=KStdAction::zoomOut(this, TQT_SLOT(slotZoomOut()), actionCollection());
// View Zoom
- zoomAction=new KSelectAction(i18n("Zoom"), 0,this,SLOT (slotZoom()),
+ zoomAction=new KSelectAction(i18n("Zoom"), 0,this,TQT_SLOT (slotZoom()),
actionCollection(), "view_zoom");
zoomAction->setWhatsThis(i18n("<h3>Zoom</h3>"
"Choose the desired zoom level."));
- zoomAction->setItems(QStringList()
+ zoomAction->setItems(TQStringList()
<< i18n("25%")
<< i18n("50%")
<< i18n("100%")
@@ -517,58 +517,58 @@ void KImageMapEditor::setupActions()
zoomAction->setCurrentItem(2);
- highlightAreasAction = new KToggleAction(i18n("Highlight Areas"),0, this, SLOT (slotHightlightAreas()),
+ highlightAreasAction = new KToggleAction(i18n("Highlight Areas"),0, this, TQT_SLOT (slotHightlightAreas()),
actionCollection(), "view_highlightareas");
- showAltAction = new KToggleAction(i18n("Show Alt Tag"),0, this, SLOT (slotShowAltTag()),
+ showAltAction = new KToggleAction(i18n("Show Alt Tag"),0, this, TQT_SLOT (slotShowAltTag()),
actionCollection(), "view_showalt");
#if KDE_IS_VERSION(3,2,90)
showAltAction->setCheckedState(i18n("Hide Alt Tag"));
#endif
- mapNameAction= new KAction(i18n("Map &Name..."),0,this,SLOT(mapEditName()),
+ mapNameAction= new KAction(i18n("Map &Name..."),0,this,TQT_SLOT(mapEditName()),
actionCollection(), "map_name");
- mapNewAction = new KAction(i18n("Ne&w Map..."),0,this,SLOT(mapNew()),
+ mapNewAction = new KAction(i18n("Ne&w Map..."),0,this,TQT_SLOT(mapNew()),
actionCollection(), "map_new");
mapNewAction->setToolTip(i18n("Create a new map"));
- mapDeleteAction = new KAction(i18n("D&elete Map"),0,this,SLOT(mapDelete()),
+ mapDeleteAction = new KAction(i18n("D&elete Map"),0,this,TQT_SLOT(mapDelete()),
actionCollection(), "map_delete");
mapDeleteAction->setToolTip(i18n("Delete the current active map"));
- mapDefaultAreaAction = new KAction(i18n("Edit &Default Area..."),0,this,SLOT(mapDefaultArea()),
+ mapDefaultAreaAction = new KAction(i18n("Edit &Default Area..."),0,this,TQT_SLOT(mapDefaultArea()),
actionCollection(), "map_defaultarea");
mapDefaultAreaAction->setToolTip(i18n("Edit the default area of the current active map"));
- temp = new KAction(i18n("&Preview"),0,this,SLOT(mapPreview()),
+ temp = new KAction(i18n("&Preview"),0,this,TQT_SLOT(mapPreview()),
actionCollection(), "map_preview");
temp->setToolTip(i18n("Show a preview"));
// IMAGE
i18n("&Image");
- imageAddAction = new KAction(i18n("Add Image..."),0,this,SLOT(imageAdd()),
+ imageAddAction = new KAction(i18n("Add Image..."),0,this,TQT_SLOT(imageAdd()),
actionCollection(), "image_add");
imageAddAction->setToolTip(i18n("Add a new image"));
- imageRemoveAction = new KAction(i18n("Remove Image"),0,this,SLOT(imageRemove()),
+ imageRemoveAction = new KAction(i18n("Remove Image"),0,this,TQT_SLOT(imageRemove()),
actionCollection(), "image_remove");
imageRemoveAction->setToolTip(i18n("Remove the current visible image"));
- imageUsemapAction = new KAction(i18n("Edit Usemap..."),0,this,SLOT(imageUsemap()),
+ imageUsemapAction = new KAction(i18n("Edit Usemap..."),0,this,TQT_SLOT(imageUsemap()),
actionCollection(), "image_usemap");
imageUsemapAction->setToolTip(i18n("Edit the usemap tag of the current visible image"));
- temp= new KAction(i18n("Show &HTML"),0,this,SLOT(mapShowHTML()),
+ temp= new KAction(i18n("Show &HTML"),0,this,TQT_SLOT(mapShowHTML()),
actionCollection(), "map_showhtml");
// Selection Tool
arrowAction=new KRadioAction(i18n("&Selection"), "arrow",
- 0,this,SLOT (slotDrawArrow()),
+ 0,this,TQT_SLOT (slotDrawArrow()),
actionCollection(), "tool_arrow");
- QMimeSourceFactory::defaultFactory()->setPixmap( "arrowimage", SmallIcon("arrow") );
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "arrowimage", SmallIcon("arrow") );
arrowAction->setWhatsThis(i18n("<h3>Selection</h3>"
"Click this to select areas."));
arrowAction->setExclusiveGroup("drawing");
@@ -576,54 +576,54 @@ void KImageMapEditor::setupActions()
// Circle
circleAction=new KRadioAction(i18n("&Circle"), "circle",
- 0,this,SLOT (slotDrawCircle()),
+ 0,this,TQT_SLOT (slotDrawCircle()),
actionCollection(), "tool_circle");
- QMimeSourceFactory::defaultFactory()->setPixmap( "circleimage", SmallIcon("drawcircle") );
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "circleimage", SmallIcon("drawcircle") );
circleAction->setWhatsThis(i18n("<h3>Circle</h3>"
"Click this to start drawing a circle."));
circleAction->setExclusiveGroup("drawing");
// Rectangle
rectangleAction=new KRadioAction(i18n("&Rectangle"), "rectangle",
- 0,this,SLOT (slotDrawRectangle()),
+ 0,this,TQT_SLOT (slotDrawRectangle()),
actionCollection(), "tool_rectangle");
- QMimeSourceFactory::defaultFactory()->setPixmap( "rectangleimage", SmallIcon("drawrectangle") );
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "rectangleimage", SmallIcon("drawrectangle") );
rectangleAction->setWhatsThis(i18n("<h3>Rectangle</h3>"
"Click this to start drawing a rectangle."));
rectangleAction->setExclusiveGroup("drawing");
// Polygon
polygonAction=new KRadioAction(i18n("&Polygon"), "polygon",
- 0,this,SLOT (slotDrawPolygon()),
+ 0,this,TQT_SLOT (slotDrawPolygon()),
actionCollection(), "tool_polygon");
- QMimeSourceFactory::defaultFactory()->setPixmap( "polygonimage", SmallIcon("drawpolygon") );
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "polygonimage", SmallIcon("drawpolygon") );
polygonAction->setWhatsThis(i18n("<h3>Polygon</h3>"
"Click this to start drawing a polygon."));
polygonAction->setExclusiveGroup("drawing");
// Freehand
freehandAction=new KRadioAction(i18n("&Freehand Polygon"), "freehand",
- 0,this,SLOT (slotDrawFreehand()),
+ 0,this,TQT_SLOT (slotDrawFreehand()),
actionCollection(), "tool_freehand");
- QMimeSourceFactory::defaultFactory()->setPixmap( "freehandimage", SmallIcon("freehand") );
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "freehandimage", SmallIcon("freehand") );
freehandAction->setWhatsThis(i18n("<h3>Freehandpolygon</h3>"
"Click this to start drawing a freehand polygon."));
freehandAction->setExclusiveGroup("drawing");
// Add Point
addPointAction=new KRadioAction(i18n("&Add Point"), "addpoint",
- 0,this,SLOT (slotDrawAddPoint()),
+ 0,this,TQT_SLOT (slotDrawAddPoint()),
actionCollection(), "tool_addpoint");
- QMimeSourceFactory::defaultFactory()->setPixmap( "addpointimage", SmallIcon("addpoint") );
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "addpointimage", SmallIcon("addpoint") );
addPointAction->setWhatsThis(i18n("<h3>Add Point</h3>"
"Click this to add points to a polygon."));
addPointAction->setExclusiveGroup("drawing");
// Remove Point
removePointAction=new KRadioAction(i18n("&Remove Point"), "removepoint",
- 0,this,SLOT (slotDrawRemovePoint()),
+ 0,this,TQT_SLOT (slotDrawRemovePoint()),
actionCollection(), "tool_removepoint");
- QMimeSourceFactory::defaultFactory()->setPixmap( "removepointimage", SmallIcon("removepoint") );
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "removepointimage", SmallIcon("removepoint") );
removePointAction->setWhatsThis(i18n("<h3>Remove Point</h3>"
"Click this to remove points from a polygon."));
removePointAction->setExclusiveGroup("drawing");
@@ -631,31 +631,31 @@ void KImageMapEditor::setupActions()
#if KDE_VERSION < 300
KAction *cancelAction =
#endif
- new KAction(i18n("Cancel Drawing"), Key_Escape, this, SLOT( slotCancelDrawing() ),
+ new KAction(i18n("Cancel Drawing"), Key_Escape, this, TQT_SLOT( slotCancelDrawing() ),
actionCollection(), "canceldrawing" );
- moveLeftAction = new KAction(i18n("Move Left"), Key_Left, this, SLOT( slotMoveLeft() ),
+ moveLeftAction = new KAction(i18n("Move Left"), Key_Left, this, TQT_SLOT( slotMoveLeft() ),
actionCollection() , "moveleft" );
- moveRightAction = new KAction(i18n("Move Right"), Key_Right, this, SLOT( slotMoveRight() ),
+ moveRightAction = new KAction(i18n("Move Right"), Key_Right, this, TQT_SLOT( slotMoveRight() ),
actionCollection() , "moveright" );
- moveUpAction = new KAction(i18n("Move Up"), Key_Up, this, SLOT( slotMoveUp() ),
+ moveUpAction = new KAction(i18n("Move Up"), Key_Up, this, TQT_SLOT( slotMoveUp() ),
actionCollection() , "moveup" );
- moveDownAction = new KAction(i18n("Move Down"), Key_Down, this, SLOT( slotMoveDown() ),
+ moveDownAction = new KAction(i18n("Move Down"), Key_Down, this, TQT_SLOT( slotMoveDown() ),
actionCollection() , "movedown" );
- increaseWidthAction = new KAction(i18n("Increase Width"), Key_Right + SHIFT, this, SLOT( slotIncreaseWidth() ),
+ increaseWidthAction = new KAction(i18n("Increase Width"), Key_Right + SHIFT, this, TQT_SLOT( slotIncreaseWidth() ),
actionCollection() , "increasewidth" );
- decreaseWidthAction = new KAction(i18n("Decrease Width"), Key_Left + SHIFT, this, SLOT( slotDecreaseWidth() ),
+ decreaseWidthAction = new KAction(i18n("Decrease Width"), Key_Left + SHIFT, this, TQT_SLOT( slotDecreaseWidth() ),
actionCollection() , "decreasewidth" );
- increaseHeightAction = new KAction(i18n("Increase Height"), Key_Up + SHIFT, this, SLOT( slotIncreaseHeight() ),
+ increaseHeightAction = new KAction(i18n("Increase Height"), Key_Up + SHIFT, this, TQT_SLOT( slotIncreaseHeight() ),
actionCollection() , "increaseheight" );
- decreaseHeightAction = new KAction(i18n("Decrease Height"), Key_Down + SHIFT, this, SLOT( slotDecreaseHeight() ),
+ decreaseHeightAction = new KAction(i18n("Decrease Height"), Key_Down + SHIFT, this, TQT_SLOT( slotDecreaseHeight() ),
actionCollection() , "decreaseheight" );
#if KDE_VERSION < 300
accel = new KAccel(widget());
@@ -670,38 +670,38 @@ void KImageMapEditor::setupActions()
decreaseHeightAction->plugAccel(accel, true);
#endif
- toFrontAction = new KAction(i18n("Bring to Front"), 0 , this, SLOT( slotToFront() ),
+ toFrontAction = new KAction(i18n("Bring to Front"), 0 , this, TQT_SLOT( slotToFront() ),
actionCollection() , "tofront" );
- toBackAction = new KAction(i18n("Send to Back"), 0 , this, SLOT( slotToBack() ),
+ toBackAction = new KAction(i18n("Send to Back"), 0 , this, TQT_SLOT( slotToBack() ),
actionCollection() , "toback" );
- forwardOneAction = new KAction(i18n("Bring Forward One"), "raise" ,0, this, SLOT( slotForwardOne() ),
+ forwardOneAction = new KAction(i18n("Bring Forward One"), "raise" ,0, this, TQT_SLOT( slotForwardOne() ),
actionCollection() , "forwardone" );
- backOneAction = new KAction(i18n("Send Back One"), "lower" ,0, this, SLOT( slotBackOne() ),
+ backOneAction = new KAction(i18n("Send Back One"), "lower" ,0, this, TQT_SLOT( slotBackOne() ),
actionCollection() , "backone" );
forwardOneAction->plug(areaListView->upBtn);
backOneAction->plug(areaListView->downBtn);
- connect( areaListView->upBtn, SIGNAL(pressed()), forwardOneAction, SLOT(activate()));
- connect( areaListView->downBtn, SIGNAL(pressed()), backOneAction, SLOT(activate()));
+ connect( areaListView->upBtn, TQT_SIGNAL(pressed()), forwardOneAction, TQT_SLOT(activate()));
+ connect( areaListView->downBtn, TQT_SIGNAL(pressed()), backOneAction, TQT_SLOT(activate()));
new KAction( i18n("Configure KImageMapEditor..."), "configure", 0,
- this, SLOT(slotShowPreferences()),
+ this, TQT_SLOT(slotShowPreferences()),
actionCollection(), "configure_kimagemapeditor" );
if (areaDock) {
configureShowAreaListAction = new KToggleAction( i18n("Show Area List"), 0L, 0,
- this, SLOT(configureShowAreaList()),
+ this, TQT_SLOT(configureShowAreaList()),
actionCollection(), "configure_show_arealist" );
configureShowMapListAction = new KToggleAction( i18n("Show Map List"), 0L, 0,
- this, SLOT(configureShowMapList()),
+ this, TQT_SLOT(configureShowMapList()),
actionCollection(), "configure_show_maplist" );
configureShowImageListAction = new KToggleAction( i18n("Show Image List"), 0L, 0,
- this, SLOT(configureShowImageList()),
+ this, TQT_SLOT(configureShowImageList()),
actionCollection(), "configure_show_imagelist" );
#if KDE_IS_VERSION(3,2,90)
configureShowAreaListAction->setCheckedState(i18n("Hide Area List"));
@@ -725,30 +725,30 @@ void KImageMapEditor::setupStatusBar()
void KImageMapEditor::slotShowPreferences()
{
PreferencesDialog *dialog = new PreferencesDialog(widget(),config());
- connect(dialog, SIGNAL(applyClicked()), this, SLOT(slotConfigChanged()));
+ connect(dialog, TQT_SIGNAL(applyClicked()), this, TQT_SLOT(slotConfigChanged()));
dialog->exec();
delete dialog;
}
-void KImageMapEditor::showPopupMenu(const QPoint & pos, const QString & name)
+void KImageMapEditor::showPopupMenu(const TQPoint & pos, const TQString & name)
{
- QPopupMenu* pop = static_cast<QPopupMenu *>(factory()->container(name, this));
+ TQPopupMenu* pop = static_cast<TQPopupMenu *>(factory()->container(name, this));
if (!pop) {
- kdWarning() << QString("KImageMapEditorPart: Missing XML definition for %1\n").arg(name) << endl;
+ kdWarning() << TQString("KImageMapEditorPart: Missing XML definition for %1\n").arg(name) << endl;
return;
}
pop->popup(pos);
}
-void KImageMapEditor::slotShowMainPopupMenu(const QPoint & pos)
+void KImageMapEditor::slotShowMainPopupMenu(const TQPoint & pos)
{
showPopupMenu(pos,"popup_main");
}
-void KImageMapEditor::slotShowMapPopupMenu(QListViewItem* item,const QPoint & pos)
+void KImageMapEditor::slotShowMapPopupMenu(TQListViewItem* item,const TQPoint & pos)
{
if (isReadWrite()) {
mapDeleteAction->setEnabled(item);
@@ -762,7 +762,7 @@ void KImageMapEditor::slotShowMapPopupMenu(QListViewItem* item,const QPoint & po
showPopupMenu(pos,"popup_map");
}
-void KImageMapEditor::slotShowImagePopupMenu(QListViewItem* item,const QPoint & pos)
+void KImageMapEditor::slotShowImagePopupMenu(TQListViewItem* item,const TQPoint & pos)
{
imageRemoveAction->setEnabled(item);
imageUsemapAction->setEnabled(item);
@@ -773,7 +773,7 @@ void KImageMapEditor::slotShowImagePopupMenu(QListViewItem* item,const QPoint &
showPopupMenu(pos,"popup_image");
}
-void KImageMapEditor::slotShowPopupMenu(QListViewItem* item,const QPoint & p)
+void KImageMapEditor::slotShowPopupMenu(TQListViewItem* item,const TQPoint & p)
{
if (!item)
return;
@@ -794,14 +794,14 @@ void KImageMapEditor::updateStatusBar()
void KImageMapEditor::slotChangeStatusCoords(int x,int y)
{
-// statusBar()->changeItem(QString(" Cursor : x: %1 ,y: %2 ").arg(x).arg(y),STATUS_CURSOR);
+// statusBar()->changeItem(TQString(" Cursor : x: %1 ,y: %2 ").arg(x).arg(y),STATUS_CURSOR);
cursorStatusText = i18n(" Cursor: x: %1, y: %2 ").arg(x).arg(y);
updateStatusBar();
}
void KImageMapEditor::slotUpdateSelectionCoords() {
if (selected()->count()>0) {
- QRect r=selected()->rect();
+ TQRect r=selected()->rect();
// statusBar()->changeItem(
selectionStatusText = i18n(" Selection: x: %1, y: %2, w: %3, h: %4 ").arg(r.left()).arg(r.top()).arg(r.width()).arg(r.height());
@@ -814,7 +814,7 @@ void KImageMapEditor::slotUpdateSelectionCoords() {
updateStatusBar();
}
-void KImageMapEditor::slotUpdateSelectionCoords( const QRect & r )
+void KImageMapEditor::slotUpdateSelectionCoords( const TQRect & r )
{
selectionStatusText = i18n(" Selection: x: %1, y: %2, w: %3, h: %4 ").arg(r.left()).arg(r.top()).arg(r.width()).arg(r.height());
updateStatusBar();
@@ -827,57 +827,57 @@ KApplication* KImageMapEditor::app() const
}
-void KImageMapEditor::drawToCenter(QPainter* p, const QString & str, int y, int width) {
+void KImageMapEditor::drawToCenter(TQPainter* p, const TQString & str, int y, int width) {
int xmid = width / 2;
- QFontMetrics fm = p->fontMetrics();
- QRect strBounds = fm.boundingRect(str);
+ TQFontMetrics fm = p->fontMetrics();
+ TQRect strBounds = fm.boundingRect(str);
p->drawText(xmid-(strBounds.width()/2),y,str);
}
-QImage KImageMapEditor::getBackgroundImage() {
+TQImage KImageMapEditor::getBackgroundImage() {
// Lazy initialisation
if ( _backgroundImage.isNull() ) {
-// QString filename = QString("dropimage_")+KGlobal::locale()->language()+".png";
-// QString path = QString::null; //KGlobal::dirs()->findResourceDir( "data", "kimagemapeditor/"+filename ) + "kimagemapeditor/"+filename;
+// TQString filename = TQString("dropimage_")+KGlobal::locale()->language()+".png";
+// TQString path = TQString::null; //KGlobal::dirs()->findResourceDir( "data", "kimagemapeditor/"+filename ) + "kimagemapeditor/"+filename;
// kdDebug() << "getBackgroundPic : loaded image : " << path << endl;
-// if ( ! QFileInfo(path).exists() ) {
+// if ( ! TQFileInfo(path).exists() ) {
int width = 400;
int height = 400;
int border = 20;
int fontSize = 58;
- QPixmap pix(width,height);
- pix.fill(QColor(74,76,74));
- QPainter p(&pix);
+ TQPixmap pix(width,height);
+ pix.fill(TQColor(74,76,74));
+ TQPainter p(&pix);
- QFont font;
+ TQFont font;
font.setFamily("Sans");
font.setPixelSize(fontSize);
font.setBold(true);
p.setFont( font );
p.setRasterOp(Qt::CopyROP);
- p.setPen(QPen(QColor(112,114,112),1));
+ p.setPen(TQPen(TQColor(112,114,112),1));
// The translated string must be divided into
// parts with about the same size that fit to the image
- QString str = i18n("Drop an image or HTML file");
- QStringList strList = QStringList::split(" ",str);
+ TQString str = i18n("Drop an image or HTML file");
+ TQStringList strList = TQStringList::split(" ",str);
// Get the string parts
- QString tmp;
- QStringList outputStrList;
- QFontMetrics fm = p.fontMetrics();
+ TQString tmp;
+ TQStringList outputStrList;
+ TQFontMetrics fm = p.fontMetrics();
- for ( QStringList::Iterator it = strList.begin(); it != strList.end(); ++it ) {
- QString tmp2 = tmp + *it;
+ for ( TQStringList::Iterator it = strList.begin(); it != strList.end(); ++it ) {
+ TQString tmp2 = tmp + *it;
if (fm.boundingRect(tmp2).width() > width-border) {
outputStrList.append(tmp);
@@ -894,7 +894,7 @@ QImage KImageMapEditor::getBackgroundImage() {
int step = myround(float(height) / (outputStrList.size()+1));
int y = step;
- for ( QStringList::Iterator it = outputStrList.begin(); it != outputStrList.end(); ++it ) {
+ for ( TQStringList::Iterator it = outputStrList.begin(); it != outputStrList.end(); ++it ) {
drawToCenter(&p, *it, y, pix.width());
y += step;
}
@@ -908,19 +908,19 @@ QImage KImageMapEditor::getBackgroundImage() {
return _backgroundImage;
/*
- QFontDatabase fdb;
- QStringList families = fdb.families();
- for ( QStringList::Iterator f = families.begin(); f != families.end(); ++f ) {
- QString family = *f;
+ TQFontDatabase fdb;
+ TQStringList families = fdb.families();
+ for ( TQStringList::Iterator f = families.begin(); f != families.end(); ++f ) {
+ TQString family = *f;
qDebug( family );
- QStringList styles = fdb.styles( family );
- for ( QStringList::Iterator s = styles.begin(); s != styles.end(); ++s ) {
- QString style = *s;
- QString dstyle = "\t" + style + " (";
- QValueList<int> smoothies = fdb.smoothSizes( family, style );
- for ( QValueList<int>::Iterator points = smoothies.begin();
+ TQStringList styles = fdb.styles( family );
+ for ( TQStringList::Iterator s = styles.begin(); s != styles.end(); ++s ) {
+ TQString style = *s;
+ TQString dstyle = "\t" + style + " (";
+ TQValueList<int> smoothies = fdb.smoothSizes( family, style );
+ for ( TQValueList<int>::Iterator points = smoothies.begin();
points != smoothies.end(); ++points ) {
- dstyle += QString::number( *points ) + " ";
+ dstyle += TQString::number( *points ) + " ";
}
dstyle = dstyle.left( dstyle.length() - 1 ) + ")";
qDebug( dstyle );
@@ -933,7 +933,7 @@ QImage KImageMapEditor::getBackgroundImage() {
pix.save(path,"PNG",100);
}
- if ( ! QFileInfo(path).exists() ) {
+ if ( ! TQFileInfo(path).exists() ) {
kdError() << "Couldn't find needed " << filename << " file in "
"the data directory of KImageMapEditor.\n"
"Perhaps you have forgotten to do a make install !" << endl;
@@ -957,14 +957,14 @@ void KImageMapEditor::addArea(Area* area) {
for (Area* a = list.first(); a != 0L; a = list.next() )
{
areas->prepend(a);
- a->setListViewItem(new QListViewItem(areaListView->listView,a->attribute("href")));
+ a->setListViewItem(new TQListViewItem(areaListView->listView,a->attribute("href")));
a->listViewItem()->setPixmap(1,makeListViewPix(*a));
}
}
else
{
areas->prepend(area);
- area->setListViewItem(new QListViewItem(areaListView->listView,area->attribute("href")));
+ area->setListViewItem(new TQListViewItem(areaListView->listView,area->attribute("href")));
area->listViewItem()->setPixmap(1,makeListViewPix(*area));
}
@@ -975,7 +975,7 @@ void KImageMapEditor::addArea(Area* area) {
void KImageMapEditor::addAreaAndEdit(Area* s)
{
areas->prepend(s);
- s->setListViewItem(new QListViewItem(areaListView->listView,s->attribute("href")));
+ s->setListViewItem(new TQListViewItem(areaListView->listView,s->attribute("href")));
s->listViewItem()->setPixmap(1,makeListViewPix(*s));
deselectAll();
select(s);
@@ -991,7 +991,7 @@ void KImageMapEditor::deleteArea( Area * area )
if (!area) return;
// only for repaint reasons
- QRect redrawRect = area->selectionRect();
+ TQRect redrawRect = area->selectionRect();
// Perhaps we've got a selection of areas
// so test it and delete the whole selection
@@ -1112,7 +1112,7 @@ void KImageMapEditor::slotSelectionChanged()
}
-void KImageMapEditor::select( QListViewItem* item)
+void KImageMapEditor::select( TQListViewItem* item)
{
AreaListIterator it = areaList();
@@ -1307,13 +1307,13 @@ void KImageMapEditor::updateUpDownBtn()
void KImageMapEditor::deselectAll()
{
- QRect redrawRect= currentSelected->selectionRect();
+ TQRect redrawRect= currentSelected->selectionRect();
currentSelected->reset();
drawZone->repaintRect(redrawRect);
updateActionAccess();
}
-Area* KImageMapEditor::onArea(const QPoint & p) const {
+Area* KImageMapEditor::onArea(const TQPoint & p) const {
for (Area* s=areas->first();s!=0L;s=areas->next()) {
if (s->contains(p))
return s;
@@ -1327,7 +1327,7 @@ int KImageMapEditor::showTagEditor(Area *a) {
drawZone->repaintArea(*a);
AreaDialog *dialog= new AreaDialog(this,a);
- connect (dialog, SIGNAL(areaChanged(Area*)), this, SLOT(slotAreaChanged(Area*)));
+ connect (dialog, TQT_SIGNAL(areaChanged(Area*)), this, TQT_SLOT(slotAreaChanged(Area*)));
int result = dialog->exec();
@@ -1336,7 +1336,7 @@ int KImageMapEditor::showTagEditor(Area *a) {
}
-int KImageMapEditor::showTagEditor(QListViewItem *item) {
+int KImageMapEditor::showTagEditor(TQListViewItem *item) {
if (!item) return 0;
for (Area* a=areas->first();a!=0L;a=areas->next()) {
if (a->listViewItem()==item) {
@@ -1351,9 +1351,9 @@ int KImageMapEditor::showTagEditor() {
}
-QString KImageMapEditor::getHTMLImageMap() const {
- QString retStr;
- retStr+="<map "+QString("name=\"")+_mapName+"\">\n";
+TQString KImageMapEditor::getHTMLImageMap() const {
+ TQString retStr;
+ retStr+="<map "+TQString("name=\"")+_mapName+"\">\n";
for (Area* a=areas->first();a!=0L;a=areas->next()) {
retStr+=" "+a->getHTMLCode()+"\n";
@@ -1366,9 +1366,9 @@ QString KImageMapEditor::getHTMLImageMap() const {
return retStr;
}
-QPixmap KImageMapEditor::makeListViewPix(Area & a)
+TQPixmap KImageMapEditor::makeListViewPix(Area & a)
{
- QPixmap pix=a.cutOut(drawZone->picture());
+ TQPixmap pix=a.cutOut(drawZone->picture());
double shrinkFactor=1;
@@ -1376,12 +1376,12 @@ QPixmap KImageMapEditor::makeListViewPix(Area & a)
if (maxAreaPreviewHeight < pix.height())
shrinkFactor = ( (double) maxAreaPreviewHeight / pix.height() );
- QPixmap pix2((int)(pix.width()*shrinkFactor), (int)(pix.height()*shrinkFactor));
+ TQPixmap pix2((int)(pix.width()*shrinkFactor), (int)(pix.height()*shrinkFactor));
// Give all pixels a defined color
pix2.fill(Qt::white);
- QPainter p(&pix2);
+ TQPainter p(&pix2);
p.scale(shrinkFactor,shrinkFactor);
p.drawPixmap(0,0,pix);
@@ -1389,7 +1389,7 @@ QPixmap KImageMapEditor::makeListViewPix(Area & a)
return pix2;
}
-void KImageMapEditor::setMapName(const QString & s) {
+void KImageMapEditor::setMapName(const TQString & s) {
mapsListView->changeMapName(_mapName, s);
_mapName=s;
currentMapElement->mapTag->name = s;
@@ -1398,8 +1398,8 @@ void KImageMapEditor::setMapName(const QString & s) {
void KImageMapEditor::setPicture(const KURL & url) {
_imageUrl=url;
- if (QFileInfo(url.path()).exists()) {
- QImage img(url.path());
+ if (TQFileInfo(url.path()).exists()) {
+ TQImage img(url.path());
if (!img.isNull()) {
setPicture(img);
@@ -1407,13 +1407,13 @@ void KImageMapEditor::setPicture(const KURL & url) {
imageUsemapAction->setEnabled(true);
}
else
- kdError() << QString("The image %1 could not be opened.").arg(url.path()) << endl;
+ kdError() << TQString("The image %1 could not be opened.").arg(url.path()) << endl;
}
else
- kdError() << QString("The image %1 does not exist.").arg(url.path()) << endl;
+ kdError() << TQString("The image %1 does not exist.").arg(url.path()) << endl;
}
-void KImageMapEditor::setPicture(const QImage & pix) {
+void KImageMapEditor::setPicture(const TQImage & pix) {
drawZone->setPicture(pix);
updateAllAreas();
}
@@ -1508,11 +1508,11 @@ void KImageMapEditor::mapEditName()
{
bool ok=false;
#if KDE_IS_VERSION(3, 1, 90)
- QString input = KInputDialog::getText(i18n("Enter Map Name"),
+ TQString input = KInputDialog::getText(i18n("Enter Map Name"),
i18n("Enter the name of the map:"),
_mapName,&ok,widget());
#else
- QString input = KLineEditDlg::getText(i18n("Enter Map Name"),
+ TQString input = KLineEditDlg::getText(i18n("Enter Map Name"),
i18n("Enter the name of the map:"),
_mapName,&ok,widget());
#endif
@@ -1529,12 +1529,12 @@ void KImageMapEditor::mapEditName()
void KImageMapEditor::mapShowHTML()
{
- KDialogBase *dialog= new KDialogBase(widget(),QString::null,true,i18n("HTML Code of Map"),KDialogBase::Ok);
- QMultiLineEdit *edit = new QMultiLineEdit(dialog);
+ KDialogBase *dialog= new KDialogBase(widget(),TQString::null,true,i18n("HTML Code of Map"),KDialogBase::Ok);
+ TQMultiLineEdit *edit = new TQMultiLineEdit(dialog);
edit->setText(getHtmlCode());
edit->setReadOnly(true);
- edit->setWordWrap(QTextEdit::NoWrap);
+ edit->setWordWrap(TQTextEdit::NoWrap);
dialog->setMainWidget(edit);
// dialog->resize(dialog->calculateSize(edit->maxLineWidth(),edit->numLines()*));
// dialog->adjustSize();
@@ -1544,7 +1544,7 @@ void KImageMapEditor::mapShowHTML()
void KImageMapEditor::openFile(const KURL & url) {
if ( ! url.isEmpty()) {
- QString ext=QFileInfo(url.path()).extension().lower();
+ TQString ext=TQFileInfo(url.path()).extension().lower();
if (ext=="png" || ext=="jpg" || ext=="jpeg" || ext=="gif" ||
ext=="bmp" || ext=="xbm" || ext=="xpm" || ext=="mng" || ext=="pnm")
@@ -1561,14 +1561,14 @@ bool KImageMapEditor::openURL(const KURL & url) {
// For non local files, we cannot check
// the existance
if (url.isLocalFile() &&
- ! QFile::exists(url.path()))
+ ! TQFile::exists(url.path()))
return true;
return KParts::ReadOnlyPart::openURL(url);
}
void KImageMapEditor::fileOpen() {
- QString fileName = KFileDialog::getOpenFileName(QString::null,
+ TQString fileName = KFileDialog::getOpenFileName(TQString::null,
i18n("*.png *.jpg *.jpeg *.gif *.htm *.html|Web File\n"
"*.png *.jpg *.jpeg *.gif *.bmp *.xbm *.xpm *.pnm *.mng|Images\n"
"*.htm *.html|HTML Files\n"
@@ -1617,7 +1617,7 @@ void KImageMapEditor::fileSaveAs() {
}
- QFileInfo fileInfo(url.path());
+ TQFileInfo fileInfo(url.path());
if ( fileInfo.exists() )
{
@@ -1641,7 +1641,7 @@ void KImageMapEditor::fileSaveAs() {
bool KImageMapEditor::openFile()
{
- QFileInfo fileInfo(url().path());
+ TQFileInfo fileInfo(url().path());
if ( !fileInfo.exists() )
{
@@ -1661,28 +1661,28 @@ bool KImageMapEditor::openFile()
}
/**
- * This methods supposes that the given QTextStream s has just read
+ * This methods supposes that the given TQTextStream s has just read
* the &lt; of a tag. It now reads all attributes of the tag until a &gt;
* The tagname itself is also read and stored as a <em>tagname</em>
- * attribute. After parsing the whole tag it returns a QDict<QString>
+ * attribute. After parsing the whole tag it returns a TQDict<TQString>
* with all attributes and their values. It stores the whole read text in the
* parameter readText.
*/
-QDict<QString> KImageMapEditor::getTagAttributes(QTextStream & s, QString & readText)
+TQDict<TQString> KImageMapEditor::getTagAttributes(TQTextStream & s, TQString & readText)
{
- QDict<QString> dict(17,false);
+ TQDict<TQString> dict(17,false);
// the "<" is already read
- QChar w;
- QString attr,value;
+ TQChar w;
+ TQString attr,value;
- readText = QString::null;
+ readText = TQString::null;
// get the tagname
while (!s.atEnd() && w!=" ") {
s >> w;
readText.append(w);
if (w==" " || w==">") {
- dict.insert("tagname",new QString(value));
+ dict.insert("tagname",new TQString(value));
break;
}
value+=w;
@@ -1715,10 +1715,10 @@ QDict<QString> KImageMapEditor::getTagAttributes(QTextStream & s, QString & read
bool attrRead=true; // currently reading an attribute ?
bool equalSign=false; // an equalsign was read?
bool valueRead=false; // currently reading a value ?
- QChar quotation='\0'; // currently reading a value with quotation marks ?
+ TQChar quotation='\0'; // currently reading a value with quotation marks ?
bool php=false; // currently reading a php script
- attr=QString::null;
- value=QString::null;
+ attr=TQString::null;
+ value=TQString::null;
//get the other attributes
while (!s.atEnd() && w!=">")
@@ -1761,7 +1761,7 @@ QDict<QString> KImageMapEditor::getTagAttributes(QTextStream & s, QString & read
// finished ?
if (w==">") {
if (valueRead)
- dict.insert(attr,new QString(value));
+ dict.insert(attr,new TQString(value));
return dict;
} else
// currently reading an attribute ?
@@ -1801,16 +1801,16 @@ QDict<QString> KImageMapEditor::getTagAttributes(QTextStream & s, QString & read
} else {
quotation='\0';
valueRead=false;
- dict.insert(attr,new QString(value));
- attr = value = QString::null;
+ dict.insert(attr,new TQString(value));
+ attr = value = TQString::null;
}
} else
// a whitespace indicates that the value has finished
if (w==" ") {
valueRead=false;
- dict.insert(attr,new QString(value));
- attr = value = QString::null;
+ dict.insert(attr,new TQString(value));
+ attr = value = TQString::null;
}
} else {
if (w!=" ") {
@@ -1825,25 +1825,25 @@ QDict<QString> KImageMapEditor::getTagAttributes(QTextStream & s, QString & read
}
-bool KImageMapEditor::openHTMLFile(const KURL & url, const QString & mapName, const QString & imagePath)
+bool KImageMapEditor::openHTMLFile(const KURL & url, const TQString & mapName, const TQString & imagePath)
{
- QFile f(url.path());
+ TQFile f(url.path());
if ( !f.exists () )
return false;
f.open(IO_ReadOnly);
- QTextStream s(&f);
- QString str;
- QChar w;
- QDict<QString> *attr=0L;
- QPtrList<ImageTag> *images= new QPtrList<ImageTag>;
+ TQTextStream s(&f);
+ TQString str;
+ TQChar w;
+ TQDict<TQString> *attr=0L;
+ TQPtrList<ImageTag> *images= new TQPtrList<ImageTag>;
MapTag *map=0L;
- QPtrList<MapTag> *maps = new QPtrList<MapTag>;
+ TQPtrList<MapTag> *maps = new TQPtrList<MapTag>;
_htmlContent.clear();
currentMapElement = 0L;
- QString temp;
- QString origcode;
+ TQString temp;
+ TQString origcode;
bool readMap=false;
@@ -1854,11 +1854,11 @@ bool KImageMapEditor::openHTMLFile(const KURL & url, const QString & mapName, co
{
if (!readMap && !origcode.isEmpty()) {
_htmlContent.append( new HtmlElement(origcode));
- origcode = QString::null;
+ origcode = TQString::null;
}
origcode.append("<");
- attr=new QDict<QString>(getTagAttributes(s,temp));
+ attr=new TQDict<TQString>(getTagAttributes(s,temp));
origcode.append(temp);
if (attr->find("tagname")) {
@@ -1869,7 +1869,7 @@ bool KImageMapEditor::openHTMLFile(const KURL & url, const QString & mapName, co
images->append(el->imgTag);
_htmlContent.append(el);
- origcode = QString::null;
+ origcode = TQString::null;
} else
if (attr->find("tagname")->lower()=="map") {
map = new MapTag();
@@ -1883,7 +1883,7 @@ bool KImageMapEditor::openHTMLFile(const KURL & url, const QString & mapName, co
el->mapTag = map;
_htmlContent.append(el);
- origcode = QString::null;
+ origcode = TQString::null;
} else
if (readMap) {
if (attr->find("tagname")->lower()=="area") {
@@ -1891,7 +1891,7 @@ bool KImageMapEditor::openHTMLFile(const KURL & url, const QString & mapName, co
}
} else {
_htmlContent.append(new HtmlElement(origcode));
- origcode = QString::null;
+ origcode = TQString::null;
}
}
@@ -1924,7 +1924,7 @@ bool KImageMapEditor::openHTMLFile(const KURL & url, const QString & mapName, co
if (images->count() == 1) {
if (images->first()) {
ImageTag* imgTag = images->first();
- QString *src = imgTag->find("src");
+ TQString *src = imgTag->find("src");
if (src)
imageUrl = KURL(url,*src);
}
@@ -1936,12 +1936,12 @@ bool KImageMapEditor::openHTMLFile(const KURL & url, const QString & mapName, co
ImageTag* imageTag;
for ( imageTag = images->first(); imageTag; imageTag = images->next() )
{
- QString *usemap = imageTag->find("usemap");
+ TQString *usemap = imageTag->find("usemap");
if (usemap) {
// Remove the #
- QString usemapName = usemap->right(usemap->length()-1);
+ TQString usemapName = usemap->right(usemap->length()-1);
if (usemapName == map->name) {
- QString *src = imageTag->find("src");
+ TQString *src = imageTag->find("src");
if (src)
imageUrl = KURL(url,*src);
}
@@ -2003,7 +2003,7 @@ bool KImageMapEditor::openHTMLFile(const KURL & url, const QString & mapName, co
* Returns the first matching element.
* Returns 0L if no element was found.
*/
-HtmlElement* KImageMapEditor::findHtmlElement(const QString & containingText) {
+HtmlElement* KImageMapEditor::findHtmlElement(const TQString & containingText) {
for (HtmlElement * el = _htmlContent.first(); el; el = _htmlContent.next() ) {
if (el->htmlCode.contains(containingText,false)) {
return el;
@@ -2027,7 +2027,7 @@ HtmlImgElement* KImageMapEditor::findHtmlImgElement(ImageTag* tag) {
return 0L;
}
-void KImageMapEditor::addMap(const QString & name = QString::null) {
+void KImageMapEditor::addMap(const TQString & name = TQString::null) {
HtmlMapElement* el = new HtmlMapElement("\n<map></map>");
MapTag* map = new MapTag();
map->name = name;
@@ -2062,7 +2062,7 @@ void KImageMapEditor::addMap(const QString & name = QString::null) {
* to the given map name.<br>
* Returns 0L if there exists no map with the given name
*/
-HtmlMapElement* KImageMapEditor::findHtmlMapElement(const QString & mapName) {
+HtmlMapElement* KImageMapEditor::findHtmlMapElement(const TQString & mapName) {
for (HtmlElement * el = _htmlContent.first(); el; el = _htmlContent.next() ) {
if (dynamic_cast<HtmlMapElement*>(el)) {
HtmlMapElement *tagEl = static_cast<HtmlMapElement*>(el);
@@ -2079,7 +2079,7 @@ HtmlMapElement* KImageMapEditor::findHtmlMapElement(const QString & mapName) {
/**
* Calls setMap with the HtmlMapElement with the given map name
*/
-void KImageMapEditor::setMap(const QString & mapName) {
+void KImageMapEditor::setMap(const TQString & mapName) {
HtmlMapElement* el = findHtmlMapElement(mapName);
if (!el) {
kdWarning() << "KImageMapEditor::setMap : Couldn't set map '" << mapName << "', because it wasn't found !" << endl;
@@ -2106,34 +2106,34 @@ void KImageMapEditor::setMap(MapTag* map) {
void KImageMapEditor::saveAreasToMapTag(MapTag* map) {
map->clear();
for (Area* a=areas->first();a!=0L;a=areas->next()) {
- QDict<QString> *dict = new QDict<QString>(17,false);
- QString *shapeStr = 0L;
+ TQDict<TQString> *dict = new TQDict<TQString>(17,false);
+ TQString *shapeStr = 0L;
switch (a->type()) {
- case Area::Rectangle : shapeStr = new QString("rect");break;
- case Area::Circle : shapeStr = new QString("circle");break;
- case Area::Polygon : shapeStr = new QString("poly");break;
+ case Area::Rectangle : shapeStr = new TQString("rect");break;
+ case Area::Circle : shapeStr = new TQString("circle");break;
+ case Area::Polygon : shapeStr = new TQString("poly");break;
default : continue;
}
dict->insert("shape",shapeStr);
for (AttributeIterator it = a->firstAttribute();it!=a->lastAttribute();++it) {
- dict->insert(it.key(),new QString(it.data()));
+ dict->insert(it.key(),new TQString(it.data()));
}
- dict->insert("coords",new QString(a->coordsToString()));
+ dict->insert("coords",new TQString(a->coordsToString()));
map->append(dict);
}
if (defaultArea && defaultArea->finished()) {
- QDict<QString> *dict = new QDict<QString>(17,false);
- dict->insert("shape",new QString("default"));
+ TQDict<TQString> *dict = new TQDict<TQString>(17,false);
+ dict->insert("shape",new TQString("default"));
for (AttributeIterator it = defaultArea->firstAttribute();it!=defaultArea->lastAttribute();++it) {
- dict->insert(it.key(),new QString(it.data()));
+ dict->insert(it.key(),new TQString(it.data()));
}
map->append(dict);
@@ -2159,7 +2159,7 @@ void KImageMapEditor::setMap(HtmlMapElement* mapElement) {
_mapName = map->name;
for (AreaTag *tag=map->first();tag!=0L;tag=map->next())
{
- QString shape="rect";
+ TQString shape="rect";
if (tag->find("shape"))
shape=*tag->find("shape");
@@ -2245,12 +2245,12 @@ void KImageMapEditor::setMapActionsEnabled(bool b) {
}
-QString KImageMapEditor::getHtmlCode() {
+TQString KImageMapEditor::getHtmlCode() {
if (currentMapElement) {
currentMapElement->htmlCode = getHTMLImageMap();
}
- QString result;
+ TQString result;
HtmlElement *el;
for ( el = _htmlContent.first(); el; el = _htmlContent.next() ) {
@@ -2263,16 +2263,16 @@ QString KImageMapEditor::getHtmlCode() {
void KImageMapEditor::saveImageMap(const KURL & url)
{
- QFileInfo fileInfo(url.path());
+ TQFileInfo fileInfo(url.path());
- if (!QFileInfo(url.directory()).isWritable()) {
+ if (!TQFileInfo(url.directory()).isWritable()) {
KMessageBox::error(widget(),
i18n("<qt>The file <i>%1</i> could not be saved, because you do not have the required write permissions.</qt>").arg(url.path()));
return;
}
if (!backupFileCreated) {
- QString backupFile = url.path()+"~";
+ TQString backupFile = url.path()+"~";
KIO::file_copy(url, KURL::fromPathOrURL( backupFile ), -1, true, false, false);
backupFileCreated = true;
}
@@ -2282,10 +2282,10 @@ void KImageMapEditor::saveImageMap(const KURL & url)
if (mapName().isEmpty()) {
mapEditName();
}
- QFile file(url.path());
+ TQFile file(url.path());
file.open(IO_WriteOnly);
- QTextStream t(&file);
+ TQTextStream t(&file);
if (_htmlContent.isEmpty()) {
t << "<html>\n"
@@ -2432,7 +2432,7 @@ void KImageMapEditor::slotToFront()
void KImageMapEditor::slotMoveUp()
{
- QRect r=selected()->rect();
+ TQRect r=selected()->rect();
selected()->setMoving(true);
selected()->moveBy(0,-1);
@@ -2445,7 +2445,7 @@ void KImageMapEditor::slotMoveUp()
void KImageMapEditor::slotMoveDown()
{
- QRect r=selected()->rect();
+ TQRect r=selected()->rect();
selected()->setMoving(true);
selected()->moveBy(0,1);
@@ -2458,7 +2458,7 @@ void KImageMapEditor::slotMoveDown()
void KImageMapEditor::slotMoveLeft()
{
- QRect r=selected()->rect();
+ TQRect r=selected()->rect();
selected()->setMoving(true);
selected()->moveBy(-1,0);
@@ -2471,7 +2471,7 @@ void KImageMapEditor::slotMoveLeft()
void KImageMapEditor::slotMoveRight()
{
- QRect r=selected()->rect();
+ TQRect r=selected()->rect();
selected()->setMoving(true);
selected()->moveBy(1,0);
@@ -2491,7 +2491,7 @@ void KImageMapEditor::slotIncreaseHeight()
{
Area *oldArea=selected()->clone();
- QRect r = selected()->rect();
+ TQRect r = selected()->rect();
r.setHeight( r.height()+1 );
r.moveBy(0,-1);
@@ -2507,7 +2507,7 @@ void KImageMapEditor::slotDecreaseHeight()
{
Area *oldArea=selected()->clone();
- QRect r = selected()->rect();
+ TQRect r = selected()->rect();
r.setHeight( r.height()-1 );
r.moveBy(0,1);
@@ -2523,7 +2523,7 @@ void KImageMapEditor::slotIncreaseWidth()
{
Area *oldArea=selected()->clone();
- QRect r = selected()->rect();
+ TQRect r = selected()->rect();
r.setWidth( r.width()+1 );
selected()->setRect(r);
@@ -2538,7 +2538,7 @@ void KImageMapEditor::slotDecreaseWidth()
{
Area *oldArea=selected()->clone();
- QRect r = selected()->rect();
+ TQRect r = selected()->rect();
r.setWidth( r.width()-1 );
selected()->setRect(r);
@@ -2569,7 +2569,7 @@ void KImageMapEditor::slotShowAltTag()
void KImageMapEditor::mapNew()
{
- QString mapName = mapsListView->getUnusedMapName();
+ TQString mapName = mapsListView->getUnusedMapName();
addMap(mapName);
mapEditName();
}
@@ -2579,7 +2579,7 @@ void KImageMapEditor::mapDelete()
if (mapsListView->count() == 0)
return;
- QString selectedMap = mapsListView->selectedMap();
+ TQString selectedMap = mapsListView->selectedMap();
int result = KMessageBox::warningContinueCancel(widget(),
i18n("<qt>Are you sure you want to delete the map <i>%1</i>?"
@@ -2631,7 +2631,7 @@ bool KImageMapEditor::queryClose() {
return true;
switch ( KMessageBox::warningYesNoCancel( widget(),
- i18n("<qt>The file <i>%1</i> has been modified.<br>Do you want to save it?</qt>").arg(url().fileName()), QString::null, KStdGuiItem::save(), KStdGuiItem::discard()) ) {
+ i18n("<qt>The file <i>%1</i> has been modified.<br>Do you want to save it?</qt>").arg(url().fileName()), TQString::null, KStdGuiItem::save(), KStdGuiItem::discard()) ) {
case KMessageBox::Yes :
saveFile();
return true;
@@ -2671,12 +2671,12 @@ void KImageMapEditor::addImage(const KURL & imgUrl) {
if (imgUrl.isEmpty())
return;
- QString relativePath ( QExtFileInfo::toRelative(imgUrl, KURL( url().directory() )).path() );
+ TQString relativePath ( QExtFileInfo::toRelative(imgUrl, KURL( url().directory() )).path() );
- QString imgHtml = QString("<img src=\"")+relativePath+QString("\">");
+ TQString imgHtml = TQString("<img src=\"")+relativePath+TQString("\">");
ImageTag *imgTag = new ImageTag();
- imgTag->insert("tagname",new QString("img"));
- imgTag->insert("src", new QString(relativePath));
+ imgTag->insert("tagname",new TQString("img"));
+ imgTag->insert("src", new TQString(relativePath));
HtmlImgElement *imgEl = new HtmlImgElement(imgHtml);
imgEl->imgTag = imgTag;
@@ -2727,7 +2727,7 @@ void KImageMapEditor::imageRemove() {
else {
ImageTag* selected = imagesListView->selectedImage();
if (selected) {
- QString *url = selected->find("src");
+ TQString *url = selected->find("src");
if (url) {
setPicture(KURL(*url));
}
@@ -2744,12 +2744,12 @@ void KImageMapEditor::imageUsemap() {
if ( ! imageTag)
return;
- QString usemap;
+ TQString usemap;
if (imageTag->find("usemap"))
usemap=*imageTag->find("usemap");
- QStringList maps = mapsListView->getMaps();
+ TQStringList maps = mapsListView->getMaps();
int index = maps.findIndex(usemap);
if (index == -1) {
maps.prepend("");
@@ -2757,14 +2757,14 @@ void KImageMapEditor::imageUsemap() {
}
#if KDE_IS_VERSION(3, 1, 90)
- QString input = KInputDialog::getItem(i18n("Enter Usemap"),
+ TQString input = KInputDialog::getItem(i18n("Enter Usemap"),
#else
- QString input = QInputDialog::getItem(i18n("Enter Usemap"),
+ TQString input = QInputDialog::getItem(i18n("Enter Usemap"),
#endif
i18n("Enter the usemap value:"),
maps,index,true,&ok,widget());
if (ok) {
- imageTag->replace("usemap", new QString(input));
+ imageTag->replace("usemap", new TQString(input));
imagesListView->updateImage(imageTag);
setModified(true);
@@ -2772,10 +2772,10 @@ void KImageMapEditor::imageUsemap() {
HtmlImgElement* imgEl = findHtmlImgElement(imageTag);
imgEl->htmlCode = "<";
- QString *tagName = imgEl->imgTag->find("tagname");
- imgEl->htmlCode += QString(*tagName);
+ TQString *tagName = imgEl->imgTag->find("tagname");
+ imgEl->htmlCode += TQString(*tagName);
- QDictIterator<QString> it( *imgEl->imgTag );
+ TQDictIterator<TQString> it( *imgEl->imgTag );
for( ; it.current(); ++it ) {
if (it.currentKey() != "tagname") {
imgEl->htmlCode += " " + it.currentKey() + "=\"";
diff --git a/kimagemapeditor/kimagemapeditor.h b/kimagemapeditor/kimagemapeditor.h
index bf76349e..6d655746 100644
--- a/kimagemapeditor/kimagemapeditor.h
+++ b/kimagemapeditor/kimagemapeditor.h
@@ -18,10 +18,10 @@
#ifndef KIMAGEMAPDIALOG_H
#define KIMAGEMAPDIALOG_H
-#include <qptrlist.h>
-#include <qobjectlist.h>
-#include <qdict.h>
-#include <qimage.h>
+#include <tqptrlist.h>
+#include <tqobjectlist.h>
+#include <tqdict.h>
+#include <tqimage.h>
#include <kurl.h>
#include <kparts/part.h>
#include <kparts/browserextension.h>
@@ -49,39 +49,39 @@ class KToggleAction;
/**
* Stores an area tag and all its attributes
*/
-typedef QDict<QString> AreaTag;
+typedef TQDict<TQString> AreaTag;
/**
* Stores an image tag and all its attributes
* the origcode attribute hold the original htmlcode
* of this tag
*/
-typedef QDict<QString> ImageTag;
+typedef TQDict<TQString> ImageTag;
/**
* Only a small class to give a list of AreaTags a name
*/
-class MapTag : public QPtrList<AreaTag> {
+class MapTag : public TQPtrList<AreaTag> {
public:
MapTag();
- QString name;
+ TQString name;
bool modified;
};
class HtmlElement {
public:
- HtmlElement(const QString & s) {
+ HtmlElement(const TQString & s) {
htmlCode = s;
};
virtual ~HtmlElement() {}
;
- QString htmlCode;
+ TQString htmlCode;
};
class HtmlMapElement : public HtmlElement {
public:
- HtmlMapElement(const QString & s) : HtmlElement(s) {
+ HtmlMapElement(const TQString & s) : HtmlElement(s) {
mapTag = 0L;
};
@@ -92,7 +92,7 @@ public:
class HtmlImgElement : public HtmlElement {
public:
-HtmlImgElement(const QString & s) : HtmlElement(s) {
+HtmlImgElement(const TQString & s) : HtmlElement(s) {
imgTag = 0L;
};
virtual ~HtmlImgElement() {}
@@ -103,7 +103,7 @@ HtmlImgElement(const QString & s) : HtmlElement(s) {
/**
* Stores the hole HTML content in a List.
*/
-class HtmlContent : public QPtrList<HtmlElement> {}
+class HtmlContent : public TQPtrList<HtmlElement> {}
;
@@ -133,8 +133,8 @@ class KImageMapEditor : public KParts::ReadWritePart {
public :
enum ToolType { Selection, Rectangle, Circle, Polygon, Freehand, AddPoint, RemovePoint };
- KImageMapEditor(QWidget *parentWidget, const char *,
- QObject *parent, const char *name, const QStringList & args = QStringList());
+ KImageMapEditor(TQWidget *parentWidget, const char *,
+ TQObject *parent, const char *name, const TQStringList & args = TQStringList());
virtual ~KImageMapEditor();
static KAboutData *createAboutData();
@@ -161,15 +161,15 @@ public :
void deselectAll();
void deselect(Area* s);
void deselectWithoutUpdate(Area*);
- QString getHTMLImageMap() const;
- Area* onArea(const QPoint & p) const;
- QPixmap makeListViewPix(Area &) ;
- QString mapName() const;
+ TQString getHTMLImageMap() const;
+ Area* onArea(const TQPoint & p) const;
+ TQPixmap makeListViewPix(Area &) ;
+ TQString mapName() const;
void select(Area*);
void selectWithoutUpdate(Area*);
- void select(QListViewItem*);
+ void select(TQListViewItem*);
AreaSelection* selected() const;
- void setPicture(const QImage & pix);
+ void setPicture(const TQImage & pix);
int showTagEditor(Area *);
KCommandHistory *commandHistory() const;
@@ -186,7 +186,7 @@ public :
virtual bool closeURL();
bool queryClose();
virtual void setReadWrite(bool);
- QString getHtmlCode();
+ TQString getHtmlCode();
/**
* Reimplemented to disable and enable Save action
@@ -213,14 +213,14 @@ public :
protected:
void init();
- bool openHTMLFile(const KURL &, const QString & mapName = QString::null, const QString & imagePath = QString::null);
+ bool openHTMLFile(const KURL &, const TQString & mapName = TQString::null, const TQString & imagePath = TQString::null);
void saveImageMap(const KURL &);
/**
* Returns a language dependend background picture, with
* the text : Drop an image or html file
*/
- QImage getBackgroundImage();
+ TQImage getBackgroundImage();
/**
@@ -236,8 +236,8 @@ private:
// the url of the working image;
KURL _imageUrl;
- QString _mapName;
- QImage _backgroundImage;
+ TQString _mapName;
+ TQImage _backgroundImage;
bool backupFileCreated;
@@ -247,7 +247,7 @@ private:
AreaSelection *copyArea;
Area *defaultArea;
DrawZone* drawZone;
- QTabWidget* tabWidget;
+ TQTabWidget* tabWidget;
AreaListView *areaListView;
ImagesListView* imagesListView;
MapsListView* mapsListView;
@@ -320,8 +320,8 @@ private:
KCommandHistory *_commandHistory;
int maxAreaPreviewHeight;
- QString cursorStatusText;
- QString selectionStatusText;
+ TQString cursorStatusText;
+ TQString selectionStatusText;
void setupActions();
void setupStatusBar();
@@ -331,37 +331,37 @@ private:
void updateAllAreas();
void updateUpDownBtn();
- QDict<QString> getTagAttributes(QTextStream & s,QString &);
+ TQDict<TQString> getTagAttributes(TQTextStream & s,TQString &);
void setMap(HtmlMapElement*);
void setMap(MapTag*);
- void addMap(const QString &);
+ void addMap(const TQString &);
// Returns the entire html file as a String
- HtmlElement* findHtmlElement(const QString &);
+ HtmlElement* findHtmlElement(const TQString &);
HtmlImgElement* findHtmlImgElement(ImageTag*);
- HtmlMapElement* findHtmlMapElement(const QString &);
+ HtmlMapElement* findHtmlMapElement(const TQString &);
void deleteAllMaps();
void addImage(const KURL &);
void setImageActionsEnabled(bool);
void setMapActionsEnabled(bool);
void saveAreasToMapTag(MapTag*);
- void showPopupMenu(const QPoint &, const QString &);
- void drawToCenter(QPainter* p, const QString & str, int y, int width);
+ void showPopupMenu(const TQPoint &, const TQString &);
+ void drawToCenter(TQPainter* p, const TQString & str, int y, int width);
public slots:
void slotChangeStatusCoords(int x,int y);
void slotUpdateSelectionCoords();
- void slotUpdateSelectionCoords( const QRect &);
+ void slotUpdateSelectionCoords( const TQRect &);
void slotAreaChanged(Area *);
- void slotShowMainPopupMenu(const QPoint &);
- void slotShowMapPopupMenu(QListViewItem *, const QPoint &);
- void slotShowImagePopupMenu(QListViewItem *, const QPoint &);
+ void slotShowMainPopupMenu(const TQPoint &);
+ void slotShowMapPopupMenu(TQListViewItem *, const TQPoint &);
+ void slotShowImagePopupMenu(TQListViewItem *, const TQPoint &);
void slotConfigChanged();
void setPicture(const KURL & url);
- void setMap(const QString &);
- void setMapName(const QString & s);
+ void setMap(const TQString &);
+ void setMapName(const TQString & s);
protected slots:
@@ -379,13 +379,13 @@ protected slots:
void fileSave();
void fileClose();
- void slotShowPopupMenu(QListViewItem*,const QPoint &);
+ void slotShowPopupMenu(TQListViewItem*,const TQPoint &);
void slotShowPreferences();
void slotHightlightAreas();
void slotShowAltTag();
void slotSelectionChanged();
- int showTagEditor(QListViewItem *item);
+ int showTagEditor(TQListViewItem *item);
int showTagEditor();
void slotZoom();
@@ -448,7 +448,7 @@ inline KImageMapEditor::ToolType KImageMapEditor::currentToolType() const {
return _currentToolType;
}
-inline QString KImageMapEditor::mapName() const {
+inline TQString KImageMapEditor::mapName() const {
return _mapName;
}
diff --git a/kimagemapeditor/kimearea.cpp b/kimagemapeditor/kimearea.cpp
index cb873564..cee54b8a 100644
--- a/kimagemapeditor/kimearea.cpp
+++ b/kimagemapeditor/kimearea.cpp
@@ -15,16 +15,16 @@
* *
***************************************************************************/
-#include <qbitmap.h>
-#include <qpointarray.h>
-#include <qpainter.h>
-#include <qpixmap.h>
-#include <qimage.h>
-#include <qpen.h>
-#include <qbrush.h>
-#include <qpalette.h>
-#include <qcolor.h>
-#include <qlistview.h>
+#include <tqbitmap.h>
+#include <tqpointarray.h>
+#include <tqpainter.h>
+#include <tqpixmap.h>
+#include <tqimage.h>
+#include <tqpen.h>
+#include <tqbrush.h>
+#include <tqpalette.h>
+#include <tqcolor.h>
+#include <tqlistview.h>
#include <kdebug.h>
@@ -41,7 +41,7 @@ bool Area::showAlt;
Area::Area()
{
- _coords=new QPointArray();
+ _coords=new TQPointArray();
_selectionPoints= new SelectionPointList();
_selectionPoints->setAutoDelete(true);
_finished=false;
@@ -61,13 +61,13 @@ Area* Area::clone() const
return areaClone;
}
-QPointArray* Area::coords() const {
+TQPointArray* Area::coords() const {
return _coords;
}
-QString Area::getHTMLAttributes() const
+TQString Area::getHTMLAttributes() const
{
- QString retStr="";
+ TQString retStr="";
for (AttributeIterator it = firstAttribute();it!=lastAttribute();++it)
{
@@ -85,20 +85,20 @@ Area::~Area() {
}
-bool Area::contains(const QPoint &) const {
+bool Area::contains(const TQPoint &) const {
return false;
}
-QString Area::getHTMLCode() const {
+TQString Area::getHTMLCode() const {
return "";
}
-QString Area::attribute(const QString & name) const
+TQString Area::attribute(const TQString & name) const
{
return _attributes[name.lower()];
}
-void Area::setAttribute(const QString & name, const QString & value)
+void Area::setAttribute(const TQString & name, const TQString & value)
{
_attributes.replace(name.lower(),value);
if (value.isEmpty())
@@ -116,16 +116,16 @@ AttributeIterator Area::lastAttribute() const
}
-bool Area::setCoords(const QString &) {
+bool Area::setCoords(const TQString &) {
return true;
}
-void Area::moveSelectionPoint(QRect*, const QPoint &)
+void Area::moveSelectionPoint(TQRect*, const TQPoint &)
{}
// Default implementation; is specified by subclasses
-QString Area::coordsToString() const
+TQString Area::coordsToString() const
{
return "";
}
@@ -139,13 +139,13 @@ void Area::setArea(const Area & copy)
{
delete _coords;
delete _selectionPoints;
- _coords=new QPointArray(copy.coords()->copy());
+ _coords=new TQPointArray(copy.coords()->copy());
_selectionPoints= new SelectionPointList();
currentHighlighted=-1;
// Need a deep copy of the list
- for (QRect *r=copy.selectionPoints()->first();r!=0L;r=copy.selectionPoints()->next())
- _selectionPoints->append(new QRect( r->topLeft(),r->bottomRight() ) );
+ for (TQRect *r=copy.selectionPoints()->first();r!=0L;r=copy.selectionPoints()->next())
+ _selectionPoints->append(new TQRect( r->topLeft(),r->bottomRight() ) );
_finished=copy.finished();
_isSelected=copy.isSelected();
@@ -162,7 +162,7 @@ void Area::setArea(const Area & copy)
}
-void Area::setListViewItem(QListViewItem* item) {
+void Area::setListViewItem(TQListViewItem* item) {
_listViewItem=item;
}
@@ -173,13 +173,13 @@ void Area::deleteListViewItem()
}
-void Area::setRect(const QRect & r)
+void Area::setRect(const TQRect & r)
{
_rect=r;
updateSelectionPoints();
}
-QRect Area::rect() const {
+TQRect Area::rect() const {
return _rect;
}
@@ -196,7 +196,7 @@ void Area::moveBy(int dx, int dy) {
_coords->setPoint(i,newX,newY);
}
- for (QRect *r=_selectionPoints->first();r!=0L;r=_selectionPoints->next()) {
+ for (TQRect *r=_selectionPoints->first();r!=0L;r=_selectionPoints->next()) {
r->moveBy(dx,dy);
}
}
@@ -213,12 +213,12 @@ uint Area::countSelectionPoints() const
return (uint) selectionPoints()->count();
}
-int Area::addCoord(const QPoint & p)
+int Area::addCoord(const TQPoint & p)
{
_coords->resize(_coords->size()+1);
_coords->setPoint(_coords->size()-1,p);
- QRect *r= new QRect(0,0,SELSIZE,SELSIZE);
+ TQRect *r= new TQRect(0,0,SELSIZE,SELSIZE);
r->moveCenter(p);
_selectionPoints->append(r);
setRect(_coords->boundingRect());
@@ -226,7 +226,7 @@ int Area::addCoord(const QPoint & p)
return _coords->size()-1;
}
-void Area::insertCoord(int pos, const QPoint & p)
+void Area::insertCoord(int pos, const TQPoint & p)
{
/*
@@ -253,7 +253,7 @@ void Area::insertCoord(int pos, const QPoint & p)
}
_coords->setPoint(pos, p);
- QRect *r= new QRect(0,0,SELSIZE,SELSIZE);
+ TQRect *r= new TQRect(0,0,SELSIZE,SELSIZE);
r->moveCenter(p);
_selectionPoints->insert(pos,r);
setRect(_coords->boundingRect());
@@ -277,7 +277,7 @@ void Area::removeCoord(int pos) {
setRect(_coords->boundingRect());
}
-bool Area::removeSelectionPoint(QRect * r)
+bool Area::removeSelectionPoint(TQRect * r)
{
if (_selectionPoints->contains(r))
{
@@ -289,7 +289,7 @@ bool Area::removeSelectionPoint(QRect * r)
}
-void Area::moveCoord(int pos, const QPoint & p) {
+void Area::moveCoord(int pos, const TQPoint & p) {
_coords->setPoint(pos,p);
_selectionPoints->at(pos)->moveCenter(p);
setRect(_coords->boundingRect());
@@ -307,21 +307,21 @@ void Area::highlightSelectionPoint(int number){
currentHighlighted=number;
}
-QRect Area::selectionRect() const {
- QRect r = rect();
+TQRect Area::selectionRect() const {
+ TQRect r = rect();
r.moveBy(-SELSIZE*2,-SELSIZE*2);
- r.setSize(r.size()+QSize(SELSIZE*4,SELSIZE*4));
+ r.setSize(r.size()+TQSize(SELSIZE*4,SELSIZE*4));
return r;
}
-void Area::drawHighlighting(QPainter & p)
+void Area::drawHighlighting(TQPainter & p)
{
if (Area::highlightArea && !isMoving() && _highlightedPixmap)
{
p.setRasterOp(Qt::CopyROP);
- QPoint point = QPoint(rect().x(),rect().y());
+ TQPoint point = TQPoint(rect().x(),rect().y());
if (point.x()<0)
point.setX(0);
if (point.y()<0)
@@ -332,21 +332,21 @@ void Area::drawHighlighting(QPainter & p)
}
}
-void Area::drawAlt(QPainter & p)
+void Area::drawAlt(TQPainter & p)
{
double x,y;
double scalex = p.worldMatrix().m11();
// double scaley = p.worldMatrix().m12();
- QWMatrix oldMatrix = p.worldMatrix();
+ TQWMatrix oldMatrix = p.worldMatrix();
- p.setWorldMatrix(QWMatrix(1,oldMatrix.m12(), oldMatrix.m21(), 1, oldMatrix.dx(), oldMatrix.dy() ));
+ p.setWorldMatrix(TQWMatrix(1,oldMatrix.m12(), oldMatrix.m21(), 1, oldMatrix.dx(), oldMatrix.dy() ));
x = (rect().x()+rect().width()/2)*scalex;
y = (rect().y()+rect().height()/2)*scalex;
- QFontMetrics metrics = p.fontMetrics();
+ TQFontMetrics metrics = p.fontMetrics();
int w = metrics.width(attribute("alt"));
x -= w/2;
@@ -362,7 +362,7 @@ void Area::drawAlt(QPainter & p)
else
{
p.setRasterOp(Qt::XorROP);
- p.setPen(QPen(QColor("white"),1));
+ p.setPen(TQPen(TQColor("white"),1));
}
p.drawText(myround(x),myround(y),attribute("alt"));
@@ -370,7 +370,7 @@ void Area::drawAlt(QPainter & p)
p.setWorldMatrix(oldMatrix);
}
-void Area::draw(QPainter & p)
+void Area::draw(TQPainter & p)
{
// Only draw the selection points at base class
@@ -382,45 +382,45 @@ void Area::draw(QPainter & p)
double scalex = p.worldMatrix().m11();
// double scaley = p.worldMatrix().m12();
- QWMatrix oldMatrix = p.worldMatrix();
+ TQWMatrix oldMatrix = p.worldMatrix();
- p.setWorldMatrix(QWMatrix(1,oldMatrix.m12(), oldMatrix.m21(), 1, oldMatrix.dx(), oldMatrix.dy() ));
+ p.setWorldMatrix(TQWMatrix(1,oldMatrix.m12(), oldMatrix.m21(), 1, oldMatrix.dx(), oldMatrix.dy() ));
- for (QRect *r=_selectionPoints->first();r!=0L;r=_selectionPoints->next()) {
+ for (TQRect *r=_selectionPoints->first();r!=0L;r=_selectionPoints->next()) {
// Draw a green circle around the selected point ( only when editing a polygon )
if (i==currentHighlighted) {
- QRect r2(0,0,15,15);
+ TQRect r2(0,0,15,15);
r2.moveCenter(r->center()*scalex);
p.setRasterOp(Qt::CopyROP);
- p.setPen(QPen(QColor("lightgreen"),2));
+ p.setPen(TQPen(TQColor("lightgreen"),2));
p.drawEllipse(r2);
p.setRasterOp(Qt::XorROP);
- p.setPen(QPen(QColor("white"),1));
+ p.setPen(TQPen(TQColor("white"),1));
}
// Draw the selection point
p.setRasterOp(Qt::XorROP);
- QRect r3(*r);
+ TQRect r3(*r);
int d = 1;
if (scalex > 2) d=0;
- r3.moveCenter( QPoint((int)(r3.center().x()*scalex),(int)(r3.center().y()*scalex)) );
+ r3.moveCenter( TQPoint((int)(r3.center().x()*scalex),(int)(r3.center().y()*scalex)) );
- p.fillRect(r3,QBrush("white"));
+ p.fillRect(r3,TQBrush("white"));
/*
- QRect r3(*r);
- r3.moveTopLeft( QPoint(r3.left()*scalex+2*(scalex-1), r3.top()*scalex+2*(scalex-1)) );
+ TQRect r3(*r);
+ r3.moveTopLeft( TQPoint(r3.left()*scalex+2*(scalex-1), r3.top()*scalex+2*(scalex-1)) );
- r3.setSize(r3.size()+QSize(2,2));
+ r3.setSize(r3.size()+TQSize(2,2));
//+ r3.moveBy(-1,-1);
p.setRasterOp(Qt::CopyROP);
- p.setPen(QPen(QColor("lightgreen"),1));
- p.setBrush(QColor("lightgreen"));
+ p.setPen(TQPen(TQColor("lightgreen"),1));
+ p.setBrush(TQColor("lightgreen"));
p.drawPie(r3,0,5760);
- p.setPen(QPen(QColor("black"),1));
- r3.setSize(r3.size()+QSize(2,2));
+ p.setPen(TQPen(TQColor("black"),1));
+ r3.setSize(r3.size()+TQSize(2,2));
r3.moveBy(-1,-1);
p.drawEllipse(r3);
*/
@@ -439,11 +439,11 @@ void Area::draw(QPainter & p)
}
-QRect* Area::onSelectionPoint(const QPoint & p, double zoom) const
+TQRect* Area::onSelectionPoint(const TQPoint & p, double zoom) const
{
- for (QRect *r=_selectionPoints->first();r!=0L;r=_selectionPoints->next())
+ for (TQRect *r=_selectionPoints->first();r!=0L;r=_selectionPoints->next())
{
- QRect r2(r->topLeft(),r->bottomRight());
+ TQRect r2(r->topLeft(),r->bottomRight());
r2.moveCenter(r2.center()*zoom);
@@ -464,13 +464,13 @@ QRect* Area::onSelectionPoint(const QPoint & p, double zoom) const
* returns only the part of the image which is
* covered by the area
*/
-QPixmap Area::cutOut(const QImage & image)
+TQPixmap Area::cutOut(const TQImage & image)
{
if ( 0>=rect().width() ||
0>=rect().height() ||
!rect().intersects(image.rect()) )
{
- QPixmap dummyPix(10,10);
+ TQPixmap dummyPix(10,10);
dummyPix.fill();
delete _highlightedPixmap;
_highlightedPixmap = 0L;
@@ -478,11 +478,11 @@ QPixmap Area::cutOut(const QImage & image)
}
// Get the mask from the subclasses
- QBitmap mask=getMask();
+ TQBitmap mask=getMask();
// The rectangle which is part of the image
- QRect partOfImage=rect();
- QRect partOfMask(0,0,mask.width(),mask.height());
+ TQRect partOfImage=rect();
+ TQRect partOfMask(0,0,mask.width(),mask.height());
// If the area is outside of the image make the
@@ -507,13 +507,13 @@ QPixmap Area::cutOut(const QImage & image)
partOfMask.setY(myabs(rect().y()));
}
- QImage tempImage=mask.convertToImage().copy(partOfMask);
+ TQImage tempImage=mask.convertToImage().copy(partOfMask);
mask.convertFromImage(tempImage);
// partOfImage = partOfImage.normalize();
- QImage cut=image.copy(partOfImage);
+ TQImage cut=image.copy(partOfImage);
- QPixmap pix;
+ TQPixmap pix;
// partOfMask = partOfMask.normalize();
if (!partOfMask.isValid())
@@ -521,9 +521,9 @@ QPixmap Area::cutOut(const QImage & image)
<< partOfMask.width() << "," << partOfMask.height() << "," << endl;
/*
- QBitmap mask2(partOfMask.width(), partOfMask.height());
- QPainter p4(&mask2);
- p4.drawPixmap( QPoint(0,0) ,mask,partOfMask);
+ TQBitmap mask2(partOfMask.width(), partOfMask.height());
+ TQPainter p4(&mask2);
+ p4.drawPixmap( TQPoint(0,0) ,mask,partOfMask);
p4.flush();
p4.end();
*/
@@ -532,27 +532,27 @@ QPixmap Area::cutOut(const QImage & image)
setHighlightedPixmap(cut, mask);
- QPixmap retPix(pix.width(),pix.height());
- QPainter p3(&retPix);
+ TQPixmap retPix(pix.width(),pix.height());
+ TQPainter p3(&retPix);
// if transparent image fill the background
// with gimp-like rectangles
if (pix.mask()) {
- QPixmap backPix(32,32);
+ TQPixmap backPix(32,32);
// Gimp like transparent rectangle
- QPainter p2(&backPix);
- p2.fillRect(0,0,32,32,QColor(156,149,156));
- p2.fillRect(0,16,16,16,QColor(98,105,98));
- p2.fillRect(16,0,16,16,QColor(98,105,98));
+ TQPainter p2(&backPix);
+ p2.fillRect(0,0,32,32,TQColor(156,149,156));
+ p2.fillRect(0,16,16,16,TQColor(98,105,98));
+ p2.fillRect(16,0,16,16,TQColor(98,105,98));
p2.flush();
- p3.setPen(QPen());
- p3.fillRect(0,0,pix.width(),pix.height(),QBrush(QColor("black"),backPix));
+ p3.setPen(TQPen());
+ p3.fillRect(0,0,pix.width(),pix.height(),TQBrush(TQColor("black"),backPix));
}
- p3.drawPixmap(QPoint(0,0),pix);
+ p3.drawPixmap(TQPoint(0,0),pix);
p3.flush();
p3.end();
retPix.setMask(mask);
@@ -560,22 +560,22 @@ QPixmap Area::cutOut(const QImage & image)
return retPix;
}
-QBitmap Area::getMask() const
+TQBitmap Area::getMask() const
{
- QBitmap b;
+ TQBitmap b;
return b;
}
-void Area::setHighlightedPixmap( QImage & im, QBitmap & mask )
+void Area::setHighlightedPixmap( TQImage & im, TQBitmap & mask )
{
if (!Area::highlightArea)
return;
delete _highlightedPixmap;
- QImage image = im.convertDepth( 32 );
- QSize size = image.size();
- QColor pixel;
+ TQImage image = im.convertDepth( 32 );
+ TQSize size = image.size();
+ TQColor pixel;
double r,g,b;
@@ -596,7 +596,7 @@ void Area::setHighlightedPixmap( QImage & im, QBitmap & mask )
}
}
- _highlightedPixmap = new QPixmap();
+ _highlightedPixmap = new TQPixmap();
_highlightedPixmap->convertFromImage( image );
_highlightedPixmap->setMask( mask );
@@ -613,13 +613,13 @@ void Area::setHighlightedPixmap( QImage & im, QBitmap & mask )
RectArea::RectArea()
: Area()
{
- QRect *p = new QRect(0,0,SELSIZE,SELSIZE);
+ TQRect *p = new TQRect(0,0,SELSIZE,SELSIZE);
_selectionPoints->append(p);
- p = new QRect(0,0,SELSIZE,SELSIZE);
+ p = new TQRect(0,0,SELSIZE,SELSIZE);
_selectionPoints->append(p);
- p = new QRect(0,0,SELSIZE,SELSIZE);
+ p = new TQRect(0,0,SELSIZE,SELSIZE);
_selectionPoints->append(p);
- p = new QRect(0,0,SELSIZE,SELSIZE);
+ p = new TQRect(0,0,SELSIZE,SELSIZE);
_selectionPoints->append(p);
_type=Area::Rectangle;
@@ -635,21 +635,21 @@ Area* RectArea::clone() const
return areaClone;
}
-void RectArea::draw(QPainter & p)
+void RectArea::draw(TQPainter & p)
{
drawHighlighting(p);
// p.setRasterOp(Qt::CopyROP);
// p.setRasterOp(Qt:: OrROP);
-// QBrush b(QBrush::SolidPattern);
-// QBrush b(QBrush::Dense4Pattern);
-// QBrush b(QBrush::BDiagPattern);
-// b.setColor(QColor(32,32,32));
+// TQBrush b(TQBrush::SolidPattern);
+// TQBrush b(TQBrush::Dense4Pattern);
+// TQBrush b(TQBrush::BDiagPattern);
+// b.setColor(TQColor(32,32,32));
// p.fillRect(rect(), b);
p.setRasterOp(Qt::XorROP);
- p.setPen(QPen(QColor("white"),1));
- QRect r(rect());
+ p.setPen(TQPen(TQColor("white"),1));
+ TQRect r(rect());
r.setWidth(r.width()+1);
r.setHeight(r.height()+1);
p.drawRect(r);
@@ -657,12 +657,12 @@ void RectArea::draw(QPainter & p)
Area::draw(p);
}
-QBitmap RectArea::getMask() const
+TQBitmap RectArea::getMask() const
{
- QBitmap mask(rect().width(),rect().height());
+ TQBitmap mask(rect().width(),rect().height());
mask.fill(Qt::color0);
- QPainter p(&mask);
+ TQPainter p(&mask);
p.setBackgroundColor(Qt::color0);
p.setPen(Qt::color1);
p.setBrush(Qt::color1);
@@ -672,9 +672,9 @@ QBitmap RectArea::getMask() const
return mask;
}
-QString RectArea::coordsToString() const
+TQString RectArea::coordsToString() const
{
- QString retStr=QString("%1,%2,%3,%4")
+ TQString retStr=TQString("%1,%2,%3,%4")
.arg(rect().left())
.arg(rect().top())
.arg(rect().right())
@@ -683,20 +683,20 @@ QString RectArea::coordsToString() const
return retStr;
}
-bool RectArea::contains(const QPoint & p) const{
+bool RectArea::contains(const TQPoint & p) const{
return rect().contains(p);
}
-void RectArea::moveSelectionPoint(QRect* selectionPoint, const QPoint & p)
+void RectArea::moveSelectionPoint(TQRect* selectionPoint, const TQPoint & p)
{
selectionPoint->moveCenter(p);
int i=0;
- for (QRect *r=_selectionPoints->first();r!=0L;r=_selectionPoints->next()) {
+ for (TQRect *r=_selectionPoints->first();r!=0L;r=_selectionPoints->next()) {
if (r==selectionPoint)
break;
i++;
}
- QRect r2(_rect);
+ TQRect r2(_rect);
switch (i) {
case 0 : _rect.setLeft(p.x());
_rect.setTop(p.y());
@@ -720,19 +720,19 @@ void RectArea::moveSelectionPoint(QRect* selectionPoint, const QPoint & p)
void RectArea::updateSelectionPoints()
{
_selectionPoints->first()->moveCenter(_rect.topLeft());
- _selectionPoints->next()->moveCenter(_rect.topRight()+QPoint(1,0));
- _selectionPoints->next()->moveCenter(_rect.bottomLeft()+QPoint(0,1));
- _selectionPoints->next()->moveCenter(_rect.bottomRight()+QPoint(1,1));
+ _selectionPoints->next()->moveCenter(_rect.topRight()+TQPoint(1,0));
+ _selectionPoints->next()->moveCenter(_rect.bottomLeft()+TQPoint(0,1));
+ _selectionPoints->next()->moveCenter(_rect.bottomRight()+TQPoint(1,1));
}
-bool RectArea::setCoords(const QString & s)
+bool RectArea::setCoords(const TQString & s)
{
_finished=true;
- QStringList list=QStringList::split(",",s);
- QRect r;
+ TQStringList list=TQStringList::split(",",s);
+ TQRect r;
bool ok=true;
- QStringList::Iterator it = list.begin();
+ TQStringList::Iterator it = list.begin();
r.setLeft((*it).toInt(&ok,10));it++;
r.setTop((*it).toInt(&ok,10));it++;
r.setRight((*it).toInt(&ok,10));it++;
@@ -744,8 +744,8 @@ bool RectArea::setCoords(const QString & s)
return false;
}
-QString RectArea::getHTMLCode() const {
- QString retStr;
+TQString RectArea::getHTMLCode() const {
+ TQString retStr;
retStr+="<area ";
retStr+="shape=\"rect\" ";
@@ -766,13 +766,13 @@ CircleArea::CircleArea()
: Area()
{
_type=Area::Circle;
- QRect *p = new QRect(0,0,SELSIZE,SELSIZE);
+ TQRect *p = new TQRect(0,0,SELSIZE,SELSIZE);
_selectionPoints->append(p);
- p = new QRect(0,0,SELSIZE,SELSIZE);
+ p = new TQRect(0,0,SELSIZE,SELSIZE);
_selectionPoints->append(p);
- p = new QRect(0,0,SELSIZE,SELSIZE);
+ p = new TQRect(0,0,SELSIZE,SELSIZE);
_selectionPoints->append(p);
- p = new QRect(0,0,SELSIZE,SELSIZE);
+ p = new TQRect(0,0,SELSIZE,SELSIZE);
_selectionPoints->append(p);
}
@@ -786,26 +786,26 @@ Area* CircleArea::clone() const
return areaClone;
}
-void CircleArea::draw(QPainter & p)
+void CircleArea::draw(TQPainter & p)
{
drawHighlighting(p);
/*
p.setRasterOp(Qt::CopyROP);
- QBrush bold = p.brush();
- QBrush b(QBrush::Dense5Pattern);
- b.setColor(QColor("green"));
+ TQBrush bold = p.brush();
+ TQBrush b(TQBrush::Dense5Pattern);
+ b.setColor(TQColor("green"));
p.setBrush(b);
- QRect r = _rect;
+ TQRect r = _rect;
r.moveBy(1,1);
- r.setSize( r.size()-QSize(2,2) );
+ r.setSize( r.size()-TQSize(2,2) );
p.drawChord(r,0,5760);
p.setBrush(bold);
*/
p.setRasterOp(Qt::XorROP);
- p.setPen(QPen(QColor("white"),1));
+ p.setPen(TQPen(TQColor("white"),1));
- QRect r(_rect);
+ TQRect r(_rect);
r.setWidth(r.width()+1);
r.setHeight(r.height()+1);
p.drawEllipse(r);
@@ -813,16 +813,16 @@ void CircleArea::draw(QPainter & p)
Area::draw(p);
}
-QBitmap CircleArea::getMask() const
+TQBitmap CircleArea::getMask() const
{
- QBitmap mask(_rect.width(),_rect.height());
+ TQBitmap mask(_rect.width(),_rect.height());
mask.fill(Qt::color0);
- QPainter p(&mask);
+ TQPainter p(&mask);
p.setBackgroundColor(Qt::color0);
p.setPen(Qt::color1);
p.setBrush(Qt::color1);
- p.drawPie(QRect(0,0,_rect.width(),_rect.height()),0,5760);
+ p.drawPie(TQRect(0,0,_rect.width(),_rect.height()),0,5760);
p.flush();
p.end();
@@ -831,9 +831,9 @@ QBitmap CircleArea::getMask() const
}
-QString CircleArea::coordsToString() const
+TQString CircleArea::coordsToString() const
{
- QString retStr=QString("%1,%2,%3")
+ TQString retStr=TQString("%1,%2,%3")
.arg(_rect.center().x())
.arg(_rect.center().y())
.arg(_rect.width()/2);
@@ -841,18 +841,18 @@ QString CircleArea::coordsToString() const
return retStr;
}
-bool CircleArea::contains(const QPoint & p) const
+bool CircleArea::contains(const TQPoint & p) const
{
- QRegion r(_rect,QRegion::Ellipse);
+ TQRegion r(_rect,TQRegion::Ellipse);
return r.contains(p);
}
-void CircleArea::moveSelectionPoint(QRect* selectionPoint, const QPoint & p)
+void CircleArea::moveSelectionPoint(TQRect* selectionPoint, const TQPoint & p)
{
selectionPoint->moveCenter(p);
int i=0;
- for (QRect *r=_selectionPoints->first();r!=0L;r=_selectionPoints->next()) {
+ for (TQRect *r=_selectionPoints->first();r!=0L;r=_selectionPoints->next()) {
if (r==selectionPoint)
break;
i++;
@@ -860,7 +860,7 @@ void CircleArea::moveSelectionPoint(QRect* selectionPoint, const QPoint & p)
// The code below really sucks, but I have no better idea.
// it only makes sure that the circle is perfektly round
- QPoint newPoint;
+ TQPoint newPoint;
int diff=myabs(p.x()-_rect.center().x());
if (myabs(p.y()-_rect.center().y())>diff)
diff=myabs(p.y()-_rect.center().y());
@@ -910,9 +910,9 @@ void CircleArea::moveSelectionPoint(QRect* selectionPoint, const QPoint & p)
}
-void CircleArea::setRect(const QRect & r)
+void CircleArea::setRect(const TQRect & r)
{
- QRect r2 = r;
+ TQRect r2 = r;
if ( r2.height() != r2.width() )
r2.setHeight( r2.width() );
@@ -928,26 +928,26 @@ void CircleArea::updateSelectionPoints()
_selectionPoints->next()->moveCenter(_rect.bottomRight());
}
-bool CircleArea::setCoords(const QString & s)
+bool CircleArea::setCoords(const TQString & s)
{
_finished=true;
- QStringList list=QStringList::split(",",s);
+ TQStringList list=TQStringList::split(",",s);
bool ok=true;
- QStringList::Iterator it = list.begin();
+ TQStringList::Iterator it = list.begin();
int x=(*it).toInt(&ok,10);it++;
int y=(*it).toInt(&ok,10);it++;
int rad=(*it).toInt(&ok,10);
if (!ok) return false;
- QRect r;
+ TQRect r;
r.setWidth(rad*2);
r.setHeight(rad*2);
- r.moveCenter(QPoint(x,y));
+ r.moveCenter(TQPoint(x,y));
setRect(r);
return true;
}
-QString CircleArea::getHTMLCode() const {
- QString retStr;
+TQString CircleArea::getHTMLCode() const {
+ TQString retStr;
retStr+="<area ";
retStr+="shape=\"circle\" ";
@@ -981,12 +981,12 @@ Area* PolyArea::clone() const
return areaClone;
}
-void PolyArea::draw(QPainter & p)
+void PolyArea::draw(TQPainter & p)
{
drawHighlighting(p);
p.setRasterOp(Qt::XorROP);
- p.setPen(QPen(QColor("white"),1));
+ p.setPen(TQPen(TQColor("white"),1));
if (_coords->count()==0) return;
@@ -1007,32 +1007,32 @@ void PolyArea::draw(QPainter & p)
Area::draw(p);
}
-QBitmap PolyArea::getMask() const
+TQBitmap PolyArea::getMask() const
{
- QBitmap mask(_rect.width(),_rect.height());
+ TQBitmap mask(_rect.width(),_rect.height());
mask.fill(Qt::color0);
- QPainter p(&mask);
+ TQPainter p(&mask);
p.setBackgroundColor(Qt::color0);
p.setPen(Qt::color1);
p.setBrush(Qt::color1);
p.setClipping(true);
- QRegion r(*_coords);
+ TQRegion r(*_coords);
r.translate(-_rect.left(),-_rect.top());
p.setClipRegion(r);
- p.fillRect(QRect(0,0,_rect.width(),_rect.height()),Qt::color1);
+ p.fillRect(TQRect(0,0,_rect.width(),_rect.height()),Qt::color1);
p.flush();
p.end();
return mask;
}
-QString PolyArea::coordsToString() const
+TQString PolyArea::coordsToString() const
{
- QString retStr;
+ TQString retStr;
for (uint i=0;i<_coords->count();i++) {
- retStr.append(QString("%1,%2,")
+ retStr.append(TQString("%1,%2,")
.arg(_coords->point(i).x())
.arg(_coords->point(i).y()));
}
@@ -1042,13 +1042,13 @@ QString PolyArea::coordsToString() const
return retStr;
}
-int PolyArea::distance(const QPoint &p1, const QPoint &p2)
+int PolyArea::distance(const TQPoint &p1, const TQPoint &p2)
{
- QPoint temp = p1-p2;
+ TQPoint temp = p1-p2;
return temp.manhattanLength();
}
-bool PolyArea::isBetween(const QPoint &p, const QPoint &p1, const QPoint &p2)
+bool PolyArea::isBetween(const TQPoint &p, const TQPoint &p1, const TQPoint &p2)
{
int dist = distance(p,p1)+distance(p,p2)-distance(p1,p2);
@@ -1063,7 +1063,7 @@ void PolyArea::simplifyCoords()
if (_coords->size()<4)
return;
- QPoint p = _coords->point(0) - _coords->point(1);
+ TQPoint p = _coords->point(0) - _coords->point(1);
uint i = 1;
@@ -1119,7 +1119,7 @@ void PolyArea::simplifyCoords()
}
-int PolyArea::addCoord(const QPoint & p)
+int PolyArea::addCoord(const TQPoint & p)
{
if (_coords->size()<3)
{
@@ -1135,7 +1135,7 @@ int PolyArea::addCoord(const QPoint & p)
int n=_coords->size();
-// QPoint temp = p-_coords->point(0);
+// TQPoint temp = p-_coords->point(0);
int nearest = 0;
int olddist = distance(p,_coords->point(0));
int mindiff = 999999999;
@@ -1160,23 +1160,23 @@ int PolyArea::addCoord(const QPoint & p)
}
-bool PolyArea::contains(const QPoint & p) const
+bool PolyArea::contains(const TQPoint & p) const
{
// A line can't contain a point
if (_coords->count() >2 ) {
- QRegion r(*_coords);
+ TQRegion r(*_coords);
return r.contains(p);
}
else
return false;
}
-void PolyArea::moveSelectionPoint(QRect* selectionPoint, const QPoint & p)
+void PolyArea::moveSelectionPoint(TQRect* selectionPoint, const TQPoint & p)
{
selectionPoint->moveCenter(p);
int i=0;
- for (QRect *r=_selectionPoints->first();r!=0L;r=_selectionPoints->next()) {
+ for (TQRect *r=_selectionPoints->first();r!=0L;r=_selectionPoints->next()) {
if (r==selectionPoint)
break;
i++;
@@ -1187,7 +1187,7 @@ void PolyArea::moveSelectionPoint(QRect* selectionPoint, const QPoint & p)
void PolyArea::updateSelectionPoints()
{
- QRect *r;
+ TQRect *r;
r=_selectionPoints->first();
for (uint i=0;i<_coords->size();i++)
@@ -1198,14 +1198,14 @@ void PolyArea::updateSelectionPoints()
}
-bool PolyArea::setCoords(const QString & s)
+bool PolyArea::setCoords(const TQString & s)
{
_finished=true;
- QStringList list=QStringList::split(",",s);
- _coords=new QPointArray();
+ TQStringList list=TQStringList::split(",",s);
+ _coords=new TQPointArray();
_selectionPoints= new SelectionPointList();
- for (QStringList::Iterator it = list.begin(); it !=list.end(); ++it)
+ for (TQStringList::Iterator it = list.begin(); it !=list.end(); ++it)
{
bool ok=true;
int newXCoord=(*it).toInt(&ok,10);
@@ -1214,15 +1214,15 @@ bool PolyArea::setCoords(const QString & s)
if (it==list.end()) break;
int newYCoord=(*it).toInt(&ok,10);
if (!ok) return false;
- insertCoord(_coords->size(), QPoint(newXCoord,newYCoord));
+ insertCoord(_coords->size(), TQPoint(newXCoord,newYCoord));
}
return true;
}
-QString PolyArea::getHTMLCode() const {
- QString retStr;
+TQString PolyArea::getHTMLCode() const {
+ TQString retStr;
retStr+="<area ";
retStr+="shape=\"poly\" ";
@@ -1243,12 +1243,12 @@ void PolyArea::setFinished(bool b)
_finished=b;
}
-QRect PolyArea::selectionRect() const
+TQRect PolyArea::selectionRect() const
{
- QRect r = _rect;
+ TQRect r = _rect;
r.moveBy(-10,-10);
- r.setSize(r.size()+QSize(21,21));
+ r.setSize(r.size()+TQSize(21,21));
return r;
}
@@ -1276,12 +1276,12 @@ Area* DefaultArea::clone() const
return areaClone;
}
-void DefaultArea::draw(QPainter &)
+void DefaultArea::draw(TQPainter &)
{}
-QString DefaultArea::getHTMLCode() const {
- QString retStr;
+TQString DefaultArea::getHTMLCode() const {
+ TQString retStr;
retStr+="<area ";
retStr+="shape=\"default\" ";
@@ -1378,7 +1378,7 @@ void AreaSelection::reset()
invalidate();
}
-bool AreaSelection::contains(const QPoint & p) const
+bool AreaSelection::contains(const TQPoint & p) const
{
bool b=false;
AreaListIterator it=getAreaListIterator();
@@ -1395,14 +1395,14 @@ bool AreaSelection::contains(const QPoint & p) const
return b;
}
-QRect* AreaSelection::onSelectionPoint(const QPoint & p, double zoom) const
+TQRect* AreaSelection::onSelectionPoint(const TQPoint & p, double zoom) const
{
AreaListIterator it=getAreaListIterator();
if (it.count() != 1)
return 0L;
- QRect* retRect=0L;
+ TQRect* retRect=0L;
for ( ; it.current() != 0L; ++it )
{
@@ -1415,7 +1415,7 @@ QRect* AreaSelection::onSelectionPoint(const QPoint & p, double zoom) const
return retRect;
}
-void AreaSelection::moveSelectionPoint(QRect* selectionPoint, const QPoint & p)
+void AreaSelection::moveSelectionPoint(TQRect* selectionPoint, const TQPoint & p)
{
// It's only possible to move a SelectionPoint if only one Area is selected
if (_areas->count() != 1)
@@ -1439,7 +1439,7 @@ void AreaSelection::moveBy(int dx, int dy)
invalidate();
}
-QString AreaSelection::typeString() const
+TQString AreaSelection::typeString() const
{
// if there is only one Area selected
// show the name of that Area
@@ -1480,12 +1480,12 @@ void AreaSelection::updateSelectionPoints()
-QRect AreaSelection::selectionRect() const
+TQRect AreaSelection::selectionRect() const
{
if (!_selectionCacheValid)
{
_selectionCacheValid=true;
- QRect r;
+ TQRect r;
AreaListIterator it=getAreaListIterator();
for ( ; it.current() != 0L; ++it )
@@ -1551,7 +1551,7 @@ void AreaSelection::setAreaList( const AreaList & areas )
invalidate();
}
-void AreaSelection::setRect(const QRect & r)
+void AreaSelection::setRect(const TQRect & r)
{
if ( _areas->count()==1 )
{
@@ -1563,12 +1563,12 @@ void AreaSelection::setRect(const QRect & r)
updateSelectionPoints();
}
-QRect AreaSelection::rect() const
+TQRect AreaSelection::rect() const
{
if (!_rectCacheValid)
{
_rectCacheValid=true;
- QRect r;
+ TQRect r;
AreaListIterator it=getAreaListIterator();
for ( ; it.current() != 0L; ++it )
@@ -1581,7 +1581,7 @@ QRect AreaSelection::rect() const
}
-int AreaSelection::addCoord(const QPoint & p)
+int AreaSelection::addCoord(const TQPoint & p)
{
if ( _areas->count()==1 )
{
@@ -1592,7 +1592,7 @@ int AreaSelection::addCoord(const QPoint & p)
return 0;
}
-void AreaSelection::insertCoord(int pos, const QPoint & p)
+void AreaSelection::insertCoord(int pos, const TQPoint & p)
{
if ( _areas->count()==1 )
{
@@ -1610,7 +1610,7 @@ void AreaSelection::removeCoord(int pos)
}
}
-bool AreaSelection::removeSelectionPoint(QRect * r)
+bool AreaSelection::removeSelectionPoint(TQRect * r)
{
bool result=false;
@@ -1634,7 +1634,7 @@ SelectionPointList* AreaSelection::selectionPoints() const
}
-void AreaSelection::moveCoord(int pos,const QPoint & p)
+void AreaSelection::moveCoord(int pos,const TQPoint & p)
{
if ( _areas->count()==1 )
{
@@ -1653,7 +1653,7 @@ void AreaSelection::highlightSelectionPoint(int i)
}
-QPointArray* AreaSelection::coords() const
+TQPointArray* AreaSelection::coords() const
{
if ( _areas->count()==1 )
{
@@ -1663,7 +1663,7 @@ QPointArray* AreaSelection::coords() const
return Area::coords();
}
-QString AreaSelection::attribute(const QString & name) const
+TQString AreaSelection::attribute(const TQString & name) const
{
if ( _areas->count()==1 )
{
@@ -1673,7 +1673,7 @@ QString AreaSelection::attribute(const QString & name) const
return Area::attribute(name);
}
-void AreaSelection::setAttribute(const QString & name, const QString & value)
+void AreaSelection::setAttribute(const TQString & name, const TQString & value)
{
AreaListIterator it=getAreaListIterator();
@@ -1728,7 +1728,7 @@ bool AreaSelection::isMoving() const
* Checks if an area is outside the rectangle parameter
* returns false if an area has no pixel in common with the rectangle parameter
**/
-bool AreaSelection::allAreasWithin(const QRect & r) const
+bool AreaSelection::allAreasWithin(const TQRect & r) const
{
if ( ! r.contains(rect()) )
{
@@ -1743,7 +1743,7 @@ bool AreaSelection::allAreasWithin(const QRect & r) const
}
-void AreaSelection::draw(QPainter &)
+void AreaSelection::draw(TQPainter &)
{}
diff --git a/kimagemapeditor/kimearea.h b/kimagemapeditor/kimearea.h
index 581bba94..8cd9677a 100644
--- a/kimagemapeditor/kimearea.h
+++ b/kimagemapeditor/kimearea.h
@@ -18,11 +18,11 @@
#ifndef KIMEAREA_H
#define KIMEAREA_H
-#include <qrect.h>
-#include <qpoint.h>
-#include <qptrlist.h>
+#include <tqrect.h>
+#include <tqpoint.h>
+#include <tqptrlist.h>
#include <klocale.h>
-#include <qmap.h>
+#include <tqmap.h>
#include "kdeversion.h"
@@ -31,10 +31,10 @@ class QPointArray;
class QListViewItem;
class QBitmap;
-typedef QPtrList<QRect> SelectionPointList;
+typedef TQPtrList<TQRect> SelectionPointList;
-typedef QMap<QString,QString> AttributeMap;
-typedef QMapConstIterator<QString,QString> AttributeIterator;
+typedef TQMap<TQString,TQString> AttributeMap;
+typedef TQMapConstIterator<TQString,TQString> AttributeIterator;
@@ -46,26 +46,26 @@ public:
static bool showAlt;
protected:
- QRect _rect;
+ TQRect _rect;
ShapeType _type;
- QString _name;
- QString _href;
- QString _alt;
- QString _target;
+ TQString _name;
+ TQString _href;
+ TQString _alt;
+ TQString _target;
AttributeMap _attributes;
bool _isSelected;
bool _finished;
bool _isMoving;
int currentHighlighted;
- QListViewItem* _listViewItem;
+ TQListViewItem* _listViewItem;
// Only used for Polygons
- QPointArray *_coords;
+ TQPointArray *_coords;
SelectionPointList *_selectionPoints;
- QPixmap *_highlightedPixmap;
+ TQPixmap *_highlightedPixmap;
- void drawHighlighting(QPainter & p);
- void drawAlt(QPainter & p);
- QString getHTMLAttributes() const;
+ void drawHighlighting(TQPainter & p);
+ void drawAlt(TQPainter & p);
+ TQString getHTMLAttributes() const;
public:
Area();
@@ -73,60 +73,60 @@ public:
virtual Area* clone() const;
// Default implementation; is specified by subclasses
- virtual bool contains(const QPoint &) const;
+ virtual bool contains(const TQPoint &) const;
// Default implementation; is specified by subclasses
- virtual QString coordsToString() const;
- virtual void draw(QPainter &);
+ virtual TQString coordsToString() const;
+ virtual void draw(TQPainter &);
- virtual QBitmap getMask() const;
- virtual QString getHTMLCode() const;
+ virtual TQBitmap getMask() const;
+ virtual TQString getHTMLCode() const;
- virtual void setHighlightedPixmap( QImage &, QBitmap &);
+ virtual void setHighlightedPixmap( TQImage &, TQBitmap &);
virtual void moveBy(int, int);
virtual void moveTo(int, int);
- virtual void moveSelectionPoint(QRect*, const QPoint &);
+ virtual void moveSelectionPoint(TQRect*, const TQPoint &);
- virtual QRect* onSelectionPoint(const QPoint &,double zoom) const;
- virtual bool removeSelectionPoint(QRect * r);
+ virtual TQRect* onSelectionPoint(const TQPoint &,double zoom) const;
+ virtual bool removeSelectionPoint(TQRect * r);
virtual SelectionPointList* selectionPoints() const { return _selectionPoints; }
- virtual QRect rect() const;
+ virtual TQRect rect() const;
- virtual QRect selectionRect() const;
+ virtual TQRect selectionRect() const;
virtual void setArea(const Area &);
- virtual bool setCoords(const QString &);
+ virtual bool setCoords(const TQString &);
/** finished drawing only important for polygon */
virtual void setFinished(bool b) { _finished=b; }
- virtual void setRect(const QRect &);
+ virtual void setRect(const TQRect &);
virtual void setMoving(bool b);
virtual bool isMoving() const;
// Default implementation; is specified by subclasses
- virtual QString typeString() const { return ""; }
+ virtual TQString typeString() const { return ""; }
virtual ShapeType type() const;
virtual void updateSelectionPoints() {};
// Only interesting for Polygons
virtual void simplifyCoords() {};
- virtual int addCoord(const QPoint &);
- virtual void insertCoord(int, const QPoint &);
+ virtual int addCoord(const TQPoint &);
+ virtual void insertCoord(int, const TQPoint &);
virtual void removeCoord(int);
- virtual void moveCoord(int,const QPoint &);
- virtual QPointArray* coords() const;
+ virtual void moveCoord(int,const TQPoint &);
+ virtual TQPointArray* coords() const;
virtual void highlightSelectionPoint(int);
- virtual QString attribute(const QString &) const;
- virtual void setAttribute(const QString &, const QString &);
+ virtual TQString attribute(const TQString &) const;
+ virtual void setAttribute(const TQString &, const TQString &);
virtual AttributeIterator firstAttribute() const;
virtual AttributeIterator lastAttribute() const;
- QPixmap cutOut(const QImage &) ;
- void setListViewItem(QListViewItem*);
+ TQPixmap cutOut(const TQImage &) ;
+ void setListViewItem(TQListViewItem*);
void deleteListViewItem();
- QListViewItem* listViewItem() const;
- void setName(const QString &);
- QString name() const;
+ TQListViewItem* listViewItem() const;
+ void setName(const TQString &);
+ TQString name() const;
void setSelected(bool b);
bool isSelected() const;
bool finished() const;
@@ -136,15 +136,15 @@ public:
-inline QListViewItem* Area::listViewItem() const {
+inline TQListViewItem* Area::listViewItem() const {
return _listViewItem;
}
-inline void Area::setName(const QString & name) {
+inline void Area::setName(const TQString & name) {
_name=name;
}
-inline QString Area::name() const {
+inline TQString Area::name() const {
return _name;
}
@@ -172,14 +172,14 @@ class RectArea : public Area
virtual ~RectArea();
virtual Area* clone() const;
- virtual bool contains(const QPoint & p) const;
- virtual QString coordsToString() const;
- virtual void draw(QPainter & p);
- virtual void moveSelectionPoint(QRect* selectionPoint, const QPoint & p);
- virtual bool setCoords(const QString & s);
- virtual QString typeString() const { return i18n("Rectangle"); }
- virtual QBitmap getMask() const;
- virtual QString getHTMLCode() const;
+ virtual bool contains(const TQPoint & p) const;
+ virtual TQString coordsToString() const;
+ virtual void draw(TQPainter & p);
+ virtual void moveSelectionPoint(TQRect* selectionPoint, const TQPoint & p);
+ virtual bool setCoords(const TQString & s);
+ virtual TQString typeString() const { return i18n("Rectangle"); }
+ virtual TQBitmap getMask() const;
+ virtual TQString getHTMLCode() const;
virtual void updateSelectionPoints();
};
@@ -194,15 +194,15 @@ class CircleArea : public Area
virtual ~CircleArea();
virtual Area* clone() const;
- virtual bool contains(const QPoint & p) const;
- virtual QString coordsToString() const;
- virtual void draw(QPainter & p);
- virtual void moveSelectionPoint(QRect* selectionPoint, const QPoint & p);
- virtual bool setCoords(const QString & s);
- virtual void setRect(const QRect & r);
- virtual QString typeString() const { return i18n("Circle"); }
- virtual QBitmap getMask() const;
- virtual QString getHTMLCode() const;
+ virtual bool contains(const TQPoint & p) const;
+ virtual TQString coordsToString() const;
+ virtual void draw(TQPainter & p);
+ virtual void moveSelectionPoint(TQRect* selectionPoint, const TQPoint & p);
+ virtual bool setCoords(const TQString & s);
+ virtual void setRect(const TQRect & r);
+ virtual TQString typeString() const { return i18n("Circle"); }
+ virtual TQBitmap getMask() const;
+ virtual TQString getHTMLCode() const;
virtual void updateSelectionPoints();
};
@@ -217,23 +217,23 @@ class PolyArea :public Area
virtual ~PolyArea();
virtual Area* clone() const;
- virtual bool contains(const QPoint & p) const;
- virtual QString coordsToString() const;
- virtual void draw(QPainter & p);
- virtual void moveSelectionPoint(QRect* selectionPoint, const QPoint & p);
+ virtual bool contains(const TQPoint & p) const;
+ virtual TQString coordsToString() const;
+ virtual void draw(TQPainter & p);
+ virtual void moveSelectionPoint(TQRect* selectionPoint, const TQPoint & p);
virtual void simplifyCoords();
- virtual int addCoord(const QPoint & p);
- virtual bool setCoords(const QString & s);
- virtual QRect selectionRect() const;
+ virtual int addCoord(const TQPoint & p);
+ virtual bool setCoords(const TQString & s);
+ virtual TQRect selectionRect() const;
virtual void setFinished(bool b);
- virtual QString typeString() const { return i18n("Polygon"); }
- virtual QBitmap getMask() const;
- virtual QString getHTMLCode() const;
+ virtual TQString typeString() const { return i18n("Polygon"); }
+ virtual TQBitmap getMask() const;
+ virtual TQString getHTMLCode() const;
virtual void updateSelectionPoints();
private:
- static int distance(const QPoint &p1, const QPoint &p2);
- static bool isBetween(const QPoint &p, const QPoint &p1, const QPoint &p2);
+ static int distance(const TQPoint &p1, const TQPoint &p2);
+ static bool isBetween(const TQPoint &p, const TQPoint &p1, const TQPoint &p2);
};
@@ -248,15 +248,15 @@ class DefaultArea :public Area
virtual Area* clone() const;
// the default area isn't drawn
- virtual void draw(QPainter & p);
- virtual QString typeString() const { return i18n("Default"); }
- virtual QString getHTMLCode() const;
+ virtual void draw(TQPainter & p);
+ virtual TQString typeString() const { return i18n("Default"); }
+ virtual TQString getHTMLCode() const;
};
-typedef QPtrList<Area> AreaList;
-typedef QPtrListIterator<Area> AreaListIterator;
+typedef TQPtrList<Area> AreaList;
+typedef TQPtrListIterator<Area> AreaListIterator;
/**
* This class represents a selection of areas
@@ -294,18 +294,18 @@ class AreaSelection : public Area {
/**
* Overiden Methods of the Area class
*/
- virtual bool contains(const QPoint & p) const;
+ virtual bool contains(const TQPoint & p) const;
/**
*
**/
- virtual QRect* onSelectionPoint(const QPoint & p, double zoom) const;
+ virtual TQRect* onSelectionPoint(const TQPoint & p, double zoom) const;
/**
* Only if one Area is selected the moveSelectionPoint method
* of that Area will be called
**/
- virtual void moveSelectionPoint(QRect* selectionPoint, const QPoint & p);
+ virtual void moveSelectionPoint(TQRect* selectionPoint, const TQPoint & p);
virtual SelectionPointList* selectionPoints() const;
@@ -327,16 +327,16 @@ class AreaSelection : public Area {
* If only one Area is selected the setRect method of that Area
* will be called
**/
- virtual void setRect(const QRect & r);
- virtual QRect rect() const;
+ virtual void setRect(const TQRect & r);
+ virtual TQRect rect() const;
- virtual QString typeString() const;
+ virtual TQString typeString() const;
virtual ShapeType type() const;
// The selection is only a container
// so it is never drawn
- virtual void draw(QPainter & p);
+ virtual void draw(TQPainter & p);
/**
@@ -345,18 +345,18 @@ class AreaSelection : public Area {
virtual Area* clone() const;
virtual void updateSelectionPoints();
- virtual int addCoord(const QPoint & p);
- virtual void insertCoord(int pos, const QPoint & p);
+ virtual int addCoord(const TQPoint & p);
+ virtual void insertCoord(int pos, const TQPoint & p);
virtual void removeCoord(int pos);
- virtual bool removeSelectionPoint(QRect * r);
- virtual void moveCoord(int pos,const QPoint & p);
- virtual QPointArray* coords() const;
+ virtual bool removeSelectionPoint(TQRect * r);
+ virtual void moveCoord(int pos,const TQPoint & p);
+ virtual TQPointArray* coords() const;
virtual void highlightSelectionPoint(int);
- virtual QRect selectionRect() const;
+ virtual TQRect selectionRect() const;
- virtual QString attribute(const QString & name) const;
- virtual void setAttribute(const QString & name, const QString & value);
+ virtual TQString attribute(const TQString & name) const;
+ virtual void setAttribute(const TQString & name, const TQString & value);
virtual AttributeIterator firstAttribute() const;
virtual AttributeIterator lastAttribute() const;
@@ -364,7 +364,7 @@ class AreaSelection : public Area {
virtual bool isMoving() const;
- bool allAreasWithin(const QRect & r) const;
+ bool allAreasWithin(const TQRect & r) const;
// makes the cache invalid
void invalidate();
@@ -374,8 +374,8 @@ class AreaSelection : public Area {
// The selectionRect and the rect are cached
// so even in const functions they must be changeable
- mutable QRect _cachedSelectionRect;
- mutable QRect _cachedRect;
+ mutable TQRect _cachedSelectionRect;
+ mutable TQRect _cachedRect;
mutable bool _selectionCacheValid;
mutable bool _rectCacheValid;
diff --git a/kimagemapeditor/kimecommands.cpp b/kimagemapeditor/kimecommands.cpp
index e061a463..59157f9d 100644
--- a/kimagemapeditor/kimecommands.cpp
+++ b/kimagemapeditor/kimecommands.cpp
@@ -14,7 +14,7 @@
* (at your option) any later version. *
* *
***************************************************************************/
-#include <qstring.h>
+#include <tqstring.h>
#include <kdebug.h>
#include <klocale.h>
@@ -122,7 +122,7 @@ void PasteCommand::unexecute()
}
-MoveCommand::MoveCommand (KImageMapEditor *document, AreaSelection * a, const QPoint & oldPoint)
+MoveCommand::MoveCommand (KImageMapEditor *document, AreaSelection * a, const TQPoint & oldPoint)
:
#if KDE_VERSION < 300
KCommand
@@ -231,7 +231,7 @@ void ResizeCommand::unexecute()
-AddPointCommand::AddPointCommand (KImageMapEditor *document, AreaSelection *a, const QPoint & p)
+AddPointCommand::AddPointCommand (KImageMapEditor *document, AreaSelection *a, const TQPoint & p)
:
#if KDE_VERSION < 300
KCommand
@@ -268,7 +268,7 @@ void AddPointCommand::execute()
void AddPointCommand::unexecute()
{
-// QRect *selectionPoint = _areaSelection->onSelectionPoint(_point);
+// TQRect *selectionPoint = _areaSelection->onSelectionPoint(_point);
Area* repaintArea = _areaSelection->clone();
_areaSelection->removeCoord(_coordpos);
diff --git a/kimagemapeditor/kimecommands.h b/kimagemapeditor/kimecommands.h
index 946c09b4..87b5b87b 100644
--- a/kimagemapeditor/kimecommands.h
+++ b/kimagemapeditor/kimecommands.h
@@ -90,15 +90,15 @@ KNamedCommand
#endif
{
public:
- MoveCommand (KImageMapEditor *document, AreaSelection *a,const QPoint & oldPoint);
+ MoveCommand (KImageMapEditor *document, AreaSelection *a,const TQPoint & oldPoint);
~MoveCommand ();
virtual void execute();
virtual void unexecute();
protected:
- QPoint _newPoint;
- QPoint _oldPoint;
+ TQPoint _newPoint;
+ TQPoint _oldPoint;
KImageMapEditor* _document;
AreaSelection *_areaSelection;
@@ -135,7 +135,7 @@ KNamedCommand
#endif
{
public:
- AddPointCommand (KImageMapEditor *document, AreaSelection *a, const QPoint & p);
+ AddPointCommand (KImageMapEditor *document, AreaSelection *a, const TQPoint & p);
~AddPointCommand ();
virtual void execute();
@@ -145,7 +145,7 @@ KNamedCommand
KImageMapEditor* _document;
AreaSelection *_areaSelection;
- QPoint _point;
+ TQPoint _point;
int _coordpos;
};
diff --git a/kimagemapeditor/kimedialogs.cpp b/kimagemapeditor/kimedialogs.cpp
index 27f104cb..0196b0e5 100644
--- a/kimagemapeditor/kimedialogs.cpp
+++ b/kimagemapeditor/kimedialogs.cpp
@@ -16,22 +16,22 @@
***************************************************************************/
// QT
-//#include <qstring.h>
-#include <qcheckbox.h>
-#include <qmultilineedit.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qhbox.h>
-#include <qvbox.h>
-#include <qlineedit.h>
-#include <qlistbox.h>
-#include <qtable.h>
-#include <qgroupbox.h>
-#include <qspinbox.h>
-#include <qtabwidget.h>
-#include <qpointarray.h>
-#include <qimage.h>
-//#include <qwidget.h>
+//#include <tqstring.h>
+#include <tqcheckbox.h>
+#include <tqmultilineedit.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqhbox.h>
+#include <tqvbox.h>
+#include <tqlineedit.h>
+#include <tqlistbox.h>
+#include <tqtable.h>
+#include <tqgroupbox.h>
+#include <tqspinbox.h>
+#include <tqtabwidget.h>
+#include <tqpointarray.h>
+#include <tqimage.h>
+//#include <tqwidget.h>
// KDE
#include <kiconloader.h>
#include <kfiledialog.h>
@@ -47,8 +47,8 @@
// LOCAL
#include "kimedialogs.h"
-CoordsEdit::CoordsEdit(QWidget *parent, Area* a)
- : QWidget(parent)
+CoordsEdit::CoordsEdit(TQWidget *parent, Area* a)
+ : TQWidget(parent)
{
area=a;
}
@@ -66,52 +66,52 @@ CoordsEdit::~CoordsEdit()
{
}
-RectCoordsEdit::RectCoordsEdit(QWidget *parent, Area* a)
+RectCoordsEdit::RectCoordsEdit(TQWidget *parent, Area* a)
: CoordsEdit(parent,a)
{
- QGridLayout *layout= new QGridLayout(this,5,2,5,5);
+ TQGridLayout *layout= new TQGridLayout(this,5,2,5,5);
- topXSpin = new QSpinBox(this);
+ topXSpin = new TQSpinBox(this);
topXSpin->setMaxValue(INT_MAX);
topXSpin->setMinValue(0);
topXSpin->setValue(a->rect().left());
layout->addWidget(topXSpin,0,1);
- connect( topXSpin, SIGNAL(valueChanged(const QString &)), this, SLOT(slotTriggerUpdate()));
+ connect( topXSpin, TQT_SIGNAL(valueChanged(const TQString &)), this, TQT_SLOT(slotTriggerUpdate()));
- QLabel *lbl= new QLabel(i18n("Top &X:"),this);
+ TQLabel *lbl= new TQLabel(i18n("Top &X:"),this);
lbl->setBuddy(topXSpin);
layout->addWidget(lbl,0,0);
- topYSpin = new QSpinBox(this);
+ topYSpin = new TQSpinBox(this);
topYSpin->setMaxValue(INT_MAX);
topYSpin->setMinValue(0);
topYSpin->setValue(a->rect().top());
layout->addWidget(topYSpin,1,1);
- connect( topYSpin, SIGNAL(valueChanged(const QString &)), this, SLOT(slotTriggerUpdate()));
+ connect( topYSpin, TQT_SIGNAL(valueChanged(const TQString &)), this, TQT_SLOT(slotTriggerUpdate()));
- lbl= new QLabel(i18n("Top &Y:"),this);
+ lbl= new TQLabel(i18n("Top &Y:"),this);
lbl->setBuddy(topYSpin);
layout->addWidget(lbl,1,0);
- widthSpin = new QSpinBox(this);
+ widthSpin = new TQSpinBox(this);
widthSpin->setMaxValue(INT_MAX);
widthSpin->setMinValue(0);
widthSpin->setValue(a->rect().width());
layout->addWidget(widthSpin,2,1);
- connect( widthSpin, SIGNAL(valueChanged(const QString &)), this, SLOT(slotTriggerUpdate()));
+ connect( widthSpin, TQT_SIGNAL(valueChanged(const TQString &)), this, TQT_SLOT(slotTriggerUpdate()));
- lbl= new QLabel(i18n("&Width:"),this);
+ lbl= new TQLabel(i18n("&Width:"),this);
lbl->setBuddy(widthSpin);
layout->addWidget(lbl,2,0);
- heightSpin = new QSpinBox(this);
+ heightSpin = new TQSpinBox(this);
heightSpin->setMaxValue(INT_MAX);
heightSpin->setMinValue(0);
heightSpin->setValue(a->rect().height());
layout->addWidget(heightSpin,3,1);
- connect( heightSpin, SIGNAL(valueChanged(const QString &)), this, SLOT(slotTriggerUpdate()));
+ connect( heightSpin, TQT_SIGNAL(valueChanged(const TQString &)), this, TQT_SLOT(slotTriggerUpdate()));
- lbl= new QLabel(i18n("Hei&ght:"),this);
+ lbl= new TQLabel(i18n("Hei&ght:"),this);
lbl->setBuddy(heightSpin);
layout->addWidget(lbl,3,0);
@@ -119,7 +119,7 @@ RectCoordsEdit::RectCoordsEdit(QWidget *parent, Area* a)
}
void RectCoordsEdit::applyChanges() {
- QRect r;
+ TQRect r;
r.setLeft(topXSpin->text().toInt());
r.setTop(topYSpin->text().toInt());
r.setWidth(widthSpin->text().toInt());
@@ -127,43 +127,43 @@ void RectCoordsEdit::applyChanges() {
area->setRect(r);
}
-CircleCoordsEdit::CircleCoordsEdit(QWidget *parent, Area* a)
+CircleCoordsEdit::CircleCoordsEdit(TQWidget *parent, Area* a)
: CoordsEdit(parent,a)
{
- QGridLayout *layout= new QGridLayout(this,4,2,5,5);
+ TQGridLayout *layout= new TQGridLayout(this,4,2,5,5);
- centerXSpin = new QSpinBox(this);
+ centerXSpin = new TQSpinBox(this);
centerXSpin->setMaxValue(INT_MAX);
centerXSpin->setMinValue(0);
centerXSpin->setValue(a->rect().center().x());
layout->addWidget(centerXSpin,0,1);
- connect( centerXSpin, SIGNAL(valueChanged(const QString &)), this, SLOT(slotTriggerUpdate()));
+ connect( centerXSpin, TQT_SIGNAL(valueChanged(const TQString &)), this, TQT_SLOT(slotTriggerUpdate()));
- QLabel *lbl= new QLabel(i18n("Center &X:"),this);
+ TQLabel *lbl= new TQLabel(i18n("Center &X:"),this);
lbl->setBuddy(centerXSpin);
layout->addWidget(lbl,0,0);
- centerYSpin = new QSpinBox(this);
+ centerYSpin = new TQSpinBox(this);
centerYSpin->setMaxValue(INT_MAX);
centerYSpin->setMinValue(0);
centerYSpin->setValue(a->rect().center().y());
layout->addWidget(centerYSpin,1,1);
- connect( centerYSpin, SIGNAL(valueChanged(const QString &)), this, SLOT(slotTriggerUpdate()));
+ connect( centerYSpin, TQT_SIGNAL(valueChanged(const TQString &)), this, TQT_SLOT(slotTriggerUpdate()));
- lbl= new QLabel(i18n("Center &Y:"),this);
+ lbl= new TQLabel(i18n("Center &Y:"),this);
lbl->setBuddy(centerYSpin);
layout->addWidget(lbl,1,0);
- radiusSpin = new QSpinBox(this);
+ radiusSpin = new TQSpinBox(this);
radiusSpin->setMaxValue(INT_MAX);
radiusSpin->setMinValue(0);
radiusSpin->setValue(a->rect().width()/2);
layout->addWidget(radiusSpin,2,1);
- connect( radiusSpin, SIGNAL(valueChanged(const QString &)), this, SLOT(slotTriggerUpdate()));
+ connect( radiusSpin, TQT_SIGNAL(valueChanged(const TQString &)), this, TQT_SLOT(slotTriggerUpdate()));
- lbl= new QLabel(i18n("&Radius:"),this);
+ lbl= new TQLabel(i18n("&Radius:"),this);
lbl->setBuddy(radiusSpin);
layout->addWidget(lbl,2,0);
@@ -172,34 +172,34 @@ CircleCoordsEdit::CircleCoordsEdit(QWidget *parent, Area* a)
}
void CircleCoordsEdit::applyChanges() {
- QRect r;
+ TQRect r;
r.setWidth(radiusSpin->text().toInt()*2);
r.setHeight(radiusSpin->text().toInt()*2);
- r.moveCenter(QPoint(centerXSpin->text().toInt(),
+ r.moveCenter(TQPoint(centerXSpin->text().toInt(),
centerYSpin->text().toInt()));
area->setRect(r);
}
-PolyCoordsEdit::PolyCoordsEdit(QWidget *parent, Area* a)
+PolyCoordsEdit::PolyCoordsEdit(TQWidget *parent, Area* a)
: CoordsEdit(parent,a)
{
if (!a) return;
- QVBoxLayout *layout= new QVBoxLayout(this);
+ TQVBoxLayout *layout= new TQVBoxLayout(this);
int numPoints=a->coords()->count();
- coordsTable= new QTable(numPoints,2,this);
+ coordsTable= new TQTable(numPoints,2,this);
coordsTable->horizontalHeader()->setLabel(0,"X");
coordsTable->horizontalHeader()->setLabel(1,"Y");
coordsTable->verticalHeader()->hide();
coordsTable->setLeftMargin(0);
- coordsTable->setSelectionMode( QTable::Single );
+ coordsTable->setSelectionMode( TQTable::Single );
for (int i=0;i<numPoints;i++) {
- coordsTable->setText(i,0, QString::number(area->coords()->point(i).x()) );
- coordsTable->setText(i,1, QString::number(area->coords()->point(i).y()) );
+ coordsTable->setText(i,0, TQString::number(area->coords()->point(i).x()) );
+ coordsTable->setText(i,1, TQString::number(area->coords()->point(i).y()) );
}
- connect( coordsTable, SIGNAL(currentChanged(int,int)), this, SLOT(slotHighlightPoint(int)));
+ connect( coordsTable, TQT_SIGNAL(currentChanged(int,int)), this, TQT_SLOT(slotHighlightPoint(int)));
// coordsTable->setMinimumHeight(50);
// coordsTable->setMaximumHeight(400);
@@ -207,11 +207,11 @@ PolyCoordsEdit::PolyCoordsEdit(QWidget *parent, Area* a)
coordsTable->resize(coordsTable->width(),100);
layout->addWidget(coordsTable);
layout->setStretchFactor(coordsTable,-1);
- QHBox *hbox= new QHBox(this);
- QPushButton *addBtn=new QPushButton(i18n("Add"),hbox);
- connect( addBtn, SIGNAL(pressed()), this, SLOT(slotAddPoint()));
- QPushButton *removeBtn=new QPushButton(i18n("Remove"),hbox);
- connect( removeBtn, SIGNAL(pressed()), this, SLOT(slotRemovePoint()));
+ TQHBox *hbox= new TQHBox(this);
+ TQPushButton *addBtn=new TQPushButton(i18n("Add"),hbox);
+ connect( addBtn, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotAddPoint()));
+ TQPushButton *removeBtn=new TQPushButton(i18n("Remove"),hbox);
+ connect( removeBtn, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotRemovePoint()));
layout->addWidget(hbox);
slotHighlightPoint(1);
@@ -231,7 +231,7 @@ void PolyCoordsEdit::slotHighlightPoint(int row) {
void PolyCoordsEdit::slotAddPoint() {
int newPos= coordsTable->currentRow();
- QPoint currentPoint=area->coords()->point(newPos);
+ TQPoint currentPoint=area->coords()->point(newPos);
area->insertCoord(newPos,currentPoint);
int count=area->coords()->size();
@@ -239,8 +239,8 @@ void PolyCoordsEdit::slotAddPoint() {
coordsTable->setNumRows(count);
for (int i=0;i<count;i++) {
- coordsTable->setText(i,0, QString::number(area->coords()->point(i).x()) );
- coordsTable->setText(i,1, QString::number(area->coords()->point(i).y()) );
+ coordsTable->setText(i,0, TQString::number(area->coords()->point(i).x()) );
+ coordsTable->setText(i,1, TQString::number(area->coords()->point(i).y()) );
}
emit update();
@@ -256,8 +256,8 @@ void PolyCoordsEdit::slotRemovePoint() {
coordsTable->setNumRows(count);
for (int i=0;i<count;i++) {
- coordsTable->setText(i,0, QString::number(area->coords()->point(i).x()) );
- coordsTable->setText(i,1, QString::number(area->coords()->point(i).y()) );
+ coordsTable->setText(i,0, TQString::number(area->coords()->point(i).x()) );
+ coordsTable->setText(i,1, TQString::number(area->coords()->point(i).y()) );
}
emit update();
@@ -267,37 +267,37 @@ void PolyCoordsEdit::applyChanges() {
int count=coordsTable->numRows();
for (int i=0;i<count;i++) {
- QPoint newPoint( coordsTable->text(i,0).toInt(),
+ TQPoint newPoint( coordsTable->text(i,0).toInt(),
coordsTable->text(i,1).toInt());
area->moveCoord(i,newPoint);
}
}
-SelectionCoordsEdit::SelectionCoordsEdit(QWidget *parent, Area* a)
+SelectionCoordsEdit::SelectionCoordsEdit(TQWidget *parent, Area* a)
: CoordsEdit(parent,a)
{
- QGridLayout *layout= new QGridLayout(this,2,2);
+ TQGridLayout *layout= new TQGridLayout(this,2,2);
- topXSpin = new QSpinBox(this);
+ topXSpin = new TQSpinBox(this);
topXSpin->setMaxValue(INT_MAX);
topXSpin->setMinValue(0);
topXSpin->setValue(a->rect().left());
layout->addWidget(topXSpin,0,1);
- connect( topXSpin, SIGNAL(valueChanged(const QString &)), this, SLOT(slotTriggerUpdate()));
+ connect( topXSpin, TQT_SIGNAL(valueChanged(const TQString &)), this, TQT_SLOT(slotTriggerUpdate()));
- QLabel *lbl= new QLabel(i18n("Top &X"),this);
+ TQLabel *lbl= new TQLabel(i18n("Top &X"),this);
lbl->setBuddy(topXSpin);
layout->addWidget(lbl,0,0);
- topYSpin = new QSpinBox(this);
+ topYSpin = new TQSpinBox(this);
topYSpin->setMaxValue(INT_MAX);
topYSpin->setMinValue(0);
topYSpin->setValue(a->rect().top());
layout->addWidget(topYSpin,1,1);
- connect( topYSpin, SIGNAL(valueChanged(const QString &)), this, SLOT(slotTriggerUpdate()));
+ connect( topYSpin, TQT_SIGNAL(valueChanged(const TQString &)), this, TQT_SLOT(slotTriggerUpdate()));
- lbl= new QLabel(i18n("Top &Y"),this);
+ lbl= new TQLabel(i18n("Top &Y"),this);
lbl->setBuddy(topYSpin);
layout->addWidget(lbl,1,0);
}
@@ -308,32 +308,32 @@ void SelectionCoordsEdit::applyChanges() {
-QLineEdit* AreaDialog::createLineEdit(QWidget* parent, QGridLayout *layout, int y, const QString & value, const QString & name)
+TQLineEdit* AreaDialog::createLineEdit(TQWidget* parent, TQGridLayout *layout, int y, const TQString & value, const TQString & name)
{
- QLineEdit* edit=new QLineEdit(value,parent);
+ TQLineEdit* edit=new TQLineEdit(value,parent);
layout->addWidget(edit,y,2);
- QLabel* lbl=new QLabel(name,parent);
+ TQLabel* lbl=new TQLabel(name,parent);
lbl->setBuddy(edit);
layout->addWidget(lbl,y,1);
return edit;
}
-QWidget* AreaDialog::createGeneralPage()
+TQWidget* AreaDialog::createGeneralPage()
{
- QFrame* page = new QFrame(this);
- QGridLayout* layout = new QGridLayout(page,5,2,5,5);
+ TQFrame* page = new TQFrame(this);
+ TQGridLayout* layout = new TQGridLayout(page,5,2,5,5);
- QHBox *hbox= new QHBox(page);
- hrefEdit = new QLineEdit(area->attribute("href"),hbox);
- QPushButton *btn = new QPushButton("",hbox);
+ TQHBox *hbox= new TQHBox(page);
+ hrefEdit = new TQLineEdit(area->attribute("href"),hbox);
+ TQPushButton *btn = new TQPushButton("",hbox);
btn->setPixmap(SmallIcon("fileopen"));
- connect( btn, SIGNAL(pressed()), this, SLOT(slotChooseHref()));
+ connect( btn, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotChooseHref()));
hbox->setMinimumHeight(hbox->height());
layout->addWidget(hbox,0,2);
- QLabel *lbl=new QLabel(i18n( "&HREF:" ),page);
+ TQLabel *lbl=new TQLabel(i18n( "&HREF:" ),page);
lbl->setBuddy(hrefEdit);
layout->addWidget(lbl,0,1);
@@ -343,7 +343,7 @@ QWidget* AreaDialog::createGeneralPage()
if (area->type()==Area::Default)
{
- defaultAreaChk = new QCheckBox(i18n("Enable default map"),page);
+ defaultAreaChk = new TQCheckBox(i18n("Enable default map"),page);
if (area->finished())
defaultAreaChk->setChecked(true);
layout->addWidget(defaultAreaChk,3,2);
@@ -355,23 +355,23 @@ QWidget* AreaDialog::createGeneralPage()
return page;
}
-QWidget* AreaDialog::createCoordsPage()
+TQWidget* AreaDialog::createCoordsPage()
{
- QFrame* page = new QFrame(this);
- QVBoxLayout *layout = new QVBoxLayout(page);
+ TQFrame* page = new TQFrame(this);
+ TQVBoxLayout *layout = new TQVBoxLayout(page);
layout->setMargin(5);
coordsEdit = createCoordsEdit(page,area);
layout->addWidget(coordsEdit);
- connect( coordsEdit, SIGNAL(update()), this, SLOT(slotUpdateArea()));
+ connect( coordsEdit, TQT_SIGNAL(update()), this, TQT_SLOT(slotUpdateArea()));
return page;
}
-QWidget* AreaDialog::createJavascriptPage()
+TQWidget* AreaDialog::createJavascriptPage()
{
- QFrame* page = new QFrame(this);
- QGridLayout* layout = new QGridLayout(page,8,2,5,5);
+ TQFrame* page = new TQFrame(this);
+ TQGridLayout* layout = new TQGridLayout(page,8,2,5,5);
onClickEdit = createLineEdit(page,layout,0,area->attribute("onClick"),i18n("OnClick:"));
onDblClickEdit = createLineEdit(page,layout,1,area->attribute("onDblClick"),i18n("OnDblClick:"));
@@ -387,17 +387,17 @@ QWidget* AreaDialog::createJavascriptPage()
return page;
}
-QWidget* AreaDialog::createButtonBar()
+TQWidget* AreaDialog::createButtonBar()
{
- QHBox *box = new QHBox(this);
- QWidget *spacer = new QWidget(box);
- QPushButton *okBtn = new KPushButton(KStdGuiItem::ok(),box);
- QPushButton *applyBtn = new KPushButton(KStdGuiItem::apply(),box);
- QPushButton *cancelBtn = new KPushButton(KStdGuiItem::cancel(),box);
+ TQHBox *box = new TQHBox(this);
+ TQWidget *spacer = new TQWidget(box);
+ TQPushButton *okBtn = new KPushButton(KStdGuiItem::ok(),box);
+ TQPushButton *applyBtn = new KPushButton(KStdGuiItem::apply(),box);
+ TQPushButton *cancelBtn = new KPushButton(KStdGuiItem::cancel(),box);
- connect(okBtn, SIGNAL(clicked()), this, SLOT(slotOk()));
- connect(applyBtn, SIGNAL(clicked()), this, SLOT(slotApply()));
- connect(cancelBtn, SIGNAL(clicked()), this, SLOT(slotCancel()));
+ connect(okBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotOk()));
+ connect(applyBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotApply()));
+ connect(cancelBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCancel()));
box->setSpacing(5);
box->setStretchFactor(spacer,10);
@@ -423,7 +423,7 @@ AreaDialog::AreaDialog(KImageMapEditor* parent,Area * a)
setCaption(i18n("Area Tag Editor"));
area=a;
- QString shape="Default";
+ TQString shape="Default";
areaCopy= a->clone();
oldArea= new Area();
oldArea->setRect( a->rect() );
@@ -439,20 +439,20 @@ AreaDialog::AreaDialog(KImageMapEditor* parent,Area * a)
// To get a margin around everything
- QVBoxLayout *layout = new QVBoxLayout(this);
+ TQVBoxLayout *layout = new TQVBoxLayout(this);
layout->setMargin(5);
- QLabel *lbl = new QLabel("<b>"+shape+"</b>",this);
+ TQLabel *lbl = new TQLabel("<b>"+shape+"</b>",this);
lbl->setTextFormat(Qt::RichText);
layout->addWidget(lbl);
- QFrame *line = new QFrame(this);
- line->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+ TQFrame *line = new TQFrame(this);
+ line->setFrameStyle(TQFrame::HLine | TQFrame::Sunken);
line->setFixedHeight(10);
layout->addWidget(line);
- QTabWidget *tab = new QTabWidget(this);
+ TQTabWidget *tab = new TQTabWidget(this);
layout->addWidget(tab);
@@ -467,8 +467,8 @@ AreaDialog::AreaDialog(KImageMapEditor* parent,Area * a)
tab->addTab(createJavascriptPage(),i18n("&JavaScript"));
- line = new QFrame(this);
- line->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+ line = new TQFrame(this);
+ line->setFrameStyle(TQFrame::HLine | TQFrame::Sunken);
line->setFixedHeight(10);
layout->addWidget(line);
@@ -485,7 +485,7 @@ AreaDialog::~AreaDialog() {
delete oldArea;
}
-CoordsEdit* AreaDialog::createCoordsEdit(QWidget *parent, Area *a) {
+CoordsEdit* AreaDialog::createCoordsEdit(TQWidget *parent, Area *a) {
if (!a) return 0;
switch (a->type()) {
case Area::Rectangle :
@@ -506,7 +506,7 @@ CoordsEdit* AreaDialog::createCoordsEdit(QWidget *parent, Area *a) {
}
void AreaDialog::slotChooseHref() {
- KURL url=KFileDialog::getOpenURL(QString::null, "*|" + i18n( "All Files" ), this, i18n("Choose File"));
+ KURL url=KFileDialog::getOpenURL(TQString::null, "*|" + i18n( "All Files" ), this, i18n("Choose File"));
if (!url.isEmpty()) {
hrefEdit->setText(url.url());
}
@@ -570,59 +570,59 @@ void AreaDialog::slotUpdateArea() {
oldArea->setRect(area->rect());
}
-ImageMapChooseDialog::ImageMapChooseDialog(QWidget* parent,QPtrList<MapTag> *_maps,QPtrList<ImageTag> *_images,const KURL & _baseUrl)
+ImageMapChooseDialog::ImageMapChooseDialog(TQWidget* parent,TQPtrList<MapTag> *_maps,TQPtrList<ImageTag> *_images,const KURL & _baseUrl)
: KDialogBase(parent,"",true,i18n( "Choose Map & Image to Edit" ),Ok,Ok,true)
{
baseUrl=_baseUrl;
maps=_maps;
images=_images;
currentMap=0L;
- QWidget *page=new QWidget(this);
+ TQWidget *page=new TQWidget(this);
setMainWidget(page);
setCaption(baseUrl.fileName());
- QVBoxLayout *layout = new QVBoxLayout(page,5,5);
+ TQVBoxLayout *layout = new TQVBoxLayout(page,5,5);
- QLabel *lbl= new QLabel(i18n("Select an image and/or a map that you want to edit"),page);
- lbl->setFont(QFont("Sans Serif",12, QFont::Bold));
+ TQLabel *lbl= new TQLabel(i18n("Select an image and/or a map that you want to edit"),page);
+ lbl->setFont(TQFont("Sans Serif",12, TQFont::Bold));
layout->addWidget(lbl);
- QFrame *line= new QFrame(page);
- line->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+ TQFrame *line= new TQFrame(page);
+ line->setFrameStyle(TQFrame::HLine | TQFrame::Sunken);
line->setFixedHeight(10);
layout->addWidget(line,0);
- QGridLayout *gridLayout= new QGridLayout(layout,2,3,5);
+ TQGridLayout *gridLayout= new TQGridLayout(layout,2,3,5);
gridLayout->setRowStretch(0,0);
gridLayout->setRowStretch(1,100);
- lbl=new QLabel(i18n("&Maps"),page);
- mapListBox= new QListBox(page);
+ lbl=new TQLabel(i18n("&Maps"),page);
+ mapListBox= new TQListBox(page);
lbl->setBuddy(mapListBox);
gridLayout->addWidget(lbl,0,0);
gridLayout->addWidget(mapListBox,1,0);
- line= new QFrame(page);
- line->setFrameStyle(QFrame::VLine | QFrame::Sunken);
+ line= new TQFrame(page);
+ line->setFrameStyle(TQFrame::VLine | TQFrame::Sunken);
line->setFixedWidth(10);
-// line->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding));
+// line->setSizePolicy(TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Expanding));
gridLayout->addWidget(line,1,1);
- lbl=new QLabel(i18n("Image Preview"),page);
+ lbl=new TQLabel(i18n("Image Preview"),page);
gridLayout->addWidget(lbl,0,2);
- imagePreview= new QLabel(page);
+ imagePreview= new TQLabel(page);
imagePreview->setFixedSize(310,210);
- imagePreview->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding));
- imagePreview->setFrameStyle(QLabel::Panel | QLabel::Sunken);
+ imagePreview->setSizePolicy(TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Expanding));
+ imagePreview->setFrameStyle(TQLabel::Panel | TQLabel::Sunken);
imagePreview->setIndent(5);
- imagePreview->setBackgroundColor(QColor("white"));
+ imagePreview->setBackgroundColor(TQColor("white"));
// imagePreview->setLineWidth(2);
// imagePreview->setScaledContents(true);
-// lbl= new QLabel(i18n("&Maps"),page);
+// lbl= new TQLabel(i18n("&Maps"),page);
// lbl->setBuddy(mapListBox);
gridLayout->addWidget(imagePreview,1,2);
// layout->addLayout(gridLayout,1);
- line= new QFrame(page);
- line->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+ line= new TQFrame(page);
+ line->setFrameStyle(TQFrame::HLine | TQFrame::Sunken);
line->setFixedHeight(10);
layout->addWidget(line,0);
@@ -635,7 +635,7 @@ ImageMapChooseDialog::ImageMapChooseDialog(QWidget* parent,QPtrList<MapTag> *_ma
for (MapTag *tag = maps->first(); tag!=0L; tag=maps->next()) {
mapListBox->insertItem(tag->name);
}
- connect (mapListBox, SIGNAL(highlighted(int)), this, SLOT(slotMapChanged(int)));
+ connect (mapListBox, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotMapChanged(int)));
}
initImageListTable(page);
@@ -648,25 +648,25 @@ ImageMapChooseDialog::ImageMapChooseDialog(QWidget* parent,QPtrList<MapTag> *_ma
resize(510,460);
}
-void ImageMapChooseDialog::initImageListTable(QWidget* parent) {
+void ImageMapChooseDialog::initImageListTable(TQWidget* parent) {
if (images->isEmpty()) {
- imageListTable= new QTable(1,1,parent);
+ imageListTable= new TQTable(1,1,parent);
imageListTable->setText(0,0,i18n("No images found"));
imageListTable->setEnabled(false);
imageListTable->horizontalHeader()->hide();
imageListTable->setTopMargin(0);
imageListTable->setColumnStretchable(0,true);
} else {
- imageListTable= new QTable(images->count(),2,parent);
+ imageListTable= new TQTable(images->count(),2,parent);
imageListTable->setColumnStretchable(0,true);
}
imageListTable->verticalHeader()->hide();
imageListTable->setLeftMargin(0);
- QLabel *lbl= new QLabel(i18n("&Images"),parent);
+ TQLabel *lbl= new TQLabel(i18n("&Images"),parent);
lbl->setBuddy(imageListTable);
parent->layout()->add(lbl);
@@ -678,15 +678,15 @@ void ImageMapChooseDialog::initImageListTable(QWidget* parent) {
imageListTable->horizontalHeader()->setLabel(0,i18n("Path"));
imageListTable->horizontalHeader()->setLabel(1,"usemap");
- imageListTable->setSelectionMode(QTable::SingleRow);
- imageListTable->setFocusStyle(QTable::FollowStyle);
+ imageListTable->setSelectionMode(TQTable::SingleRow);
+ imageListTable->setFocusStyle(TQTable::FollowStyle);
imageListTable->clearSelection(true);
int row=0;
for (ImageTag *tag = images->first(); tag!=0L; tag=images->next()) {
- QString src="";
- QString usemap="";
+ TQString src="";
+ TQString usemap="";
if (tag->find("src"))
src=*tag->find("src");
if (tag->find("usemap"))
@@ -696,7 +696,7 @@ void ImageMapChooseDialog::initImageListTable(QWidget* parent) {
imageListTable->setText(row,1,usemap);
row++;
}
- connect (imageListTable, SIGNAL(selectionChanged()), this, SLOT(slotImageChanged()));
+ connect (imageListTable, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotImageChanged()));
imageListTable->selectRow(0);
slotImageChanged();
@@ -710,12 +710,12 @@ ImageMapChooseDialog::~ImageMapChooseDialog() {
void ImageMapChooseDialog::slotImageChanged()
{
int i=imageListTable->currentRow();
- QImage pix;
+ TQImage pix;
if (images->at(i)->find("src")) {
- QString str=*images->at(i)->find("src");
+ TQString str=*images->at(i)->find("src");
// relative url
pixUrl=KURL(baseUrl,str);
- pix=QImage(pixUrl.path());
+ pix=TQImage(pixUrl.path());
double zoom1=1;
double zoom2=1;
if (pix.width()>300)
@@ -727,14 +727,14 @@ void ImageMapChooseDialog::slotImageChanged()
zoom1= zoom1 < zoom2 ? zoom1 : zoom2;
pix=pix.smoothScale((int)(pix.width()*zoom1),int(pix.height()*zoom1));
}
- QPixmap pix2;
+ TQPixmap pix2;
pix2.convertFromImage(pix);
imagePreview->setPixmap(pix2);
// imagePreview->repaint();
}
-void ImageMapChooseDialog::selectImageWithUsemap(const QString & usemap) {
+void ImageMapChooseDialog::selectImageWithUsemap(const TQString & usemap) {
for (int i=0; i<imageListTable->numRows(); i++) {
if (imageListTable->text(i,1)==usemap) {
imageListTable->selectRow(i);
@@ -749,18 +749,18 @@ void ImageMapChooseDialog::slotMapChanged(int i) {
selectImageWithUsemap(currentMap->name);
}
-PreferencesDialog::PreferencesDialog(QWidget *parent, KConfig* conf)
+PreferencesDialog::PreferencesDialog(TQWidget *parent, KConfig* conf)
: KDialogBase(parent,"",true,i18n("Preferences"),Ok|Apply|Cancel,Ok,true)
{
config = conf;
- QVBox *page=new QVBox(this);
+ TQVBox *page=new TQVBox(this);
page->setSpacing(6);
setMainWidget(page);
- QHBox *hbox= new QHBox(page);
+ TQHBox *hbox= new TQHBox(page);
- QLabel *lbl = new QLabel(i18n("&Maximum image preview height:")+" ",hbox);
- rowHeightSpinBox = new QSpinBox(hbox);
+ TQLabel *lbl = new TQLabel(i18n("&Maximum image preview height:")+" ",hbox);
+ rowHeightSpinBox = new TQSpinBox(hbox);
lbl->setBuddy(rowHeightSpinBox);
config->setGroup("Appearance");
@@ -771,9 +771,9 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, KConfig* conf)
config->setGroup("General");
- hbox= new QHBox(page);
- lbl = new QLabel(i18n("&Undo limit:")+" ",hbox);
- undoSpinBox = new QSpinBox(hbox);
+ hbox= new TQHBox(page);
+ lbl = new TQLabel(i18n("&Undo limit:")+" ",hbox);
+ undoSpinBox = new TQSpinBox(hbox);
undoSpinBox->setFixedWidth(60);
lbl->setBuddy(undoSpinBox);
@@ -781,31 +781,31 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, KConfig* conf)
undoSpinBox->setMinValue(1);
undoSpinBox->setValue(config->readNumEntry("undo-level",20));
- hbox= new QHBox(page);
- lbl = new QLabel(i18n("&Redo limit:")+" ",hbox);
+ hbox= new TQHBox(page);
+ lbl = new TQLabel(i18n("&Redo limit:")+" ",hbox);
- redoSpinBox = new QSpinBox(hbox);
+ redoSpinBox = new TQSpinBox(hbox);
redoSpinBox->setFixedWidth(60);
redoSpinBox->setMaxValue(100);
redoSpinBox->setMinValue(1);
redoSpinBox->setValue(config->readNumEntry("redo-level",20));
lbl->setBuddy(redoSpinBox);
- startWithCheck = new QCheckBox(i18n("&Start with last used document"),page);
+ startWithCheck = new TQCheckBox(i18n("&Start with last used document"),page);
startWithCheck->setChecked(config->readBoolEntry("start-with-last-used-document",true));
/*
- hbox= new QHBox(page);
- (void)new QLabel(i18n("Highlight Areas")+" ",hbox);
+ hbox= new TQHBox(page);
+ (void)new TQLabel(i18n("Highlight Areas")+" ",hbox);
- colorizeAreaChk = new QCheckBox(hbox);
+ colorizeAreaChk = new TQCheckBox(hbox);
colorizeAreaChk->setFixedWidth(60);
colorizeAreaChk->setChecked(kapp->config()->readBoolEntry("highlightareas",true));
- hbox= new QHBox(page);
- (void)new QLabel(i18n("Show alternative text")+" ",hbox);
+ hbox= new TQHBox(page);
+ (void)new TQLabel(i18n("Show alternative text")+" ",hbox);
- showAltChk = new QCheckBox(hbox);
+ showAltChk = new TQCheckBox(hbox);
showAltChk->setFixedWidth(60);
showAltChk->setChecked(kapp->config()->readBoolEntry("showalt",true));
*/
@@ -836,7 +836,7 @@ void PreferencesDialog::slotApply( void ) {
emit applyClicked();
}
-HTMLPreviewDialog::HTMLPreviewDialog(QWidget* parent, KURL url, const QString & htmlCode)
+HTMLPreviewDialog::HTMLPreviewDialog(TQWidget* parent, KURL url, const TQString & htmlCode)
: KDialogBase(parent, "", true, i18n("Preview"), KDialogBase::Ok)
{
tempFile = new KTempFile(url.directory(false), ".html");
@@ -845,17 +845,17 @@ HTMLPreviewDialog::HTMLPreviewDialog(QWidget* parent, KURL url, const QString &
kdDebug() << "HTMLPreviewDialog: TempFile : " << tempFile->name() << endl;
tempFile->close();
- QVBox *page = makeVBoxMainWidget();
+ TQVBox *page = makeVBoxMainWidget();
htmlPart = new KHTMLPart(page,"htmlpart");
// htmlView = new KHTMLView(htmlPart, page);
-// htmlView->setVScrollBarMode(QScrollView::Auto);
-// htmlView->setHScrollBarMode(QScrollView::Auto);
+// htmlView->setVScrollBarMode(TQScrollView::Auto);
+// htmlView->setHScrollBarMode(TQScrollView::Auto);
// dialog->resize(dialog->calculateSize(edit->maxLineWidth(),edit->numLines()*));
// dialog->adjustSize();
- QLabel* lbl = new QLabel(page,"urllabel");
+ TQLabel* lbl = new TQLabel(page,"urllabel");
- connect( htmlPart, SIGNAL( onURL(const QString&)), lbl, SLOT( setText(const QString&)));
+ connect( htmlPart, TQT_SIGNAL( onURL(const TQString&)), lbl, TQT_SLOT( setText(const TQString&)));
}
HTMLPreviewDialog::~HTMLPreviewDialog() {
diff --git a/kimagemapeditor/kimedialogs.h b/kimagemapeditor/kimedialogs.h
index c87f8dfe..7e4f3809 100644
--- a/kimagemapeditor/kimedialogs.h
+++ b/kimagemapeditor/kimedialogs.h
@@ -31,10 +31,10 @@ class QMultiLineEdit;
class QSpinBox;
-class CoordsEdit : public QWidget {
+class CoordsEdit : public TQWidget {
Q_OBJECT
public :
- CoordsEdit(QWidget *parent, Area* a);
+ CoordsEdit(TQWidget *parent, Area* a);
virtual ~CoordsEdit();
virtual void applyChanges();
protected:
@@ -47,23 +47,23 @@ Q_OBJECT
class RectCoordsEdit : public CoordsEdit {
public:
- RectCoordsEdit(QWidget *parent, Area* a);
+ RectCoordsEdit(TQWidget *parent, Area* a);
virtual void applyChanges();
private:
- QSpinBox *topXSpin;
- QSpinBox *topYSpin;
- QSpinBox *widthSpin;
- QSpinBox *heightSpin;
+ TQSpinBox *topXSpin;
+ TQSpinBox *topYSpin;
+ TQSpinBox *widthSpin;
+ TQSpinBox *heightSpin;
};
class CircleCoordsEdit : public CoordsEdit {
public:
- CircleCoordsEdit(QWidget *parent, Area* a);
+ CircleCoordsEdit(TQWidget *parent, Area* a);
virtual void applyChanges();
private:
- QSpinBox *centerXSpin;
- QSpinBox *centerYSpin;
- QSpinBox *radiusSpin;
+ TQSpinBox *centerXSpin;
+ TQSpinBox *centerYSpin;
+ TQSpinBox *radiusSpin;
};
class QTable;
@@ -71,11 +71,11 @@ class QTable;
class PolyCoordsEdit : public CoordsEdit {
Q_OBJECT
public:
- PolyCoordsEdit(QWidget *parent, Area* a);
+ PolyCoordsEdit(TQWidget *parent, Area* a);
~PolyCoordsEdit();
virtual void applyChanges();
private:
- QTable *coordsTable;
+ TQTable *coordsTable;
protected slots:
void slotAddPoint();
void slotRemovePoint();
@@ -86,11 +86,11 @@ Q_OBJECT
class SelectionCoordsEdit : public CoordsEdit {
Q_OBJECT
public:
- SelectionCoordsEdit(QWidget *parent, Area* a);
+ SelectionCoordsEdit(TQWidget *parent, Area* a);
virtual void applyChanges();
private:
- QSpinBox *topXSpin;
- QSpinBox *topYSpin;
+ TQSpinBox *topXSpin;
+ TQSpinBox *topYSpin;
};
@@ -104,22 +104,22 @@ Q_OBJECT
Area *area;
Area *oldArea; // Only for drawing reasons
Area *areaCopy; // A copy for restoring the original area if user press cancel
- QLineEdit *hrefEdit;
- QLineEdit *altEdit;
- QLineEdit *targetEdit;
- QLineEdit *titleEdit;
+ TQLineEdit *hrefEdit;
+ TQLineEdit *altEdit;
+ TQLineEdit *targetEdit;
+ TQLineEdit *titleEdit;
- QLineEdit *onClickEdit;
- QLineEdit *onDblClickEdit;
- QLineEdit *onMouseDownEdit;
- QLineEdit *onMouseUpEdit;
- QLineEdit *onMouseOverEdit;
- QLineEdit *onMouseMoveEdit;
- QLineEdit *onMouseOutEdit;
+ TQLineEdit *onClickEdit;
+ TQLineEdit *onDblClickEdit;
+ TQLineEdit *onMouseDownEdit;
+ TQLineEdit *onMouseUpEdit;
+ TQLineEdit *onMouseOverEdit;
+ TQLineEdit *onMouseMoveEdit;
+ TQLineEdit *onMouseOutEdit;
CoordsEdit *coordsEdit;
- CoordsEdit* createCoordsEdit(QWidget *parent, Area *a);
- QCheckBox *defaultAreaChk;
+ CoordsEdit* createCoordsEdit(TQWidget *parent, Area *a);
+ TQCheckBox *defaultAreaChk;
KImageMapEditor *_document;
@@ -133,11 +133,11 @@ Q_OBJECT
void slotChooseHref();
void slotUpdateArea();
- QLineEdit* createLineEdit(QWidget* parent, QGridLayout *layout, int y, const QString & value, const QString & name);
- QWidget* createGeneralPage();
- QWidget* createCoordsPage();
- QWidget* createJavascriptPage();
- QWidget* createButtonBar();
+ TQLineEdit* createLineEdit(TQWidget* parent, TQGridLayout *layout, int y, const TQString & value, const TQString & name);
+ TQWidget* createGeneralPage();
+ TQWidget* createCoordsPage();
+ TQWidget* createJavascriptPage();
+ TQWidget* createButtonBar();
signals:
void areaChanged(Area* a);
};
@@ -150,23 +150,23 @@ class QLabel;
class ImageMapChooseDialog : public KDialogBase {
Q_OBJECT
private:
- QTable *imageListTable;
- QLabel *imagePreview;
- QListBox *mapListBox;
- QLineEdit *mapNameEdit;
- QPtrList<MapTag> *maps;
- QPtrList<ImageTag> *images;
+ TQTable *imageListTable;
+ TQLabel *imagePreview;
+ TQListBox *mapListBox;
+ TQLineEdit *mapNameEdit;
+ TQPtrList<MapTag> *maps;
+ TQPtrList<ImageTag> *images;
KURL baseUrl;
- void initImageListTable(QWidget*);
+ void initImageListTable(TQWidget*);
public:
- ImageMapChooseDialog(QWidget* parent,QPtrList<MapTag> *_maps,QPtrList<ImageTag> *_images, const KURL & _baseUrl);
+ ImageMapChooseDialog(TQWidget* parent,TQPtrList<MapTag> *_maps,TQPtrList<ImageTag> *_images, const KURL & _baseUrl);
~ImageMapChooseDialog();
KURL pixUrl;
MapTag* currentMap;
protected slots:
void slotImageChanged();
void slotMapChanged(int i);
- void selectImageWithUsemap(const QString & usemap);
+ void selectImageWithUsemap(const TQString & usemap);
};
@@ -175,19 +175,19 @@ class KConfig;
class PreferencesDialog : public KDialogBase {
Q_OBJECT
public:
- PreferencesDialog(QWidget *parent,KConfig*);
+ PreferencesDialog(TQWidget *parent,KConfig*);
~PreferencesDialog();
protected slots:
virtual void slotDefault( void );
virtual void slotOk( void );
virtual void slotApply( void );
private:
- QSpinBox *rowHeightSpinBox;
- QSpinBox *undoSpinBox;
- QSpinBox *redoSpinBox;
-// QCheckBox *colorizeAreaChk;
-// QCheckBox *showAltChk;
- QCheckBox *startWithCheck;
+ TQSpinBox *rowHeightSpinBox;
+ TQSpinBox *undoSpinBox;
+ TQSpinBox *redoSpinBox;
+// TQCheckBox *colorizeAreaChk;
+// TQCheckBox *showAltChk;
+ TQCheckBox *startWithCheck;
KConfig *config;
};
@@ -196,7 +196,7 @@ class KTempFile;
class HTMLPreviewDialog : public KDialogBase {
public:
- HTMLPreviewDialog(QWidget *, KURL, const QString &);
+ HTMLPreviewDialog(TQWidget *, KURL, const TQString &);
~HTMLPreviewDialog();
virtual void show();
private:
diff --git a/kimagemapeditor/kimeshell.cpp b/kimagemapeditor/kimeshell.cpp
index d919d2b7..071f3299 100644
--- a/kimagemapeditor/kimeshell.cpp
+++ b/kimagemapeditor/kimeshell.cpp
@@ -29,7 +29,7 @@
#include <kapplication.h>
#include <kdebug.h>
-#include <qhbox.h>
+#include <tqhbox.h>
#include "drawzone.h"
#include "kimagemapeditor.h" // the KPart
@@ -44,8 +44,8 @@ KimeShell::KimeShell(const char *name )
KDockWidget* mainDock;
mainDock = createDockWidget( "MainDockWidget", 0L, 0L, "main_dock_widget");
- QWidget *w = new QHBox( mainDock );
-// QLayout* layout = new QGridLayout( mainDock );
+ TQWidget *w = new TQHBox( mainDock );
+// TQLayout* layout = new TQGridLayout( mainDock );
mainDock->setWidget( w );
// allow others to dock to the 4 sides
@@ -67,17 +67,17 @@ KimeShell::KimeShell(const char *name )
createShellGUI( true );
guiFactory()->addClient( m_part );
KParts::GUIActivateEvent ev( true );
- QApplication::sendEvent( m_part, &ev );
+ TQApplication::sendEvent( m_part, &ev );
//setCentralWidget(part->widget());
if (!initialGeometrySet())
- resize( QSize(725, 525).expandedTo(minimumSizeHint()));
+ resize( TQSize(725, 525).expandedTo(minimumSizeHint()));
- connect( m_part, SIGNAL(setStatusBarText(const QString &)),
- this, SLOT(slotSetStatusBarText ( const QString & )));
+ connect( m_part, TQT_SIGNAL(setStatusBarText(const TQString &)),
+ this, TQT_SLOT(slotSetStatusBarText ( const TQString & )));
- connect( m_part, SIGNAL(setWindowCaption(const QString &)),
- this, SLOT(setCaption( const QString &)));
+ connect( m_part, TQT_SIGNAL(setWindowCaption(const TQString &)),
+ this, TQT_SLOT(setCaption( const TQString &)));
setAutoSaveSettings( "General Options" );
@@ -109,16 +109,16 @@ bool KimeShell::queryExit()
void KimeShell::setupActions()
{
- (void)KStdAction::openNew(this, SLOT(fileNew()), actionCollection());
+ (void)KStdAction::openNew(this, TQT_SLOT(fileNew()), actionCollection());
// File Quit
- (void)KStdAction::quit(this, SLOT(close()),actionCollection());
+ (void)KStdAction::quit(this, TQT_SLOT(close()),actionCollection());
- (void)KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection());
- (void)KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection());
- (void)KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection());
- (void)KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection());
+ (void)KStdAction::showToolbar(this, TQT_SLOT(optionsShowToolbar()), actionCollection());
+ (void)KStdAction::keyBindings(this, TQT_SLOT(optionsConfigureKeys()), actionCollection());
+ (void)KStdAction::configureToolbars(this, TQT_SLOT(optionsConfigureToolbars()), actionCollection());
+ (void)KStdAction::showStatusbar(this, TQT_SLOT(optionsShowStatusbar()), actionCollection());
}
@@ -155,7 +155,7 @@ void KimeShell::openLastFile()
void KimeShell::fileOpen()
{
- KURL url=KFileDialog::getOpenURL(QString::null,
+ KURL url=KFileDialog::getOpenURL(TQString::null,
"*.png *.jpg *.jpeg *.gif *.htm *.html|" + i18n( "Web Files" ) + "\n"
"*.png *.jpg *.jpeg *.gif *.bmp *.xbm *.xpm *.pnm *.mng|" + i18n( "Images" ) + "\n"
"*.htm *.html|" + i18n( "HTML Files" ) + "\n"
@@ -258,8 +258,8 @@ void KimeShell::optionsConfigureToolbars()
// use the standard toolbar editor
KEditToolbar dlg(factory());
- connect(&dlg, SIGNAL(newToolbarConfig()),
- this, SLOT(applyNewToolbarConfig()));
+ connect(&dlg, TQT_SIGNAL(newToolbarConfig()),
+ this, TQT_SLOT(applyNewToolbarConfig()));
dlg.exec();
}
diff --git a/kimagemapeditor/mapslistview.cpp b/kimagemapeditor/mapslistview.cpp
index ec89ae4a..d3a9ebe9 100644
--- a/kimagemapeditor/mapslistview.cpp
+++ b/kimagemapeditor/mapslistview.cpp
@@ -23,40 +23,40 @@
#include "mapslistview.h"
-MapsListView::MapsListView(QWidget *parent, const char *name)
-: QVBox(parent, name) {
+MapsListView::MapsListView(TQWidget *parent, const char *name)
+: TQVBox(parent, name) {
_listView = new KListView(this);
_listView->addColumn(i18n("Maps"));
_listView->setFullWidth(true);
- _listView->setSelectionMode(QListView::Single);
+ _listView->setSelectionMode(TQListView::Single);
_listView->setItemsRenameable(true);
- connect( _listView, SIGNAL( selectionChanged(QListViewItem*)),
- this, SLOT( slotSelectionChanged(QListViewItem*)));
+ connect( _listView, TQT_SIGNAL( selectionChanged(TQListViewItem*)),
+ this, TQT_SLOT( slotSelectionChanged(TQListViewItem*)));
- connect( _listView, SIGNAL( itemRenamed(QListViewItem*)),
- this, SLOT( slotItemRenamed(QListViewItem*)));
+ connect( _listView, TQT_SIGNAL( itemRenamed(TQListViewItem*)),
+ this, TQT_SLOT( slotItemRenamed(TQListViewItem*)));
}
MapsListView::~MapsListView() {
}
-void MapsListView::addMap(const QString & name = QString::null) {
- new QListViewItem(_listView,name);
+void MapsListView::addMap(const TQString & name = TQString::null) {
+ new TQListViewItem(_listView,name);
//kdDebug() << "MapsListView::addMap : Added map '" << name << "'" << endl;
}
-void MapsListView::addMaps(QPtrList<MapTag> * maps) {
+void MapsListView::addMaps(TQPtrList<MapTag> * maps) {
for (MapTag *tag = maps->first(); tag!=0L; tag=maps->next()) {
addMap(tag->name);
}
}
-void MapsListView::selectMap(const QString & name) {
- QListViewItem* item = _listView->findItem(name,0);
+void MapsListView::selectMap(const TQString & name) {
+ TQListViewItem* item = _listView->findItem(name,0);
if (item) {
selectMap(item);
} else
@@ -64,16 +64,16 @@ void MapsListView::selectMap(const QString & name) {
}
-void MapsListView::selectMap(QListViewItem* item) {
+void MapsListView::selectMap(TQListViewItem* item) {
if (item)
_listView->setSelected(item,true);
}
-QString MapsListView::selectedMap() {
- QString result;
+TQString MapsListView::selectedMap() {
+ TQString result;
- QListViewItem* item = _listView->selectedItem();
+ TQListViewItem* item = _listView->selectedItem();
if (item)
result = item->text(0);
else
@@ -82,8 +82,8 @@ QString MapsListView::selectedMap() {
return result;
}
-void MapsListView::removeMap(const QString & name) {
- QListViewItem* item = _listView->findItem(name,0);
+void MapsListView::removeMap(const TQString & name) {
+ TQListViewItem* item = _listView->findItem(name,0);
if (item) {
_listView->takeItem(item);
_listView->setSelected(_listView->currentItem(),true);
@@ -96,19 +96,19 @@ void MapsListView::clear() {
_listView->clear();
}
-void MapsListView::slotSelectionChanged(QListViewItem* item) {
- QString name = item->text(0);
+void MapsListView::slotSelectionChanged(TQListViewItem* item) {
+ TQString name = item->text(0);
emit mapSelected(name);
}
-void MapsListView::slotItemRenamed(QListViewItem* item) {
- QString name = item->text(0);
+void MapsListView::slotItemRenamed(TQListViewItem* item) {
+ TQString name = item->text(0);
emit mapRenamed(name);
}
-void MapsListView::changeMapName(const QString & oldName, const QString & newName) {
+void MapsListView::changeMapName(const TQString & oldName, const TQString & newName) {
// kdDebug() << "MapsListView::changeMapName : " << oldName << " to " << newName << endl;
- QListViewItem* item = _listView->findItem(oldName,0);
+ TQListViewItem* item = _listView->findItem(oldName,0);
if (item) {
item->setText(0,newName);
// kdDebug() << "MapsListView::changeMapName : successful" << endl;
@@ -120,12 +120,12 @@ void MapsListView::changeMapName(const QString & oldName, const QString & newNam
}
-bool MapsListView::nameAlreadyExists(const QString & name) {
+bool MapsListView::nameAlreadyExists(const TQString & name) {
// kdDebug() << "MapsListView::nameAlreadyExists : " << name << " ? " << endl;
bool result = false;
- QListViewItem* item = 0L;
+ TQListViewItem* item = 0L;
for(item = _listView->firstChild(); item; item = item->nextSibling()) {
- QString otherMap = item->text(0);
+ TQString otherMap = item->text(0);
if(name == otherMap) {
result = true;
break;
@@ -137,26 +137,26 @@ bool MapsListView::nameAlreadyExists(const QString & name) {
return result;
}
-QStringList MapsListView::getMaps() {
- QStringList result;
+TQStringList MapsListView::getMaps() {
+ TQStringList result;
- QListViewItem* item = 0L;
+ TQListViewItem* item = 0L;
for(item = _listView->firstChild(); item; item = item->nextSibling()) {
- QString map = item->text(0);
+ TQString map = item->text(0);
result << map;
}
return result;
}
-QString MapsListView::getUnusedMapName() {
- QString result;
- QString attempt;
+TQString MapsListView::getUnusedMapName() {
+ TQString result;
+ TQString attempt;
int i=0;
while(result.isEmpty()) {
i++;
attempt = i18n("unnamed");
- attempt += QString::number(i);
+ attempt += TQString::number(i);
if (nameAlreadyExists(attempt))
continue;
diff --git a/kimagemapeditor/mapslistview.h b/kimagemapeditor/mapslistview.h
index 559725a2..467279ae 100644
--- a/kimagemapeditor/mapslistview.h
+++ b/kimagemapeditor/mapslistview.h
@@ -18,7 +18,7 @@
#ifndef _MAPSLISTVIEW_H_
#define _MAPSLISTVIEW_H_
-#include <qvbox.h>
+#include <tqvbox.h>
#include "kimagemapeditor.h"
class KListView;
@@ -32,44 +32,44 @@ class MapsListView : public QVBox
{
Q_OBJECT
public:
- MapsListView(QWidget *parent, const char *name);
+ MapsListView(TQWidget *parent, const char *name);
~MapsListView();
/**
* Adds the given map to the ListView
*/
- void addMap(const QString &);
+ void addMap(const TQString &);
/**
* Adds all maps of the given QList to the ListView
*/
- void addMaps(QPtrList<MapTag> *);
+ void addMaps(TQPtrList<MapTag> *);
/**
* Removes the given map from the ListView
*/
- void removeMap(const QString &);
+ void removeMap(const TQString &);
/**
* Set the the given map selected in the ListView.
* it does not emit mapSelected afterwards.
*/
- void selectMap(const QString &);
+ void selectMap(const TQString &);
/**
* Selects the given ListViewItem and deselects the current selected item
*/
- void selectMap(QListViewItem* item);
+ void selectMap(TQListViewItem* item);
/**
* Changes the name of the map with the @p oldName to @p newName
*/
- void changeMapName(const QString & oldName, const QString & newName);
+ void changeMapName(const TQString & oldName, const TQString & newName);
/**
* Returns the current selected map
*/
- QString selectedMap();
+ TQString selectedMap();
/**
@@ -81,17 +81,17 @@ public:
* Returns a name for a map which is not used yet.
* Returns for example Unnamed1
*/
- QString getUnusedMapName();
+ TQString getUnusedMapName();
/**
* Wether or not the given map name already exists
*/
- bool nameAlreadyExists(const QString &);
+ bool nameAlreadyExists(const TQString &);
/**
- * Returns a QStringList of all maps
+ * Returns a TQStringList of all maps
*/
- QStringList getMaps();
+ TQStringList getMaps();
/**
* Returns the number of maps
@@ -103,8 +103,8 @@ protected:
KListView* _listView;
protected slots:
- void slotSelectionChanged(QListViewItem*);
- void slotItemRenamed(QListViewItem*);
+ void slotSelectionChanged(TQListViewItem*);
+ void slotItemRenamed(TQListViewItem*);
signals:
@@ -112,13 +112,13 @@ signals:
* Gets emitted when the user selects a map in
* the ListView
*/
- void mapSelected(const QString &);
+ void mapSelected(const TQString &);
/**
* Emitted when the user has renamed a map in the ListView
*/
- void mapRenamed(const QString & newName);
+ void mapRenamed(const TQString & newName);
};
diff --git a/kimagemapeditor/qextfileinfo.cpp b/kimagemapeditor/qextfileinfo.cpp
index c52c48b5..4c10d102 100644
--- a/kimagemapeditor/qextfileinfo.cpp
+++ b/kimagemapeditor/qextfileinfo.cpp
@@ -12,12 +12,12 @@
//qt includes
-#include <qdir.h>
-#include <qapplication.h>
-#include <qptrlist.h>
-#include <qstringlist.h>
-#include <qregexp.h>
-#include <qtimer.h>
+#include <tqdir.h>
+#include <tqapplication.h>
+#include <tqptrlist.h>
+#include <tqstringlist.h>
+#include <tqregexp.h>
+#include <tqtimer.h>
//kde includes
#include <kurl.h>
@@ -32,7 +32,7 @@
//app includes
#include "qextfileinfo.h"
-QString QExtFileInfo::lastErrorMsg = "";
+TQString QExtFileInfo::lastErrorMsg = "";
/** create a relative short url based in baseURL*/
KURL QExtFileInfo::toRelative(const KURL& urlToConvert,const KURL& baseURL)
@@ -40,8 +40,8 @@ KURL QExtFileInfo::toRelative(const KURL& urlToConvert,const KURL& baseURL)
KURL resultURL = urlToConvert;
if (urlToConvert.protocol() == baseURL.protocol())
{
- QString path = urlToConvert.path();
- QString basePath = baseURL.path(1);
+ TQString path = urlToConvert.path();
+ TQString basePath = baseURL.path(1);
if (path.startsWith("/"))
{
path.remove(0, 1);
@@ -72,7 +72,7 @@ KURL QExtFileInfo::toRelative(const KURL& urlToConvert,const KURL& baseURL)
};
}
- resultURL.setPath(QDir::cleanDirPath(path));
+ resultURL.setPath(TQDir::cleanDirPath(path));
}
if (urlToConvert.path().endsWith("/")) resultURL.adjustPath(1);
@@ -85,15 +85,15 @@ KURL QExtFileInfo::toAbsolute(const KURL& urlToConvert,const KURL& baseURL)
if (urlToConvert.protocol() == baseURL.protocol() && !urlToConvert.path().startsWith("/"))
{
int pos;
- QString cutname = urlToConvert.path();
- QString cutdir = baseURL.path(1);
+ TQString cutname = urlToConvert.path();
+ TQString cutdir = baseURL.path(1);
while ( (pos = cutname.find("../")) >=0 )
{
cutname.remove( 0, pos+3 );
cutdir.remove( cutdir.length()-1, 1 );
cutdir.remove( cutdir.findRev('/')+1 , 1000);
}
- resultURL.setPath(QDir::cleanDirPath(cutdir+cutname));
+ resultURL.setPath(TQDir::cleanDirPath(cutdir+cutname));
}
if (urlToConvert.path().endsWith("/")) resultURL.adjustPath(1);
@@ -105,13 +105,13 @@ KURL QExtFileInfo::toAbsolute(const KURL& urlToConvert,const KURL& baseURL)
This is needed for empty directory adding/handling. (Andras)
Currently works only for local directories
*/
-KURL::List QExtFileInfo::allFiles( const KURL& path, const QString& mask)
+KURL::List QExtFileInfo::allFiles( const KURL& path, const TQString& mask)
{
QExtFileInfo internalFileInfo;
return internalFileInfo.allFilesInternal(path, mask);
}
-KURL::List QExtFileInfo::allFilesRelative( const KURL& path, const QString& mask)
+KURL::List QExtFileInfo::allFilesRelative( const KURL& path, const TQString& mask)
{
QExtFileInfo internalFileInfo;
KURL::List r = internalFileInfo.allFilesInternal( path, mask);
@@ -153,7 +153,7 @@ bool QExtFileInfo::createDir( const KURL& path )
KURL QExtFileInfo::cdUp(const KURL &url)
{
KURL u = url;
- QString dir = u.path(-1);
+ TQString dir = u.path(-1);
while ( !dir.isEmpty() && dir.right(1) != "/" )
{
dir.remove( dir.length()-1,1);
@@ -162,7 +162,7 @@ KURL QExtFileInfo::cdUp(const KURL &url)
return u;
}
-QString QExtFileInfo::shortName(const QString &fname)
+TQString QExtFileInfo::shortName(const TQString &fname)
{
return fname.section("/",-1);
}
@@ -175,7 +175,7 @@ KURL QExtFileInfo::path( const KURL &url )
KURL QExtFileInfo::home()
{
KURL url;
- url.setPath(QDir::currentDirPath()+"/");
+ url.setPath(TQDir::currentDirPath()+"/");
return url;
}
@@ -189,7 +189,7 @@ bool QExtFileInfo::exists(const KURL& a_url)
// No dialog when stating.
if ( a_url.isLocalFile() )
{
- return QFile::exists( a_url.path() );
+ return TQFile::exists( a_url.path() );
} else
{
QExtFileInfo internalFileInfo;
@@ -199,14 +199,14 @@ bool QExtFileInfo::exists(const KURL& a_url)
/* Synchronouse copy, like NetAccess::file_copy in KDE 3.2 */
bool QExtFileInfo::copy( const KURL& src, const KURL& target, int permissions,
- bool overwrite, bool resume, QWidget* window )
+ bool overwrite, bool resume, TQWidget* window )
{
QExtFileInfo internalFileInfo;
return internalFileInfo.internalCopy( src, target, permissions, overwrite, resume, window );
}
/** No descriptions */
-KURL::List QExtFileInfo::allFilesInternal(const KURL& startURL, const QString& mask)
+KURL::List QExtFileInfo::allFilesInternal(const KURL& startURL, const TQString& mask)
{
dirListItems.clear();
if (internalExists(startURL))
@@ -214,16 +214,16 @@ KURL::List QExtFileInfo::allFilesInternal(const KURL& startURL, const QString& m
lstFilters.setAutoDelete(true);
lstFilters.clear();
// Split on white space
- QStringList list = QStringList::split( ' ', mask );
- for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
- lstFilters.append( new QRegExp(*it, false, true ) );
+ TQStringList list = TQStringList::split( ' ', mask );
+ for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it )
+ lstFilters.append( new TQRegExp(*it, false, true ) );
bJobOK = true;
KIO::ListJob *job = KIO::listRecursive(startURL, false, true);
- connect(job, SIGNAL(entries(KIO::Job *, const KIO::UDSEntryList&)),
- this, SLOT(slotNewEntries(KIO::Job *, const KIO::UDSEntryList&)));
- connect( job, SIGNAL( result (KIO::Job *) ),
- this, SLOT( slotResult (KIO::Job *) ) );
+ connect(job, TQT_SIGNAL(entries(KIO::Job *, const KIO::UDSEntryList&)),
+ this, TQT_SLOT(slotNewEntries(KIO::Job *, const KIO::UDSEntryList&)));
+ connect( job, TQT_SIGNAL( result (KIO::Job *) ),
+ this, TQT_SLOT( slotResult (KIO::Job *) ) );
// kdDebug(24000) << "Now listing: " << startURL.url() << endl;
enter_loop();
@@ -247,11 +247,11 @@ bool QExtFileInfo::internalExists(const KURL& url)
KIO::StatJob * job = KIO::stat( url, false);
job->setDetails(0);
job->setSide(false); //check the url for writing
- connect( job, SIGNAL( result (KIO::Job *) ),
- this, SLOT( slotResult (KIO::Job *) ) );
+ connect( job, TQT_SIGNAL( result (KIO::Job *) ),
+ this, TQT_SLOT( slotResult (KIO::Job *) ) );
//To avoid lock-ups, start a timer.
- QTimer::singleShot(10*1000, this,SLOT(slotTimeout()));
+ TQTimer::singleShot(10*1000, this,TQT_SLOT(slotTimeout()));
// kdDebug(24000)<<"QExtFileInfo::internalExists:before enter_loop"<<endl;
enter_loop();
// kdDebug(24000)<<"QExtFileInfo::internalExists:after enter_loop"<<endl;
@@ -259,28 +259,28 @@ bool QExtFileInfo::internalExists(const KURL& url)
}
bool QExtFileInfo::internalCopy(const KURL& src, const KURL& target, int permissions,
- bool overwrite, bool resume, QWidget* window)
+ bool overwrite, bool resume, TQWidget* window)
{
bJobOK = true; // success unless further error occurs
KIO::Scheduler::checkSlaveOnHold(true);
KIO::Job * job = KIO::file_copy( src, target, permissions, overwrite, resume );
job->setWindow (window);
- connect( job, SIGNAL( result (KIO::Job *) ),
- this, SLOT( slotResult (KIO::Job *) ) );
+ connect( job, TQT_SIGNAL( result (KIO::Job *) ),
+ this, TQT_SLOT( slotResult (KIO::Job *) ) );
enter_loop();
return bJobOK;
}
-void qt_enter_modal( QWidget *widget );
-void qt_leave_modal( QWidget *widget );
+void qt_enter_modal( TQWidget *widget );
+void qt_leave_modal( TQWidget *widget );
void QExtFileInfo::enter_loop()
{
- QWidget dummy(0,0,WType_Dialog | WShowModal);
- dummy.setFocusPolicy( QWidget::NoFocus );
+ TQWidget dummy(0,0,WType_Dialog | WShowModal);
+ dummy.setFocusPolicy( TQWidget::NoFocus );
qt_enter_modal(&dummy);
// kdDebug(24000)<<"QExtFileInfo::enter_loop:before qApp->enter_loop()"<<endl;
qApp->enter_loop();
@@ -306,15 +306,15 @@ void QExtFileInfo::slotNewEntries(KIO::Job *job, const KIO::UDSEntryList& udsLis
KURL url = static_cast<KIO::ListJob *>(job)->url();
url.adjustPath(-1);
// avoid creating these QStrings again and again
- static const QString& dot = KGlobal::staticQString(".");
- static const QString& dotdot = KGlobal::staticQString("..");
+ static const TQString& dot = KGlobal::staticQString(".");
+ static const TQString& dotdot = KGlobal::staticQString("..");
KIO::UDSEntryListConstIterator it = udsList.begin();
KIO::UDSEntryListConstIterator end = udsList.end();
KURL itemURL;
for ( ; it != end; ++it )
{
- QString name;
+ TQString name;
// find out about the name
KIO::UDSEntry::ConstIterator entit = (*it).begin();
@@ -330,7 +330,7 @@ void QExtFileInfo::slotNewEntries(KIO::Job *job, const KIO::UDSEntryList& udsLis
KFileItem* item = new KFileItem( *it, url, false, true );
itemURL = item->url();
if (item->isDir()) itemURL.adjustPath(1);
- for ( QPtrListIterator<QRegExp> filterIt( lstFilters ); filterIt.current(); ++filterIt )
+ for ( TQPtrListIterator<TQRegExp> filterIt( lstFilters ); filterIt.current(); ++filterIt )
if ( filterIt.current()->exactMatch( item->text() ) )
dirListItems.append(itemURL);
delete item;
diff --git a/kimagemapeditor/qextfileinfo.h b/kimagemapeditor/qextfileinfo.h
index 20294bde..6f2b867c 100644
--- a/kimagemapeditor/qextfileinfo.h
+++ b/kimagemapeditor/qextfileinfo.h
@@ -17,9 +17,9 @@
#include <kurl.h>
#include <kfileitem.h>
-#include <qobject.h>
-#include <qptrlist.h>
-#include <qregexp.h>
+#include <tqobject.h>
+#include <tqptrlist.h>
+#include <tqregexp.h>
class QExtFileInfo:public QObject
{
@@ -33,33 +33,33 @@ public:
/** convert relative filename to absolute */
static KURL toAbsolute(const KURL& urlToConvert,const KURL& baseURL);
/** recurse function for all files in dir */
- static KURL::List allFiles( const KURL& path, const QString &mask);
- static KURL::List allFilesRelative( const KURL& path, const QString &mask);
+ static KURL::List allFiles( const KURL& path, const TQString &mask);
+ static KURL::List allFilesRelative( const KURL& path, const TQString &mask);
/** create dir if don't exists */
static bool createDir(const KURL & path );
static KURL cdUp(const KURL &dir);
- static QString shortName(const QString &fname );
+ static TQString shortName(const TQString &fname );
static KURL path(const KURL &);
static KURL home();
static bool exists(const KURL& url);
static bool copy( const KURL& src, const KURL& dest, int permissions=-1,
- bool overwrite=false, bool resume=false, QWidget* window = 0L );
+ bool overwrite=false, bool resume=false, TQWidget* window = 0L );
void enter_loop();
private:
bool internalExists(const KURL& url);
bool internalCopy(const KURL& src, const KURL& target, int permissions,
- bool overwrite, bool resume, QWidget* window);
+ bool overwrite, bool resume, TQWidget* window);
bool bJobOK;
- static QString lastErrorMsg;
+ static TQString lastErrorMsg;
KIO::UDSEntry m_entry;
KURL::List dirListItems;
- QPtrList<QRegExp> lstFilters;
+ TQPtrList<TQRegExp> lstFilters;
/** No descriptions */
- KURL::List allFilesInternal(const KURL& startURL, const QString& mask);
+ KURL::List allFilesInternal(const KURL& startURL, const TQString& mask);
// friend class I_like_this_class;