Changeset ce60f42 in confclerk_git


Ignore:
Timestamp:
07/14/21 21:28:46 (10 months ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master
Children:
6759e32
Parents:
af9f24b
git-author:
Philipp Spitzer <philipp@…> (07/14/21 21:27:16)
git-committer:
Philipp Spitzer <philipp@…> (07/14/21 21:28:46)
Message:

Replace QFontMetrics::width() with QFontMetrics::horizontalAdvance() to avoid a deprecation warning.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/daynavigatorwidget.cpp

    raf9f24b rce60f42  
    122122    qreal factor = 0.8;
    123123#else
    124     qreal factor = (qreal) 2 * q.width() / painter.fontMetrics().width(selectedDateStr);
     124#if QT_VERSION >= 0x050b00 // QT 5.11
     125    auto dateStrWidth = painter.fontMetrics().horizontalAdvance(selectedDateStr);
     126#else
     127    auto dateStrWidth = painter.fontMetrics().width(selectedDateStr);
     128#endif
     129    qreal factor = (qreal) 2 * q.width() / dateStrWidth;
    125130#endif
    126131    if (factor < 1) f.setPointSizeF(f.pointSizeF() * factor);
Note: See TracChangeset for help on using the changeset viewer.