From 5b3ad773cf2d6f2ead71996f496611561929b657 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 17 Jul 2013 13:59:34 +0200 Subject: [PATCH] Change output color per label --- qt/multypo.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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) -- 2.30.2