Changeset View
Changeset View
Standalone View
Standalone View
src/kitemviews/kitemlistcontroller.h
Show All 34 Lines | |||||
35 | class KItemListSelectionManager; | 35 | class KItemListSelectionManager; | ||
36 | class KItemListView; | 36 | class KItemListView; | ||
37 | class KItemListWidget; | 37 | class KItemListWidget; | ||
38 | class QGraphicsSceneHoverEvent; | 38 | class QGraphicsSceneHoverEvent; | ||
39 | class QGraphicsSceneDragDropEvent; | 39 | class QGraphicsSceneDragDropEvent; | ||
40 | class QGraphicsSceneMouseEvent; | 40 | class QGraphicsSceneMouseEvent; | ||
41 | class QGraphicsSceneResizeEvent; | 41 | class QGraphicsSceneResizeEvent; | ||
42 | class QGraphicsSceneWheelEvent; | 42 | class QGraphicsSceneWheelEvent; | ||
43 | class QHideEvent; | | |||
44 | class QInputMethodEvent; | 43 | class QInputMethodEvent; | ||
45 | class QKeyEvent; | 44 | class QKeyEvent; | ||
46 | class QShowEvent; | | |||
47 | class QTransform; | 45 | class QTransform; | ||
48 | 46 | | |||
49 | /** | 47 | /** | ||
50 | * @brief Controls the view, model and selection of an item-list. | 48 | * @brief Controls the view, model and selection of an item-list. | ||
51 | * | 49 | * | ||
52 | * For a working item-list it is mandatory to set a compatible view and model | 50 | * For a working item-list it is mandatory to set a compatible view and model | ||
53 | * with KItemListController::setView() and KItemListController::setModel(). | 51 | * with KItemListController::setView() and KItemListController::setModel(). | ||
54 | * | 52 | * | ||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Line(s) | 66 | public: | |||
131 | /** | 129 | /** | ||
132 | * If set to true, the signals itemActivated() and itemsActivated() are emitted | 130 | * If set to true, the signals itemActivated() and itemsActivated() are emitted | ||
133 | * after a single-click of the left mouse button. If set to false (the default), | 131 | * after a single-click of the left mouse button. If set to false (the default), | ||
134 | * the setting from style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick) is used. | 132 | * the setting from style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick) is used. | ||
135 | */ | 133 | */ | ||
136 | void setSingleClickActivationEnforced(bool singleClick); | 134 | void setSingleClickActivationEnforced(bool singleClick); | ||
137 | bool singleClickActivationEnforced() const; | 135 | bool singleClickActivationEnforced() const; | ||
138 | 136 | | |||
139 | virtual bool showEvent(QShowEvent* event); | 137 | bool processEvent(QEvent* event, const QTransform& transform); | ||
140 | virtual bool hideEvent(QHideEvent* event); | | |||
141 | virtual bool keyPressEvent(QKeyEvent* event); | | |||
142 | virtual bool inputMethodEvent(QInputMethodEvent* event); | | |||
143 | virtual bool mousePressEvent(QGraphicsSceneMouseEvent* event, const QTransform& transform); | | |||
144 | virtual bool mouseMoveEvent(QGraphicsSceneMouseEvent* event, const QTransform& transform); | | |||
145 | virtual bool mouseReleaseEvent(QGraphicsSceneMouseEvent* event, const QTransform& transform); | | |||
146 | virtual bool mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event, const QTransform& transform); | | |||
147 | virtual bool dragEnterEvent(QGraphicsSceneDragDropEvent* event, const QTransform& transform); | | |||
148 | virtual bool dragLeaveEvent(QGraphicsSceneDragDropEvent* event, const QTransform& transform); | | |||
149 | virtual bool dragMoveEvent(QGraphicsSceneDragDropEvent* event, const QTransform& transform); | | |||
150 | virtual bool dropEvent(QGraphicsSceneDragDropEvent* event, const QTransform& transform); | | |||
151 | virtual bool hoverEnterEvent(QGraphicsSceneHoverEvent* event, const QTransform& transform); | | |||
152 | virtual bool hoverMoveEvent(QGraphicsSceneHoverEvent* event, const QTransform& transform); | | |||
153 | virtual bool hoverLeaveEvent(QGraphicsSceneHoverEvent* event, const QTransform& transform); | | |||
154 | virtual bool wheelEvent(QGraphicsSceneWheelEvent* event, const QTransform& transform); | | |||
155 | virtual bool resizeEvent(QGraphicsSceneResizeEvent* event, const QTransform& transform); | | |||
156 | virtual bool processEvent(QEvent* event, const QTransform& transform); | | |||
157 | 138 | | |||
158 | signals: | 139 | signals: | ||
159 | /** | 140 | /** | ||
160 | * Is emitted if exactly one item has been activated by e.g. a mouse-click | 141 | * Is emitted if exactly one item has been activated by e.g. a mouse-click | ||
161 | * or by pressing Return/Enter. | 142 | * or by pressing Return/Enter. | ||
162 | */ | 143 | */ | ||
163 | void itemActivated(int index); | 144 | void itemActivated(int index); | ||
164 | 145 | | |||
▲ Show 20 Lines • Show All 137 Lines • ▼ Show 20 Line(s) | 238 | private: | |||
302 | 283 | | |||
303 | /** | 284 | /** | ||
304 | * Dependent on the selection-behavior the extendedSelectionRegion-property | 285 | * Dependent on the selection-behavior the extendedSelectionRegion-property | ||
305 | * of the KItemListStyleOption from the view should be adjusted: If no | 286 | * of the KItemListStyleOption from the view should be adjusted: If no | ||
306 | * rubberband selection is used the property should be enabled. | 287 | * rubberband selection is used the property should be enabled. | ||
307 | */ | 288 | */ | ||
308 | void updateExtendedSelectionRegion(); | 289 | void updateExtendedSelectionRegion(); | ||
309 | 290 | | |||
291 | bool keyPressEvent(QKeyEvent* event); | ||||
292 | bool inputMethodEvent(QInputMethodEvent* event); | ||||
293 | bool mousePressEvent(QGraphicsSceneMouseEvent* event, const QTransform& transform); | ||||
294 | bool mouseMoveEvent(QGraphicsSceneMouseEvent* event, const QTransform& transform); | ||||
295 | bool mouseReleaseEvent(QGraphicsSceneMouseEvent* event, const QTransform& transform); | ||||
296 | bool mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event, const QTransform& transform); | ||||
297 | bool dragEnterEvent(QGraphicsSceneDragDropEvent* event, const QTransform& transform); | ||||
298 | bool dragLeaveEvent(QGraphicsSceneDragDropEvent* event, const QTransform& transform); | ||||
299 | bool dragMoveEvent(QGraphicsSceneDragDropEvent* event, const QTransform& transform); | ||||
300 | bool dropEvent(QGraphicsSceneDragDropEvent* event, const QTransform& transform); | ||||
301 | bool hoverEnterEvent(QGraphicsSceneHoverEvent* event, const QTransform& transform); | ||||
302 | bool hoverMoveEvent(QGraphicsSceneHoverEvent* event, const QTransform& transform); | ||||
303 | bool hoverLeaveEvent(QGraphicsSceneHoverEvent* event, const QTransform& transform); | ||||
304 | bool wheelEvent(QGraphicsSceneWheelEvent* event, const QTransform& transform); | ||||
305 | bool resizeEvent(QGraphicsSceneResizeEvent* event, const QTransform& transform); | ||||
306 | | ||||
310 | private: | 307 | private: | ||
311 | bool m_singleClickActivationEnforced; | 308 | bool m_singleClickActivationEnforced; | ||
312 | bool m_selectionTogglePressed; | 309 | bool m_selectionTogglePressed; | ||
313 | bool m_clearSelectionIfItemsAreNotDragged; | 310 | bool m_clearSelectionIfItemsAreNotDragged; | ||
314 | SelectionBehavior m_selectionBehavior; | 311 | SelectionBehavior m_selectionBehavior; | ||
315 | AutoActivationBehavior m_autoActivationBehavior; | 312 | AutoActivationBehavior m_autoActivationBehavior; | ||
316 | MouseDoubleClickAction m_mouseDoubleClickAction; | 313 | MouseDoubleClickAction m_mouseDoubleClickAction; | ||
317 | KItemModelBase* m_model; | 314 | KItemModelBase* m_model; | ||
Show All 37 Lines |