QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
projectusagetracker.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2026 The QElectroTech Team
3 This file is part of QElectroTech.
4
5 QElectroTech is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9
10 QElectroTech is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef PROJECTUSAGETRACKER_H
19#define PROJECTUSAGETRACKER_H
20
21#include <QElapsedTimer>
22
23class QDomElement;
24
36{
37 public:
39
40 qint64 secondsSpent() const;
41 void resetSecondsSpent();
42
43 bool isEnabled() const {return m_enabled;}
44 void setEnabled(bool enabled);
45
46 void setActive(bool active);
47
48 void toXml(QDomElement &parent_element) const;
49 void fromXml(const QDomElement &parent_element);
50
51 private:
52 qint64 m_seconds_spent = 0;
53 bool m_enabled = true;
54 bool m_active = false;
55 QElapsedTimer m_elapsed_timer;
56};
57
58#endif // PROJECTUSAGETRACKER_H
qint64 m_seconds_spent
Definition projectusagetracker.h:52
void setEnabled(bool enabled)
ProjectUsageTracker::setEnabled Enable or disable time tracking for this project. Disabling while cur...
Definition projectusagetracker.cpp:56
ProjectUsageTracker()=default
void setActive(bool active)
ProjectUsageTracker::setActive Tell the tracker whether this project's tab is currently the active on...
Definition projectusagetracker.cpp:77
bool m_active
Definition projectusagetracker.h:54
bool isEnabled() const
Definition projectusagetracker.h:43
qint64 secondsSpent() const
ProjectUsageTracker::secondsSpent.
Definition projectusagetracker.cpp:27
void toXml(QDomElement &parent_element) const
ProjectUsageTracker::toXml Append a <usage> child element to parent_element with the current accumula...
Definition projectusagetracker.cpp:98
void resetSecondsSpent()
ProjectUsageTracker::resetSecondsSpent Zero the accumulated time. If the tracker is currently timing,...
Definition projectusagetracker.cpp:41
bool m_enabled
Definition projectusagetracker.h:53
QElapsedTimer m_elapsed_timer
Definition projectusagetracker.h:55
void fromXml(const QDomElement &parent_element)
ProjectUsageTracker::fromXml Read the <usage> child element of parent_element, if any.
Definition projectusagetracker.cpp:112