diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2013-07-27 16:57:53 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2013-07-27 18:48:46 +0200 |
commit | 7c2bc4b5ce4fc1a72868aa949e9ec49fbe2e7931 (patch) | |
tree | 4655c7263ca5c64d23d10167cb459dd9cb253815 /src/statgraph.cpp | |
parent | 88ea2b6cd4382627fb6efca9cc54825aee881d1e (diff) | |
download | tork-7c2bc4b5ce4fc1a72868aa949e9ec49fbe2e7931.tar.gz tork-7c2bc4b5ce4fc1a72868aa949e9ec49fbe2e7931.zip |
Initial TQt conversion
Diffstat (limited to 'src/statgraph.cpp')
-rw-r--r-- | src/statgraph.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/statgraph.cpp b/src/statgraph.cpp index 4313e5f..706f3a8 100644 --- a/src/statgraph.cpp +++ b/src/statgraph.cpp @@ -33,22 +33,22 @@ #include "statgraph.h" -#include <qpainter.h> -#include <qlabel.h> +#include <ntqpainter.h> +#include <ntqlabel.h> #include <kdebug.h> #define SOFT_STEP 3 -const QColor StatGraph::defaultBgColor = Qt::black; -const QColor StatGraph::defaultReadingColor = Qt::yellow; -const QColor StatGraph::defaultLabelColor = Qt::white; -const QColor StatGraph::defaultGridColor = Qt::lightGray; +const TQColor StatGraph::defaultBgColor = TQt::black; +const TQColor StatGraph::defaultReadingColor = TQt::yellow; +const TQColor StatGraph::defaultLabelColor = TQt::white; +const TQColor StatGraph::defaultGridColor = TQt::lightGray; /// Color used to pass transparent colors -//const QColor StatGraph::invalidColor = QColor(-1, -1, -1); +//const TQColor StatGraph::invalidColor = TQColor(-1, -1, -1); -StatGraph::StatGraph(QWidget *parent, ushort pace, ushort gridPace, const QString &label, const QColor &bgColor, const char *name) - : QLabel(parent, name), m_style(Shades), m_gridPace(gridPace), m_pace(pace) +StatGraph::StatGraph(TQWidget *parent, ushort pace, ushort gridPace, const TQString &label, const TQColor &bgColor, const char *name) + : TQLabel(parent, name), m_style(Shades), m_gridPace(gridPace), m_pace(pace) { setLabel(label); setBgColor(bgColor); @@ -64,7 +64,7 @@ StatGraph::~StatGraph() delete[] m_readings; } -void StatGraph::setBgColor(const QColor &color) +void StatGraph::setBgColor(const TQColor &color) { m_bgColor = color; @@ -72,7 +72,7 @@ void StatGraph::setBgColor(const QColor &color) setBackgroundColor(m_bgColor); } -inline void StatGraph::paintGrid(QPainter &p) +inline void StatGraph::paintGrid(TQPainter &p) { p.setPen(m_gridColor); @@ -85,7 +85,7 @@ inline void StatGraph::paintGrid(QPainter &p) } } -inline void StatGraph::paintShades(QPainter &p) +inline void StatGraph::paintShades(TQPainter &p) { //kdDebug() << "StatGraph::paintShades()" << endl; const uint graphHeight = height(); @@ -107,7 +107,7 @@ inline void StatGraph::paintShades(QPainter &p) } } -inline void StatGraph::paintBars(QPainter &p) +inline void StatGraph::paintBars(TQPainter &p) { //kdDebug() << "StatGraph::paintBars()" << endl; const uint graphHeight = height(); @@ -120,7 +120,7 @@ inline void StatGraph::paintBars(QPainter &p) } } -inline void StatGraph::paintLines(QPainter &p) +inline void StatGraph::paintLines(TQPainter &p) { //kdDebug() << "StatGraph::paintLines()" << endl; const uint graphHeight = height(); @@ -133,10 +133,10 @@ inline void StatGraph::paintLines(QPainter &p) } } -inline void StatGraph::paintLabel(QPainter &p) +inline void StatGraph::paintLabel(TQPainter &p) { //kdDebug() << "StatGraph::paintLabel()" << endl; - p.setFont(QFont("Helvetica", 8)); + p.setFont(TQFont("Helvetica", 8)); p.setPen(m_labelColor); p.drawText(rect(), AlignLeft | AlignTop, m_label); } @@ -174,9 +174,9 @@ void StatGraph::softenReadings(uint &reading) reading = old - SOFT_STEP; } -void StatGraph::resizeEvent(QResizeEvent *e) +void StatGraph::resizeEvent(TQResizeEvent *e) { - QLabel::resizeEvent(e); + TQLabel::resizeEvent(e); uint oldNumReadings = m_numReadings; m_numReadings = width() / m_pace; @@ -197,14 +197,14 @@ void StatGraph::resizeEvent(QResizeEvent *e) } } -void StatGraph::paintEvent(QPaintEvent *e) +void StatGraph::paintEvent(TQPaintEvent *e) { - QLabel::paintEvent(e); + TQLabel::paintEvent(e); if ( ! m_readingColor.isValid() ) m_readingColor = defaultReadingColor; if ( ! m_labelColor.isValid() ) m_labelColor = defaultLabelColor; if ( ! m_gridColor.isValid() ) m_gridColor = defaultGridColor; - QPainter p(this); + TQPainter p(this); if ( m_gridPace ) paintGrid(p); @@ -224,15 +224,15 @@ void StatGraph::paintEvent(QPaintEvent *e) paintLabel(p); } -void StatGraph::mousePressEvent(QMouseEvent *e) +void StatGraph::mousePressEvent(TQMouseEvent *e) { - QLabel::mousePressEvent(e); + TQLabel::mousePressEvent(e); m_button = e->button(); } -void StatGraph::mouseReleaseEvent(QMouseEvent *e) +void StatGraph::mouseReleaseEvent(TQMouseEvent *e) { - QLabel::mouseReleaseEvent(e); + TQLabel::mouseReleaseEvent(e); if ( m_button == e->button() ) { switch(m_button) @@ -247,7 +247,7 @@ void StatGraph::mouseReleaseEvent(QMouseEvent *e) kdDebug() << "Unknown button combination" << endl; } } - m_button = Qt::NoButton; + m_button = TQt::NoButton; } #include "statgraph.moc" |