From: Ralf Jung Date: Wed, 17 Jul 2013 11:59:34 +0000 (+0200) Subject: Change output color per label X-Git-Url: https://git.ralfj.de/multypo.git/commitdiff_plain/5b3ad773cf2d6f2ead71996f496611561929b657?ds=inline Change output color per label --- diff --git a/qt/multypo.cpp b/qt/multypo.cpp index 2584c0c..e7a1886 100644 --- a/qt/multypo.cpp +++ b/qt/multypo.cpp @@ -9,12 +9,19 @@ #include #include +static QString colorToString(QColor col) +{ + return QString("#%1%2%3").arg(col.red(), 2, 16, QChar('0')) + .arg(col.green(), 2, 16, QChar('0')) + .arg(col.blue(), 2, 16, QChar('0')); +} + MultypoWindow::MultypoWindow(QWidget *parent) : QWidget(parent), xiInited(false) { /* Prepare colors */ - setStyleSheet("background-color: black; color: green"); + setStyleSheet("background-color: black; color: green; font-size: 30pt"); /* Prepare conents */ setLayout(new QVBoxLayout(this)); @@ -43,7 +50,8 @@ void MultypoWindow::handleKeyPress(int device, QString string) layout()->addWidget(label); players[device] = label; } - players[device]->setText(players[device]->text() + string); + QColor textColor = QColor(Qt::blue); + players[device]->setText(players[device]->text() + ""+string+""); } bool MultypoWindow::handleX11Event(XEvent *event)