workspace.h 1.19 KB
Newer Older
Tobias WEBER's avatar
Tobias WEBER committed
1
/**
Tobias WEBER's avatar
date    
Tobias WEBER committed
2
 * workspace
Tobias WEBER's avatar
Tobias WEBER committed
3
 * @author Tobias Weber <tweber@ill.fr>
Tobias WEBER's avatar
date    
Tobias WEBER committed
4
 * @date 25-May-2018
Tobias WEBER's avatar
Tobias WEBER committed
5
6
7
8
9
10
11
12
13
14
15
 * @license see 'LICENSE' file
 */

#ifndef __WORKSPACE_H__
#define __WORKSPACE_H__

#include <QtCore/QSettings>
#include <QtWidgets/QWidget>
#include <QtWidgets/QDockWidget>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QListWidget>
16
#include "qcp/qcustomplot.h"
Tobias WEBER's avatar
Tobias WEBER committed
17
18
19

#include <memory>

20
#include "data.h"
Tobias WEBER's avatar
Tobias WEBER committed
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40


/**
 * work space widget
 */
class WorkSpaceWidget : public QWidget
{
private:
	QSettings *m_pSettings = nullptr;

	QListWidget *m_pListFiles = new QListWidget(this);
	QCustomPlot *m_pPlotter = new QCustomPlot(this);

public:
	WorkSpaceWidget(QWidget *pParent = nullptr, QSettings *pSettings = nullptr);
	virtual ~WorkSpaceWidget();

protected:
	void ItemSelected(QListWidgetItem* pCur);
	void ItemDoubleClicked(QListWidgetItem* pCur);
41
42
43

public:
	void ReceiveFiles(const std::vector<std::string>&);
Tobias WEBER's avatar
Tobias WEBER committed
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
};



/**
 * the dock which contains the workspace widget
 */
class WorkSpace : public QDockWidget
{
private:
	std::unique_ptr<WorkSpaceWidget> m_pWS;

public:
	WorkSpace(QWidget* pParent = nullptr, QSettings *pSettings = nullptr);
	virtual ~WorkSpace();
59
60

	const WorkSpaceWidget *GetWidget() const { return m_pWS.get(); }
Tobias WEBER's avatar
Tobias WEBER committed
61
62
63
};

#endif