27 lines
599 B
C++
27 lines
599 B
C++
// SPDX-License-Identifier: MIT
|
|
|
|
#pragma once
|
|
|
|
#include <QAbstractItemModel>
|
|
#include <QPersistentModelIndex>
|
|
|
|
// A preview is not an activation: only the final selection enters focus history.
|
|
class PendingSelection : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit PendingSelection(QAbstractItemModel &model);
|
|
void select(const QModelIndex &task, bool defer);
|
|
void finish();
|
|
void cancel();
|
|
|
|
Q_SIGNALS:
|
|
void previewRequested(const QModelIndex &task);
|
|
void previewHidden();
|
|
void activationRequested(const QModelIndex &task);
|
|
|
|
private:
|
|
QPersistentModelIndex m_task;
|
|
};
|