summaryrefslogtreecommitdiffstats
path: root/src/gvcore/dragpixmapgenerator.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gvcore/dragpixmapgenerator.h')
-rw-r--r--src/gvcore/dragpixmapgenerator.h46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/gvcore/dragpixmapgenerator.h b/src/gvcore/dragpixmapgenerator.h
index d73d776..efbbd93 100644
--- a/src/gvcore/dragpixmapgenerator.h
+++ b/src/gvcore/dragpixmapgenerator.h
@@ -21,12 +21,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef DRAGPIXMAPGENERATOR_H
#define DRAGPIXMAPGENERATOR_H
-// Qt
-#include <qapplication.h>
-#include <qpixmap.h>
-#include <qtooltip.h>
-#include <qvaluelist.h>
-#include <qvaluevector.h>
+// TQt
+#include <tqapplication.h>
+#include <tqpixmap.h>
+#include <tqtooltip.h>
+#include <tqvaluelist.h>
+#include <tqvaluevector.h>
// KDE
#include <klocale.h>
@@ -47,8 +47,8 @@ public:
virtual void setGenerator(DragPixmapGenerator<T>* generator) {
mGenerator = generator;
}
- virtual QSize itemSize(T)=0;
- virtual void drawItem(QPainter*, int left, int top, T)=0;
+ virtual TQSize itemSize(T)=0;
+ virtual void drawItem(TQPainter*, int left, int top, T)=0;
virtual int spacing() const {
return 0;
}
@@ -58,7 +58,7 @@ protected:
};
-QPixmap dragPixmapGeneratorHelper(QValueVector<QPixmap> pixmapVector);
+TQPixmap dragPixmapGeneratorHelper(TQValueVector<TQPixmap> pixmapVector);
template <class T>
@@ -104,23 +104,23 @@ public:
drawer->setGenerator(this);
}
- QPixmap generate() {
+ TQPixmap generate() {
int width = 0, height = 0;
int dragCount = 0;
int spacing = mItemDrawer->spacing();
bool listCropped;
- QString bottomText;
- QFontMetrics fm = QApplication::fontMetrics();
+ TQString bottomText;
+ TQFontMetrics fm = TQApplication::fontMetrics();
// Compute pixmap size and update dragCount
- QValueListIterator<T> it = mItemList.begin();
- QValueListIterator<T> end = mItemList.end();
+ TQValueListIterator<T> it = mItemList.begin();
+ TQValueListIterator<T> end = mItemList.end();
height = -spacing;
for (; it!= end && height < MAX_HEIGHT; ++dragCount, ++it) {
- QSize itemSize = mItemDrawer->itemSize(*it);
+ TQSize itemSize = mItemDrawer->itemSize(*it);
Q_ASSERT(itemSize.width() <= ITEM_MAX_WIDTH);
- width = QMAX(width, itemSize.width());
+ width = TQMAX(width, itemSize.width());
height += itemSize.height() + spacing;
}
@@ -128,18 +128,18 @@ public:
if (listCropped) {
// If list has been cropped, leave space for item count text
height += fm.height();
- bottomText = i18n("%1 items").arg(mItemList.count());
- width = QMAX(width, fm.width("... " + bottomText));
+ bottomText = i18n("%1 items").tqarg(mItemList.count());
+ width = TQMAX(width, fm.width("... " + bottomText));
}
mPixmapWidth = width;
// Init pixmap
- QPixmap pixmap(width + 2*DRAG_MARGIN, height + 2*DRAG_MARGIN);
- QColorGroup cg = QToolTip::palette().active();
+ TQPixmap pixmap(width + 2*DRAG_MARGIN, height + 2*DRAG_MARGIN);
+ TQColorGroup cg = TQToolTip::palette().active();
pixmap.fill(cg.base());
- QPainter painter(&pixmap);
+ TQPainter painter(&pixmap);
// Draw border
painter.setPen(cg.dark());
@@ -156,7 +156,7 @@ public:
// Draw text if necessary
if (listCropped) {
int posY= height + fm.ascent();
- painter.drawText(DRAG_MARGIN, posY, "...");
+ painter.drawText(DRAG_MARGIN, posY, TQString("..."));
int offset = width - fm.width(bottomText);
painter.drawText(DRAG_MARGIN + offset, posY, bottomText);
}
@@ -167,7 +167,7 @@ public:
private:
- QValueList<T> mItemList;
+ TQValueList<T> mItemList;
DragPixmapItemDrawer<T>* mItemDrawer;
int mPixmapWidth;
};