Gui: fix double-click on checkboxes locking the properties
This commit is contained in:
committed by
Kacper Donat
parent
89cb9877b7
commit
f5c32243a6
@@ -163,10 +163,13 @@ void PropertyItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
|
||||
bool PropertyItemDelegate::editorEvent (QEvent * event, QAbstractItemModel* model,
|
||||
const QStyleOptionViewItem& option, const QModelIndex& index)
|
||||
{
|
||||
if (event && event->type() == QEvent::MouseButtonPress)
|
||||
this->pressed = true;
|
||||
else
|
||||
this->pressed = false;
|
||||
if (!event || event->type() == QEvent::MouseButtonDblClick) {
|
||||
// ignore double click, as it could cause editor lock with checkboxes
|
||||
// due to the editor being close immediately after toggling the checkbox
|
||||
// which is currently done on first click
|
||||
return true;
|
||||
}
|
||||
this->pressed = event->type() == QEvent::MouseButtonPress;
|
||||
return QItemDelegate::editorEvent(event, model, option, index);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user