mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-14 20:33:05 +02:00
Check QAbstractItemModel for nullptr before access. #2
This commit is contained in:
parent
a61d70e40e
commit
c31cab34e4
@ -172,10 +172,12 @@ bool ElementsCollectionModel::dropMimeData(const QMimeData *data,
|
|||||||
const QModelIndex &parent)
|
const QModelIndex &parent)
|
||||||
{
|
{
|
||||||
Q_UNUSED(action)
|
Q_UNUSED(action)
|
||||||
QStandardItem *qsi = itemFromIndex(
|
|
||||||
parent.QModelIndex::model()->index(row, column));
|
const QAbstractItemModel* qaim = parent.QModelIndex::model();
|
||||||
if (!qsi)
|
if (! qaim) return false;
|
||||||
qsi = itemFromIndex(parent);
|
|
||||||
|
QStandardItem* qsi = itemFromIndex(qaim->index(row, column));
|
||||||
|
if (! qsi) qsi = itemFromIndex(parent);
|
||||||
|
|
||||||
if (qsi->type() == FileElementCollectionItem::Type)
|
if (qsi->type() == FileElementCollectionItem::Type)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user