NorMIT-nav  2023.01.05-dev+develop.0da12
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
cx::XmlOptionFile
Helper class for xml files used to store ssc/cx data.
Definition: cxXmlOptionItem.h:78
cx::ControllableSplitter::~ControllableSplitter
~ControllableSplitter()
Definition: cxControllableSplitter.cpp:43
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cxXmlOptionItem.h
cx::ControllableSplitter::addLeftWidget
void addLeftWidget(QWidget *widget, QString name)
Definition: cxControllableSplitter.cpp:59
cx::ControllableSplitter::getMoveRightAction
QAction * getMoveRightAction()
Definition: cxControllableSplitter.cpp:91
cx::ControllableSplitter::addRightWidget
void addRightWidget(QWidget *widget, QString name)
Definition: cxControllableSplitter.cpp:64
cx::ControllableSplitter::getMoveLeftAction
QAction * getMoveLeftAction()
Definition: cxControllableSplitter.cpp:76
cx::XmlOptionItem
Helper class for storing one string value in an xml document.
Definition: cxXmlOptionItem.h:38
cx::ControllableSplitter
Definition: cxControllableSplitter.h:25
cx::ControllableSplitter::ControllableSplitter
ControllableSplitter(XmlOptionFile options, QWidget *parent)
Definition: cxControllableSplitter.cpp:22