Check for valid model and view in isValid for TableCells.
Change-Id: Iadca5503ed2a1d6411d46ed6fe9d5b9a56461a3a Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
parent
2e99f6c48f
commit
26022a4eee
@ -713,7 +713,7 @@ void QAccessibleTableCell::setText(QAccessible::Text /*t*/, const QString &text)
|
||||
|
||||
bool QAccessibleTableCell::isValid() const
|
||||
{
|
||||
return m_index.isValid();
|
||||
return view && view->model() && m_index.isValid();
|
||||
}
|
||||
|
||||
QAccessibleInterface *QAccessibleTableCell::parent() const
|
||||
@ -799,7 +799,8 @@ void QAccessibleTableHeaderCell::setText(QAccessible::Text, const QString &)
|
||||
|
||||
bool QAccessibleTableHeaderCell::isValid() const
|
||||
{
|
||||
return true;
|
||||
return view && view->model() && (index > 0)
|
||||
&& ((orientation == Qt::Horizontal) ? (index < view->model()->columnCount()) : (index < view->model()->rowCount()));
|
||||
}
|
||||
|
||||
QAccessibleInterface *QAccessibleTableHeaderCell::parent() const
|
||||
|
Loading…
Reference in New Issue
Block a user