Reference Examples: Avoid static_cast on function arguments

qobject_cast is safer and not very expensive here.

Change-Id: Ie87219e2a5092e453d257064a95a790de31015f5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
Ulf Hermann 2019-08-19 11:10:51 +02:00
parent adcb79025a
commit a2e1025354
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@
#include <qqml.h>
LineEditExtension::LineEditExtension(QObject *object)
: QObject(object), m_lineedit(static_cast<QLineEdit *>(object))
: QObject(object), m_lineedit(qobject_cast<QLineEdit *>(object))
{
}