Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
QmitkMemoryUsageIndicatorView.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QmitkMemoryUsageIndicatorView_h
14 #define QmitkMemoryUsageIndicatorView_h
15 
16 #include <MitkQtWidgetsExports.h>
17 
18 #include <QWidget>
19 
20 #include <array>
21 #include <utility>
22 
23 namespace Ui
24 {
25  class QmitkMemoryUsageIndicator;
26 }
27 
30 {
31  Q_OBJECT
32 
33 public:
34  QmitkMemoryUsageIndicatorView(QWidget* parent = nullptr);
36 
37 private:
38  void UpdateMemoryUsage();
39  std::string FormatMemorySize(size_t size);
40  std::string FormatPercentage(double val);
41  std::string GetMemoryDescription(size_t processSize, float percentage);
42 
43  Ui::QmitkMemoryUsageIndicator* m_Ui;
44  size_t m_PreviousState;
45  std::array<std::pair<float, QPixmap>, 4> m_States;
46 };
47 
48 #endif
MITKQTWIDGETS_EXPORT
#define MITKQTWIDGETS_EXPORT
Definition: MitkQtWidgetsExports.h:15
QmitkMemoryUsageIndicatorView
Definition: QmitkMemoryUsageIndicatorView.h:29
Ui
Definition: BlueBerryExampleLauncherDialog.h:21
MitkQtWidgetsExports.h