diff options
Diffstat (limited to 'src/chart.cpp')
-rw-r--r-- | src/chart.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/src/chart.cpp b/src/chart.cpp index fd90368..60bc741 100644 --- a/src/chart.cpp +++ b/src/chart.cpp @@ -24,22 +24,22 @@ #include "chart.h" #include "functions.h" -#include <qpainter.h> -#include <qbrush.h> +#include <ntqpainter.h> +#include <ntqbrush.h> #include <kdebug.h> using namespace tk; -Chart::Chart(QWidget* parent, const double* uploadBuffer, const double* downloadBuffer, int bufferSize, const int* ptr, const double* maxspeed, const double* sys_uploadBuffer, const double* sys_downloadBuffer, int sys_bufferSize, const int* sys_ptr, const double* sys_maxspeed, bool gotEth0) : QWidget(parent), mUplBuffer(uploadBuffer), mDldBuffer(downloadBuffer), mBufferSize(bufferSize), mPtr(ptr), mMaxSpeed(maxspeed),sys_mUplBuffer(sys_uploadBuffer), sys_mDldBuffer(sys_downloadBuffer), sys_mBufferSize(sys_bufferSize), sys_mPtr(sys_ptr), sys_mMaxSpeed(sys_maxspeed),mGotEth0(gotEth0) { - setWFlags(Qt::WNoAutoErase); - setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); +Chart::Chart(TQWidget* parent, const double* uploadBuffer, const double* downloadBuffer, int bufferSize, const int* ptr, const double* maxspeed, const double* sys_uploadBuffer, const double* sys_downloadBuffer, int sys_bufferSize, const int* sys_ptr, const double* sys_maxspeed, bool gotEth0) : TQWidget(parent), mUplBuffer(uploadBuffer), mDldBuffer(downloadBuffer), mBufferSize(bufferSize), mPtr(ptr), mMaxSpeed(maxspeed),sys_mUplBuffer(sys_uploadBuffer), sys_mDldBuffer(sys_downloadBuffer), sys_mBufferSize(sys_bufferSize), sys_mPtr(sys_ptr), sys_mMaxSpeed(sys_maxspeed),mGotEth0(gotEth0) { + setWFlags(TQt::WNoAutoErase); + setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); } -void Chart::paintEvent(QPaintEvent*) { - QPainter paint(this); - paint.setBackgroundColor(Qt::black); - paint.setBackgroundMode(Qt::OpaqueMode); - QBrush brush(QColor(0x33, 0x33, 0x33), CrossPattern); +void Chart::paintEvent(TQPaintEvent*) { + TQPainter paint(this); + paint.setBackgroundColor(TQt::black); + paint.setBackgroundMode(TQt::OpaqueMode); + TQBrush brush(TQColor(0x33, 0x33, 0x33), CrossPattern); paint.fillRect(0, 0, width(), height(), brush); @@ -55,11 +55,11 @@ void Chart::paintEvent(QPaintEvent*) { i = mBufferSize-1; int rxY = HEIGHT - int(HEIGHT * (mDldBuffer[i]/(*mMaxSpeed))); int txY = HEIGHT - int(HEIGHT * (mUplBuffer[i]/(*mMaxSpeed))); - paint.setPen(Qt::green); + paint.setPen(TQt::green); paint.drawLine(lastX, lastRxY, x, rxY); - paint.setPen(Qt::red); + paint.setPen(TQt::red); paint.drawLine(lastX, lastTxY, x, txY); - //qDebug("%d => %d", i, int(mSpeedHistoryRx[i])); + //tqDebug("%d => %d", i, int(mSpeedHistoryRx[i])); lastX = x; lastRxY = rxY; lastTxY = txY; @@ -69,11 +69,11 @@ void Chart::paintEvent(QPaintEvent*) { } - paint.setFont(QFont("Helvetica", 8)); - paint.setPen( Qt::red ); - paint.drawText( rect(), Qt::AlignTop, QString("Tor Tx: %1 ").arg(BytesPerSecToString(mUplBuffer[*mPtr]))); - paint.setPen( Qt::green ); - paint.drawText( rect(), Qt::AlignBottom, QString("Tor Rx: %1 ").arg(BytesPerSecToString(mDldBuffer[*mPtr]))); + paint.setFont(TQFont("Helvetica", 8)); + paint.setPen( TQt::red ); + paint.drawText( rect(), TQt::AlignTop, TQString("Tor Tx: %1 ").arg(BytesPerSecToString(mUplBuffer[*mPtr]))); + paint.setPen( TQt::green ); + paint.drawText( rect(), TQt::AlignBottom, TQString("Tor Rx: %1 ").arg(BytesPerSecToString(mDldBuffer[*mPtr]))); if (mGotEth0){ lastX = x = width(); @@ -85,11 +85,11 @@ void Chart::paintEvent(QPaintEvent*) { i = sys_mBufferSize-1; int rxY = HEIGHT - int(HEIGHT * (sys_mDldBuffer[i]/(*sys_mMaxSpeed))); int txY = HEIGHT - int(HEIGHT * (sys_mUplBuffer[i]/(*sys_mMaxSpeed))); - paint.setPen(Qt::darkGreen); + paint.setPen(TQt::darkGreen); paint.drawLine(lastX, lastRxY, x, rxY); - paint.setPen(Qt::darkRed); + paint.setPen(TQt::darkRed); paint.drawLine(lastX, lastTxY, x, txY); - //qDebug("%d => %d", i, int(mSpeedHistoryRx[i])); + //tqDebug("%d => %d", i, int(mSpeedHistoryRx[i])); lastX = x; lastRxY = rxY; lastTxY = txY; @@ -99,22 +99,22 @@ void Chart::paintEvent(QPaintEvent*) { } - QString TorTX = QString("Tor Tx: %1 ").arg(BytesPerSecToString(mUplBuffer[*mPtr])); - QString SysTX = QString("Sys Tx: %1 ").arg(BytesPerSecToString(sys_mUplBuffer[*sys_mPtr])); - QString TorRX = QString("Tor Rx: %1 ").arg(BytesPerSecToString(mDldBuffer[*mPtr])); - QString SysRX = QString("Sys Rx: %1 ").arg(BytesPerSecToString(sys_mDldBuffer[*sys_mPtr])); + TQString TorTX = TQString("Tor Tx: %1 ").arg(BytesPerSecToString(mUplBuffer[*mPtr])); + TQString SysTX = TQString("Sys Tx: %1 ").arg(BytesPerSecToString(sys_mUplBuffer[*sys_mPtr])); + TQString TorRX = TQString("Tor Rx: %1 ").arg(BytesPerSecToString(mDldBuffer[*mPtr])); + TQString SysRX = TQString("Sys Rx: %1 ").arg(BytesPerSecToString(sys_mDldBuffer[*sys_mPtr])); //Paint Text Representation - QRect first = paint.boundingRect( rect(), Qt::AlignTop, TorTX); + TQRect first = paint.boundingRect( rect(), TQt::AlignTop, TorTX); first.moveLeft(first.width()); - first.setWidth(paint.boundingRect( rect(), Qt::AlignTop, SysTX).width()); - paint.setPen( Qt::red ); - paint.drawText( first, Qt::AlignTop, SysTX); + first.setWidth(paint.boundingRect( rect(), TQt::AlignTop, SysTX).width()); + paint.setPen( TQt::red ); + paint.drawText( first, TQt::AlignTop, SysTX); - first = paint.boundingRect( rect(), Qt::AlignBottom, TorRX); + first = paint.boundingRect( rect(), TQt::AlignBottom, TorRX); first.moveLeft(first.width()); - first.setWidth(paint.boundingRect( rect(), Qt::AlignTop, SysRX).width()); - paint.setPen( Qt::green ); - paint.drawText( first, Qt::AlignTop, SysRX); + first.setWidth(paint.boundingRect( rect(), TQt::AlignTop, SysRX).width()); + paint.setPen( TQt::green ); + paint.drawText( first, TQt::AlignTop, SysRX); } |