From 0505aa08046393ea9071b58ced7361b392b51913 Mon Sep 17 00:00:00 2001 From: 188080501 <188080501@qq.com> Date: Sat, 25 Nov 2017 10:04:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0UUID=E9=9A=8F=E6=9C=BA?= =?UTF-8?q?=E5=99=A8=20&=20=E7=BB=86=E8=8A=82=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 19 ++++- .../TextGroup/RandomUuid/RandomUuid.pri | 23 ++++++ .../TextGroup/RandomUuid/cpp/RandomUuid | 13 +++ .../TextGroup/RandomUuid/cpp/randomuuid.cpp | 39 +++++++++ .../TextGroup/RandomUuid/cpp/randomuuid.h | 43 ++++++++++ .../TextGroup/RandomUuid/qml/RandomUuid.qml | 81 +++++++++++++++++++ .../TextGroup/RandomUuid/qml/RandomUuid.qrc | 5 ++ components/TextGroup/TextGroup.pri | 1 + .../TextGroup/UrlEncode/cpp/urlencode.cpp | 2 +- components/TextGroup/textgroup.h | 2 + .../JQToolsLibrary/include/jqtoolslibrary.h | 2 +- qml/main.qml | 6 +- 12 files changed, 227 insertions(+), 9 deletions(-) create mode 100755 components/TextGroup/RandomUuid/RandomUuid.pri create mode 100755 components/TextGroup/RandomUuid/cpp/RandomUuid create mode 100755 components/TextGroup/RandomUuid/cpp/randomuuid.cpp create mode 100755 components/TextGroup/RandomUuid/cpp/randomuuid.h create mode 100755 components/TextGroup/RandomUuid/qml/RandomUuid.qml create mode 100755 components/TextGroup/RandomUuid/qml/RandomUuid.qrc diff --git a/README.md b/README.md index 5282e33..03b05fe 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ https://github.com/188080501/JQNetwork 文本类|RGB转16进制|已完成 文本类|大小写转换|已完成 文本类|密码随机器|已完成 +文本类|UUID随机器|已完成 文本类|URL转码|已完成 文本类|JSON格式化|已完成 | | @@ -54,14 +55,14 @@ https://github.com/188080501/JQNetwork 工具类|代码行数统计|已完成 工具类|PNG图片压缩|已完成 工具类|JPG图片压缩|Mac平台已完成 -工具类|正则表达式测试器|等待开发 工具类|二维码识别器|已完成 工具类|批量替换|已完成 工具类|屏幕拾色器|等待开发 工具类|局域网文件传输|已完成 | | Qt相关|PNG警告消除|已完成 -Qt相关|Q_PROPERTY代码生成器|已完成 +Qt相关|Q_PROPERTY生成|已完成 +Qt相关|CPP文件生成|已完成 Qt相关|TS文件自动翻译器|等待开发 ## 功能介绍 @@ -81,7 +82,11 @@ Qt相关|TS文件自动翻译器|等待开发 * 密码随机器 - 可以生成随机密码字符串,例如:"Hau-eqS-5EC-kWD" + 可以生成随机密码字符串,例如:"Hau-eqS-5EC- + +* UUID随机器 + + 可以生成随机密码UUID,例如:"bff98ea4-b861-422a-8627-6eb6cbca8716" * URL转码 @@ -113,6 +118,10 @@ Qt相关|TS文件自动翻译器|等待开发 可以将文本生成二维码图片,并且保存为PNG +* 条形码生成器 + + 可以将文本生成条形码图片,并且保存为PNG + ### 工具类 * 代码行数统计 @@ -130,6 +139,10 @@ Qt相关|TS文件自动翻译器|等待开发 可以将二维码识别成字符串 +* 批量替换 + + 可以批量替换文件名或者文件内容中的特定关键字 + * 屏幕拾色器 可以拾取屏幕中,某个点的颜色 diff --git a/components/TextGroup/RandomUuid/RandomUuid.pri b/components/TextGroup/RandomUuid/RandomUuid.pri new file mode 100755 index 0000000..3198a6b --- /dev/null +++ b/components/TextGroup/RandomUuid/RandomUuid.pri @@ -0,0 +1,23 @@ +# +# This file is part of JQTools +# +# Project introduce: https://github.com/188080501/JQTools +# +# Copyright: Jason +# +# Contact email: Jason@JasonServer.com +# +# GitHub: https://github.com/188080501/ +# + +INCLUDEPATH *= \ + $$PWD/cpp/ + +HEADERS *= \ + $$PWD/cpp/randomuuid.h + +SOURCES *= \ + $$PWD/cpp/randomuuid.cpp + +RESOURCES *= \ + $$PWD/qml/RandomUuid.qrc diff --git a/components/TextGroup/RandomUuid/cpp/RandomUuid b/components/TextGroup/RandomUuid/cpp/RandomUuid new file mode 100755 index 0000000..88e674c --- /dev/null +++ b/components/TextGroup/RandomUuid/cpp/RandomUuid @@ -0,0 +1,13 @@ +/* + This file is part of JQTools + + Project introduce: https://github.com/188080501/JQTools + + Copyright: Jason + + Contact email: Jason@JasonServer.com + + GitHub: https://github.com/188080501/ +*/ + +#include "randomuuid.h" diff --git a/components/TextGroup/RandomUuid/cpp/randomuuid.cpp b/components/TextGroup/RandomUuid/cpp/randomuuid.cpp new file mode 100755 index 0000000..1d92075 --- /dev/null +++ b/components/TextGroup/RandomUuid/cpp/randomuuid.cpp @@ -0,0 +1,39 @@ +/* + This file is part of JQTools + + Project introduce: https://github.com/188080501/JQTools + + Copyright: Jason + + Contact email: Jason@JasonServer.com + + GitHub: https://github.com/188080501/ +*/ + +#include "randomuuid.h" + +// Qt lib import +#include +#include + +// JQLibrary lib import +#include "JQFoundation.h" + +using namespace RandomUuid; + +Manage::Manage() +{ + srand( QDateTime::currentDateTime().toTime_t() + qApp->applicationFilePath().size() ); +} + +QString Manage::randomUuid(const bool &includeParantheses) +{ + if ( includeParantheses ) + { + return "{" + JQFoundation::createUuidString() + "}"; + } + else + { + return JQFoundation::createUuidString(); + } +} diff --git a/components/TextGroup/RandomUuid/cpp/randomuuid.h b/components/TextGroup/RandomUuid/cpp/randomuuid.h new file mode 100755 index 0000000..6ebb59d --- /dev/null +++ b/components/TextGroup/RandomUuid/cpp/randomuuid.h @@ -0,0 +1,43 @@ +/* + This file is part of JQTools + + Project introduce: https://github.com/188080501/JQTools + + Copyright: Jason + + Contact email: Jason@JasonServer.com + + GitHub: https://github.com/188080501/ +*/ + +#ifndef GROUP_TEXTGROUP_RANDOMUUID_CPP_RANDOMUUID_H_ +#define GROUP_TEXTGROUP_RANDOMUUID_CPP_RANDOMUUID_H_ + +// JQToolsLibrary import +#include + +#define RANDOMUUID_INITIALIZA \ +{ \ + qmlRegisterType("RandomUuid", 1, 0, "RandomUuidManage"); \ +} + +namespace RandomUuid +{ + +class Manage: public AbstractTool +{ + Q_OBJECT + Q_DISABLE_COPY(Manage) + +public: + Manage(); + + ~Manage() = default; + +public slots: + QString randomUuid(const bool &includeParantheses); +}; + +} + +#endif//GROUP_TEXTGROUP_RANDOMUUID_CPP_RANDOMUUID_H_ diff --git a/components/TextGroup/RandomUuid/qml/RandomUuid.qml b/components/TextGroup/RandomUuid/qml/RandomUuid.qml new file mode 100755 index 0000000..3e99978 --- /dev/null +++ b/components/TextGroup/RandomUuid/qml/RandomUuid.qml @@ -0,0 +1,81 @@ +/* + This file is part of JQTools + + Project introduce: https://github.com/188080501/JQTools + + Copyright: Jason + + Contact email: Jason@JasonServer.com + + GitHub: https://github.com/188080501/ +*/ + +import QtQuick 2.7 +import QtQuick.Controls 1.4 +import QtGraphicalEffects 1.0 +import "qrc:/MaterialUI/Interface/" +import RandomUuid 1.0 + +Item { + id: randomUuid + width: 620 + height: 540 + + property bool changingFlag: true + + Component.onCompleted: { + changingFlag = false; + } + + RandomUuidManage { + id: randomUuidManage + } + + Item { + anchors.centerIn: parent + width: 620 + height: 540 + + MaterialTextField { + id: textFieldForPassword + x: 40 + y: 317 + width: 540 + placeholderText: "随机UUID" + } + + MaterialCheckBox { + id: checkBoxForNumber + x: 34 + y: 181 + text: "包括大括号" + checked: false + } + + MaterialButton { + x: 40 + y: 259 + width: 120 + text: "随机UUID" + + onClicked: { + textFieldForPassword.text = randomUuidManage.randomUuid( + checkBoxForNumber.checked + ); + materialUI.showSnackbarMessage( "随机UUID已经生成" ); + } + } + + MaterialButton { + x: 166 + y: 259 + width: 120 + text: "复制到剪切板" + + onClicked: { + randomUuidManage.setClipboardText( textFieldForPassword.text ); + materialUI.showSnackbarMessage( "密码已经复制到了剪切板" ); + } + } + } +} diff --git a/components/TextGroup/RandomUuid/qml/RandomUuid.qrc b/components/TextGroup/RandomUuid/qml/RandomUuid.qrc new file mode 100755 index 0000000..773498f --- /dev/null +++ b/components/TextGroup/RandomUuid/qml/RandomUuid.qrc @@ -0,0 +1,5 @@ + + + RandomUuid.qml + + diff --git a/components/TextGroup/TextGroup.pri b/components/TextGroup/TextGroup.pri index 3999e14..959ab19 100755 --- a/components/TextGroup/TextGroup.pri +++ b/components/TextGroup/TextGroup.pri @@ -14,6 +14,7 @@ include( $$PWD/Utf16Transform/Utf16Transform.pri ) include( $$PWD/RgbStringTransform/RgbStringTransform.pri ) include( $$PWD/UrlEncode/UrlEncode.pri ) include( $$PWD/RandomPassword/RandomPassword.pri ) +include( $$PWD/RandomUuid/RandomUuid.pri ) include( $$PWD/CaseTransform/CaseTransform.pri ) include( $$PWD/JsonFormat/JsonFormat.pri ) diff --git a/components/TextGroup/UrlEncode/cpp/urlencode.cpp b/components/TextGroup/UrlEncode/cpp/urlencode.cpp index f6c6743..ba5d135 100755 --- a/components/TextGroup/UrlEncode/cpp/urlencode.cpp +++ b/components/TextGroup/UrlEncode/cpp/urlencode.cpp @@ -21,7 +21,7 @@ using namespace UrlEncode; QString Manage::encode(const QString &string) { - return QUrl::toPercentEncoding( string, "/:?=" ); + return QUrl::toPercentEncoding( string, "/:?=&%" ); } QString Manage::decode(const QString &string) diff --git a/components/TextGroup/textgroup.h b/components/TextGroup/textgroup.h index e99a29a..8a98deb 100755 --- a/components/TextGroup/textgroup.h +++ b/components/TextGroup/textgroup.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -26,6 +27,7 @@ RGBSTRINGTRANSFORM_INITIALIZA; \ CASETRANSFORM_INITIALIZA; \ RANDOMPASSWORD_INITIALIZA; \ + RANDOMUUID_INITIALIZA; \ URLENCODE_INITIALIZA; \ JSONFORMAT_INITIALIZA; diff --git a/library/JQToolsLibrary/include/jqtoolslibrary.h b/library/JQToolsLibrary/include/jqtoolslibrary.h index 59b4717..20b686a 100755 --- a/library/JQToolsLibrary/include/jqtoolslibrary.h +++ b/library/JQToolsLibrary/include/jqtoolslibrary.h @@ -17,7 +17,7 @@ #include #include -#define JQTOOLS_VERSIONSTRING "17.11.15" +#define JQTOOLS_VERSIONSTRING "17.11.25" class QQmlApplicationEngine; diff --git a/qml/main.qml b/qml/main.qml index bd8bd58..a31a97a 100755 --- a/qml/main.qml +++ b/qml/main.qml @@ -43,6 +43,7 @@ ApplicationWindow { { bookmarkName: "RGB转16进制", titleName: "RGB转16进制", qrcLocation: "qrc:/RgbStringTransform/RgbStringTransform.qml" }, { bookmarkName: "大小写转换", titleName: "大小写转换", qrcLocation: "qrc:/CaseTransform/CaseTransform.qml" }, { bookmarkName: "密码随机器", titleName: "密码随机器", qrcLocation: "qrc:/RandomPassword/RandomPassword.qml" }, + { bookmarkName: "UUID随机器", titleName: "UUID随机器", qrcLocation: "qrc:/RandomUuid/RandomUuid.qml" }, { bookmarkName: "URL转码", titleName: "URL转码", qrcLocation: "qrc:/UrlEncode/UrlEncode.qml" }, { bookmarkName: "JSON格式化", titleName: "JSON格式化", qrcLocation: "qrc:/JsonFormat/JsonFormat.qml" } ] @@ -81,10 +82,7 @@ ApplicationWindow { { bookmarkName: "二维码识别器", titleName: "二维码识别器 ", qrcLocation: "qrc:/QRCodeReader/QRCodeReader.qml" }, { bookmarkName: "批量替换", titleName: "批量替换 ", qrcLocation: "qrc:/BatchReplacement/BatchReplacement.qml" }, { bookmarkName: "屏幕拾色器", titleName: "屏幕拾色器", qrcLocation: "notSupport" }, - { bookmarkName: "局域网文件传输", titleName: "局域网文件传输", qrcLocation: "qrc:/LanFileTransport/LanFileTransport.qml" }, - { bookmarkName: "局域网远程构建", titleName: "局域网远程构建", qrcLocation: "notSupport" }, - { bookmarkName: "TCP服务端模拟", titleName: "TCP服务端模拟", qrcLocation: "notSupport" }, - { bookmarkName: "TCP客户端模拟", titleName: "TCP客户端模拟", qrcLocation: "notSupport" } + { bookmarkName: "局域网文件传输", titleName: "局域网文件传输", qrcLocation: "qrc:/LanFileTransport/LanFileTransport.qml" } ] }, {