Replace expensive inherits with cheaper qobject_cast (1)
The accessibility implementations require the type to be fully defined anyway in order to call type-specific APIs, so there's no need to use inherits(). Use qobject_cast instead. Pick-to: 6.7 Change-Id: I5c013be57f48272a748451f4888911fe6aa6574e Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io> Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
This commit is contained in:
parent
460b0f98c6
commit
3973d6c529
@ -95,7 +95,7 @@ QWidgetList _q_ac_childWidgets(const QWidget *widget)
|
||||
QAccessiblePlainTextEdit::QAccessiblePlainTextEdit(QWidget* o)
|
||||
:QAccessibleTextWidget(o)
|
||||
{
|
||||
Q_ASSERT(widget()->inherits("QPlainTextEdit"));
|
||||
Q_ASSERT(qobject_cast<QPlainTextEdit *>(widget()));
|
||||
}
|
||||
|
||||
QPlainTextEdit* QAccessiblePlainTextEdit::plainTextEdit() const
|
||||
@ -192,7 +192,7 @@ void QAccessiblePlainTextEdit::scrollToSubstring(int startIndex, int endIndex)
|
||||
QAccessibleTextEdit::QAccessibleTextEdit(QWidget *o)
|
||||
: QAccessibleTextWidget(o, QAccessible::EditableText)
|
||||
{
|
||||
Q_ASSERT(widget()->inherits("QTextEdit"));
|
||||
Q_ASSERT(qobject_cast<QTextEdit *>(widget()));
|
||||
}
|
||||
|
||||
/*! Returns the text edit. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user