-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathguihelpers.h
85 lines (72 loc) · 2.46 KB
/
guihelpers.h
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
84
85
#ifndef GUIHELPERS_H
#define GUIHELPERS_H
#define PARAMETER_PROPERTY "parameter"
#define SECTION_PROPERTY "sec"
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QString>
#include "parameter.h"
/**
* @brief The GUI helper class
* This class is used to share common GUI methods for client and server
*/
class GuiHelpers
{
private:
/**
* @brief The standard constructor
*
*/
GuiHelpers();
public:
/**
* @brief Adds the top level text of an new section in the tree view
*
* @param wid The tree widget pointer
* @param text The text to set
* @return QTreeWidgetItem the new created item
*/
static QTreeWidgetItem* addToplevelWidgetItem(QTreeWidget* wid,QString text);
/**
* @brief Adds a new text only widget item to a existing section
*
* @param itm The section item
* @param text The text for the first column
* @param text2 The text for the second column
* @param textDescr The text for the third column
* @return QTreeWidgetItem the new created item
*/
static QTreeWidgetItem* addWidgetItem(QTreeWidgetItem* itm,QString text,QString text2,QString textDescr);
/**
* @brief Adds a new widget item, containing an existing widet
*
* @param wid The tree widget
* @param itm The section item
* @param text The text for the first column
* @param cwid The widget to add
* @param textDescr The text for the third column
* @return QTreeWidgetItem the new created item
*/
static QTreeWidgetItem* addWidgetItem(QTreeWidget* wid,QTreeWidgetItem* itm,QString text,QWidget* cwid,QString textDescr);
/**
* @brief
*
* @param vec
* @param str
* @return size_t
*/
static size_t findIndex(std::vector<std::string>& vec,std::string str);
/**
* @brief Add a new section to the tree view
*
* @param window The window pointer
* @param tree The tree view pointer
* @param transBackends The vector of available backends
* @param transParam The paramater map of the actual selected backend
* @param sectionName The name of the section
* @param sec The enumeration of the section
* @param currentIndex The currend selected index in transBackends
*/
static void addSettingsCat(QObject* window, QTreeWidget* tree, const std::vector<std::string> transBackends, parameterMap transParam, QString sectionName, int sec, int currentIndex);
};
#endif // GUIHELPERS_H