From 846de4f433932aeecc0819638a453abcb1eca94b Mon Sep 17 00:00:00 2001 From: jonymt <johanmt@yandex.ru> Date: Tue, 10 Sep 2019 13:34:33 +0200 Subject: [PATCH] [+] added ui.qml file for widget --- ...tionsForm.qml => DapUiQmlWidgetLastActions.qml} | 12 +----------- .../DapUiQmlWidgetLastActionsForm.ui.qml | 14 ++++++++++++++ KelvinDashboardGUI/qml.qrc | 3 ++- KelvinDashboardService/DapChainHistoryHandler.cpp | 14 ++------------ 4 files changed, 19 insertions(+), 24 deletions(-) rename KelvinDashboardGUI/{DapUiQmlWidgetLastActionsForm.qml => DapUiQmlWidgetLastActions.qml} (87%) create mode 100644 KelvinDashboardGUI/DapUiQmlWidgetLastActionsForm.ui.qml diff --git a/KelvinDashboardGUI/DapUiQmlWidgetLastActionsForm.qml b/KelvinDashboardGUI/DapUiQmlWidgetLastActions.qml similarity index 87% rename from KelvinDashboardGUI/DapUiQmlWidgetLastActionsForm.qml rename to KelvinDashboardGUI/DapUiQmlWidgetLastActions.qml index f998b04b9..6dc8088d8 100644 --- a/KelvinDashboardGUI/DapUiQmlWidgetLastActionsForm.qml +++ b/KelvinDashboardGUI/DapUiQmlWidgetLastActions.qml @@ -5,17 +5,7 @@ import QtQuick.Layouts 1.12 import DapTransactionHistory 1.0 -Rectangle { - width: 400 * pt - border.color: "#B5B5B5" - border.width: 1 * pt - color: "#EDEFF2" - - anchors { - top: parent.top - right: parent.right - bottom: parent.bottom - } +DapUiQmlWidgetLastActionsForm { MouseArea { id: mainMouseArea diff --git a/KelvinDashboardGUI/DapUiQmlWidgetLastActionsForm.ui.qml b/KelvinDashboardGUI/DapUiQmlWidgetLastActionsForm.ui.qml new file mode 100644 index 000000000..27c038bcc --- /dev/null +++ b/KelvinDashboardGUI/DapUiQmlWidgetLastActionsForm.ui.qml @@ -0,0 +1,14 @@ +import QtQuick 2.4 + +Rectangle { + width: 400 * pt + border.color: "#B5B5B5" + border.width: 1 * pt + color: "#EDEFF2" + + anchors { + top: parent.top + right: parent.right + bottom: parent.bottom + } +} diff --git a/KelvinDashboardGUI/qml.qrc b/KelvinDashboardGUI/qml.qrc index ceb9d2cdf..7a448e888 100755 --- a/KelvinDashboardGUI/qml.qrc +++ b/KelvinDashboardGUI/qml.qrc @@ -45,7 +45,6 @@ <file>DapUiQmlWidgetExchangeOrderButtonForm.ui.qml</file> <file>DapUiQmlScreenHistory.qml</file> <file>Resources/Icons/defaul_icon.png</file> - <file>DapUiQmlWidgetLastActionsForm.qml</file> <file>Resources/Icons/ic_scroll-down.png</file> <file>Resources/Icons/ic_scroll-down_hover.png</file> <file>Resources/Icons/ic_scroll-up.png</file> @@ -56,5 +55,7 @@ <file>DapUiQmlWidgetLastActionsHeaderForm.qml</file> <file>DapUiQmlScreenMainWindow.qml</file> <file>DapUiQmlScreenMainWindowForm.ui.qml</file> + <file>DapUiQmlWidgetLastActions.qml</file> + <file>DapUiQmlWidgetLastActionsForm.ui.qml</file> </qresource> </RCC> diff --git a/KelvinDashboardService/DapChainHistoryHandler.cpp b/KelvinDashboardService/DapChainHistoryHandler.cpp index 68a3dd6b6..e229a1488 100644 --- a/KelvinDashboardService/DapChainHistoryHandler.cpp +++ b/KelvinDashboardService/DapChainHistoryHandler.cpp @@ -31,18 +31,8 @@ void DapChainHistoryHandler::onRequestNewHistory(const QMap<QString, QVariant>& if(!result.isEmpty()) { - // TODO: error with "\r\n" - QString reg_str; -#ifdef Q_OS_LINUX - reg_str = "(\\w{3}\\s\\w{3}\\s\\d+\\s\\d{1,2}:\\d{2}:\\d{2}\\s\\d{4})\\n" - "\\s(\\w+)\\s(\\d+)\\s(\\w+)\\s\\w+\\s+(\\w+)"; -#endif -#ifdef Q_OS_WIN - reg_str = "(\\w{3}\\s\\w{3}\\s\\d+\\s\\d{1,2}:\\d{2}:\\d{2}\\s\\d{4})\\r\\n" - "\\s(\\w+)\\s(\\d+)\\s(\\w+)\\s\\w+\\s+(\\w+)"; -#endif - - QRegExp rx(reg_str); + QRegExp rx("(\\w{3}\\s\\w{3}\\s\\d+\\s\\d{1,2}:\\d{2}:\\d{2}\\s\\d{4})\\s+" + "\\s(\\w+)\\s(\\d+)\\s(\\w+)\\s\\w+\\s+(\\w+)"); int pos = 0; while ((pos = rx.indexIn(result, pos)) != -1) -- GitLab