From c5554a5f82ebc79fbda3940ee904e71490fb13d6 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 4 Nov 2023 22:03:54 +0900 Subject: Replace Qt with TQt Signed-off-by: Michele Calgaro --- src/drawparts/dpline.cpp | 10 ++-- src/drawparts/drawpart.cpp | 114 +++++++++++++++++++++---------------------- src/drawparts/drawpart.h | 24 ++++----- src/drawparts/solidshape.cpp | 6 +-- 4 files changed, 77 insertions(+), 77 deletions(-) (limited to 'src/drawparts') diff --git a/src/drawparts/dpline.cpp b/src/drawparts/dpline.cpp index 5127a0e..0a9d019 100644 --- a/src/drawparts/dpline.cpp +++ b/src/drawparts/dpline.cpp @@ -56,12 +56,12 @@ DPLine::DPLine( ItemDocument *itemDocument, bool newItem, const char *id ) createProperty( "line-style", Variant::Type::PenStyle ); property("line-style")->setCaption( i18n("Line Style") ); property("line-style")->setAdvanced(true); - setDataPenStyle( "line-style", Qt::SolidLine ); + setDataPenStyle( "line-style", TQt::SolidLine ); createProperty( "cap-style", Variant::Type::PenCapStyle ); property("cap-style")->setCaption( i18n("Cap Style") ); property("cap-style")->setAdvanced(true); - setDataPenCapStyle( "cap-style", Qt::FlatCap ); + setDataPenCapStyle( "cap-style", TQt::FlatCap ); } DPLine::~DPLine() @@ -84,7 +84,7 @@ void DPLine::dataChanged() unsigned( dataInt("line-width") ), getDataPenStyle("line-style"), getDataPenCapStyle("cap-style"), - Qt::MiterJoin ) ); + TQt::MiterJoin ) ); postResize(); // in case the pen width has changed update(); @@ -171,7 +171,7 @@ DPArrow::DPArrow( ItemDocument *itemDocument, bool newItem, const char *id ) // We don't want to use the square cap style as it screws up drawing our arrow head TQStringList allowed = property("cap-style")->allowed(); - allowed.remove( DrawPart::penCapStyleToName( Qt::SquareCap ) ); + allowed.remove( DrawPart::penCapStyleToName( TQt::SquareCap ) ); property("cap-style")->setAllowed(allowed); } @@ -211,7 +211,7 @@ void DPArrow::drawShape( TQPainter & p ) // Draw arrowhead TQPen pen = p.pen(); - pen.setCapStyle( Qt::RoundCap ); + pen.setCapStyle( TQt::RoundCap ); p.setPen(pen); p.setBrush(pen.color()); TQPointArray pa(3); diff --git a/src/drawparts/drawpart.cpp b/src/drawparts/drawpart.cpp index 1ac24cf..2a67a4f 100644 --- a/src/drawparts/drawpart.cpp +++ b/src/drawparts/drawpart.cpp @@ -39,9 +39,9 @@ Variant * DrawPart::createProperty( const TQString & id, Variant::Type::Value ty if ( type == Variant::Type::PenStyle ) { TQStringList penStyles; - penStyles << DrawPart::penStyleToName(Qt::SolidLine) << DrawPart::penStyleToName(Qt::DashLine) - << DrawPart::penStyleToName(Qt::DotLine) << DrawPart::penStyleToName(Qt::DashDotLine) - << DrawPart::penStyleToName(Qt::DashDotDotLine); + penStyles << DrawPart::penStyleToName(TQt::SolidLine) << DrawPart::penStyleToName(TQt::DashLine) + << DrawPart::penStyleToName(TQt::DotLine) << DrawPart::penStyleToName(TQt::DashDotLine) + << DrawPart::penStyleToName(TQt::DashDotDotLine); Variant * v = createProperty( id, Variant::Type::String ); v->setType( Variant::Type::PenStyle ); @@ -52,8 +52,8 @@ Variant * DrawPart::createProperty( const TQString & id, Variant::Type::Value ty if ( type == Variant::Type::PenCapStyle ) { TQStringList penCapStyles; - penCapStyles << DrawPart::penCapStyleToName(Qt::FlatCap) << DrawPart::penCapStyleToName(Qt::SquareCap) - << DrawPart::penCapStyleToName(Qt::RoundCap); + penCapStyles << DrawPart::penCapStyleToName(TQt::FlatCap) << DrawPart::penCapStyleToName(TQt::SquareCap) + << DrawPart::penCapStyleToName(TQt::RoundCap); Variant * v = createProperty( id, Variant::Type::String ); v->setType( Variant::Type::PenCapStyle ); @@ -65,19 +65,19 @@ Variant * DrawPart::createProperty( const TQString & id, Variant::Type::Value ty } -Qt::PenStyle DrawPart::getDataPenStyle( const TQString & id ) +TQt::PenStyle DrawPart::getDataPenStyle( const TQString & id ) { return nameToPenStyle( dataString(id) ); } -Qt::PenCapStyle DrawPart::getDataPenCapStyle( const TQString & id ) +TQt::PenCapStyle DrawPart::getDataPenCapStyle( const TQString & id ) { return nameToPenCapStyle( dataString(id) ); } -void DrawPart::setDataPenStyle( const TQString & id, Qt::PenStyle value ) +void DrawPart::setDataPenStyle( const TQString & id, TQt::PenStyle value ) { property(id)->setValue( penStyleToName(value) ); } -void DrawPart::setDataPenCapStyle( const TQString & id, Qt::PenCapStyle value ) +void DrawPart::setDataPenCapStyle( const TQString & id, TQt::PenCapStyle value ) { property(id)->setValue( penCapStyleToName(value) ); } @@ -144,121 +144,121 @@ void DrawPart::restoreFromItemData( const ItemData &itemData ) -TQString DrawPart::penStyleToID( Qt::PenStyle style ) +TQString DrawPart::penStyleToID( TQt::PenStyle style ) { switch (style) { - case Qt::SolidLine: + case TQt::SolidLine: return "SolidLine"; - case Qt::NoPen: + case TQt::NoPen: return "NoPen"; - case Qt::DashLine: + case TQt::DashLine: return "DashLine"; - case Qt::DotLine: + case TQt::DotLine: return "DotLine"; - case Qt::DashDotLine: + case TQt::DashDotLine: return "DashDotLine"; - case Qt::DashDotDotLine: + case TQt::DashDotDotLine: return "DashDotDotLine"; - case Qt::MPenStyle: + case TQt::MPenStyle: default: return ""; // ?! } } -Qt::PenStyle DrawPart::idToPenStyle( const TQString & id ) +TQt::PenStyle DrawPart::idToPenStyle( const TQString & id ) { if ( id == "NoPen" ) - return Qt::NoPen; + return TQt::NoPen; if ( id == "DashLine" ) - return Qt::DashLine; + return TQt::DashLine; if ( id == "DotLine" ) - return Qt::DotLine; + return TQt::DotLine; if ( id == "DashDotLine" ) - return Qt::DashDotLine; + return TQt::DashDotLine; if ( id == "DashDotDotLine" ) - return Qt::DashDotDotLine; - return Qt::SolidLine; + return TQt::DashDotDotLine; + return TQt::SolidLine; } -TQString DrawPart::penCapStyleToID( Qt::PenCapStyle style ) +TQString DrawPart::penCapStyleToID( TQt::PenCapStyle style ) { switch (style) { - case Qt::FlatCap: + case TQt::FlatCap: return "FlatCap"; - case Qt::SquareCap: + case TQt::SquareCap: return "SquareCap"; - case Qt::RoundCap: + case TQt::RoundCap: return "RoundCap"; - case Qt::MPenCapStyle: + case TQt::MPenCapStyle: default: return ""; // ?! } } -Qt::PenCapStyle DrawPart::idToPenCapStyle( const TQString & id ) +TQt::PenCapStyle DrawPart::idToPenCapStyle( const TQString & id ) { if ( id == "SquareCap" ) - return Qt::SquareCap; + return TQt::SquareCap; if ( id == "RoundCap" ) - return Qt::RoundCap; - return Qt::FlatCap; + return TQt::RoundCap; + return TQt::FlatCap; } -TQString DrawPart::penStyleToName( Qt::PenStyle style ) +TQString DrawPart::penStyleToName( TQt::PenStyle style ) { switch (style) { - case Qt::SolidLine: + case TQt::SolidLine: return i18n("Solid"); - case Qt::NoPen: + case TQt::NoPen: return i18n("None"); - case Qt::DashLine: + case TQt::DashLine: return i18n("Dash"); - case Qt::DotLine: + case TQt::DotLine: return i18n("Dot"); - case Qt::DashDotLine: + case TQt::DashDotLine: return i18n("Dash Dot"); - case Qt::DashDotDotLine: + case TQt::DashDotDotLine: return i18n("Dash Dot Dot"); - case Qt::MPenStyle: + case TQt::MPenStyle: default: return ""; // ?! } } -Qt::PenStyle DrawPart::nameToPenStyle( const TQString & name ) +TQt::PenStyle DrawPart::nameToPenStyle( const TQString & name ) { if ( name == i18n("None") ) - return Qt::NoPen; + return TQt::NoPen; if ( name == i18n("Dash") ) - return Qt::DashLine; + return TQt::DashLine; if ( name == i18n("Dot") ) - return Qt::DotLine; + return TQt::DotLine; if ( name == i18n("Dash Dot") ) - return Qt::DashDotLine; + return TQt::DashDotLine; if ( name == i18n("Dash Dot Dot") ) - return Qt::DashDotDotLine; - return Qt::SolidLine; + return TQt::DashDotDotLine; + return TQt::SolidLine; } -TQString DrawPart::penCapStyleToName( Qt::PenCapStyle style ) +TQString DrawPart::penCapStyleToName( TQt::PenCapStyle style ) { switch (style) { - case Qt::FlatCap: + case TQt::FlatCap: return i18n("Flat"); - case Qt::SquareCap: + case TQt::SquareCap: return i18n("Square"); - case Qt::RoundCap: + case TQt::RoundCap: return i18n("Round"); - case Qt::MPenCapStyle: + case TQt::MPenCapStyle: default: return ""; // ?! } } -Qt::PenCapStyle DrawPart::nameToPenCapStyle( const TQString & name ) +TQt::PenCapStyle DrawPart::nameToPenCapStyle( const TQString & name ) { if ( name == i18n("Square") ) - return Qt::SquareCap; + return TQt::SquareCap; if ( name == i18n("Round") ) - return Qt::RoundCap; - return Qt::FlatCap; + return TQt::RoundCap; + return TQt::FlatCap; } diff --git a/src/drawparts/drawpart.h b/src/drawparts/drawpart.h index e2b046e..71042bb 100644 --- a/src/drawparts/drawpart.h +++ b/src/drawparts/drawpart.h @@ -43,26 +43,26 @@ class DrawPart : public Item virtual Variant * createProperty( const TQString & id, Variant::Type::Value type ); - Qt::PenStyle getDataPenStyle( const TQString & id ); - Qt::PenCapStyle getDataPenCapStyle( const TQString & id ); + TQt::PenStyle getDataPenStyle( const TQString & id ); + TQt::PenCapStyle getDataPenCapStyle( const TQString & id ); - void setDataPenStyle( const TQString & id, Qt::PenStyle value ); - void setDataPenCapStyle( const TQString & id, Qt::PenCapStyle value ); + void setDataPenStyle( const TQString & id, TQt::PenStyle value ); + void setDataPenCapStyle( const TQString & id, TQt::PenCapStyle value ); virtual ItemData itemData() const; virtual void restoreFromItemData( const ItemData &itemData ); // Convention for following functions: name is i18n'd name of style, id is the english one - static TQString penStyleToID( Qt::PenStyle style ); - static Qt::PenStyle idToPenStyle( const TQString & id ); - static TQString penCapStyleToID( Qt::PenCapStyle style ); - static Qt::PenCapStyle idToPenCapStyle( const TQString & id ); + static TQString penStyleToID( TQt::PenStyle style ); + static TQt::PenStyle idToPenStyle( const TQString & id ); + static TQString penCapStyleToID( TQt::PenCapStyle style ); + static TQt::PenCapStyle idToPenCapStyle( const TQString & id ); - static TQString penStyleToName( Qt::PenStyle style ); - static Qt::PenStyle nameToPenStyle( const TQString & name ); - static TQString penCapStyleToName( Qt::PenCapStyle style ); - static Qt::PenCapStyle nameToPenCapStyle( const TQString & name ); + static TQString penStyleToName( TQt::PenStyle style ); + static TQt::PenStyle nameToPenStyle( const TQString & name ); + static TQString penCapStyleToName( TQt::PenCapStyle style ); + static TQt::PenCapStyle nameToPenCapStyle( const TQString & name ); }; #endif diff --git a/src/drawparts/solidshape.cpp b/src/drawparts/solidshape.cpp index 419e0ad..51fafa8 100644 --- a/src/drawparts/solidshape.cpp +++ b/src/drawparts/solidshape.cpp @@ -65,7 +65,7 @@ DPRectangle::DPRectangle( ItemDocument *itemDocument, bool newItem, const char * createProperty( "line-style", Variant::Type::PenStyle ); property("line-style")->setAdvanced(true); - setDataPenStyle( "line-style", Qt::SolidLine ); + setDataPenStyle( "line-style", TQt::SolidLine ); } DPRectangle::~DPRectangle() @@ -87,14 +87,14 @@ void DPRectangle::dataChanged() bool displayBackground = dataBool("background"); TQColor line_color = dataColor("line-color"); unsigned width = unsigned( dataInt("line-width") ); - Qt::PenStyle style = getDataPenStyle("line-style"); + TQt::PenStyle style = getDataPenStyle("line-style"); setPen( TQPen( line_color, width, style ) ); if (displayBackground) setBrush( dataColor("background-color") ); else - setBrush( Qt::NoBrush ); + setBrush( TQt::NoBrush ); postResize(); update(); -- cgit v1.2.1