NorMIT-nav  18.04
An IGT application
cxSpaceEditWidget.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 CXSPACEEDITWIDGET_H
13 #define CXSPACEEDITWIDGET_H
14 
15 #include "cxResourceWidgetsExport.h"
16 
17 #include <QWidget>
18 #include <QSlider>
19 #include <QLineEdit>
20 #include <QLabel>
21 #include <QGridLayout>
22 #include "cxSpacePropertyBase.h"
23 #include "cxBaseWidget.h"
24 
25 namespace cx
26 {
27 
35 class cxResourceWidgets_EXPORT SpaceEditWidget: public BaseWidget
36 {
37 Q_OBJECT
38 public:
39  SpaceEditWidget(QWidget* parent, SpacePropertyBasePtr, QGridLayout* gridLayout = 0, int row = 0);
40  virtual ~SpaceEditWidget() {}
41 
42  void showLabel(bool on);
43 
44 protected:
45  QHBoxLayout* mTopLayout;
46 
47 private slots:
48  void prePaintEvent();
49  void comboIndexChanged();
50 
51 private:
52  void attemptSetValue(COORDINATE_SYSTEM id, QString ref);
53  void rebuildIdCombobox();
54  std::vector<COORDINATE_SYSTEM> getAvailableSpaceIds();
55  void rebuildRefCombobox();
56  QStringList getAvailableSpaceRefs(COORDINATE_SYSTEM id);
57  void setRefComboVisibilityQueued();
58 
59  QLabel* mLabel;
60  QComboBox* mIdCombo;
61  QComboBox* mRefCombo;
63 };
64 
65 } // namespace cx
66 
67 #endif // CXSPACEEDITWIDGET_H
Composite widget for string selection.
boost::shared_ptr< SpacePropertyBase > SpacePropertyBasePtr
QHBoxLayout * mTopLayout
Interface for QWidget which handles widgets uniformly for the system.
Definition: cxBaseWidget.h:88
Namespace for all CustusX production code.