17#ifndef QGSTASKMANAGERWIDGET_H
18#define QGSTASKMANAGERWIDGET_H
23#include <QStyledItemDelegate>
31class QgsTaskManagerModel;
55 void modelRowsInserted(
const QModelIndex &index,
int start,
int end );
56 void clicked(
const QModelIndex &index );
60 QTreeView *mTreeView =
nullptr;
61 QgsTaskManagerModel *mModel =
nullptr;
84 QgsTaskManagerFloatingWidget(
QgsTaskManager *manager, QWidget *parent =
nullptr );
94class GUI_EXPORT QgsTaskManagerStatusBarWidget :
public QToolButton
104 QgsTaskManagerStatusBarWidget(
QgsTaskManager *manager, QWidget *parent =
nullptr );
106 QSize sizeHint()
const override;
109 void changeEvent( QEvent *event )
override;
113 void toggleDisplay();
114 void overallProgressChanged(
double progress );
115 void countActiveTasksChanged(
int count );
120 QgsTaskManagerFloatingWidget *mFloatingWidget =
nullptr;
121 QProgressBar *mProgressBar =
nullptr;
131class GUI_EXPORT QgsTaskManagerModel :
public QAbstractItemModel
163 explicit QgsTaskManagerModel(
QgsTaskManager *manager, QObject *parent =
nullptr );
166 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
167 QModelIndex parent(
const QModelIndex &index )
const override;
168 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
169 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
170 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole )
const override;
171 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
172 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
178 QgsTask *indexToTask(
const QModelIndex &index )
const;
182 void taskAdded(
long id );
183 void taskDeleted(
long id );
184 void progressChanged(
long id,
double progress );
185 void statusChanged(
long id,
int status );
197 QList<long> mRowToTaskIdList;
200 int idToRow(
long id )
const;
201 QModelIndex idToIndex(
long id,
int column )
const;
202 static QString createTooltip(
QgsTask *task, ToolTipType type );
204 friend class QgsTaskManagerStatusBarWidget;
212class GUI_EXPORT QgsTaskStatusWidget :
public QWidget
224 QSize sizeHint()
const override;
233 void setStatus(
int status );
240 void cancelClicked();
243 void paintEvent( QPaintEvent *e )
override;
244 void mousePressEvent( QMouseEvent *e )
override;
245 void mouseMoveEvent( QMouseEvent *e )
override;
246 void leaveEvent( QEvent *e )
override;
251 bool mInside =
false;
Task manager for managing a set of long-running QgsTask tasks.
Abstract base class for long running background tasks.
TaskStatus
Status of tasks.
@ Queued
Task is queued and has not begun.
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
#define SIP_MONKEYPATCH_COMPAT_NAME(FORMERNAME)