-
Notifications
You must be signed in to change notification settings - Fork 513
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
227 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( "密码已经复制到了剪切板" ); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<RCC> | ||
<qresource prefix="/RandomUuid"> | ||
<file>RandomUuid.qml</file> | ||
</qresource> | ||
</RCC> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters