summaryrefslogtreecommitdiffstats
path: root/kexi/widget/utils/kexidisplayutils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kexi/widget/utils/kexidisplayutils.cpp')
-rw-r--r--kexi/widget/utils/kexidisplayutils.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/kexi/widget/utils/kexidisplayutils.cpp b/kexi/widget/utils/kexidisplayutils.cpp
index c7d238b1..1943b086 100644
--- a/kexi/widget/utils/kexidisplayutils.cpp
+++ b/kexi/widget/utils/kexidisplayutils.cpp
@@ -19,19 +19,19 @@
#include "kexidisplayutils.h"
-#include <qpixmap.h>
-#include <qpainter.h>
-#include <qimage.h>
-#include <qwidget.h>
+#include <tqpixmap.h>
+#include <tqpainter.h>
+#include <tqimage.h>
+#include <tqwidget.h>
#include <klocale.h>
#include <kstaticdeleter.h>
// a color for displaying default values or autonumbers
-#define SPECIAL_TEXT_COLOR Qt::blue
+#define SPECIAL_TEXT_COLOR TQt::blue
-static KStaticDeleter<QPixmap> KexiDisplayUtils_autonum_deleter;
-QPixmap* KexiDisplayUtils_autonum = 0;
+static KStaticDeleter<TQPixmap> KexiDisplayUtils_autonum_deleter;
+TQPixmap* KexiDisplayUtils_autonum = 0;
static const unsigned int autonumber_png_len = 245;
static const unsigned char autonumber_png_data[] = {
@@ -56,8 +56,8 @@ static const unsigned char autonumber_png_data[] = {
};
/* Generated by qembed */
-#include <qcstring.h>
-#include <qdict.h>
+#include <tqcstring.h>
+#include <tqdict.h>
static struct Embed {
unsigned int size;
const unsigned char *data;
@@ -67,11 +67,11 @@ static struct Embed {
{ 0, 0, 0 }
};
-QPixmap* getPix(int id)
+TQPixmap* getPix(int id)
{
-// QByteArray ba;
+// TQByteArray ba;
// ba.setRawData( (char*)embed_vec[id].data, embed_vec[id].size );
- QPixmap *pix = new QPixmap();
+ TQPixmap *pix = new TQPixmap();
pix->loadFromData( embed_vec[id].data, embed_vec[id].size );
return pix;
}
@@ -90,14 +90,14 @@ KexiDisplayUtils::DisplayParameters::DisplayParameters()
{
}
-KexiDisplayUtils::DisplayParameters::DisplayParameters(QWidget *w)
+KexiDisplayUtils::DisplayParameters::DisplayParameters(TQWidget *w)
{
- textColor = w->palette().active().foreground();
- selectedTextColor = w->palette().active().highlightedText();
+ textColor = w->tqpalette().active().foreground();
+ selectedTextColor = w->tqpalette().active().highlightedText();
font = w->font();
}
-void KexiDisplayUtils::initDisplayForAutonumberSign(DisplayParameters& par, QWidget *widget)
+void KexiDisplayUtils::initDisplayForAutonumberSign(DisplayParameters& par, TQWidget *widget)
{
initDisplayUtilsImages();
@@ -105,20 +105,20 @@ void KexiDisplayUtils::initDisplayForAutonumberSign(DisplayParameters& par, QWid
par.selectedTextColor = SPECIAL_TEXT_COLOR; //hmm, unused anyway
par.font = widget->font();
par.font.setItalic(true);
- QFontMetrics fm(par.font);
+ TQFontMetrics fm(par.font);
par.textWidth = fm.width(i18n("(autonumber)"));
par.textHeight = fm.height();
}
-void KexiDisplayUtils::initDisplayForDefaultValue(DisplayParameters& par, QWidget *widget)
+void KexiDisplayUtils::initDisplayForDefaultValue(DisplayParameters& par, TQWidget *widget)
{
par.textColor = SPECIAL_TEXT_COLOR;
- par.selectedTextColor = widget->palette().active().highlightedText();
+ par.selectedTextColor = widget->tqpalette().active().highlightedText();
par.font = widget->font();
par.font.setItalic(true);
}
-void KexiDisplayUtils::paintAutonumberSign(const DisplayParameters& par, QPainter* painter,
+void KexiDisplayUtils::paintAutonumberSign(const DisplayParameters& par, TQPainter* painter,
int x, int y, int width, int height, int align, bool overrideColor)
{
painter->save();
@@ -128,37 +128,37 @@ void KexiDisplayUtils::paintAutonumberSign(const DisplayParameters& par, QPainte
painter->setPen(par.textColor);
// int text_x = x;
- if (!(align & Qt::AlignVertical_Mask))
- align |= Qt::AlignVCenter;
- if (!(align & Qt::AlignHorizontal_Mask))
- align |= Qt::AlignLeft;
+ if (!(align & TQt::AlignVertical_Mask))
+ align |= TQt::AlignVCenter;
+ if (!(align & TQt::AlignHorizontal_Mask))
+ align |= TQt::AlignLeft;
int y_pixmap_pos = 0;
- if (align & Qt::AlignVCenter) {
- y_pixmap_pos = QMAX(0, y+1 + (height - KexiDisplayUtils_autonum->height())/2);
+ if (align & TQt::AlignVCenter) {
+ y_pixmap_pos = TQMAX(0, y+1 + (height - KexiDisplayUtils_autonum->height())/2);
}
- else if (align & Qt::AlignTop) {
- y_pixmap_pos = y + QMAX(0, (par.textHeight - KexiDisplayUtils_autonum->height())/2);
+ else if (align & TQt::AlignTop) {
+ y_pixmap_pos = y + TQMAX(0, (par.textHeight - KexiDisplayUtils_autonum->height())/2);
}
- else if (align & Qt::AlignBottom) {
+ else if (align & TQt::AlignBottom) {
y_pixmap_pos = y+1 + height - KexiDisplayUtils_autonum->height()
- - QMAX(0, (par.textHeight - KexiDisplayUtils_autonum->height())/2);
+ - TQMAX(0, (par.textHeight - KexiDisplayUtils_autonum->height())/2);
}
- if (align & (Qt::AlignLeft | Qt::AlignJustify)) {
+ if (align & (TQt::AlignLeft | TQt::AlignJustify)) {
// text_x = x + KexiDisplayUtils_autonum->width() + 2;
if (!overrideColor) {
painter->drawPixmap( x, y_pixmap_pos, *KexiDisplayUtils_autonum );
x += (KexiDisplayUtils_autonum->width() + 4);
}
}
- else if (align & Qt::AlignRight) {
+ else if (align & TQt::AlignRight) {
if (!overrideColor) {
painter->drawPixmap( x + width - par.textWidth - KexiDisplayUtils_autonum->width() - 4,
y_pixmap_pos, *KexiDisplayUtils_autonum );
}
}
- else if (align & Qt::AlignCenter) {
+ else if (align & TQt::AlignCenter) {
//! @todo
if (!overrideColor)
painter->drawPixmap( x + (width - par.textWidth)/2 - KexiDisplayUtils_autonum->width() - 4,