17#ifndef QGSTASKMANAGERWIDGET_H
18#define QGSTASKMANAGERWIDGET_H
23#include <QStyledItemDelegate>
31class QgsTaskManagerModel;
56 void modelRowsInserted(
const QModelIndex &index,
int start,
int end );
57 void clicked(
const QModelIndex &index );
62 QTreeView *mTreeView =
nullptr;
63 QgsTaskManagerModel *mModel =
nullptr;
87 QgsTaskManagerFloatingWidget(
QgsTaskManager *manager, QWidget *parent =
nullptr );
98class GUI_EXPORT QgsTaskManagerStatusBarWidget :
public QToolButton
109 QgsTaskManagerStatusBarWidget(
QgsTaskManager *manager, QWidget *parent =
nullptr );
111 QSize sizeHint()
const override;
115 void changeEvent( QEvent *event )
override;
119 void toggleDisplay();
120 void overallProgressChanged(
double progress );
121 void countActiveTasksChanged(
int count );
127 QgsTaskManagerFloatingWidget *mFloatingWidget =
nullptr;
128 QProgressBar *mProgressBar =
nullptr;
138class GUI_EXPORT QgsTaskManagerModel:
public QAbstractItemModel
171 explicit QgsTaskManagerModel(
QgsTaskManager *manager, QObject *parent =
nullptr );
174 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
175 QModelIndex parent(
const QModelIndex &index )
const override;
176 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
177 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
178 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole )
const override;
179 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
180 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
186 QgsTask *indexToTask(
const QModelIndex &index )
const;
190 void taskAdded(
long id );
191 void taskDeleted(
long id );
192 void progressChanged(
long id,
double progress );
193 void statusChanged(
long id,
int status );
206 QList< long > mRowToTaskIdList;
209 int idToRow(
long id )
const;
210 QModelIndex idToIndex(
long id,
int column )
const;
211 static QString createTooltip(
QgsTask *task, ToolTipType type );
213 friend class QgsTaskManagerStatusBarWidget;
221class GUI_EXPORT QgsTaskStatusWidget :
public QWidget
234 QSize sizeHint()
const override;
243 void setStatus(
int status );
250 void cancelClicked();
254 void paintEvent( QPaintEvent *e )
override;
255 void mousePressEvent( QMouseEvent *e )
override;
256 void mouseMoveEvent( QMouseEvent *e )
override;
257 void leaveEvent( QEvent *e )
override;
263 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)