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:
parent
adcb79025a
commit
a2e1025354
|
@ -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))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue