From 7839c4ecc01aad4c5d34a6d06b2dfc4afdc58458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Tue, 4 Feb 2014 01:40:51 +0100 Subject: Pave. --- depends/groupview/main.h | 54 ------------------------------------------------ 1 file changed, 54 deletions(-) delete mode 100644 depends/groupview/main.h (limited to 'depends/groupview/main.h') diff --git a/depends/groupview/main.h b/depends/groupview/main.h deleted file mode 100644 index 2a358329..00000000 --- a/depends/groupview/main.h +++ /dev/null @@ -1,54 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include - -#include "GroupView.h" - -class Progresser : public QObject -{ - Q_OBJECT -public: - explicit Progresser(QObject *parent = 0) : QObject(parent) - { - QTimer *timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), this, SLOT(timeout())); - timer->start(50); - } - - QStandardItem *addTrackedIndex(QStandardItem *item) - { - item->setData(1000, GroupViewRoles::ProgressMaximumRole); - m_items.append(item); - return item; - } - -public -slots: - void timeout() - { - QList toRemove; - for (auto item : m_items) - { - int maximum = item->data(GroupViewRoles::ProgressMaximumRole).toInt(); - int value = item->data(GroupViewRoles::ProgressValueRole).toInt(); - int newvalue = std::min(value + 3, maximum); - item->setData(newvalue, GroupViewRoles::ProgressValueRole); - - if(newvalue >= maximum) - { - toRemove.append(item); - } - } - for(auto remove : toRemove) - { - m_items.removeAll(remove); - } - } - -private: - QList m_items; -}; -- cgit v1.2.3