-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterface.cpp
More file actions
43 lines (36 loc) · 851 Bytes
/
interface.cpp
File metadata and controls
43 lines (36 loc) · 851 Bytes
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
#include "interface.h"
Interface::Interface(QString name,QObject *parent) :
QObject(parent), _name(name)
{
}
QString Interface::getName() {
return _name;
}
void Interface::setType(QString type) {
_type = type;
}
QString Interface::getType() {
return _type;
}
QString Interface::getKey() {
return _options["key"];
}
QStringList Interface::info() {
QStringList sl;
if (this->getType().length())
sl<<"Type:"<<this->getType();
QMap<QString,QString>::iterator it = _options.begin();
QStringList options;
while (it!=_options.end()) {
options.append(it.key() + " : " + it.value());
it++;
}
if (options.length() > 0) {
sl<<"Options:";
sl.append(options);
}
return sl;
}
void Interface::setOptions(QString key, QString value) {
_options[key] = value;
}