Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
qSlicerGPUMemoryComboBox.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
4 Queen's University, Kingston, ON, Canada. All Rights Reserved.
5
6 See COPYRIGHT.txt
7 or http://www.slicer.org/copyright/copyright.txt for details.
8
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14
15 This file was originally developed by Csaba Pinter, PerkLab, Queen's University
16 and was supported through CANARIE's Research Software Program, and Cancer
17 Care Ontario.
18
19==============================================================================*/
20
21#ifndef __qSlicerGPUMemoryComboBox_h
22#define __qSlicerGPUMemoryComboBox_h
23
24// Qt includes
25#include <QComboBox>
26
27// Slicer includes
28#include "qSlicerVolumeRenderingModuleWidgetsExport.h"
29
30class qSlicerGPUMemoryComboBoxPrivate;
31
32class Q_SLICER_MODULE_VOLUMERENDERING_WIDGETS_EXPORT qSlicerGPUMemoryComboBox
33 : public QComboBox
34{
35 Q_OBJECT
38
39public:
41 typedef QComboBox Superclass;
42 explicit qSlicerGPUMemoryComboBox(QWidget* parent=nullptr);
44
46 Q_INVOKABLE int totalGPUMemoryInMB()const;
48 Q_INVOKABLE double currentGPUMemory()const;
50 Q_INVOKABLE int currentGPUMemoryInMB()const;
52 Q_INVOKABLE QString currentGPUMemoryAsString()const;
53
54public slots:
56 void setCurrentGPUMemory(double memory);
59 void setCurrentGPUMemoryFromString(const QString& memoryString);
60
61protected:
62 QScopedPointer<qSlicerGPUMemoryComboBoxPrivate> d_ptr;
63
64private:
65 Q_DECLARE_PRIVATE(qSlicerGPUMemoryComboBox);
66 Q_DISABLE_COPY(qSlicerGPUMemoryComboBox);
67};
68
69#endif
Q_INVOKABLE int currentGPUMemoryInMB() const
Return currently selected GPU memory in MB.
void setCurrentGPUMemoryFromString(const QString &memoryString)
Q_INVOKABLE QString currentGPUMemoryAsString() const
Return currently selected GPU memory as string.
QScopedPointer< qSlicerGPUMemoryComboBoxPrivate > d_ptr
QComboBox Superclass
Constructors.
void setCurrentGPUMemory(double memory)
Set currently selected GPU memory in MB or percentage (% value between 0-1)
Q_INVOKABLE int totalGPUMemoryInMB() const
Return total memory available in the GPU.
qSlicerGPUMemoryComboBox(QWidget *parent=nullptr)