NorMIT-nav  22.09
An IGT application
cxPresetWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXPRESETWIDGET_H_
13 #define CXPRESETWIDGET_H_
14 
15 #include "cxResourceWidgetsExport.h"
16 
17 #include "cxBaseWidget.h"
18 #include "cxPresets.h"
19 
20 class QComboBox;
21 
22 namespace cx {
23 
34 class cxResourceWidgets_EXPORT PresetWidget : public BaseWidget
35 {
36  Q_OBJECT
37 
38 public:
39  PresetWidget(QWidget* parent);
40  virtual ~PresetWidget(){};
41 
42  bool requestSetCurrentPreset(QString name);
43  QString getCurrentPreset();
44  void showDetailed(bool detailed);
45 
46  virtual void setPresets(PresetsPtr presets);
47 
48  QString getLastUsedPresetNameFromSettingsFile() const;
49 
50 signals:
51  void presetSelected(QString name);
52 
53 public slots:
54  virtual void resetSlot();
55  virtual void saveSlot();
56  virtual void deleteSlot();
57  virtual void populatePresetListSlot();
58 
59 protected slots:
60  virtual void presetsBoxChangedSlot(const QString&);
61 
62 protected:
63  virtual void populateButtonLayout();
64  void populatePresetList(QStringList list);
65  QString getNewPresetName(bool withoutSpaces);
66 
67  QActionGroup* mActionGroup;
69 
70 private:
71  void selectLastUsedPreset();
72  QComboBox* mPresetsComboBox;
73  QHBoxLayout* mButtonLayout;
74  QVBoxLayout* mLayout;
75 };
76 
77 } /* namespace cx */
78 #endif /* CXPRESETWIDGET_H_ */
cxPresets.h
cxBaseWidget.h
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::BaseWidget
Interface for QWidget which handles widgets uniformly for the system.
Definition: cxBaseWidget.h:88
cx::PresetWidget
Base class for preset handling. Takes care of making a uniform preset system. Contains a preset selec...
Definition: cxPresetWidget.h:34
cx::PresetWidget::mPresets
PresetsPtr mPresets
Definition: cxPresetWidget.h:68
cx::PresetsPtr
boost::shared_ptr< class Presets > PresetsPtr
Definition: cxForwardDeclarations.h:159
cx::PresetWidget::mActionGroup
QActionGroup * mActionGroup
contains all actions that will have buttons
Definition: cxPresetWidget.h:67
cx::PresetWidget::~PresetWidget
virtual ~PresetWidget()
Definition: cxPresetWidget.h:40