diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2022-07-19 17:50:22 +0200 |
---|---|---|
committer | Ivan Solovev <ivan.solovev@qt.io> | 2022-07-21 17:14:08 +0200 |
commit | ca8a71e1997650a0ecf497d667cfab5a72858c18 (patch) | |
tree | 6d01e22389d22d28c93971d151263f37f4693958 /src/linguist | |
parent | ea3365ef1f9338cf534e8840a2d1f1c5a23c03c0 (diff) | |
download | qttools-ca8a71e1997650a0ecf497d667cfab5a72858c18.tar.gz |
Designer: port away from the deprecated QAction APIs
The deprecation of QAction::associatedWidgets() results in a bit more
code, because the list of associated objects can also contain
QGraphicsWidget instances. So we need to explicitly qobject_cast them
to QWidget* before using.
Apart from that the changes are rather straightforward.
Task-number: QTBUG-104968
Pick-to: 6.4 6.3 6.2
Change-Id: I2e7c94de069cd5c9cde5e6d41ac86004a8bae6c9
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Diffstat (limited to 'src/linguist')
-rw-r--r-- | src/linguist/linguist/formpreviewview.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/linguist/linguist/formpreviewview.cpp b/src/linguist/linguist/formpreviewview.cpp index 18dfd1711..dcd14843a 100644 --- a/src/linguist/linguist/formpreviewview.cpp +++ b/src/linguist/linguist/formpreviewview.cpp @@ -352,8 +352,10 @@ static void highlightAction(QAction *a, bool on) a->setProperty(FONT_BACKUP_PROP, QVariant()); } } - for (QWidget *w : a->associatedWidgets()) - highlightWidget(w, on); + for (QObject *o : a->associatedObjects()) { + if (QWidget *w = qobject_cast<QWidget *>(o)) + highlightWidget(w, on); + } } static void highlightWidget(QWidget *w, bool on) |