Пример #1
0
void BoardView::setWinningText(std::string const & text)
{
    this->_winner = text;
    this->getGameInfos()._ui.gameStatusLabel->setText(text.c_str());
    QGraphicsRectItem* rectItem = this->_scene.addRect(0, 0, this->_scene.width(), this->scene()->height(), QPen(Qt::white), QBrush(Qt::white));
    rectItem->setOpacity(0.8);
    QGraphicsTextItem* textItem = this->_scene.addText(text.c_str(), QFont("Ubuntu, Calibri", 24, 600));
    textItem->adjustSize();
    textItem->setPos(((this->_board->getSize() * this->_lineSpacing - textItem->textWidth()) / 2), 100);
}
Пример #2
0
void NodeBackDropPrivate::setNameInternal(const QString& n)
{
    {
        QMutexLocker l(&nameStringMutex);
        nameString = n;
    }
    QString textLabel = n;
    textLabel.prepend("<div align=\"center\"><font size = 6>");
    textLabel.append("</font></div>");
    name->setHtml(textLabel);
    name->adjustSize();
    QRectF bbox = _publicInterface->boundingRect();
    _publicInterface->resize(bbox.width(), bbox.height());
}