diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2012-08-30 12:25:29 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2012-08-30 12:25:29 +0000 |
| commit | a2d9b99ce5d1af49e3bfd9493a9c25176b4e2309 (patch) | |
| tree | 8e9059873d8ab5004263c7e91b47545124fbf408 /src | |
| parent | e7941e2b101dc7cf0923ef8b7f76ef816577b377 (diff) | |
| download | qmmp-a2d9b99ce5d1af49e3bfd9493a9c25176b4e2309.tar.gz qmmp-a2d9b99ce5d1af49e3bfd9493a9c25176b4e2309.tar.bz2 qmmp-a2d9b99ce5d1af49e3bfd9493a9c25176b4e2309.zip | |
fixed radio buttons behaviour
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2911 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
| -rw-r--r-- | src/qmmpui/radioitemdelegate.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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<QMouseEvent*>(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); |
