5 static QString colorToString(QColor col)
7 return QString("#%1%2%3").arg(col.red(), 2, 16, QChar('0'))
8 .arg(col.green(), 2, 16, QChar('0'))
9 .arg(col.blue(), 2, 16, QChar('0'));
12 Player::Player(QWidget* parent) {
13 theLabel = new QLabel (parent);
14 parent->layout()->addWidget(theLabel);
19 bool Player::hasName() {
20 return !name.isNull();
23 QString Player::getName() {
27 QString Player::getCurrentLine() {
31 void Player::setWaiting(QString labeltext) {
32 theLabel->setText(labeltext);
36 void Player::resetText() {
38 theLabel->setText(currentLine);
42 void Player::handleKey(QString str) {
45 if (str.length() == 1) {
47 } else if (!hasName() && str == "Return") {
51 } else if (str == "BackSpace") {
54 theLabel->setText(currentLine);