forked from qt-creator/qt-creator
Core: Handle editor event only for real items
Rows which do not fill an entire row are treated as if they contained empty placeholder items. Do not try to handle these as the item data for these will be a nullptr. Change-Id: Ia9420aeafe3e2a0a3f7d29208ad21c81e52ac81a Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -592,7 +592,8 @@ bool ListItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *model,
|
||||
{
|
||||
if (event->type() == QEvent::MouseButtonRelease) {
|
||||
const ListItem *item = index.data(ListModel::ItemRole).value<ListItem *>();
|
||||
QTC_ASSERT(item, return false);
|
||||
if (!item)
|
||||
return false;
|
||||
auto mev = static_cast<QMouseEvent *>(event);
|
||||
if (index.isValid()) {
|
||||
const QPoint pos = mev->pos();
|
||||
|
||||
Reference in New Issue
Block a user