Commit 5bb78aab authored by Laurent Montel's avatar Laurent Montel 😁

Make it compile without deprecated method

parent 3852dde3
......@@ -40,7 +40,7 @@ add_definitions(
-DQT_NO_URL_CAST_FROM_STRING
-DQT_USE_QSTRINGBUILDER
)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
add_subdirectory(src)
add_subdirectory(data)
add_subdirectory(doc)
......
......@@ -369,10 +369,10 @@ void GameScene::drawBackground(QPainter *painter, const QRectF &)
// Draw vertical numbers for board coordinates
const qreal yVert = m_gridRect.top() + offset + fm.descent();
painter->drawText(QPointF(m_gridRect.left() - m_cellSize + 2, yVert), n);
painter->drawText(QPointF(m_gridRect.right() + m_cellSize - fm.width(n) - 3, yVert), n);
painter->drawText(QPointF(m_gridRect.right() + m_cellSize - fm.boundingRect(n).width() - 3, yVert), n);
// Draw horizontal characters for board coordinates
const qreal xHor = m_gridRect.left() + offset - fm.width(c) / 2;
const qreal xHor = m_gridRect.left() + offset - fm.boundingRect(c).width() / 2;
painter->drawText(QPointF(xHor, m_gridRect.top() - m_cellSize + fm.ascent() + 2), QString(c));
painter->drawText(QPointF(xHor, m_gridRect.bottom() + m_cellSize - 3), QString(c));
}
......
......@@ -144,7 +144,7 @@ QPixmap ThemeRenderer::renderElement(Element element, const QSize &size) const
// Check if board element is already in cache, if not render it
QPixmap pixmap;
if (!QPixmapCache::find(cacheName, pixmap)) {
if (!QPixmapCache::find(cacheName, &pixmap)) {
pixmap = QPixmap(size);
pixmap.fill(Qt::transparent);
QPainter p(&pixmap);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment