diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2012-12-05 17:02:09 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2012-12-05 17:02:09 +0000 |
| commit | e36e315d55c42b4d17f3065661a3e8e1a97e1c7f (patch) | |
| tree | 7afb19cfa9e7013e51cd6dfc6b35f689236205e3 /src/qmmpui/radioitemdelegate.cpp | |
| parent | c042c10a3105ae5ac862c22d0598da1053b983bc (diff) | |
| download | qmmp-e36e315d55c42b4d17f3065661a3e8e1a97e1c7f.tar.gz qmmp-e36e315d55c42b4d17f3065661a3e8e1a97e1c7f.tar.bz2 qmmp-e36e315d55c42b4d17f3065661a3e8e1a97e1c7f.zip | |
fixed radio button delegate
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3023 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/radioitemdelegate.cpp')
| -rw-r--r-- | src/qmmpui/radioitemdelegate.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/qmmpui/radioitemdelegate.cpp b/src/qmmpui/radioitemdelegate.cpp index 81d1fafad..a65930f7b 100644 --- a/src/qmmpui/radioitemdelegate.cpp +++ b/src/qmmpui/radioitemdelegate.cpp @@ -82,16 +82,19 @@ QSize RadioItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QMod bool RadioItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) { - if (event->type() == QEvent::MouseButtonRelease) + if (event->type() == QEvent::MouseButtonRelease || event->type() == QEvent::KeyPress) { if (hasRadioButton(index)) { - QRect checkRect = qApp->style()->subElementRect(QStyle::SE_RadioButtonIndicator, &option); + if(event->type() == QEvent::MouseButtonRelease) + { + QRect checkRect = qApp->style()->subElementRect(QStyle::SE_RadioButtonIndicator, &option); - QMouseEvent *mouseEvent = dynamic_cast<QMouseEvent*>(event); + QMouseEvent *mouseEvent = dynamic_cast<QMouseEvent*>(event); - if(!checkRect.contains(mouseEvent->pos())) - return QStyledItemDelegate::editorEvent(event,model,option,index); + if(!checkRect.contains(mouseEvent->pos())) + return QStyledItemDelegate::editorEvent(event,model,option,index); + } if (!index.data(Qt::CheckStateRole).toBool()) { |
