17 #ifndef QGSTASKMANAGERWIDGET_H 18 #define QGSTASKMANAGERWIDGET_H 23 #include <QStyledItemDelegate> 24 #include <QToolButton> 31 class QgsTaskManagerModel;
57 void modelRowsInserted(
const QModelIndex &index,
int start,
int end );
58 void clicked(
const QModelIndex &index );
63 QTreeView *mTreeView =
nullptr;
64 QgsTaskManagerModel *mModel =
nullptr;
89 QgsTaskManagerFloatingWidget(
QgsTaskManager *manager, QWidget *parent =
nullptr );
101 class GUI_EXPORT QgsTaskManagerStatusBarWidget :
public QToolButton
112 QgsTaskManagerStatusBarWidget(
QgsTaskManager *manager, QWidget *parent =
nullptr );
114 QSize sizeHint()
const override;
118 void toggleDisplay();
119 void overallProgressChanged(
double progress );
120 void countActiveTasksChanged(
int count );
126 QgsTaskManagerFloatingWidget *mFloatingWidget =
nullptr;
127 QProgressBar *mProgressBar =
nullptr;
138 class GUI_EXPORT QgsTaskManagerModel:
public QAbstractItemModel
156 explicit QgsTaskManagerModel(
QgsTaskManager *manager, QObject *parent =
nullptr );
159 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
160 QModelIndex parent(
const QModelIndex &index )
const override;
161 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
162 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
163 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole )
const override;
164 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
165 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
171 QgsTask *indexToTask(
const QModelIndex &index )
const;
176 StatusRole = Qt::UserRole,
181 void taskAdded(
long id );
182 void taskDeleted(
long id );
183 void progressChanged(
long id,
double progress );
184 void statusChanged(
long id,
int status );
190 QList< long > mRowToTaskIdList;
193 int idToRow(
long id )
const;
194 QModelIndex idToIndex(
long id,
int column )
const;
203 class GUI_EXPORT QgsTaskStatusWidget :
public QWidget
216 QSize sizeHint()
const override;
225 void setStatus(
int status );
232 void cancelClicked();
236 void paintEvent( QPaintEvent *e )
override;
237 void mousePressEvent( QMouseEvent *e )
override;
238 void mouseMoveEvent( QMouseEvent *e )
override;
239 void leaveEvent( QEvent *e )
override;
245 bool mInside =
false;
253 #endif //QGSTASKMANAGERWIDGET_H
TaskStatus
Status of tasks.
Abstract base class for long running background tasks.
Task manager for managing a set of long-running QgsTask tasks.
Task is queued and has not begun.