LeechCraft 0.6.70-19214-g121e5318a7
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
viewselectiontracker.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11#include <QModelIndexList>
12#include <QObject>
13#include "guiconfig.h"
14
15class QAbstractItemView;
16
17namespace LC::Util
18{
41 class UTIL_GUI_API ViewSelectionTracker : public QObject
42 {
43 Q_OBJECT
44
45 QAbstractItemView& View_;
46 bool ScheduledSyncToSelection_ = false;
47 bool SelectionDirty_ = false;
48 bool GestureActive_ = false;
49 public:
50 explicit ViewSelectionTracker (QAbstractItemView&, QObject* = nullptr);
51
52 bool eventFilter (QObject*, QEvent*) override;
53
62 void EndGesture ();
63 private:
64 void HandleSelectionChange ();
65 void ScheduleSyncToSelection ();
66 void SyncToSelection ();
67 signals:
71
81
92
102 void selectionSettled (const QModelIndexList& rows, const QModelIndex& current);
103 };
104}
void selectionSettled(const QModelIndexList &rows, const QModelIndex &current)
Emitted from a clean stack once the selection has settled.
bool eventFilter(QObject *, QEvent *) override
void gestureStarted()
Emitted on a left mouse button press on the view's viewport.
ViewSelectionTracker(QAbstractItemView &, QObject *=nullptr)
void selectionChanging()
Emitted from a clean stack whenever the selection or the current row changes, or the model is reset.
void EndGesture()
Ends the current left mouse button gesture, if any.
void selectionStartedChanging()
Emitted synchronously when a change is detected that selectionChanging() will report.
#define UTIL_GUI_API
Definition guiconfig.h:16