LeechCraft
0.6.70-19214-g121e5318a7
Modular cross-platform feature rich live environment.
Toggle main menu visibility
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
15
class
QAbstractItemView;
16
17
namespace
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:
70
void
gestureStarted
();
71
80
void
selectionStartedChanging
();
81
91
void
selectionChanging
();
92
102
void
selectionSettled
(
const
QModelIndexList& rows,
const
QModelIndex& current);
103
};
104
}
LC::Util::ViewSelectionTracker::selectionSettled
void selectionSettled(const QModelIndexList &rows, const QModelIndex ¤t)
Emitted from a clean stack once the selection has settled.
LC::Util::ViewSelectionTracker::eventFilter
bool eventFilter(QObject *, QEvent *) override
Definition
viewselectiontracker.cpp:38
LC::Util::ViewSelectionTracker::gestureStarted
void gestureStarted()
Emitted on a left mouse button press on the view's viewport.
LC::Util::ViewSelectionTracker::ViewSelectionTracker
ViewSelectionTracker(QAbstractItemView &, QObject *=nullptr)
Definition
viewselectiontracker.cpp:17
LC::Util::ViewSelectionTracker::selectionChanging
void selectionChanging()
Emitted from a clean stack whenever the selection or the current row changes, or the model is reset.
LC::Util::ViewSelectionTracker::EndGesture
void EndGesture()
Ends the current left mouse button gesture, if any.
Definition
viewselectiontracker.cpp:64
LC::Util::ViewSelectionTracker::selectionStartedChanging
void selectionStartedChanging()
Emitted synchronously when a change is detected that selectionChanging() will report.
guiconfig.h
UTIL_GUI_API
#define UTIL_GUI_API
Definition
guiconfig.h:16
LC::Util
Definition
icoreproxy.h:34
src
util
gui
viewselectiontracker.h
Generated by
1.18.0