RedstartSessionDetailsTreeView.h 2.58 KB
Newer Older
Dipl.-Ing. Jonas Stienen's avatar
Mooore  
Dipl.-Ing. Jonas Stienen committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
 *  --------------------------------------------------------------------------------------------
 *
 *    VVV        VVV A           Virtual Acoustics (VA) | http://www.virtualacoustics.org
 *     VVV      VVV AAA          Licensed under the Apache License, Version 2.0
 *      VVV    VVV   AAA
 *       VVV  VVV     AAA        Copyright 2015-2017
 *        VVVVVV       AAA       Institute of Technical Acoustics (ITA)
 *         VVVV         AAA      RWTH Aachen University
 *
 *  --------------------------------------------------------------------------------------------
 */
#ifndef IW_REDSTART_SESSION_DETAILS_TREE_VIEW
#define IW_REDSTART_SESSION_DETAILS_TREE_VIEW

#include <QStandardItemModel>
#include <QStandardItem>
#include <QTreeView>
#include "RedstartUtils.h"
#include <VAStruct.h>

class RedstartSessionDetailModel : public QStandardItemModel
{};

class RedstartSessionDetailsTreeView : public QTreeView
{
	Q_OBJECT

public:
	inline RedstartSessionDetailsTreeView( QWidget* pParent )
		: QTreeView( pParent )
		, m_pModel( NULL )
	{
		m_pModel = new RedstartSessionDetailModel();
		this->setModel( m_pModel );
		m_pModel->setHorizontalHeaderLabels( QStringList() << "Key" << "Value" << "Type" );
		
		//setEditTriggers( QAbstractItemView::NoEditTriggers );
		//setSelectionMode( QAbstractItemView::SingleSelection );
	};

	void SetStruct( const CVAStruct& oStruct )
	{
		QStandardItem *rootNode = m_pModel->invisibleRootItem();
		QStandardItem* item = new QStandardItem;

		QList<QStandardItem *> qlDescriptors;
		qlDescriptors << new QStandardItem( "Name" );
		qlDescriptors << new QStandardItem( "Talkthrough" );
		qlDescriptors << new QStandardItem( "String" );
		rootNode->appendRow( qlDescriptors );

		QList<QStandardItem *> qlDescriptor2;
		qlDescriptor2 << new QStandardItem( "Name" );
		rootNode->appendRow( qlDescriptor2 );

		QList<QStandardItem *> qlDescriptor3;
		qlDescriptor3 << new QStandardItem( "direction" );

		qlDescriptor2.first()->appendRow( qlDescriptor3 );

		QList<QStandardItem *> qlDescriptor4;
		qlDescriptor4 << new QStandardItem( "x" );
		qlDescriptor4 << new QStandardItem( "1.0" );
		qlDescriptor4 << new QStandardItem( "Double" );
		QList<QStandardItem *> qlDescriptor5;
		qlDescriptor5 << new QStandardItem( "y" );
		qlDescriptor5 << new QStandardItem( "1.0" );
		qlDescriptor5 << new QStandardItem( "Double" );

		qlDescriptor3.first()->appendRow( qlDescriptor4 );
		qlDescriptor3.first()->appendRow( qlDescriptor5 );
	};

	inline ~RedstartSessionDetailsTreeView() {};

	private slots:

private:
	RedstartSessionDetailModel* m_pModel;
};

#endif // IW_REDSTART_SESSION_DETAILS_TREE_VIEW