diff options
Diffstat (limited to 'src/JSObject.cpp')
| -rw-r--r-- | src/JSObject.cpp | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/src/JSObject.cpp b/src/JSObject.cpp index e899b5f..5f9c4ab 100644 --- a/src/JSObject.cpp +++ b/src/JSObject.cpp @@ -7,7 +7,7 @@ #include "JSObject.h" #include <QTime> -#include <QNetworkInterface> + //------------------------------------------------------------------------------------------------------- JSObject::JSObject(QWebFrame *parent) { _parent = parent; @@ -43,34 +43,26 @@ void JSObject::updateProgress(int i) //------------------------------------------------------------------------------------------------------- void JSObject::getMacAddress() { - QNetworkInterface *qNetI = new QNetworkInterface(); - QList<QNetworkInterface> list; - list=qNetI->allInterfaces(); - QString str; - QString macAddress; - for (int i = 0; i < list.size(); ++i) { - str = list.at(i).name(); - macAddress = list.at(i).hardwareAddress(); - qDebug() << str; - qDebug() << macAddress; - } - - //TODO:: edit jsFunction name + emit getMAC(); +} +//------------------------------------------------------------------------------------------------------- +void JSObject::printMAC(QString& macAddress) +{ QString code = QString("printMacAddress(\"%1\")").arg(macAddress); _parent->evaluateJavaScript(code); } //------------------------------------------------------------------------------------------------------- void JSObject::showTime() { - qDebug() << "---- call: showTime_Slot"; - QString time = QTime::currentTime().toString("hh:mm:ss"); - - //TODO:: edit jsFunction name + emit getTime(); +} +//------------------------------------------------------------------------------------------------------- +void JSObject::printTime(QString& time) +{ QString code; code = QString("printTime(\"%1\")").arg(time); _parent->evaluateJavaScript(code); } -//------------------------------------------------------------------------------------------------------- void JSObject::showDate() { QString date = QDate::currentDate().toString("dd.MM.yyyy"); |
