|
|
|
@ -29,6 +29,8 @@
|
|
|
|
|
#include "tqpaintdevicemetrics.h"
|
|
|
|
|
#undef Qt
|
|
|
|
|
|
|
|
|
|
#include "tdeqt4converter.h"
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
\class TDEQt4PaintDevice tdeqt4painter.h
|
|
|
|
|
\brief The TDEQt4PaintDevice class is a paint device that translates
|
|
|
|
@ -452,66 +454,7 @@ bool TDEQt4PaintDevice::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
|
|
|
|
|
}
|
|
|
|
|
if (c == PdcSetFont) {
|
|
|
|
|
TQFont qt3font = *p[0].font;
|
|
|
|
|
qt4font = QFont(QString::fromUtf8(qt3font.family().utf8().data()), qt3font.pointSize(), qt3font.weight(), qt3font.italic());
|
|
|
|
|
|
|
|
|
|
qt4font.setBold(qt3font.bold());
|
|
|
|
|
// qt4font.setCapitalization ( Capitalization caps )
|
|
|
|
|
qt4font.setFamily(QString::fromUtf8(qt3font.family().utf8().data()));
|
|
|
|
|
qt4font.setFixedPitch(qt3font.fixedPitch());
|
|
|
|
|
qt4font.setItalic(qt3font.italic());
|
|
|
|
|
// qt4font.setKerning ( bool enable )
|
|
|
|
|
// qt4font.setLetterSpacing ( SpacingType type, qreal spacing )
|
|
|
|
|
qt4font.setOverline(qt3font.overline());
|
|
|
|
|
int pixelSize = qt3font.pixelSize();
|
|
|
|
|
if (pixelSize < 0) {
|
|
|
|
|
float pointSizeFloat = qt3font.pointSizeFloat();
|
|
|
|
|
if (pointSizeFloat < 0) {
|
|
|
|
|
qt4font.setPointSize(qt3font.pointSize());
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
qt4font.setPointSizeF(pointSizeFloat);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
qt4font.setPixelSize(pixelSize);
|
|
|
|
|
}
|
|
|
|
|
// qt4font.setRawMode ( bool enable )
|
|
|
|
|
// qt4font.setRawName(QString::fromUtf8(qt3font.rawName().utf8().data()));
|
|
|
|
|
qt4font.setStretch(qt3font.stretch());
|
|
|
|
|
qt4font.setStrikeOut(qt3font.strikeOut());
|
|
|
|
|
// qt4font.setStyle ( Style style )
|
|
|
|
|
|
|
|
|
|
TQFont::StyleHint qt3fontstylehint = qt3font.styleHint();
|
|
|
|
|
QFont::StyleHint qt4fontstylehint = QFont::AnyStyle;
|
|
|
|
|
if (qt3fontstylehint == TQFont::Helvetica) qt4fontstylehint = QFont::Helvetica;
|
|
|
|
|
else if (qt3fontstylehint == TQFont::SansSerif) qt4fontstylehint = QFont::SansSerif;
|
|
|
|
|
else if (qt3fontstylehint == TQFont::Times) qt4fontstylehint = QFont::Times;
|
|
|
|
|
else if (qt3fontstylehint == TQFont::Serif) qt4fontstylehint = QFont::Serif;
|
|
|
|
|
else if (qt3fontstylehint == TQFont::Courier) qt4fontstylehint = QFont::Courier;
|
|
|
|
|
else if (qt3fontstylehint == TQFont::TypeWriter) qt4fontstylehint = QFont::TypeWriter;
|
|
|
|
|
else if (qt3fontstylehint == TQFont::OldEnglish) qt4fontstylehint = QFont::OldEnglish;
|
|
|
|
|
else if (qt3fontstylehint == TQFont::Decorative) qt4fontstylehint = QFont::Decorative;
|
|
|
|
|
else if (qt3fontstylehint == TQFont::System) qt4fontstylehint = QFont::System;
|
|
|
|
|
else if (qt3fontstylehint == TQFont::AnyStyle) qt4fontstylehint = QFont::AnyStyle;
|
|
|
|
|
|
|
|
|
|
TQFont::StyleStrategy qt3fontstrategy = qt3font.styleStrategy();
|
|
|
|
|
QFont::StyleStrategy qt4fontstrategy = (QFont::StyleStrategy)0;
|
|
|
|
|
if (qt3fontstrategy & TQFont::PreferDefault) qt4fontstrategy = (QFont::StyleStrategy)(qt4fontstrategy | QFont::PreferDefault);
|
|
|
|
|
if (qt3fontstrategy & TQFont::PreferBitmap) qt4fontstrategy = (QFont::StyleStrategy)(qt4fontstrategy | QFont::PreferBitmap);
|
|
|
|
|
if (qt3fontstrategy & TQFont::PreferDevice) qt4fontstrategy = (QFont::StyleStrategy)(qt4fontstrategy | QFont::PreferDevice);
|
|
|
|
|
if (qt3fontstrategy & TQFont::PreferOutline) qt4fontstrategy = (QFont::StyleStrategy)(qt4fontstrategy | QFont::PreferOutline);
|
|
|
|
|
if (qt3fontstrategy & TQFont::ForceOutline) qt4fontstrategy = (QFont::StyleStrategy)(qt4fontstrategy | QFont::ForceOutline);
|
|
|
|
|
if (qt3fontstrategy & TQFont::PreferMatch) qt4fontstrategy = (QFont::StyleStrategy)(qt4fontstrategy | QFont::PreferMatch);
|
|
|
|
|
if (qt3fontstrategy & TQFont::PreferQuality) qt4fontstrategy = (QFont::StyleStrategy)(qt4fontstrategy | QFont::PreferQuality);
|
|
|
|
|
if (qt3fontstrategy & TQFont::PreferAntialias) qt4fontstrategy = (QFont::StyleStrategy)(qt4fontstrategy | QFont::PreferAntialias);
|
|
|
|
|
if (qt3fontstrategy & TQFont::NoAntialias) qt4fontstrategy = (QFont::StyleStrategy)(qt4fontstrategy | QFont::NoAntialias);
|
|
|
|
|
if (qt3fontstrategy & TQFont::OpenGLCompatible) qt4fontstrategy = (QFont::StyleStrategy)(qt4fontstrategy | QFont::OpenGLCompatible);
|
|
|
|
|
|
|
|
|
|
qt4font.setStyleHint (qt4fontstylehint, qt4fontstrategy);
|
|
|
|
|
// qt4font.setStyleStrategy ( StyleStrategy s )
|
|
|
|
|
qt4font.setUnderline(qt3font.underline());
|
|
|
|
|
qt4font.setWeight(qt3font.weight());
|
|
|
|
|
// qt4font.setWordSpacing ( qreal spacing )
|
|
|
|
|
qt4font = convertTQt3ToQt4Font(qt3font);
|
|
|
|
|
}
|
|
|
|
|
if (c == PdcDrawPixmap) {
|
|
|
|
|
qt4rect = QRect(p[0].rect->x(), p[0].rect->y(), p[0].rect->width(), p[0].rect->height());
|
|
|
|
|