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);
18 bool Player::hasName() {
19 return !name.isNull();
22 QString Player::getName() {
26 QString Player::getCurrentLine() {
30 void Player::resetText() {
32 theLabel->setText(currentLine);
35 void Player::handleKey(QString str) {
36 if (str.length() == 1) {
38 } else if (!hasName() && str == "Return") {
42 } else if (str == "BackSpace") {
45 theLabel->setText(currentLine);