Skip to content

Commit

Permalink
增加UUID随机器 & 细节完善
Browse files Browse the repository at this point in the history
  • Loading branch information
188080501 committed Nov 25, 2017
1 parent 87e9c6a commit 0505aa0
Show file tree
Hide file tree
Showing 12 changed files with 227 additions and 9 deletions.
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ https://github.com/188080501/JQNetwork
文本类|RGB转16进制|已完成
文本类|大小写转换|已完成
文本类|密码随机器|已完成
文本类|UUID随机器|已完成
文本类|URL转码|已完成
文本类|JSON格式化|已完成
| |
Expand All @@ -54,14 +55,14 @@ https://github.com/188080501/JQNetwork
工具类|代码行数统计|已完成
工具类|PNG图片压缩|已完成
工具类|JPG图片压缩|Mac平台已完成
工具类|正则表达式测试器|等待开发
工具类|二维码识别器|已完成
工具类|批量替换|已完成
工具类|屏幕拾色器|等待开发
工具类|局域网文件传输|已完成
| |
Qt相关|PNG警告消除|已完成
Qt相关|Q_PROPERTY代码生成器|已完成
Qt相关|Q_PROPERTY生成|已完成
Qt相关|CPP文件生成|已完成
Qt相关|TS文件自动翻译器|等待开发

## 功能介绍
Expand All @@ -81,7 +82,11 @@ Qt相关|TS文件自动翻译器|等待开发

* 密码随机器

可以生成随机密码字符串,例如:"Hau-eqS-5EC-kWD"
可以生成随机密码字符串,例如:"Hau-eqS-5EC-

* UUID随机器

可以生成随机密码UUID,例如:"bff98ea4-b861-422a-8627-6eb6cbca8716"

* URL转码

Expand Down Expand Up @@ -113,6 +118,10 @@ Qt相关|TS文件自动翻译器|等待开发

可以将文本生成二维码图片,并且保存为PNG

* 条形码生成器

可以将文本生成条形码图片,并且保存为PNG

### 工具类
* 代码行数统计

Expand All @@ -130,6 +139,10 @@ Qt相关|TS文件自动翻译器|等待开发

可以将二维码识别成字符串

* 批量替换

可以批量替换文件名或者文件内容中的特定关键字

* 屏幕拾色器

可以拾取屏幕中,某个点的颜色
Expand Down
23 changes: 23 additions & 0 deletions components/TextGroup/RandomUuid/RandomUuid.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# This file is part of JQTools
#
# Project introduce: https://github.com/188080501/JQTools
#
# Copyright: Jason
#
# Contact email: [email protected]
#
# GitHub: https://github.com/188080501/
#

INCLUDEPATH *= \
$$PWD/cpp/

HEADERS *= \
$$PWD/cpp/randomuuid.h

SOURCES *= \
$$PWD/cpp/randomuuid.cpp

RESOURCES *= \
$$PWD/qml/RandomUuid.qrc
13 changes: 13 additions & 0 deletions components/TextGroup/RandomUuid/cpp/RandomUuid
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
This file is part of JQTools

Project introduce: https://github.com/188080501/JQTools

Copyright: Jason

Contact email: [email protected]

GitHub: https://github.com/188080501/
*/

#include "randomuuid.h"
39 changes: 39 additions & 0 deletions components/TextGroup/RandomUuid/cpp/randomuuid.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
This file is part of JQTools
Project introduce: https://github.com/188080501/JQTools
Copyright: Jason
Contact email: [email protected]
GitHub: https://github.com/188080501/
*/

#include "randomuuid.h"

// Qt lib import
#include <QCoreApplication>
#include <QDateTime>

// 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();
}
}
43 changes: 43 additions & 0 deletions components/TextGroup/RandomUuid/cpp/randomuuid.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
This file is part of JQTools
Project introduce: https://github.com/188080501/JQTools
Copyright: Jason
Contact email: [email protected]
GitHub: https://github.com/188080501/
*/

#ifndef GROUP_TEXTGROUP_RANDOMUUID_CPP_RANDOMUUID_H_
#define GROUP_TEXTGROUP_RANDOMUUID_CPP_RANDOMUUID_H_

// JQToolsLibrary import
#include <JQToolsLibrary>

#define RANDOMUUID_INITIALIZA \
{ \
qmlRegisterType<RandomUuid::Manage>("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_
81 changes: 81 additions & 0 deletions components/TextGroup/RandomUuid/qml/RandomUuid.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
This file is part of JQTools
Project introduce: https://github.com/188080501/JQTools
Copyright: Jason
Contact email: [email protected]
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( "密码已经复制到了剪切板" );
}
}
}
}
5 changes: 5 additions & 0 deletions components/TextGroup/RandomUuid/qml/RandomUuid.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/RandomUuid">
<file>RandomUuid.qml</file>
</qresource>
</RCC>
1 change: 1 addition & 0 deletions components/TextGroup/TextGroup.pri
Original file line number Diff line number Diff line change
Expand Up @@ -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 )

Expand Down
2 changes: 1 addition & 1 deletion components/TextGroup/UrlEncode/cpp/urlencode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions components/TextGroup/textgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <RgbStringTransform>
#include <CaseTransform>
#include <RandomPassword>
#include <RandomUuid>
#include <UrlEncode>
#include <JsonFormat>

Expand All @@ -26,6 +27,7 @@
RGBSTRINGTRANSFORM_INITIALIZA; \
CASETRANSFORM_INITIALIZA; \
RANDOMPASSWORD_INITIALIZA; \
RANDOMUUID_INITIALIZA; \
URLENCODE_INITIALIZA; \
JSONFORMAT_INITIALIZA;

Expand Down
2 changes: 1 addition & 1 deletion library/JQToolsLibrary/include/jqtoolslibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <QObject>
#include <QPointer>

#define JQTOOLS_VERSIONSTRING "17.11.15"
#define JQTOOLS_VERSIONSTRING "17.11.25"

class QQmlApplicationEngine;

Expand Down
6 changes: 2 additions & 4 deletions qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
]
Expand Down Expand Up @@ -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" }
]
},
{
Expand Down

0 comments on commit 0505aa0

Please sign in to comment.