diff options
author | Kai Koehne <kai.koehne@qt.io> | 2019-03-15 08:50:25 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-03-15 08:32:32 +0000 |
commit | 62e4e2021bc1e68ae9bd2e9b49556282cfe816b9 (patch) | |
tree | c375f200c8eb526fe79509e6c2caa84804c87ddb /src/pixeltool | |
parent | 14793483aab76f1ac559d83cd0846ffee54fddc5 (diff) |
Replace deprecated QString::sprintf
QString::sprintf got deprecated in qtbase commit f8f592d5c22c378ac94.
Use QString::asprintf instead.
Fixes: QTBUG-74449
Change-Id: I1a635551be4f021e5da1145c03b4d0aaf4ebda8c
Reviewed-by: Liang Qi <liang.qi@qt.io>
Diffstat (limited to 'src/pixeltool')
-rw-r--r-- | src/pixeltool/qpixeltool.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/pixeltool/qpixeltool.cpp b/src/pixeltool/qpixeltool.cpp index 7a73e3655..4abc45325 100644 --- a/src/pixeltool/qpixeltool.cpp +++ b/src/pixeltool/qpixeltool.cpp @@ -255,13 +255,12 @@ void QPixelTool::paintEvent(QPaintEvent *) } if (m_freeze) { - QString str; - str.sprintf("%8X (%3d,%3d,%3d,%3d)", - m_currentColor, - (0xff000000 & m_currentColor) >> 24, - (0x00ff0000 & m_currentColor) >> 16, - (0x0000ff00 & m_currentColor) >> 8, - (0x000000ff & m_currentColor)); + QString str = QString::asprintf("%8X (%3d,%3d,%3d,%3d)", + m_currentColor, + (0xff000000 & m_currentColor) >> 24, + (0x00ff0000 & m_currentColor) >> 16, + (0x0000ff00 & m_currentColor) >> 8, + (0x000000ff & m_currentColor)); render_string(&p, w, h, str, Qt::AlignBottom | Qt::AlignRight); @@ -279,12 +278,11 @@ void QPixelTool::paintEvent(QPaintEvent *) p.setPen(QPen(Qt::black, 1, Qt::SolidLine)); p.drawRect(r); - QString str; - str.sprintf("Rect: x=%d, y=%d, w=%d, h=%d", - r.x() / m_zoom, - r.y() / m_zoom, - r.width() / m_zoom, - r.height() / m_zoom); + QString str = QString::asprintf("Rect: x=%d, y=%d, w=%d, h=%d", + r.x() / m_zoom, + r.y() / m_zoom, + r.width() / m_zoom, + r.height() / m_zoom); render_string(&p, w, h, str, Qt::AlignBottom | Qt::AlignLeft); } |