Explicitly check whether a dragging is ongoing to decide whether a
tooltip may be shown or not, just using QApplication::mouseButtons()
is not sufficient when dragging between windows.
BUG: 294533
FIXED-IN: 4.8.1
m_tabsForFiles(false),
m_assureVisibleCurrentIndex(false),
m_isFolderWritable(true),
m_tabsForFiles(false),
m_assureVisibleCurrentIndex(false),
m_isFolderWritable(true),
m_url(url),
m_mode(DolphinView::IconsView),
m_additionalInfoList(),
m_url(url),
m_mode(DolphinView::IconsView),
m_additionalInfoList(),
}
KItemListView* view = controller->view();
}
KItemListView* view = controller->view();
+ view->installEventFilter(this);
connect(view, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)),
this, SLOT(slotSortOrderChangedByHeader(Qt::SortOrder,Qt::SortOrder)));
connect(view, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
connect(view, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)),
this, SLOT(slotSortOrderChangedByHeader(Qt::SortOrder,Qt::SortOrder)));
connect(view, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
+ case QEvent::GraphicsSceneDragEnter:
+ if (watched == m_container->controller()->view()) {
+ m_dragging = true;
+ }
+ break;
+
+ case QEvent::GraphicsSceneDragLeave:
+ if (watched == m_container->controller()->view()) {
+ m_dragging = false;
+ }
+ break;
+
+ case QEvent::GraphicsSceneDrop:
+ if (watched == m_container->controller()->view()) {
+ m_dragging = false;
+ }
{
const KFileItem item = fileItemModel()->fileItem(index);
{
const KFileItem item = fileItemModel()->fileItem(index);
- if (GeneralSettings::showToolTips() && hasFocus() && QApplication::mouseButtons() == Qt::NoButton) {
+ if (GeneralSettings::showToolTips() && !m_dragging) {
QRectF itemRect = m_container->controller()->view()->itemContextRect(index);
const QPoint pos = m_container->mapToGlobal(itemRect.topLeft().toPoint());
itemRect.moveTo(pos);
QRectF itemRect = m_container->controller()->view()->itemContextRect(index);
const QPoint pos = m_container->mapToGlobal(itemRect.topLeft().toPoint());
itemRect.moveTo(pos);
static QString fileSizeText(KIO::filesize_t fileSize);
private:
static QString fileSizeText(KIO::filesize_t fileSize);
private:
- bool m_active : 1;
- bool m_tabsForFiles : 1;
- bool m_assureVisibleCurrentIndex : 1;
- bool m_isFolderWritable : 1;
+ bool m_active;
+ bool m_tabsForFiles;
+ bool m_assureVisibleCurrentIndex;
+ bool m_isFolderWritable;
+ bool m_dragging; // True if a dragging is done. Required to be able to decide whether a
+ // tooltip may be shown when hovering an item.