summaryrefslogtreecommitdiffstats
path: root/src/electronics/components/ecsevensegment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/electronics/components/ecsevensegment.cpp')
-rw-r--r--src/electronics/components/ecsevensegment.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/electronics/components/ecsevensegment.cpp b/src/electronics/components/ecsevensegment.cpp
index ec35776..e68bf7c 100644
--- a/src/electronics/components/ecsevensegment.cpp
+++ b/src/electronics/components/ecsevensegment.cpp
@@ -17,8 +17,8 @@
#include "simulator.h"
#include <klocale.h>
-#include <qpainter.h>
-#include <qstring.h>
+#include <tqpainter.h>
+#include <tqstring.h>
Item* ECSevenSegment::construct( ItemDocument *itemDocument, bool newItem, const char *id )
{
@@ -43,7 +43,7 @@ ECSevenSegment::ECSevenSegment( ICNDocument *icnDocument, bool newItem, const ch
m_desc = i18n("A seven segment display with a decimal point. This can be configured to either have a common cathode or a common anode.");
m_bDynamicContent = true;
- QStringList pins = QStringList::split( ',', "g,f,e,d,"+QString(QChar(0xB7))+",c,b,a" );
+ TQStringList pins = TQStringList::split( ',', "g,f,e,d,"+TQString(TQChar(0xB7))+",c,b,a" );
createProperty( "0-color", Variant::Type::Color );
property("0-color")->setCaption( i18n("Color") );
@@ -51,7 +51,7 @@ ECSevenSegment::ECSevenSegment( ICNDocument *icnDocument, bool newItem, const ch
createProperty( "diode-polarity", Variant::Type::Select );
property("diode-polarity")->setCaption( i18n("Configuration") );
- property("diode-polarity")->setAllowed( QStringList::split(',',"Common Cathode,Common Anode") );
+ property("diode-polarity")->setAllowed( TQStringList::split(',',"Common Cathode,Common Anode") );
property("diode-polarity")->setValue("Common Cathode");
for ( int i=0; i<8; i++ )
@@ -71,9 +71,9 @@ ECSevenSegment::ECSevenSegment( ICNDocument *icnDocument, bool newItem, const ch
m_nNode = createPin( width()/2+offsetX(), height()+8+offsetY(), 270, "-v" );
for ( int i=0; i<7; i++ )
- m_nodes[i] = ecNodeWithID( QChar('a'+i) );
+ m_nodes[i] = ecNodeWithID( TQChar('a'+i) );
- m_nodes[7] = ecNodeWithID(QChar(0xB7));
+ m_nodes[7] = ecNodeWithID(TQChar(0xB7));
m_bCommonCathode = false; // Force update
}
@@ -86,7 +86,7 @@ ECSevenSegment::~ECSevenSegment()
void ECSevenSegment::dataChanged()
{
- QColor color = dataColor("0-color");
+ TQColor color = dataColor("0-color");
r = color.red();
g = color.green();
b = color.blue();
@@ -129,7 +129,7 @@ void ECSevenSegment::stepNonLogic()
lastUpdatePeriod += interval;
}
-void ECSevenSegment::drawShape( QPainter &p )
+void ECSevenSegment::drawShape( TQPainter &p )
{
CNItem::drawShape(p);
@@ -145,9 +145,9 @@ void ECSevenSegment::drawShape( QPainter &p )
const int y3 = y1 + _height;
const int ds = 2; // "Slope"
-// QPen pen;
+// TQPen pen;
// pen.setWidth(2);
-// pen.setCapStyle(Qt::RoundCap);
+// pen.setCapStyle(TQt::RoundCap);
// p.setPen(pen);
if ( lastUpdatePeriod != 0. )
@@ -162,43 +162,43 @@ void ECSevenSegment::drawShape( QPainter &p )
// Top
_b = last_brightness[0];
- p.setPen( QPen( QColor( uint(255-(255-_b)*(1-r)), uint(255-(255-_b)*(1-g)), uint(255-(255-_b)*(1-b)) ), 2 ) );
+ p.setPen( TQPen( TQColor( uint(255-(255-_b)*(1-r)), uint(255-(255-_b)*(1-g)), uint(255-(255-_b)*(1-b)) ), 2 ) );
p.drawLine( x1+3+ds, y1+0, x2-3+ds, y1+0 );
// Top right
_b = last_brightness[1];
- p.setPen( QPen( QColor( uint(255-(255-_b)*(1-r)), uint(255-(255-_b)*(1-g)), uint(255-(255-_b)*(1-b)) ), 2 ) );
+ p.setPen( TQPen( TQColor( uint(255-(255-_b)*(1-r)), uint(255-(255-_b)*(1-g)), uint(255-(255-_b)*(1-b)) ), 2 ) );
p.drawLine( x2+0+ds, y1+3, x2+0, y2-3 );
// Bottom right
_b = last_brightness[2];
- p.setPen( QPen( QColor( uint(255-(255-_b)*(1-r)), uint(255-(255-_b)*(1-g)), uint(255-(255-_b)*(1-b)) ), 2 ) );
+ p.setPen( TQPen( TQColor( uint(255-(255-_b)*(1-r)), uint(255-(255-_b)*(1-g)), uint(255-(255-_b)*(1-b)) ), 2 ) );
p.drawLine( x2+0, y2+3, x2+0-ds, y3-3 );
// Bottom
_b = last_brightness[3];
- p.setPen( QPen( QColor( uint(255-(255-_b)*(1-r)), uint(255-(255-_b)*(1-g)), uint(255-(255-_b)*(1-b)) ), 2 ) );
+ p.setPen( TQPen( TQColor( uint(255-(255-_b)*(1-r)), uint(255-(255-_b)*(1-g)), uint(255-(255-_b)*(1-b)) ), 2 ) );
p.drawLine( x2-3-ds, y3+0, x1+3-ds, y3+0 );
// Bottom left
_b = last_brightness[4];
- p.setPen( QPen( QColor( uint(255-(255-_b)*(1-r)), uint(255-(255-_b)*(1-g)), uint(255-(255-_b)*(1-b)) ), 2 ) );
+ p.setPen( TQPen( TQColor( uint(255-(255-_b)*(1-r)), uint(255-(255-_b)*(1-g)), uint(255-(255-_b)*(1-b)) ), 2 ) );
p.drawLine( x1+0-ds, y3-3, x1+0, y2+3 );
// Top left
_b = last_brightness[5];
- p.setPen( QPen( QColor( uint(255-(255-_b)*(1-r)), uint(255-(255-_b)*(1-g)), uint(255-(255-_b)*(1-b)) ), 2 ) );
+ p.setPen( TQPen( TQColor( uint(255-(255-_b)*(1-r)), uint(255-(255-_b)*(1-g)), uint(255-(255-_b)*(1-b)) ), 2 ) );
p.drawLine( x1+0, y2-3, x1+0+ds, y1+3 );
// Middle
_b = last_brightness[6];
- p.setPen( QPen( QColor( uint(255-(255-_b)*(1-r)), uint(255-(255-_b)*(1-g)), uint(255-(255-_b)*(1-b)) ), 2 ) );
+ p.setPen( TQPen( TQColor( uint(255-(255-_b)*(1-r)), uint(255-(255-_b)*(1-g)), uint(255-(255-_b)*(1-b)) ), 2 ) );
p.drawLine( x1+3, y2+0, x2-3, y2+0 );
// Decimal point
_b = last_brightness[7];
- p.setBrush( QBrush( QColor( uint(255-(255-_b)*(1-r)), uint(255-(255-_b)*(1-g)), uint(255-(255-_b)*(1-b)) ) ) );
- p.setPen( Qt::NoPen );
+ p.setBrush( TQBrush( TQColor( uint(255-(255-_b)*(1-r)), uint(255-(255-_b)*(1-g)), uint(255-(255-_b)*(1-b)) ) ) );
+ p.setPen( TQt::NoPen );
p.drawPie( x2+3, y3-2, 3, 3, 0, 16*360 );
lastUpdatePeriod = 0.;