diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-05-19 13:58:24 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-05-20 08:26:52 +0200 |
commit | 55b91dc4714d36d457fbfa32bc6b412415362430 (patch) | |
tree | 743eecbb2dd41f98fb9ecd0f4d29eea023524960 /examples/activeqt/hierarchy/objects.cpp | |
parent | 463299b8c9b8f2ce28126aa8180f7103112d1947 (diff) |
Fix deprecated/removed code
- Port away from QDesktopWidget
- Use QFontMetrics::horizontalAdvance() instead of width()
Pick-to: 5.15
Change-Id: I5d721fa574356a27e414545d6b9b2d28d400080b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'examples/activeqt/hierarchy/objects.cpp')
-rw-r--r-- | examples/activeqt/hierarchy/objects.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/activeqt/hierarchy/objects.cpp b/examples/activeqt/hierarchy/objects.cpp index c28cd85..af9d966 100644 --- a/examples/activeqt/hierarchy/objects.cpp +++ b/examples/activeqt/hierarchy/objects.cpp @@ -104,7 +104,7 @@ QString QSubWidget::label() const QSize QSubWidget::sizeHint() const { QFontMetrics fm(font()); - return QSize(fm.width(m_label), fm.height()); + return QSize(fm.horizontalAdvance(m_label), fm.height()); } void QSubWidget::paintEvent(QPaintEvent *) |