blob: 80556c8e58474b7ca0b42d81aef8b9da012946c2 (
plain)
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
|
#include "util.h"
#include <QDomDocument>
#include <QSettings>
#include <QDomNode>
#include "netcom.h"
#define CONFIG_DEFAULT "pracro.ini"
MacroWindow *createMacroWindow()
{
QSettings settings("pracro.ini", QSettings::IniFormat);
settings.beginGroup("server");
QString host = settings.value("host").toString();
int port = settings.value("port").toInt();
settings.endGroup();
NetCom netcom(host, port);
MacroWindow *m = new MacroWindow(netcom, "test", true, false, NULL, NULL);
return m;
}
QDomElement getWidgetElement(QString type, QString name, QString value)
{
QDomDocument doc;
QDomElement e = doc.createElement(type);
e.setAttribute("name", name);
if(value != "") e.setAttribute("value", value);
return e;
}
|