X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/d7b33b76a18b14e9f286e4d8326b00910b9ea02a..e9bd295b:/src/kitemviews/kitemlistcontroller.h diff --git a/src/kitemviews/kitemlistcontroller.h b/src/kitemviews/kitemlistcontroller.h index d929027b7..5fe195e9f 100644 --- a/src/kitemviews/kitemlistcontroller.h +++ b/src/kitemviews/kitemlistcontroller.h @@ -9,6 +9,8 @@ #ifndef KITEMLISTCONTROLLER_H #define KITEMLISTCONTROLLER_H +#include + #include "dolphin_export.h" #include "kitemset.h" @@ -32,6 +34,7 @@ class QInputMethodEvent; class QKeyEvent; class QTapGesture; class QTransform; +class QTouchEvent; /** * @brief Controls the view, model and selection of an item-list. @@ -125,7 +128,7 @@ public: bool processEvent(QEvent* event, const QTransform& transform); -signals: +Q_SIGNALS: /** * Is emitted if exactly one item has been activated by e.g. a mouse-click * or by pressing Return/Enter. @@ -136,7 +139,7 @@ signals: * Is emitted if more than one item has been activated by pressing Return/Enter * when having a selection. */ - void itemsActivated(const KItemSet& indexes); + void itemsActivated(const KItemSet &indexes); void itemMiddleClicked(int index); @@ -216,10 +219,10 @@ signals: void decreaseZoom(); void swipeUp(); -public slots: +public Q_SLOTS: void slotStateChanged(QScroller::State newState); -private slots: +private Q_SLOTS: void slotViewScrollOffsetChanged(qreal current, qreal previous); /** @@ -301,6 +304,7 @@ private: bool wheelEvent(QGraphicsSceneWheelEvent* event, const QTransform& transform); bool resizeEvent(QGraphicsSceneResizeEvent* event, const QTransform& transform); bool gestureEvent(QGestureEvent* event, const QTransform& transform); + bool touchBeginEvent(QTouchEvent* event, const QTransform& transform); void tapTriggered(QTapGesture* tap, const QTransform& transform); void tapAndHoldTriggered(QGestureEvent* event, const QTransform& transform); void pinchTriggered(QGestureEvent* event, const QTransform& transform); @@ -319,6 +323,7 @@ private: bool m_scrollerIsScrolling; bool m_pinchGestureInProgress; bool m_mousePress; + bool m_isTouchEvent; SelectionBehavior m_selectionBehavior; AutoActivationBehavior m_autoActivationBehavior; MouseDoubleClickAction m_mouseDoubleClickAction; @@ -326,14 +331,13 @@ private: KItemListView* m_view; KItemListSelectionManager* m_selectionManager; KItemListKeyboardSearchManager* m_keyboardManager; - int m_pressedIndex; + std::optional m_pressedIndex; QPointF m_pressedMousePos; QTimer* m_autoActivationTimer; Qt::GestureType m_swipeGesture; Qt::GestureType m_twoFingerTapGesture; - Qt::MouseEventSource m_lastSource; /** * When starting a rubberband selection during a Shift- or Control-key has been