Fraxinus  18.10
An IGT application
cxControllableSplitter.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 #ifndef CXCONTROLLABLESPLITTER_H
12 #define CXCONTROLLABLESPLITTER_H
13 
14 #include "cxXmlOptionItem.h"
15 #include <QWidget>
16 class QSplitter;
17 
18 namespace cx
19 {
20 
25 class ControllableSplitter : public QWidget
26 {
27  Q_OBJECT
28 public:
29  ControllableSplitter(XmlOptionFile options, QWidget* parent);
31  void addLeftWidget(QWidget* widget, QString name);
32  void addRightWidget(QWidget* widget, QString name);
33  QAction* getMoveLeftAction();
34  QAction* getMoveRightAction();
35 
36 private slots:
37  void initializeSettings();
38 
39 private:
40  void onMoveSplitterLeft();
41  void onMoveSplitterRight();
42  void shiftSplitter(int shift);
43  bool splitterShowsBoth() const;
44  void onSplitterMoved();
45 
46  int getShiftState() const;
47  void setShiftState(int shiftState);
48  void enableActions();
49 
50  XmlOptionItem getSplitterRatioOption();
51  XmlOptionItem getShiftStateOption();
52 
53  QSplitter* mSplitter;
54  QAction* mShiftSplitterLeft;
55  QAction* mShiftSplitterRight;
56  XmlOptionFile mOptions;
57  QString mLeftName;
58  QString mRightName;
59 
60  double mSplitterRatio;
61 };
62 
63 }//end namespace cx
64 
65 #endif // CXCONTROLLABLESPLITTER_H
void addLeftWidget(QWidget *widget, QString name)
Helper class for storing one string value in an xml document.
ControllableSplitter(XmlOptionFile options, QWidget *parent)
void addRightWidget(QWidget *widget, QString name)
Helper class for xml files used to store ssc/cx data.
Namespace for all CustusX production code.