From a2d9b99ce5d1af49e3bfd9493a9c25176b4e2309 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Thu, 30 Aug 2012 12:25:29 +0000 Subject: fixed radio buttons behaviour git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2911 90c681e8-e032-0410-971d-27865f9a5e38 --- src/qmmpui/radioitemdelegate.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/qmmpui/radioitemdelegate.cpp') diff --git a/src/qmmpui/radioitemdelegate.cpp b/src/qmmpui/radioitemdelegate.cpp index 1c1af928b..81d1fafad 100644 --- a/src/qmmpui/radioitemdelegate.cpp +++ b/src/qmmpui/radioitemdelegate.cpp @@ -89,7 +89,11 @@ bool RadioItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, QRect checkRect = qApp->style()->subElementRect(QStyle::SE_RadioButtonIndicator, &option); QMouseEvent *mouseEvent = dynamic_cast(event); - if (checkRect.contains(mouseEvent->pos()) && !index.data(Qt::CheckStateRole).toBool()) + + if(!checkRect.contains(mouseEvent->pos())) + return QStyledItemDelegate::editorEvent(event,model,option,index); + + if (!index.data(Qt::CheckStateRole).toBool()) { model->setData(index, Qt::Checked, Qt::CheckStateRole); QModelIndex parentItem = index.parent(); @@ -99,8 +103,8 @@ bool RadioItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, if (childIndex != index) model->setData(childIndex, Qt::Unchecked, Qt::CheckStateRole); } - return true; } + return true; } } return QStyledItemDelegate::editorEvent(event,model,option,index); -- cgit v1.2.3-13-gbd6f