Fix action selection when index's children not yet loaded

#721
This commit is contained in:
Craig Drummond
2015-08-11 19:46:42 +01:00
parent b82483b791
commit 2079cfaa66

View File

@@ -162,7 +162,7 @@ QAction * ActionItemDelegate::getAction(const QModelIndex &index) const
bool rtl = QApplication::isRightToLeft();
QListView *lv=qobject_cast<QListView *>(view);
GroupedView *gv=lv ? 0 : qobject_cast<GroupedView *>(view);
ActionPos actionPos=gv ? AP_HBottom : (lv && QListView::ListMode!=lv->viewMode() && index.child(0, 0).isValid() ? AP_VTop : AP_HMiddle);
ActionPos actionPos=gv ? AP_HBottom : (lv && QListView::ListMode!=lv->viewMode() && (index.child(0, 0).isValid() || index.model()->canFetchMore(index)) ? AP_VTop : AP_HMiddle);
QRect rect = view->visualRect(index);
rect.moveTo(view->viewport()->mapToGlobal(QPoint(rect.x(), rect.y())));
bool showCapacity = !index.data(Cantata::Role_CapacityText).toString().isEmpty();