KFile
Go to the documentation of this file.
20 #ifndef KFILEPLACESVIEW_P_H
21 #define KFILEPLACESVIEW_P_H
23 #include <QMouseEvent>
36 return m_hoveredIndex;
41 return m_focusedIndex;
51 if (m_focusedIndex.isValid() && m_focusedIndex != m_hoveredIndex) {
54 if (index == m_hoveredIndex) {
55 m_focusedIndex = m_hoveredIndex;
58 if (index.isValid()) {
61 m_focusedIndex = index;
67 switch (event->type()) {
68 case QEvent::MouseMove: {
69 QAbstractItemView *view = qobject_cast<QAbstractItemView*>(watched->parent());
70 const QModelIndex index = view->indexAt(static_cast<QMouseEvent*>(event)->pos());
71 if (index != m_hoveredIndex) {
72 if (m_hoveredIndex.isValid() && m_hoveredIndex != m_focusedIndex) {
75 if (index.isValid() && index != m_focusedIndex) {
78 m_hoveredIndex = index;
83 if (m_hoveredIndex.isValid() && m_hoveredIndex != m_focusedIndex) {
86 m_hoveredIndex = QModelIndex();
88 case QEvent::MouseButtonPress:
89 case QEvent::MouseButtonDblClick: {
91 QAbstractItemView *view = qobject_cast<QAbstractItemView*>(watched->parent());
92 if (!view->indexAt(static_cast<QMouseEvent*>(event)->pos()).isValid()) {
105 QPersistentModelIndex m_hoveredIndex;
106 QPersistentModelIndex m_focusedIndex;
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Mon Jul 15 2013 13:10:50 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.