diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
commit | d6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch) | |
tree | d109539636691d7b03036ca1c0ed29dbae6577cf /lib/widgets/processwidget.cpp | |
parent | 3331a47a9cad24795c7440ee8107143ce444ef34 (diff) | |
download | tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/widgets/processwidget.cpp')
-rw-r--r-- | lib/widgets/processwidget.cpp | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/lib/widgets/processwidget.cpp b/lib/widgets/processwidget.cpp index 3edbf161..a49a1078 100644 --- a/lib/widgets/processwidget.cpp +++ b/lib/widgets/processwidget.cpp @@ -21,21 +21,21 @@ #include "processlinemaker.h" #include <kdeversion.h> -#include <qdir.h> +#include <tqdir.h> #include <kdebug.h> #include <klocale.h> #include <kprocess.h> -#include <qpainter.h> -#include <qapplication.h> +#include <tqpainter.h> +#include <tqapplication.h> -ProcessListBoxItem::ProcessListBoxItem(const QString &s, Type type) - : QListBoxText(s), t(type) +ProcessListBoxItem::ProcessListBoxItem(const TQString &s, Type type) + : TQListBoxText(s), t(type) { - QString clean = s; - clean.replace( QChar('\t'), QString(" ") ); - clean.replace( QChar('\n'), QString() ); - clean.replace( QChar('\r'), QString() ); + TQString clean = s; + clean.replace( TQChar('\t'), TQString(" ") ); + clean.replace( TQChar('\n'), TQString() ); + clean.replace( TQChar('\r'), TQString() ); setText( clean ); setCustomHighlighting(true); @@ -57,7 +57,7 @@ static inline double blend1(double a, double b, double k) return a + (b - a) * k; } -QColor ProcessListBoxItem::blend(const QColor &c1, const QColor &c2, double k) const +TQColor ProcessListBoxItem::blend(const TQColor &c1, const TQColor &c2, double k) const { if (k < 0.0) return c1; if (k > 1.0) return c2; @@ -66,14 +66,14 @@ QColor ProcessListBoxItem::blend(const QColor &c1, const QColor &c2, double k) c int g = normalize((int)blend1((double)c1.green(), (double)c2.green(), k)); int b = normalize((int)blend1((double)c1.blue(), (double)c2.blue(), k)); - return QColor(qRgb(r, g, b)); + return TQColor(qRgb(r, g, b)); } -void ProcessListBoxItem::paint(QPainter *p) +void ProcessListBoxItem::paint(TQPainter *p) { - QColor dim, warn, err, back; + TQColor dim, warn, err, back; if (listBox()) { - const QColorGroup& group = listBox()->palette().active(); + const TQColorGroup& group = listBox()->palette().active(); if (isSelected()) { back = group.button(); warn = group.buttonText(); @@ -96,17 +96,17 @@ void ProcessListBoxItem::paint(QPainter *p) else back = Qt::white; } - p->fillRect(p->window(), QBrush(back)); + p->fillRect(p->window(), TQBrush(back)); p->setPen((t==Error)? err : (t==Diagnostic)? warn : dim); - QListBoxText::paint(p); + TQListBoxText::paint(p); } -ProcessWidget::ProcessWidget(QWidget *parent, const char *name) +ProcessWidget::ProcessWidget(TQWidget *parent, const char *name) : KListBox(parent, name) { - setFocusPolicy(QWidget::NoFocus); + setFocusPolicy(TQWidget::NoFocus); // Don't override the palette, as that can mess up styles. Instead, draw // the background ourselves (see ProcessListBoxItem::paint). @@ -117,17 +117,17 @@ ProcessWidget::ProcessWidget(QWidget *parent, const char *name) procLineMaker = new ProcessLineMaker( childproc ); - connect( procLineMaker, SIGNAL(receivedStdoutLine(const QCString&)), - this, SLOT(insertStdoutLine(const QCString&) )); - connect( procLineMaker, SIGNAL(receivedStderrLine(const QCString&)), - this, SLOT(insertStderrLine(const QCString&) )); - connect( procLineMaker, SIGNAL(receivedPartialStdoutLine(const QCString&)), - this, SLOT(addPartialStdoutLine(const QCString&) )); - connect( procLineMaker, SIGNAL(receivedPartialStderrLine(const QCString&)), - this, SLOT(addPartialStderrLine(const QCString&) )); - - connect(childproc, SIGNAL(processExited(KProcess*)), - this, SLOT(slotProcessExited(KProcess*) )) ; + connect( procLineMaker, TQT_SIGNAL(receivedStdoutLine(const TQCString&)), + this, TQT_SLOT(insertStdoutLine(const TQCString&) )); + connect( procLineMaker, TQT_SIGNAL(receivedStderrLine(const TQCString&)), + this, TQT_SLOT(insertStderrLine(const TQCString&) )); + connect( procLineMaker, TQT_SIGNAL(receivedPartialStdoutLine(const TQCString&)), + this, TQT_SLOT(addPartialStdoutLine(const TQCString&) )); + connect( procLineMaker, TQT_SIGNAL(receivedPartialStderrLine(const TQCString&)), + this, TQT_SLOT(addPartialStderrLine(const TQCString&) )); + + connect(childproc, TQT_SIGNAL(processExited(KProcess*)), + this, TQT_SLOT(slotProcessExited(KProcess*) )) ; } @@ -138,7 +138,7 @@ ProcessWidget::~ProcessWidget() } -void ProcessWidget::startJob(const QString &dir, const QString &command) +void ProcessWidget::startJob(const TQString &dir, const TQString &command) { procLineMaker->clearBuffers(); procLineMaker->blockSignals( false ); @@ -182,18 +182,18 @@ void ProcessWidget::slotProcessExited(KProcess *) } -void ProcessWidget::insertStdoutLine(const QCString &line) +void ProcessWidget::insertStdoutLine(const TQCString &line) { if( !stdoutbuf.isEmpty() ) { stdoutbuf += line; - insertItem( new ProcessListBoxItem( QString::fromLocal8Bit(stdoutbuf), + insertItem( new ProcessListBoxItem( TQString::fromLocal8Bit(stdoutbuf), ProcessListBoxItem::Normal ), lastRowStdout+1 ); stdoutbuf.truncate( 0 ); }else { - insertItem( new ProcessListBoxItem( QString::fromLocal8Bit( line ), + insertItem( new ProcessListBoxItem( TQString::fromLocal8Bit( line ), ProcessListBoxItem::Normal) ); } lastRowStdout = count() - 1; @@ -201,18 +201,18 @@ void ProcessWidget::insertStdoutLine(const QCString &line) } -void ProcessWidget::insertStderrLine(const QCString &line) +void ProcessWidget::insertStderrLine(const TQCString &line) { if( !stderrbuf.isEmpty() ) { stderrbuf += line; - insertItem( new ProcessListBoxItem( QString::fromLocal8Bit( stderrbuf ), + insertItem( new ProcessListBoxItem( TQString::fromLocal8Bit( stderrbuf ), ProcessListBoxItem::Error ), lastRowStderr+1 ); stderrbuf.truncate( 0 ); } else { - insertItem( new ProcessListBoxItem( QString::fromLocal8Bit( line ), + insertItem( new ProcessListBoxItem( TQString::fromLocal8Bit( line ), ProcessListBoxItem::Error) ); } lastRowStderr = count() - 1; @@ -222,7 +222,7 @@ void ProcessWidget::insertStderrLine(const QCString &line) void ProcessWidget::childFinished(bool normal, int status) { - QString s; + TQString s; ProcessListBoxItem::Type t; if (normal) { @@ -249,12 +249,12 @@ void ProcessWidget::childFinished(bool normal, int status) } -QSize ProcessWidget::minimumSizeHint() const +TQSize ProcessWidget::minimumSizeHint() const { // I'm not sure about this, but when I don't use override minimumSizeHint(), // the initial size in clearly too small - return QSize( QListBox::sizeHint().width(), + return TQSize( TQListBox::sizeHint().width(), (fontMetrics().lineSpacing()+2)*4 ); } @@ -270,12 +270,12 @@ void ProcessWidget::maybeScrollToBottom() } } -void ProcessWidget::addPartialStderrLine(const QCString& linepart) +void ProcessWidget::addPartialStderrLine(const TQCString& linepart) { stderrbuf += linepart; } -void ProcessWidget::addPartialStdoutLine(const QCString& linepart) +void ProcessWidget::addPartialStdoutLine(const TQCString& linepart) { stdoutbuf += linepart; } |