Replace Qt with TQt

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
replace/qt-tqt
Michele Calgaro 6 months ago
parent 0f7f50ffa0
commit 338f7820f9
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -18,15 +18,15 @@
#include "tdeqt4converter.h" #include "tdeqt4converter.h"
TQt::Orientation convertQt4ToTQt3Orientation(Qt::Orientation qt4orient) TQt::Orientation convertQt4ToTQt3Orientation(TQt::Orientation qt4orient)
{ {
TQt::Orientation tqt3orient; TQt::Orientation tqt3orient;
switch ( qt4orient ) { switch ( qt4orient ) {
case Qt::Horizontal: case TQt::Horizontal:
tqt3orient = TQt::Horizontal; tqt3orient = TQt::Horizontal;
break; break;
case Qt::Vertical: case TQt::Vertical:
tqt3orient = TQt::Vertical; tqt3orient = TQt::Vertical;
break; break;
} }
@ -120,7 +120,7 @@ TQPixmap convertQt4ToTQt3Pixmap(QPixmap qt4pixmap, bool copyTransparency, TQColo
qtPM.detach(); qtPM.detach();
if (copyTransparency) { if (copyTransparency) {
qtPM.fill(Qt::transparent); qtPM.fill(TQt::transparent);
} }
else { else {
tqtPM.fill(*bgcolor); tqtPM.fill(*bgcolor);
@ -140,10 +140,10 @@ TQRegion convertQt4ToTQt3Region(QRegion qt4region)
// SLOW // SLOW
if (!qt4br.isNull()) { if (!qt4br.isNull()) {
QBitmap regionMask(qt4br.x()+qt4br.width(), qt4br.y()+qt4br.height()); QBitmap regionMask(qt4br.x()+qt4br.width(), qt4br.y()+qt4br.height());
regionMask.fill(Qt::color0); regionMask.fill(TQt::color0);
QPainter qt4brpainter(&regionMask); QPainter qt4brpainter(&regionMask);
qt4brpainter.setClipRegion(qt4region); qt4brpainter.setClipRegion(qt4region);
qt4brpainter.fillRect(0,0,regionMask.width(),regionMask.height(),Qt::color1); qt4brpainter.fillRect(0,0,regionMask.width(),regionMask.height(),TQt::color1);
qt4brpainter.end(); qt4brpainter.end();
TQBitmap tqt3RegionMask; TQBitmap tqt3RegionMask;
tqt3RegionMask = convertQt4ToTQt3Pixmap(regionMask); tqt3RegionMask = convertQt4ToTQt3Pixmap(regionMask);
@ -252,59 +252,59 @@ QBrush convertTQt3ToQt4Brush(TQBrush tqt3brush)
{ {
QBrush qt4brush; QBrush qt4brush;
TQt::BrushStyle tqt3brushstyle = tqt3brush.style(); TQt::BrushStyle tqt3brushstyle = tqt3brush.style();
Qt::BrushStyle qt4brushstyle; TQt::BrushStyle qt4brushstyle;
switch ( tqt3brushstyle ) { switch ( tqt3brushstyle ) {
case TQt::NoBrush: case TQt::NoBrush:
qt4brushstyle = Qt::NoBrush; qt4brushstyle = TQt::NoBrush;
break; break;
case TQt::SolidPattern: case TQt::SolidPattern:
qt4brushstyle = Qt::SolidPattern; qt4brushstyle = TQt::SolidPattern;
break; break;
case TQt::Dense1Pattern: case TQt::Dense1Pattern:
qt4brushstyle = Qt::Dense1Pattern; qt4brushstyle = TQt::Dense1Pattern;
break; break;
case TQt::Dense2Pattern: case TQt::Dense2Pattern:
qt4brushstyle = Qt::Dense2Pattern; qt4brushstyle = TQt::Dense2Pattern;
break; break;
case TQt::Dense3Pattern: case TQt::Dense3Pattern:
qt4brushstyle = Qt::Dense3Pattern; qt4brushstyle = TQt::Dense3Pattern;
break; break;
case TQt::Dense4Pattern: case TQt::Dense4Pattern:
qt4brushstyle = Qt::Dense4Pattern; qt4brushstyle = TQt::Dense4Pattern;
break; break;
case TQt::Dense5Pattern: case TQt::Dense5Pattern:
qt4brushstyle = Qt::Dense5Pattern; qt4brushstyle = TQt::Dense5Pattern;
break; break;
case TQt::Dense6Pattern: case TQt::Dense6Pattern:
qt4brushstyle = Qt::Dense6Pattern; qt4brushstyle = TQt::Dense6Pattern;
break; break;
case TQt::Dense7Pattern: case TQt::Dense7Pattern:
qt4brushstyle = Qt::Dense7Pattern; qt4brushstyle = TQt::Dense7Pattern;
break; break;
case TQt::HorPattern: case TQt::HorPattern:
qt4brushstyle = Qt::HorPattern; qt4brushstyle = TQt::HorPattern;
break; break;
case TQt::VerPattern: case TQt::VerPattern:
qt4brushstyle = Qt::VerPattern; qt4brushstyle = TQt::VerPattern;
break; break;
case TQt::CrossPattern: case TQt::CrossPattern:
qt4brushstyle = Qt::CrossPattern; qt4brushstyle = TQt::CrossPattern;
break; break;
case TQt::BDiagPattern: case TQt::BDiagPattern:
qt4brushstyle = Qt::BDiagPattern; qt4brushstyle = TQt::BDiagPattern;
break; break;
case TQt::FDiagPattern: case TQt::FDiagPattern:
qt4brushstyle = Qt::FDiagPattern; qt4brushstyle = TQt::FDiagPattern;
break; break;
case TQt::DiagCrossPattern: case TQt::DiagCrossPattern:
qt4brushstyle = Qt::DiagCrossPattern; qt4brushstyle = TQt::DiagCrossPattern;
break; break;
case TQt::CustomPattern: case TQt::CustomPattern:
qt4brushstyle = Qt::TexturePattern; qt4brushstyle = TQt::TexturePattern;
break; break;
default: default:
qt4brushstyle = Qt::NoBrush; qt4brushstyle = TQt::NoBrush;
#if defined(QT_CHECK_RANGE) #if defined(QT_CHECK_RANGE)
tqWarning( "convertTQt3ToQt4Brush: Invalid brush style %d", tqt3brushstyle ); tqWarning( "convertTQt3ToQt4Brush: Invalid brush style %d", tqt3brushstyle );
#endif #endif
@ -312,7 +312,7 @@ QBrush convertTQt3ToQt4Brush(TQBrush tqt3brush)
qt4brush.setStyle(qt4brushstyle); qt4brush.setStyle(qt4brushstyle);
TQColor qt3color = tqt3brush.color(); TQColor qt3color = tqt3brush.color();
qt4brush.setColor(QColor(qt3color.red(), qt3color.green(), qt3color.blue(), 255)); qt4brush.setColor(QColor(qt3color.red(), qt3color.green(), qt3color.blue(), 255));
if (qt4brushstyle == Qt::TexturePattern) { if (qt4brushstyle == TQt::TexturePattern) {
TQPixmap tqtPM = *tqt3brush.pixmap(); TQPixmap tqtPM = *tqt3brush.pixmap();
QPixmap qtPM = QPixmap::fromX11Pixmap(tqtPM.handle(), QPixmap::ImplicitlyShared); QPixmap qtPM = QPixmap::fromX11Pixmap(tqtPM.handle(), QPixmap::ImplicitlyShared);
qtPM.detach(); qtPM.detach();
@ -325,56 +325,56 @@ QBrush convertTQt3ToQt4Brush(TQBrush tqt3brush)
TQBrush convertQt4ToTQt3Brush(QBrush qt4brush) TQBrush convertQt4ToTQt3Brush(QBrush qt4brush)
{ {
TQBrush tqt3brush; TQBrush tqt3brush;
Qt::BrushStyle qt4brushstyle = qt4brush.style(); TQt::BrushStyle qt4brushstyle = qt4brush.style();
TQt::BrushStyle tqt3brushstyle; TQt::BrushStyle tqt3brushstyle;
switch ( qt4brushstyle ) { switch ( qt4brushstyle ) {
case Qt::NoBrush: case TQt::NoBrush:
tqt3brushstyle = TQt::NoBrush; tqt3brushstyle = TQt::NoBrush;
break; break;
case Qt::SolidPattern: case TQt::SolidPattern:
tqt3brushstyle = TQt::SolidPattern; tqt3brushstyle = TQt::SolidPattern;
break; break;
case Qt::Dense1Pattern: case TQt::Dense1Pattern:
tqt3brushstyle = TQt::Dense1Pattern; tqt3brushstyle = TQt::Dense1Pattern;
break; break;
case Qt::Dense2Pattern: case TQt::Dense2Pattern:
tqt3brushstyle = TQt::Dense2Pattern; tqt3brushstyle = TQt::Dense2Pattern;
break; break;
case Qt::Dense3Pattern: case TQt::Dense3Pattern:
tqt3brushstyle = TQt::Dense3Pattern; tqt3brushstyle = TQt::Dense3Pattern;
break; break;
case Qt::Dense4Pattern: case TQt::Dense4Pattern:
tqt3brushstyle = TQt::Dense4Pattern; tqt3brushstyle = TQt::Dense4Pattern;
break; break;
case Qt::Dense5Pattern: case TQt::Dense5Pattern:
tqt3brushstyle = TQt::Dense5Pattern; tqt3brushstyle = TQt::Dense5Pattern;
break; break;
case Qt::Dense6Pattern: case TQt::Dense6Pattern:
tqt3brushstyle = TQt::Dense6Pattern; tqt3brushstyle = TQt::Dense6Pattern;
break; break;
case Qt::Dense7Pattern: case TQt::Dense7Pattern:
tqt3brushstyle = TQt::Dense7Pattern; tqt3brushstyle = TQt::Dense7Pattern;
break; break;
case Qt::HorPattern: case TQt::HorPattern:
tqt3brushstyle = TQt::HorPattern; tqt3brushstyle = TQt::HorPattern;
break; break;
case Qt::VerPattern: case TQt::VerPattern:
tqt3brushstyle = TQt::VerPattern; tqt3brushstyle = TQt::VerPattern;
break; break;
case Qt::CrossPattern: case TQt::CrossPattern:
tqt3brushstyle = TQt::CrossPattern; tqt3brushstyle = TQt::CrossPattern;
break; break;
case Qt::BDiagPattern: case TQt::BDiagPattern:
tqt3brushstyle = TQt::BDiagPattern; tqt3brushstyle = TQt::BDiagPattern;
break; break;
case Qt::FDiagPattern: case TQt::FDiagPattern:
tqt3brushstyle = TQt::FDiagPattern; tqt3brushstyle = TQt::FDiagPattern;
break; break;
case Qt::DiagCrossPattern: case TQt::DiagCrossPattern:
tqt3brushstyle = TQt::DiagCrossPattern; tqt3brushstyle = TQt::DiagCrossPattern;
break; break;
case Qt::TexturePattern: case TQt::TexturePattern:
tqt3brushstyle = TQt::CustomPattern; tqt3brushstyle = TQt::CustomPattern;
break; break;
default: default:

@ -64,7 +64,7 @@ enum TQt3WidgetType {
TQT3WT_TQToolButton TQT3WT_TQToolButton
}; };
TQt::Orientation convertQt4ToTQt3Orientation(Qt::Orientation qt4orient); TQt::Orientation convertQt4ToTQt3Orientation(TQt::Orientation qt4orient);
TQSlider::TickSetting convertQt4ToTQt3TickSetting(QSlider::TickPosition qt4ts); TQSlider::TickSetting convertQt4ToTQt3TickSetting(QSlider::TickPosition qt4ts);
QColor convertTQt3ToQt4Color(TQColor tqt3color); QColor convertTQt3ToQt4Color(TQColor tqt3color);
TQColor convertQt4ToTQt3Color(QColor qt4color); TQColor convertQt4ToTQt3Color(QColor qt4color);

@ -48,7 +48,7 @@
inline int qt4PainterRectSubtraction(QPainter* pd) { inline int qt4PainterRectSubtraction(QPainter* pd) {
QPen pen = pd->pen(); QPen pen = pd->pen();
return pen.style() != Qt::NoPen && pen.width() == 0 ? 1 : 0; return pen.style() != TQt::NoPen && pen.width() == 0 ? 1 : 0;
} }
inline QRect qt4PainterAdjustedRectangle(const QRect &r, QPainter* pd) inline QRect qt4PainterAdjustedRectangle(const QRect &r, QPainter* pd)
@ -105,7 +105,7 @@ bool TDEQt4PaintDevice::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
QString qt4string; QString qt4string;
QMatrix qt4matrix; QMatrix qt4matrix;
QRegion qt4region; QRegion qt4region;
Qt::BGMode qt4bkmode = Qt::TransparentMode; TQt::BGMode qt4bkmode = TQt::TransparentMode;
QPainter::CompositionMode qt4compositionmode = QPainter::CompositionMode_SourceOver; QPainter::CompositionMode qt4compositionmode = QPainter::CompositionMode_SourceOver;
int qt4formattedtextflags = 0; int qt4formattedtextflags = 0;
@ -244,52 +244,52 @@ bool TDEQt4PaintDevice::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
qt4rect = QRect(p[0].rect->x(), p[0].rect->y(), p[0].rect->width(), p[0].rect->height()); qt4rect = QRect(p[0].rect->x(), p[0].rect->y(), p[0].rect->width(), p[0].rect->height());
qt4formattedtextflags = 0; qt4formattedtextflags = 0;
// if (p[1].ival & TQt::AlignAuto) { // if (p[1].ival & TQt::AlignAuto) {
// qt4formattedtextflags = qt4formattedtextflags | Qt::AlignAuto; // qt4formattedtextflags = qt4formattedtextflags | TQt::AlignAuto;
// } // }
if ((p[1].ival & TQt::AlignLeft) == TQt::AlignLeft) { if ((p[1].ival & TQt::AlignLeft) == TQt::AlignLeft) {
qt4formattedtextflags = qt4formattedtextflags | Qt::AlignLeft; qt4formattedtextflags = qt4formattedtextflags | TQt::AlignLeft;
} }
if ((p[1].ival & TQt::AlignRight) == TQt::AlignRight) { if ((p[1].ival & TQt::AlignRight) == TQt::AlignRight) {
qt4formattedtextflags = qt4formattedtextflags | Qt::AlignRight; qt4formattedtextflags = qt4formattedtextflags | TQt::AlignRight;
} }
if ((p[1].ival & TQt::AlignHCenter) == TQt::AlignHCenter) { if ((p[1].ival & TQt::AlignHCenter) == TQt::AlignHCenter) {
qt4formattedtextflags = qt4formattedtextflags | Qt::AlignHCenter; qt4formattedtextflags = qt4formattedtextflags | TQt::AlignHCenter;
} }
if ((p[1].ival & TQt::AlignJustify) == TQt::AlignJustify) { if ((p[1].ival & TQt::AlignJustify) == TQt::AlignJustify) {
qt4formattedtextflags = qt4formattedtextflags | Qt::AlignJustify; qt4formattedtextflags = qt4formattedtextflags | TQt::AlignJustify;
} }
if ((p[1].ival & TQt::AlignTop) == TQt::AlignTop) { if ((p[1].ival & TQt::AlignTop) == TQt::AlignTop) {
qt4formattedtextflags = qt4formattedtextflags | Qt::AlignTop; qt4formattedtextflags = qt4formattedtextflags | TQt::AlignTop;
} }
if ((p[1].ival & TQt::AlignBottom) == TQt::AlignBottom) { if ((p[1].ival & TQt::AlignBottom) == TQt::AlignBottom) {
qt4formattedtextflags = qt4formattedtextflags | Qt::AlignBottom; qt4formattedtextflags = qt4formattedtextflags | TQt::AlignBottom;
} }
if ((p[1].ival & TQt::AlignVCenter) == TQt::AlignVCenter) { if ((p[1].ival & TQt::AlignVCenter) == TQt::AlignVCenter) {
qt4formattedtextflags = qt4formattedtextflags | Qt::AlignVCenter; qt4formattedtextflags = qt4formattedtextflags | TQt::AlignVCenter;
} }
if ((p[1].ival & TQt::AlignCenter) == TQt::AlignCenter) { if ((p[1].ival & TQt::AlignCenter) == TQt::AlignCenter) {
qt4formattedtextflags = qt4formattedtextflags | Qt::AlignCenter; qt4formattedtextflags = qt4formattedtextflags | TQt::AlignCenter;
} }
if ((p[1].ival & TQt::SingleLine) == TQt::SingleLine) { if ((p[1].ival & TQt::SingleLine) == TQt::SingleLine) {
qt4formattedtextflags = qt4formattedtextflags | Qt::TextSingleLine; qt4formattedtextflags = qt4formattedtextflags | TQt::TextSingleLine;
} }
if ((p[1].ival & TQt::DontClip) == TQt::DontClip) { if ((p[1].ival & TQt::DontClip) == TQt::DontClip) {
qt4formattedtextflags = qt4formattedtextflags | Qt::TextDontClip; qt4formattedtextflags = qt4formattedtextflags | TQt::TextDontClip;
} }
if ((p[1].ival & TQt::ExpandTabs) == TQt::ExpandTabs) { if ((p[1].ival & TQt::ExpandTabs) == TQt::ExpandTabs) {
qt4formattedtextflags = qt4formattedtextflags | Qt::TextExpandTabs; qt4formattedtextflags = qt4formattedtextflags | TQt::TextExpandTabs;
} }
if ((p[1].ival & TQt::ShowPrefix) == TQt::ShowPrefix) { if ((p[1].ival & TQt::ShowPrefix) == TQt::ShowPrefix) {
qt4formattedtextflags = qt4formattedtextflags | Qt::TextShowMnemonic; qt4formattedtextflags = qt4formattedtextflags | TQt::TextShowMnemonic;
} }
if ((p[1].ival & TQt::WordBreak) == TQt::WordBreak) { if ((p[1].ival & TQt::WordBreak) == TQt::WordBreak) {
qt4formattedtextflags = qt4formattedtextflags | Qt::TextWordWrap; qt4formattedtextflags = qt4formattedtextflags | TQt::TextWordWrap;
} }
if ((p[1].ival & TQt::BreakAnywhere) == TQt::BreakAnywhere) { if ((p[1].ival & TQt::BreakAnywhere) == TQt::BreakAnywhere) {
qt4formattedtextflags = qt4formattedtextflags | Qt::TextWrapAnywhere; qt4formattedtextflags = qt4formattedtextflags | TQt::TextWrapAnywhere;
} }
if ((p[1].ival & TQt::NoAccel) == TQt::NoAccel) { if ((p[1].ival & TQt::NoAccel) == TQt::NoAccel) {
qt4formattedtextflags = qt4formattedtextflags | Qt::TextHideMnemonic; qt4formattedtextflags = qt4formattedtextflags | TQt::TextHideMnemonic;
} }
qt4string = QString::fromUtf8(p[2].str->utf8().data()); qt4string = QString::fromUtf8(p[2].str->utf8().data());
} }
@ -313,58 +313,58 @@ bool TDEQt4PaintDevice::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
} }
if (c == PdcSetBrush) { if (c == PdcSetBrush) {
TQt::BrushStyle tqt3brushstyle = p[0].brush->style(); TQt::BrushStyle tqt3brushstyle = p[0].brush->style();
Qt::BrushStyle qt4brushstyle; TQt::BrushStyle qt4brushstyle;
switch ( tqt3brushstyle ) { switch ( tqt3brushstyle ) {
case TQt::NoBrush: case TQt::NoBrush:
qt4brushstyle = Qt::NoBrush; qt4brushstyle = TQt::NoBrush;
break; break;
case TQt::SolidPattern: case TQt::SolidPattern:
qt4brushstyle = Qt::SolidPattern; qt4brushstyle = TQt::SolidPattern;
break; break;
case TQt::Dense1Pattern: case TQt::Dense1Pattern:
qt4brushstyle = Qt::Dense1Pattern; qt4brushstyle = TQt::Dense1Pattern;
break; break;
case TQt::Dense2Pattern: case TQt::Dense2Pattern:
qt4brushstyle = Qt::Dense2Pattern; qt4brushstyle = TQt::Dense2Pattern;
break; break;
case TQt::Dense3Pattern: case TQt::Dense3Pattern:
qt4brushstyle = Qt::Dense3Pattern; qt4brushstyle = TQt::Dense3Pattern;
break; break;
case TQt::Dense4Pattern: case TQt::Dense4Pattern:
qt4brushstyle = Qt::Dense4Pattern; qt4brushstyle = TQt::Dense4Pattern;
break; break;
case TQt::Dense5Pattern: case TQt::Dense5Pattern:
qt4brushstyle = Qt::Dense5Pattern; qt4brushstyle = TQt::Dense5Pattern;
break; break;
case TQt::Dense6Pattern: case TQt::Dense6Pattern:
qt4brushstyle = Qt::Dense6Pattern; qt4brushstyle = TQt::Dense6Pattern;
break; break;
case TQt::Dense7Pattern: case TQt::Dense7Pattern:
qt4brushstyle = Qt::Dense7Pattern; qt4brushstyle = TQt::Dense7Pattern;
break; break;
case TQt::HorPattern: case TQt::HorPattern:
qt4brushstyle = Qt::HorPattern; qt4brushstyle = TQt::HorPattern;
break; break;
case TQt::VerPattern: case TQt::VerPattern:
qt4brushstyle = Qt::VerPattern; qt4brushstyle = TQt::VerPattern;
break; break;
case TQt::CrossPattern: case TQt::CrossPattern:
qt4brushstyle = Qt::CrossPattern; qt4brushstyle = TQt::CrossPattern;
break; break;
case TQt::BDiagPattern: case TQt::BDiagPattern:
qt4brushstyle = Qt::BDiagPattern; qt4brushstyle = TQt::BDiagPattern;
break; break;
case TQt::FDiagPattern: case TQt::FDiagPattern:
qt4brushstyle = Qt::FDiagPattern; qt4brushstyle = TQt::FDiagPattern;
break; break;
case TQt::DiagCrossPattern: case TQt::DiagCrossPattern:
qt4brushstyle = Qt::DiagCrossPattern; qt4brushstyle = TQt::DiagCrossPattern;
break; break;
case TQt::CustomPattern: case TQt::CustomPattern:
qt4brushstyle = Qt::TexturePattern; qt4brushstyle = TQt::TexturePattern;
break; break;
default: default:
qt4brushstyle = Qt::NoBrush; qt4brushstyle = TQt::NoBrush;
#if defined(QT_CHECK_RANGE) #if defined(QT_CHECK_RANGE)
tqWarning( "TDEQt4PaintDevice::cmd: Invalid brush style %d", tqt3brushstyle ); tqWarning( "TDEQt4PaintDevice::cmd: Invalid brush style %d", tqt3brushstyle );
#endif #endif
@ -372,7 +372,7 @@ bool TDEQt4PaintDevice::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
qt4brush.setStyle(qt4brushstyle); qt4brush.setStyle(qt4brushstyle);
TQColor qt3color = p[0].brush->color(); TQColor qt3color = p[0].brush->color();
qt4brush.setColor(QColor(qt3color.red(), qt3color.green(), qt3color.blue(), 255)); qt4brush.setColor(QColor(qt3color.red(), qt3color.green(), qt3color.blue(), 255));
if (qt4brushstyle == Qt::TexturePattern) { if (qt4brushstyle == TQt::TexturePattern) {
#ifdef USE_QT4_FROM_X11_PIXMAP_FUNCTIONS #ifdef USE_QT4_FROM_X11_PIXMAP_FUNCTIONS
TQPixmap tqtPM = *p[0].brush->pixmap(); TQPixmap tqtPM = *p[0].brush->pixmap();
QPixmap qtPM = QPixmap::fromX11Pixmap(tqtPM.handle(), QPixmap::ImplicitlyShared); QPixmap qtPM = QPixmap::fromX11Pixmap(tqtPM.handle(), QPixmap::ImplicitlyShared);
@ -389,28 +389,28 @@ bool TDEQt4PaintDevice::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
if (c == PdcSetPen) { if (c == PdcSetPen) {
bool customPenStyle = false; bool customPenStyle = false;
TQt::PenStyle tqt3penstyle = p[0].pen->style(); TQt::PenStyle tqt3penstyle = p[0].pen->style();
Qt::PenStyle qt4penstyle; TQt::PenStyle qt4penstyle;
QVector<qreal> dashes; QVector<qreal> dashes;
qreal mark; qreal mark;
qreal space; qreal space;
switch ( tqt3penstyle ) { switch ( tqt3penstyle ) {
case TQt::NoPen: case TQt::NoPen:
qt4penstyle = Qt::NoPen; qt4penstyle = TQt::NoPen;
break; break;
case TQt::SolidLine: case TQt::SolidLine:
qt4penstyle = Qt::SolidLine; qt4penstyle = TQt::SolidLine;
break; break;
case TQt::DashLine: case TQt::DashLine:
qt4penstyle = Qt::DashLine; qt4penstyle = TQt::DashLine;
break; break;
case TQt::DotLine: case TQt::DotLine:
qt4penstyle = Qt::DotLine; qt4penstyle = TQt::DotLine;
break; break;
case TQt::DashDotLine: case TQt::DashDotLine:
qt4penstyle = Qt::DashDotLine; qt4penstyle = TQt::DashDotLine;
break; break;
case TQt::DashDotDotLine: case TQt::DashDotDotLine:
qt4penstyle = Qt::DashDotDotLine; qt4penstyle = TQt::DashDotDotLine;
break; break;
case TQt::FineDotLine: case TQt::FineDotLine:
customPenStyle = true; customPenStyle = true;
@ -420,10 +420,10 @@ bool TDEQt4PaintDevice::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
qt4pen.setDashPattern(dashes); qt4pen.setDashPattern(dashes);
break; break;
case TQt::MPenStyle: case TQt::MPenStyle:
qt4penstyle = Qt::MPenStyle; qt4penstyle = TQt::MPenStyle;
break; break;
default: default:
qt4penstyle = Qt::NoPen; qt4penstyle = TQt::NoPen;
#if defined(QT_CHECK_RANGE) #if defined(QT_CHECK_RANGE)
tqWarning( "TDEQt4PaintDevice::cmd: Invalid pen style %d", tqt3penstyle ); tqWarning( "TDEQt4PaintDevice::cmd: Invalid pen style %d", tqt3penstyle );
#endif #endif
@ -432,42 +432,42 @@ bool TDEQt4PaintDevice::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
qt4pen.setStyle(qt4penstyle); qt4pen.setStyle(qt4penstyle);
} }
TQt::PenCapStyle tqt3pencapstyle = p[0].pen->capStyle(); TQt::PenCapStyle tqt3pencapstyle = p[0].pen->capStyle();
Qt::PenCapStyle qt4pencapstyle; TQt::PenCapStyle qt4pencapstyle;
switch ( tqt3pencapstyle ) { switch ( tqt3pencapstyle ) {
case TQt::FlatCap: case TQt::FlatCap:
qt4pencapstyle = Qt::FlatCap; qt4pencapstyle = TQt::FlatCap;
break; break;
case TQt::SquareCap: case TQt::SquareCap:
qt4pencapstyle = Qt::SquareCap; qt4pencapstyle = TQt::SquareCap;
break; break;
case TQt::RoundCap: case TQt::RoundCap:
qt4pencapstyle = Qt::RoundCap; qt4pencapstyle = TQt::RoundCap;
break; break;
case TQt::MPenCapStyle: case TQt::MPenCapStyle:
qt4pencapstyle = Qt::MPenCapStyle; qt4pencapstyle = TQt::MPenCapStyle;
default: default:
qt4pencapstyle = Qt::FlatCap; qt4pencapstyle = TQt::FlatCap;
#if defined(QT_CHECK_RANGE) #if defined(QT_CHECK_RANGE)
tqWarning( "TDEQt4PaintDevice::cmd: Invalid pen cap style %d", tqt3pencapstyle ); tqWarning( "TDEQt4PaintDevice::cmd: Invalid pen cap style %d", tqt3pencapstyle );
#endif #endif
} }
qt4pen.setCapStyle(qt4pencapstyle); qt4pen.setCapStyle(qt4pencapstyle);
TQt::PenJoinStyle tqt3penjoinstyle = p[0].pen->joinStyle(); TQt::PenJoinStyle tqt3penjoinstyle = p[0].pen->joinStyle();
Qt::PenJoinStyle qt4penjoinstyle; TQt::PenJoinStyle qt4penjoinstyle;
switch ( tqt3penjoinstyle ) { switch ( tqt3penjoinstyle ) {
case TQt::MiterJoin: case TQt::MiterJoin:
qt4penjoinstyle = Qt::MiterJoin; qt4penjoinstyle = TQt::MiterJoin;
break; break;
case TQt::BevelJoin: case TQt::BevelJoin:
qt4penjoinstyle = Qt::BevelJoin; qt4penjoinstyle = TQt::BevelJoin;
break; break;
case TQt::RoundJoin: case TQt::RoundJoin:
qt4penjoinstyle = Qt::RoundJoin; qt4penjoinstyle = TQt::RoundJoin;
break; break;
case TQt::MPenJoinStyle: case TQt::MPenJoinStyle:
qt4penjoinstyle = Qt::MPenJoinStyle; qt4penjoinstyle = TQt::MPenJoinStyle;
default: default:
qt4penjoinstyle = Qt::MiterJoin; qt4penjoinstyle = TQt::MiterJoin;
#if defined(QT_CHECK_RANGE) #if defined(QT_CHECK_RANGE)
tqWarning( "TDEQt4PaintDevice::cmd: Invalid pen join style %d", tqt3penjoinstyle ); tqWarning( "TDEQt4PaintDevice::cmd: Invalid pen join style %d", tqt3penjoinstyle );
#endif #endif
@ -481,13 +481,13 @@ bool TDEQt4PaintDevice::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
TQt::BGMode qt3bkmode = (TQt::BGMode)p[0].ival; TQt::BGMode qt3bkmode = (TQt::BGMode)p[0].ival;
switch ( qt3bkmode ) { switch ( qt3bkmode ) {
case TQt::TransparentMode: case TQt::TransparentMode:
qt4bkmode = Qt::TransparentMode; qt4bkmode = TQt::TransparentMode;
break; break;
case TQt::OpaqueMode: case TQt::OpaqueMode:
qt4bkmode = Qt::OpaqueMode; qt4bkmode = TQt::OpaqueMode;
break; break;
default: default:
qt4bkmode = Qt::TransparentMode; qt4bkmode = TQt::TransparentMode;
#if defined(QT_CHECK_RANGE) #if defined(QT_CHECK_RANGE)
tqWarning( "TDEQt4PaintDevice::cmd: Invalid background mode %d", qt3bkmode ); tqWarning( "TDEQt4PaintDevice::cmd: Invalid background mode %d", qt3bkmode );
#endif #endif
@ -566,7 +566,7 @@ bool TDEQt4PaintDevice::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
m_qt4painter->drawPolyline( qt4polygon ); m_qt4painter->drawPolyline( qt4polygon );
break; break;
case PdcDrawPolygon: case PdcDrawPolygon:
m_qt4painter->drawPolygon( qt4polygon, (p[1].ival == 0)?Qt::OddEvenFill:Qt::WindingFill ); m_qt4painter->drawPolygon( qt4polygon, (p[1].ival == 0)?TQt::OddEvenFill:TQt::WindingFill );
break; break;
case PdcDrawCubicBezier: case PdcDrawCubicBezier:
index = 0; index = 0;
@ -705,7 +705,7 @@ bool TDEQt4PaintDevice::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
m_qt4painter->setClipping( (m_qt4OrigClipping)?true:p[0].ival ); m_qt4painter->setClipping( (m_qt4OrigClipping)?true:p[0].ival );
break; break;
case PdcSetClipRegion: case PdcSetClipRegion:
m_qt4painter->setClipRegion( (m_qt4OrigClipping)?qt4region.intersected(m_qt4OrigClipRegion):qt4region, Qt::ReplaceClip ); m_qt4painter->setClipRegion( (m_qt4OrigClipping)?qt4region.intersected(m_qt4OrigClipRegion):qt4region, TQt::ReplaceClip );
break; break;
default: default:
#if defined(QT_CHECK_RANGE) #if defined(QT_CHECK_RANGE)

@ -1671,7 +1671,7 @@ TQWidget* Qt4TDEStyle::initializeInterfaceWidget(TQt3WidgetType wt, const QWidge
m_tqt3progressbar_widget->setGeometry(0, 0, qt4progressbar_widget->width(), qt4progressbar_widget->height()); m_tqt3progressbar_widget->setGeometry(0, 0, qt4progressbar_widget->width(), qt4progressbar_widget->height());
m_tqt3progressbar_widget->setEnabled(qt4progressbar_widget->isEnabled()); m_tqt3progressbar_widget->setEnabled(qt4progressbar_widget->isEnabled());
m_tqt3progressbar_widget->setProgress(qt4progressbar_widget->value()-qt4progressbar_widget->minimum(),qt4progressbar_widget->maximum()-qt4progressbar_widget->minimum()); m_tqt3progressbar_widget->setProgress(qt4progressbar_widget->value()-qt4progressbar_widget->minimum(),qt4progressbar_widget->maximum()-qt4progressbar_widget->minimum());
if (qt4progressbar_widget->orientation() != Qt::Horizontal) { if (qt4progressbar_widget->orientation() != TQt::Horizontal) {
// Qt3 cannot draw vertical progress bars // Qt3 cannot draw vertical progress bars
if (enable_debug_warnings) { if (enable_debug_warnings) {
printf("No rules to draw vertical Qt4 progress bar\n"); fflush(stdout); printf("No rules to draw vertical Qt4 progress bar\n"); fflush(stdout);
@ -2012,7 +2012,7 @@ TQWidget* Qt4TDEStyle::initializeInterfaceWidget(TQt3WidgetType wt, const QWidge
// Construct an internal TQTitleBar widget from the options and widget provided by Qt4 // Construct an internal TQTitleBar widget from the options and widget provided by Qt4
m_tqt3titlebar_widget->setGeometry(qt4styleoptions->rect.x(), qt4styleoptions->rect.y(), qt4styleoptions->rect.width(), qt4styleoptions->rect.height()); m_tqt3titlebar_widget->setGeometry(qt4styleoptions->rect.x(), qt4styleoptions->rect.y(), qt4styleoptions->rect.width(), qt4styleoptions->rect.height());
m_tqt3titlebar_widget->setCaption(convertQt4ToTQt3String(qt4titlebar_options->text)); m_tqt3titlebar_widget->setCaption(convertQt4ToTQt3String(qt4titlebar_options->text));
m_tqt3titlebar_widget->setActive(qt4titlebar_options->titleBarState & Qt::WindowActive); m_tqt3titlebar_widget->setActive(qt4titlebar_options->titleBarState & TQt::WindowActive);
// HACK // HACK
// TQt3 does not know how to handle transparent icons in title bars, // TQt3 does not know how to handle transparent icons in title bars,
@ -2064,11 +2064,11 @@ TQWidget* Qt4TDEStyle::initializeInterfaceWidget(TQt3WidgetType wt, const QWidge
m_tqt3toolbutton_widget->setEnabled(qt4toolbutton_widget->isEnabled()); m_tqt3toolbutton_widget->setEnabled(qt4toolbutton_widget->isEnabled());
m_tqt3toolbutton_widget->setIconSet(convertQt4ToTQt3IconSet(qt4toolbutton_widget->icon(), m_tqt3IconSize_Small, m_tqt3IconSize_Large, m_internalTQt3PixmapCache)); m_tqt3toolbutton_widget->setIconSet(convertQt4ToTQt3IconSet(qt4toolbutton_widget->icon(), m_tqt3IconSize_Small, m_tqt3IconSize_Large, m_internalTQt3PixmapCache));
// m_tqt3toolbutton_widget->setUsesBigPixmap(qt4toolbutton_widget->); // m_tqt3toolbutton_widget->setUsesBigPixmap(qt4toolbutton_widget->);
m_tqt3toolbutton_widget->setUsesTextLabel(((qt4toolbutton_widget->toolButtonStyle() != Qt::ToolButtonIconOnly) && (qt4toolbutton_widget->toolButtonStyle() != Qt::ToolButtonFollowStyle))); m_tqt3toolbutton_widget->setUsesTextLabel(((qt4toolbutton_widget->toolButtonStyle() != TQt::ToolButtonIconOnly) && (qt4toolbutton_widget->toolButtonStyle() != TQt::ToolButtonFollowStyle)));
m_tqt3toolbutton_widget->setTextLabel(convertQt4ToTQt3String(qt4toolbutton_widget->text())); m_tqt3toolbutton_widget->setTextLabel(convertQt4ToTQt3String(qt4toolbutton_widget->text()));
m_tqt3toolbutton_widget->setToggleButton(qt4toolbutton_widget->isCheckable()); m_tqt3toolbutton_widget->setToggleButton(qt4toolbutton_widget->isCheckable());
m_tqt3toolbutton_widget->setOn(qt4toolbutton_widget->isChecked()); m_tqt3toolbutton_widget->setOn(qt4toolbutton_widget->isChecked());
if (qt4toolbutton_widget->toolButtonStyle() == Qt::ToolButtonTextBesideIcon) { if (qt4toolbutton_widget->toolButtonStyle() == TQt::ToolButtonTextBesideIcon) {
m_tqt3toolbutton_widget->setTextPosition(TQToolButton::BesideIcon); m_tqt3toolbutton_widget->setTextPosition(TQToolButton::BesideIcon);
} }
m_tqt3toolbutton_widget->setAutoRaise(qt4toolbutton_widget->autoRaise()); m_tqt3toolbutton_widget->setAutoRaise(qt4toolbutton_widget->autoRaise());
@ -2338,13 +2338,13 @@ void Qt4TDEStyle::drawComplexControl(ComplexControl control, const QStyleOptionC
// This logic is taken from Qt4 (qcommonstyle.cpp) // This logic is taken from Qt4 (qcommonstyle.cpp)
// It will need to be kept in sync with whatever Nokia does // It will need to be kept in sync with whatever Nokia does
drawCloseButton = (tbopt->subControls & SC_TitleBarCloseButton && tbopt->titleBarFlags & Qt::WindowSystemMenuHint); drawCloseButton = (tbopt->subControls & SC_TitleBarCloseButton && tbopt->titleBarFlags & TQt::WindowSystemMenuHint);
drawMaxButton = (tbopt->subControls & SC_TitleBarMaxButton && tbopt->titleBarFlags & Qt::WindowMaximizeButtonHint && !(tbopt->titleBarState & Qt::WindowMaximized)); drawMaxButton = (tbopt->subControls & SC_TitleBarMaxButton && tbopt->titleBarFlags & TQt::WindowMaximizeButtonHint && !(tbopt->titleBarState & TQt::WindowMaximized));
drawMinButton = (tbopt->subControls & SC_TitleBarMinButton && tbopt->titleBarFlags & Qt::WindowMinimizeButtonHint && !(tbopt->titleBarState & Qt::WindowMinimized)); drawMinButton = (tbopt->subControls & SC_TitleBarMinButton && tbopt->titleBarFlags & TQt::WindowMinimizeButtonHint && !(tbopt->titleBarState & TQt::WindowMinimized));
drawNormalButton = (tbopt->subControls & SC_TitleBarNormalButton) && (((tbopt->titleBarFlags & Qt::WindowMinimizeButtonHint) && (tbopt->titleBarState & Qt::WindowMinimized)) || ((tbopt->titleBarFlags & Qt::WindowMaximizeButtonHint) && (tbopt->titleBarState & Qt::WindowMaximized))); drawNormalButton = (tbopt->subControls & SC_TitleBarNormalButton) && (((tbopt->titleBarFlags & TQt::WindowMinimizeButtonHint) && (tbopt->titleBarState & TQt::WindowMinimized)) || ((tbopt->titleBarFlags & TQt::WindowMaximizeButtonHint) && (tbopt->titleBarState & TQt::WindowMaximized)));
drawShadeButton = (tbopt->subControls & SC_TitleBarShadeButton && tbopt->titleBarFlags & Qt::WindowShadeButtonHint && !(tbopt->titleBarState & Qt::WindowMinimized)); drawShadeButton = (tbopt->subControls & SC_TitleBarShadeButton && tbopt->titleBarFlags & TQt::WindowShadeButtonHint && !(tbopt->titleBarState & TQt::WindowMinimized));
drawUnshadeButton = (tbopt->subControls & SC_TitleBarUnshadeButton && tbopt->titleBarFlags & Qt::WindowShadeButtonHint && tbopt->titleBarState & Qt::WindowMinimized); drawUnshadeButton = (tbopt->subControls & SC_TitleBarUnshadeButton && tbopt->titleBarFlags & TQt::WindowShadeButtonHint && tbopt->titleBarState & TQt::WindowMinimized);
drawSysMenuButton = (tbopt->subControls & SC_TitleBarSysMenu && tbopt->titleBarFlags & Qt::WindowSystemMenuHint); drawSysMenuButton = (tbopt->subControls & SC_TitleBarSysMenu && tbopt->titleBarFlags & TQt::WindowSystemMenuHint);
// End logic taken from Qt4 // End logic taken from Qt4
// FIXME // FIXME
@ -2368,7 +2368,7 @@ void Qt4TDEStyle::drawComplexControl(ComplexControl control, const QStyleOptionC
if (tbopt->subControls & SC_TitleBarLabel) { if (tbopt->subControls & SC_TitleBarLabel) {
subControl = subControl | TQStyle::SC_TitleBarLabel; subControl = subControl | TQStyle::SC_TitleBarLabel;
} }
if (drawNormalButton && !(tbopt->titleBarState & Qt::WindowMaximized)) { if (drawNormalButton && !(tbopt->titleBarState & TQt::WindowMaximized)) {
subControl = subControl | TQStyle::SC_TitleBarNormalButton; subControl = subControl | TQStyle::SC_TitleBarNormalButton;
} }
if (drawShadeButton) { if (drawShadeButton) {
@ -3116,7 +3116,7 @@ void Qt4TDEStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QP
BASE_QT4_STYLE_CLASS::drawPrimitive(pe, opt, p, w); BASE_QT4_STYLE_CLASS::drawPrimitive(pe, opt, p, w);
} }
else { else {
p->fillRect(opt->rect, Qt::transparent); p->fillRect(opt->rect, TQt::transparent);
} }
} }

Loading…
Cancel
Save