first version
This commit is contained in:
29
Hasher.pro
Normal file
29
Hasher.pro
Normal file
@ -0,0 +1,29 @@
|
||||
QT += core gui concurrent
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
CONFIG += c++17
|
||||
|
||||
# You can make your code fail to compile if it uses deprecated APIs.
|
||||
# In order to do so, uncomment the following line.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
SOURCES += \
|
||||
calculator.cpp \
|
||||
comp_window.cpp \
|
||||
main.cpp \
|
||||
mainwindow.cpp
|
||||
|
||||
HEADERS += \
|
||||
calculator.h \
|
||||
comp_window.h \
|
||||
mainwindow.h
|
||||
|
||||
FORMS += \
|
||||
comp_window.ui \
|
||||
mainwindow.ui
|
||||
|
||||
# Default rules for deployment.
|
||||
qnx: target.path = /tmp/$${TARGET}/bin
|
||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||
!isEmpty(target.path): INSTALLS += target
|
267
Hasher.pro.user
Normal file
267
Hasher.pro.user
Normal file
@ -0,0 +1,267 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 12.0.2, 2024-04-10T15:52:14. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
<value type="QByteArray">{ee5feb50-f37c-4025-be75-74dc258ebaed}</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
<value type="qlonglong">0</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||
<value type="QString" key="language">Cpp</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||
<value type="QString" key="language">QmlJS</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||
<value type="int" key="EditorConfiguration.PreferAfterWhitespaceComments">0</value>
|
||||
<value type="bool" key="EditorConfiguration.PreferSingleLineComments">false</value>
|
||||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
|
||||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||
<value type="bool" key="EditorConfiguration.UseIndenter">false</value>
|
||||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||
<value type="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value>
|
||||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||
<value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value>
|
||||
<value type="bool" key="EditorConfiguration.tintMarginArea">true</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
|
||||
<value type="bool" key="AutoTest.Framework.Boost">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.CTest">false</value>
|
||||
<value type="bool" key="AutoTest.Framework.Catch">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.GTest">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.QtTest">true</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
|
||||
<value type="int" key="AutoTest.RunAfterBuild">0</value>
|
||||
<value type="bool" key="AutoTest.UseGlobal">true</value>
|
||||
<valuemap type="QVariantMap" key="ClangTools">
|
||||
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
|
||||
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
|
||||
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
|
||||
<value type="int" key="ClangTools.ParallelJobs">8</value>
|
||||
<value type="bool" key="ClangTools.PreferConfigFile">true</value>
|
||||
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
|
||||
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
|
||||
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
|
||||
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="DeviceType">Desktop</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.6.1 MinGW 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.6.1 MinGW 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.661.win64_mingw_kit</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<value type="int" key="EnableQmlDebugging">0</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:\StudyCode\qt\build-Hasher-Desktop_Qt_6_6_1_MinGW_64_bit-Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">F:/StudyCode/qt/build-Hasher-Desktop_Qt_6_6_1_MinGW_64_bit-Debug</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:\StudyCode\qt\build-Hasher-Desktop_Qt_6_6_1_MinGW_64_bit-Release</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">F:/StudyCode/qt/build-Hasher-Desktop_Qt_6_6_1_MinGW_64_bit-Release</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
||||
<value type="int" key="QtQuickCompiler">0</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
|
||||
<value type="int" key="EnableQmlDebugging">0</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:\StudyCode\qt\build-Hasher-Desktop_Qt_6_6_1_MinGW_64_bit-Profile</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">F:/StudyCode/qt/build-Hasher-Desktop_Qt_6_6_1_MinGW_64_bit-Profile</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
||||
<value type="int" key="QtQuickCompiler">0</value>
|
||||
<value type="int" key="SeparateDebugInfo">0</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">部署</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">部署</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
|
||||
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<value type="int" key="Analyzer.Valgrind.Callgrind.CostFormat">0</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="CustomOutputParsers"/>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:F:/StudyCode/qt/Hasher/Hasher.pro</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">F:/StudyCode/qt/Hasher/Hasher.pro</value>
|
||||
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">F:/StudyCode/qt/build-Hasher-Desktop_Qt_6_6_1_MinGW_64_bit-Debug</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||
<value type="qlonglong">1</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>Version</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
</qtcreator>
|
172
calculator.cpp
Normal file
172
calculator.cpp
Normal file
@ -0,0 +1,172 @@
|
||||
#include "calculator.h"
|
||||
int calc_number = 7;
|
||||
std::map<QString,std::map<QString ,double >> process;
|
||||
|
||||
|
||||
QString GetCRC32(QString fileName,int col)
|
||||
{//多项式公式:x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1 宽度:32 多项式:04C11DB7 初始值:FFFFFFFF 结果异或值:FFFFFFFF 输入反转:true 输出反转:true
|
||||
static const quint32 crc32Table[] =
|
||||
{
|
||||
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
|
||||
0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
|
||||
0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,
|
||||
0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
|
||||
0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
|
||||
0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
|
||||
0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c,
|
||||
0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
|
||||
0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
|
||||
0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
|
||||
0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106,
|
||||
0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
|
||||
0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
|
||||
0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
|
||||
0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
|
||||
0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
|
||||
0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
|
||||
0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
|
||||
0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa,
|
||||
0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
|
||||
0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
|
||||
0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
|
||||
0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84,
|
||||
0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
|
||||
0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
|
||||
0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
|
||||
0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,
|
||||
0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
|
||||
0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
|
||||
0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
|
||||
0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28,
|
||||
0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
|
||||
0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
|
||||
0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
|
||||
0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
|
||||
0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
|
||||
0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
|
||||
0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
|
||||
0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc,
|
||||
0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
|
||||
0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
|
||||
0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
|
||||
0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
|
||||
};
|
||||
QFile file(fileName);
|
||||
QByteArray array;
|
||||
if(file.open(QFile::ReadOnly)){
|
||||
array = file.readAll();
|
||||
}
|
||||
quint32 crc32 = 0xFFFFFFFF;
|
||||
for ( auto i = 0; i < array.size(); ++i )
|
||||
{
|
||||
process[QString("%1%2").arg(fileName).arg(col)]["crc32"] = 1.0 * i / array.size();
|
||||
crc32 = crc32Table[ ( crc32 ^ array.constData()[ i ]) & 0xff ] ^ ( crc32 >> 8 );
|
||||
}
|
||||
process[QString("%1%2").arg(fileName).arg(col)]["crc32"] = 1;
|
||||
crc32 ^=0xFFFFFFFF;
|
||||
file.close();
|
||||
return QString::number(crc32,16);
|
||||
}
|
||||
QString GetMD4(QString fileName,int col){
|
||||
QFile file(fileName);
|
||||
if (!file.open(QIODevice::ReadOnly)) {
|
||||
qWarning("Cannot open file for reading");
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
QCryptographicHash hash(QCryptographicHash::Md4);
|
||||
int i = 0;
|
||||
while (!file.atEnd()) {
|
||||
process[QString("%1%2").arg(fileName).arg(col)]["md4"] = (1.0 * i++ * pre_size) / file.size();
|
||||
hash.addData(file.read(pre_size)); // 每次读取1MB
|
||||
}
|
||||
process[QString("%1%2").arg(fileName).arg(col)]["md4"]=1;
|
||||
file.close();
|
||||
return hash.result().toHex();
|
||||
}
|
||||
QString GetMD5(QString fileName,int col){
|
||||
QFile file(fileName);
|
||||
if (!file.open(QIODevice::ReadOnly)) {
|
||||
qWarning("Cannot open file for reading");
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
QCryptographicHash hash(QCryptographicHash::Md5);
|
||||
int i = 0;
|
||||
while (!file.atEnd()) {
|
||||
process[QString("%1%2").arg(fileName).arg(col)]["md5"] = (1.0 * i++ * pre_size) / file.size();
|
||||
hash.addData(file.read(pre_size)); // 每次读取1MB
|
||||
}
|
||||
process[QString("%1%2").arg(fileName).arg(col)]["md5"]=1;
|
||||
file.close();
|
||||
return hash.result().toHex();
|
||||
}
|
||||
QString GetSHA1(QString fileName,int col){
|
||||
QFile file(fileName);
|
||||
if (!file.open(QIODevice::ReadOnly)) {
|
||||
qWarning("Cannot open file for reading");
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
QCryptographicHash hash(QCryptographicHash::Sha1);
|
||||
int i = 0;
|
||||
while (!file.atEnd()) {
|
||||
process[QString("%1%2").arg(fileName).arg(col)]["sha1"] = (1.0 * i++ * pre_size) / file.size();
|
||||
hash.addData(file.read(pre_size)); // 每次读取1MB
|
||||
}
|
||||
process[QString("%1%2").arg(fileName).arg(col)]["sha1"]=1;
|
||||
file.close();
|
||||
return hash.result().toHex();
|
||||
}
|
||||
QString GetSHA256(QString fileName,int col){
|
||||
QFile file(fileName);
|
||||
if (!file.open(QIODevice::ReadOnly)) {
|
||||
qWarning("Cannot open file for reading");
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
QCryptographicHash hash(QCryptographicHash::Sha256);
|
||||
int i = 0;
|
||||
while (!file.atEnd()) {
|
||||
process[QString("%1%2").arg(fileName).arg(col)]["sha256"] = (1.0 * i++ * pre_size) / file.size();
|
||||
hash.addData(file.read(pre_size)); // 每次读取1MB
|
||||
}
|
||||
process[QString("%1%2").arg(fileName).arg(col)]["sha256"]=1;
|
||||
file.close();
|
||||
return hash.result().toHex();
|
||||
}
|
||||
QString GetSHA384(QString fileName,int col){
|
||||
QFile file(fileName);
|
||||
if (!file.open(QIODevice::ReadOnly)) {
|
||||
qWarning("Cannot open file for reading");
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
QCryptographicHash hash(QCryptographicHash::Sha384);
|
||||
int i = 0;
|
||||
while (!file.atEnd()) {
|
||||
process[QString("%1%2").arg(fileName).arg(col)]["sha384"] = (1.0 * i++ * pre_size) / file.size();
|
||||
hash.addData(file.read(pre_size)); // 每次读取1MB
|
||||
}
|
||||
process[QString("%1%2").arg(fileName).arg(col)]["sha384"]=1;
|
||||
file.close();
|
||||
return hash.result().toHex();
|
||||
}
|
||||
QString GetSHA512(QString fileName,int col){
|
||||
|
||||
QFile file(fileName);
|
||||
if (!file.open(QIODevice::ReadOnly)) {
|
||||
qWarning("Cannot open file for reading");
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
QCryptographicHash hash(QCryptographicHash::Sha512);
|
||||
int i = 0;
|
||||
while (!file.atEnd()) {
|
||||
process[QString("%1%2").arg(fileName).arg(col)]["sha512"] = (1.0 * i++ * pre_size) / file.size();
|
||||
hash.addData(file.read(pre_size)); // 每次读取1MB
|
||||
}
|
||||
process[QString("%1%2").arg(fileName).arg(col)]["sha512"]=1;
|
||||
file.close();
|
||||
return hash.result().toHex();
|
||||
}
|
22
calculator.h
Normal file
22
calculator.h
Normal file
@ -0,0 +1,22 @@
|
||||
#include <QString>
|
||||
#include <QFile>
|
||||
#include <QCryptographicHash>
|
||||
#include <map>
|
||||
|
||||
#ifndef CALCULATOR_H
|
||||
#define CALCULATOR_H
|
||||
|
||||
extern int calc_number;
|
||||
extern std::map<QString ,std::map<QString ,double>> process;
|
||||
|
||||
const unsigned int pre_size = 1024*1024;
|
||||
QString GetCRC32(QString fileName,int col);
|
||||
QString GetMD4(QString fileName,int col);
|
||||
QString GetMD5 ( QString fileName ,int col);
|
||||
QString GetSHA1(QString fileName,int col);
|
||||
QString GetSHA256(QString fileName,int col);
|
||||
QString GetSHA384(QString fileName,int col);
|
||||
QString GetSHA512(QString fileName,int col);
|
||||
|
||||
#endif // CALCULATOR_H
|
||||
|
140
comp_window.cpp
Normal file
140
comp_window.cpp
Normal file
@ -0,0 +1,140 @@
|
||||
#include "comp_window.h"
|
||||
#include "ui_comp_window.h"
|
||||
#include "QClipboard"
|
||||
|
||||
int comp_style = false;
|
||||
|
||||
comp_window::comp_window(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, ui(new Ui::comp_window)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QClipboard *clipboard = QGuiApplication::clipboard();
|
||||
QString originalText = clipboard->text().trimmed();
|
||||
ui->lineEdit_need_comp->setText(originalText);
|
||||
ui->lineEdit_need_comp->setFocus();
|
||||
}
|
||||
|
||||
comp_window::~comp_window()
|
||||
{
|
||||
comp_style = false;
|
||||
delete ui;
|
||||
}
|
||||
void comp_window::draw_comp_result(){
|
||||
QString need = ui->lineEdit_need_comp->text();
|
||||
QString CRC32 = ui->lineEdit_CRC32->text();
|
||||
QString MD4 = ui->lineEdit_MD4->text();
|
||||
QString MD5 = ui->lineEdit_MD5->text();
|
||||
QString SHA1 = ui->lineEdit_SHA1->text();
|
||||
QString SHA256 = ui->lineEdit_SHA256->text();
|
||||
QString SHA384 = ui->lineEdit_SHA384->text();
|
||||
QString SHA512 = ui->lineEdit_SHA512->text();
|
||||
if(need == CRC32){
|
||||
ui->lineEdit_CRC32->setGraphicsEffect(gen_style(1));
|
||||
}else{
|
||||
ui->lineEdit_CRC32->setGraphicsEffect(gen_style(2));
|
||||
}
|
||||
|
||||
if(need == MD4){
|
||||
ui->lineEdit_MD4->setGraphicsEffect(gen_style(1));
|
||||
}else{
|
||||
ui->lineEdit_MD4->setGraphicsEffect(gen_style(2));
|
||||
}
|
||||
|
||||
if(need == MD5){
|
||||
ui->lineEdit_MD5->setGraphicsEffect(gen_style(1));
|
||||
}else{
|
||||
ui->lineEdit_MD5->setGraphicsEffect(gen_style(2));
|
||||
}
|
||||
|
||||
if(need == SHA1){
|
||||
ui->lineEdit_SHA1->setGraphicsEffect(gen_style(1));
|
||||
}else{
|
||||
ui->lineEdit_SHA1->setGraphicsEffect(gen_style(2));
|
||||
}
|
||||
|
||||
if(need == SHA256){
|
||||
ui->lineEdit_SHA256->setGraphicsEffect(gen_style(1));
|
||||
}else{
|
||||
ui->lineEdit_SHA256->setGraphicsEffect(gen_style(2));
|
||||
}
|
||||
|
||||
if(need == SHA384){
|
||||
ui->lineEdit_SHA384->setGraphicsEffect(gen_style(1));
|
||||
}else{
|
||||
|
||||
ui->lineEdit_SHA384->setGraphicsEffect(gen_style(2));
|
||||
}
|
||||
|
||||
if(need == SHA512){
|
||||
ui->lineEdit_SHA512->setGraphicsEffect(gen_style(1));
|
||||
}else{
|
||||
|
||||
ui->lineEdit_SHA512->setGraphicsEffect(gen_style(2));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QGraphicsDropShadowEffect * comp_window::gen_style(int style){
|
||||
QGraphicsDropShadowEffect * effect = new QGraphicsDropShadowEffect(this);
|
||||
|
||||
effect->setOffset(0, 0);
|
||||
effect->setBlurRadius(10);
|
||||
if(style==1){
|
||||
effect->setColor(Qt::green);
|
||||
}
|
||||
if(style==2){
|
||||
effect->setColor(Qt::red);
|
||||
}
|
||||
return effect;
|
||||
}
|
||||
void comp_window::set_hash_info(const QString &str, const QString &type)
|
||||
{
|
||||
|
||||
this->setWindowTitle(str);
|
||||
if(type=="type" && str == "查看"){
|
||||
ui->label->hide();
|
||||
ui->lineEdit_need_comp->hide();
|
||||
ui->lineEdit_CRC32->setGraphicsEffect(gen_style(0));
|
||||
ui->lineEdit_MD5->setGraphicsEffect(gen_style(0));
|
||||
ui->lineEdit_MD4->setGraphicsEffect(gen_style(0));
|
||||
ui->lineEdit_SHA1->setGraphicsEffect(gen_style(0));
|
||||
ui->lineEdit_SHA256->setGraphicsEffect(gen_style(0));
|
||||
ui->lineEdit_SHA384->setGraphicsEffect(gen_style(0));
|
||||
ui->lineEdit_SHA512->setGraphicsEffect(gen_style(0));
|
||||
}
|
||||
if(type=="file_name")
|
||||
ui->lineEdit_file_name->setText(str);
|
||||
if(type=="file_size")
|
||||
ui->lineEdit_file_size->setText(str);
|
||||
if(type=="file_path")
|
||||
ui->lineEdit_file_path->setText(str);
|
||||
if(type=="CRC32")
|
||||
ui->lineEdit_CRC32->setText(str);
|
||||
if(type=="MD4")
|
||||
ui->lineEdit_MD4->setText(str);
|
||||
if(type=="MD5")
|
||||
ui->lineEdit_MD5->setText(str);
|
||||
if(type=="SHA1")
|
||||
ui->lineEdit_SHA1->setText(str);
|
||||
if(type=="SHA256")
|
||||
ui->lineEdit_SHA256->setText(str);
|
||||
if(type=="SHA384")
|
||||
ui->lineEdit_SHA384->setText(str);
|
||||
if(type=="SHA512")
|
||||
ui->lineEdit_SHA512->setText(str);
|
||||
|
||||
if(type=="type" && str=="对比"){
|
||||
comp_style = true;
|
||||
draw_comp_result();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void comp_window::on_lineEdit_need_comp_textChanged(const QString &arg1)
|
||||
{
|
||||
if(comp_style)
|
||||
draw_comp_result();
|
||||
|
||||
}
|
||||
|
31
comp_window.h
Normal file
31
comp_window.h
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef COMP_WINDOW_H
|
||||
#define COMP_WINDOW_H
|
||||
|
||||
#include "QGraphicsDropShadowEffect"
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class comp_window;
|
||||
}
|
||||
|
||||
class comp_window : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit comp_window(QWidget *parent = nullptr);
|
||||
void draw_comp_result();
|
||||
~comp_window();
|
||||
public slots:
|
||||
|
||||
void set_hash_info(const QString &str, const QString &type);
|
||||
private slots:
|
||||
void on_lineEdit_need_comp_textChanged(const QString &arg1);
|
||||
|
||||
|
||||
private:
|
||||
Ui::comp_window *ui;
|
||||
QGraphicsDropShadowEffect * gen_style(int style);
|
||||
};
|
||||
|
||||
#endif // COMP_WINDOW_H
|
178
comp_window.ui
Normal file
178
comp_window.ui
Normal file
@ -0,0 +1,178 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>comp_window</class>
|
||||
<widget class="QDialog" name="comp_window">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>561</width>
|
||||
<height>333</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<property name="modal">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_CRC32">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>文件名称</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_MD5">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_SHA256">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>SHA1</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>SHA512</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>SHA384</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_file_name">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_need_comp"/>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_SHA384">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>MD5</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>SHA256</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>文件大小</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_MD4">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_SHA1">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>MD4</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_SHA512">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>CRC32</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>哈希对比:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>文件路径</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_file_size">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_file_path">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
13
main.cpp
Normal file
13
main.cpp
Normal file
@ -0,0 +1,13 @@
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QStyleFactory>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
a.setStyle(QStyleFactory::create("fusion"));
|
||||
MainWindow w;
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
420
mainwindow.cpp
Normal file
420
mainwindow.cpp
Normal file
@ -0,0 +1,420 @@
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include <calculator.h>
|
||||
#include <QDragEnterEvent>
|
||||
#include <QFile>
|
||||
#include <QDebug>
|
||||
#include <QMimeData>
|
||||
#include <QTimer>
|
||||
#include <QString>
|
||||
#include <QTime>
|
||||
#include <QFileInfo>
|
||||
#include <QCryptographicHash>
|
||||
#include <qtconcurrentrun.h>
|
||||
#include <QFutureWatcher>
|
||||
#include <QPushButton>
|
||||
#include <comp_window.h>
|
||||
#include <QLineEdit>
|
||||
#include <QGraphicsDropShadowEffect>
|
||||
#include <QMessageBox>
|
||||
|
||||
|
||||
QString global_status = "空闲";
|
||||
|
||||
QString get_file_size_string(double file_size) {
|
||||
const char* units[] = {"B", "KB", "MB", "GB", "TB", "PB"};
|
||||
double size = static_cast<double>(file_size);
|
||||
long long unsigned int i = 0;
|
||||
while (size >= 1024 && i < (sizeof(units) / sizeof(units[0]) - 1)) {
|
||||
size /= 1024;
|
||||
++i;
|
||||
}
|
||||
return QString("%1 %2").arg(size).arg(units[i]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MainWindow::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
adjustColumnSize();
|
||||
}
|
||||
|
||||
double getProcess(){
|
||||
auto cursor = process.begin();
|
||||
int total = 0;
|
||||
double process_percent = 0;
|
||||
while(cursor!=process.end()){
|
||||
total++;
|
||||
double single = (cursor->second["crc32"]+
|
||||
cursor->second["md4"]+
|
||||
cursor->second["md5"]+
|
||||
cursor->second["sha1"]+
|
||||
cursor->second["sha256"]+
|
||||
cursor->second["sha384"]+
|
||||
cursor->second["sha512"])*1.0 / (calc_number) * 100;
|
||||
process_percent += single;
|
||||
cursor ++;
|
||||
}
|
||||
return process_percent / total;
|
||||
}
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setAcceptDrops(true);
|
||||
QLabel * status = new QLabel();
|
||||
ui->statusbar->insertWidget(0,status);
|
||||
QLabel * calc_process = new QLabel();
|
||||
ui->statusbar->insertWidget(1,calc_process);
|
||||
QTimer * kernel = new QTimer();
|
||||
kernel->start(500);
|
||||
connect(kernel,&QTimer::timeout,[=](){
|
||||
double p = getProcess();
|
||||
if(int(p)==100){
|
||||
global_status = "已完成";
|
||||
process.clear();
|
||||
}
|
||||
status->setText("状态: " + global_status);
|
||||
|
||||
if(global_status == "已完成" || global_status == "空闲" ){
|
||||
|
||||
calc_process->setText("队列进度: 100%" );
|
||||
}else{
|
||||
|
||||
calc_process->setText("队列进度: " + QString("%1%").arg(p));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MainWindow::dragEnterEvent(QDragEnterEvent *e)
|
||||
{
|
||||
e->acceptProposedAction();
|
||||
}
|
||||
|
||||
|
||||
auto MainWindow::gen_obj(QString text){
|
||||
auto obj = new QLineEdit();
|
||||
obj->setText(text);
|
||||
obj->setReadOnly(true);
|
||||
obj->setStyleSheet("QLineEdit{border:0px solid gray;}QLineEdit:focus {border-width:2px;border-color:rgb(170, 170, 255);background:rgba(69, 63, 45, 255);}");
|
||||
|
||||
|
||||
// QGraphicsDropShadowEffect *shadow_effect = new QGraphicsDropShadowEffect(this);
|
||||
// shadow_effect->setOffset(0, 0);
|
||||
// shadow_effect->setColor(Qt::red);
|
||||
// shadow_effect->setBlurRadius(20);
|
||||
// obj->setGraphicsEffect(shadow_effect);
|
||||
|
||||
return obj;
|
||||
}
|
||||
void MainWindow::open_comp_window(int type, int curr_row){
|
||||
auto cursor = process.begin();
|
||||
while(cursor!=process.end()){
|
||||
if(cursor->first == QString("%1%2").arg(ui->tableWidget->item(curr_row,4)->text()).arg(curr_row)){
|
||||
double single = (cursor->second["crc32"]+
|
||||
cursor->second["md4"]+
|
||||
cursor->second["md5"]+
|
||||
cursor->second["sha1"]+
|
||||
cursor->second["sha256"]+
|
||||
cursor->second["sha384"]+
|
||||
cursor->second["sha512"])* 1.0 / (calc_number) * 100;
|
||||
if(single != 100){
|
||||
QMessageBox::warning(this,"稍等片刻","数据尚未计算完毕,请稍后再试");
|
||||
return;
|
||||
}
|
||||
}
|
||||
cursor++;
|
||||
}
|
||||
|
||||
comp_window *comp_win = new comp_window();
|
||||
connect(this, &MainWindow::send_hash_info,comp_win, &comp_window::set_hash_info);
|
||||
emit send_hash_info(ui->tableWidget->item(curr_row,2)->text(), "file_name");
|
||||
emit send_hash_info(ui->tableWidget->item(curr_row,3)->text(), "file_size");
|
||||
emit send_hash_info(ui->tableWidget->item(curr_row,4)->text(), "file_path");
|
||||
emit send_hash_info(ui->tableWidget->item(curr_row,5)->text(), "CRC32");
|
||||
emit send_hash_info(ui->tableWidget->item(curr_row,6)->text(), "MD4");
|
||||
emit send_hash_info(ui->tableWidget->item(curr_row,7)->text(), "MD5");
|
||||
emit send_hash_info(ui->tableWidget->item(curr_row,8)->text(), "SHA1");
|
||||
emit send_hash_info(ui->tableWidget->item(curr_row,9)->text(), "SHA256");
|
||||
emit send_hash_info(ui->tableWidget->item(curr_row,10)->text(), "SHA384");
|
||||
emit send_hash_info(ui->tableWidget->item(curr_row,11)->text(), "SHA512");
|
||||
if(type==1){
|
||||
emit send_hash_info("对比", "type");
|
||||
}
|
||||
else if (type == 2){
|
||||
emit send_hash_info("查看", "type");
|
||||
}
|
||||
comp_win->show();
|
||||
|
||||
}
|
||||
void MainWindow::Calculate(QString path){
|
||||
global_status = "正在计算";
|
||||
QFileInfo fileInfo(path);
|
||||
int rowCount = ui->tableWidget->rowCount();
|
||||
ui->tableWidget->insertRow(rowCount);
|
||||
QHBoxLayout *layout = new QHBoxLayout();
|
||||
auto * show_btn = new QPushButton();
|
||||
show_btn->setText("查看" );
|
||||
auto * comp_btn = new QPushButton();
|
||||
comp_btn->setText("比较");
|
||||
layout->insertWidget(0, comp_btn);
|
||||
layout->insertWidget(0, show_btn);
|
||||
|
||||
connect(comp_btn, &QPushButton::clicked,this, [&]() {
|
||||
QObject * obj = sender()->parent();
|
||||
QTableWidgetItem * item = (QTableWidgetItem *)obj;
|
||||
QWidget * widget = (QWidget *)item;
|
||||
int x = widget->frameGeometry().x();
|
||||
int y = widget->frameGeometry().y();
|
||||
QModelIndex modelIndex = ui->tableWidget->indexAt(QPoint(x, y));
|
||||
int curr_row = modelIndex.row();
|
||||
int column = modelIndex.column();
|
||||
open_comp_window(1,curr_row);
|
||||
|
||||
});
|
||||
|
||||
connect(show_btn, &QPushButton::clicked,this, [&]() {
|
||||
QObject * obj = sender()->parent();
|
||||
QTableWidgetItem * item = (QTableWidgetItem *)obj;
|
||||
QWidget * widget = (QWidget *)item;
|
||||
int x = widget->frameGeometry().x();
|
||||
int y = widget->frameGeometry().y();
|
||||
QModelIndex modelIndex = ui->tableWidget->indexAt(QPoint(x, y));
|
||||
int curr_row = modelIndex.row();
|
||||
int column = modelIndex.column();
|
||||
open_comp_window(2,curr_row);
|
||||
});
|
||||
|
||||
|
||||
layout->setContentsMargins(0,0,0,0);
|
||||
QWidget *widget = new QWidget();
|
||||
widget->setLayout(layout);
|
||||
ui->tableWidget->setItem(rowCount, 0, new QTableWidgetItem(""));
|
||||
ui->tableWidget->setCellWidget(rowCount, 0,widget );
|
||||
|
||||
|
||||
ui->tableWidget->setItem(rowCount, 1, new QTableWidgetItem(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss")));
|
||||
ui->tableWidget->setCellWidget(rowCount, 1, gen_obj(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss")));
|
||||
ui->tableWidget->setItem(rowCount, 2, new QTableWidgetItem(fileInfo.fileName()));
|
||||
ui->tableWidget->setCellWidget(rowCount, 2, gen_obj(fileInfo.fileName()));
|
||||
ui->tableWidget->setItem(rowCount, 3, new QTableWidgetItem(get_file_size_string(fileInfo.size())));
|
||||
ui->tableWidget->setCellWidget(rowCount, 3, gen_obj(get_file_size_string(fileInfo.size())));
|
||||
ui->tableWidget->setItem(rowCount, 4, new QTableWidgetItem(fileInfo.filePath()));
|
||||
ui->tableWidget->setCellWidget(rowCount, 4, gen_obj(fileInfo.filePath()));
|
||||
adjustColumnSize();
|
||||
if(ui->checkBox_CRC32->isChecked()){
|
||||
|
||||
QFuture<QString > future = QtConcurrent::run(GetCRC32, path,rowCount);
|
||||
QFutureWatcher<QString> *m_watcher = new QFutureWatcher<QString>(this);
|
||||
m_watcher = new QFutureWatcher<QString>(this);
|
||||
m_watcher->setFuture(future);
|
||||
connect(m_watcher, &QFutureWatcher<QString>::finished, this, [=](){
|
||||
auto item = new QTableWidgetItem(future.result());
|
||||
this->ui->tableWidget->setItem(rowCount, 5, item);
|
||||
ui->tableWidget->setCellWidget(rowCount, 5, gen_obj(future.result()));
|
||||
adjustColumnSize();
|
||||
});
|
||||
}else{
|
||||
|
||||
process[QString("%1%2").arg(path).arg(rowCount)]["crc32"] = 1;
|
||||
this->ui->tableWidget->setItem(rowCount, 5, new QTableWidgetItem("---"));
|
||||
ui->tableWidget->setCellWidget(rowCount, 5, gen_obj("---"));
|
||||
}
|
||||
if(ui->checkBox_MD4->isChecked()){
|
||||
QFuture<QString > future = QtConcurrent::run(GetMD4, path,rowCount);
|
||||
QFutureWatcher<QString> *m_watcher = new QFutureWatcher<QString>(this);
|
||||
m_watcher = new QFutureWatcher<QString>(this);
|
||||
m_watcher->setFuture(future);
|
||||
connect(m_watcher, &QFutureWatcher<QString>::finished, this, [=](){
|
||||
this->ui->tableWidget->setItem(rowCount, 6, new QTableWidgetItem(future.result()));
|
||||
ui->tableWidget->setCellWidget(rowCount, 6, gen_obj(future.result()));
|
||||
adjustColumnSize();
|
||||
});
|
||||
}else{
|
||||
process[QString("%1%2").arg(path).arg(rowCount)]["md4"] = 1;
|
||||
this->ui->tableWidget->setItem(rowCount, 6, new QTableWidgetItem("---"));
|
||||
ui->tableWidget->setCellWidget(rowCount, 6, gen_obj("---"));
|
||||
}
|
||||
if(ui->checkBox_MD5->isChecked()){
|
||||
QFuture<QString > future = QtConcurrent::run(GetMD5, path,rowCount);
|
||||
QFutureWatcher<QString> *m_watcher = new QFutureWatcher<QString>(this);
|
||||
m_watcher = new QFutureWatcher<QString>(this);
|
||||
m_watcher->setFuture(future);
|
||||
connect(m_watcher, &QFutureWatcher<QString>::finished, this, [=](){
|
||||
this->ui->tableWidget->setItem(rowCount, 7, new QTableWidgetItem(future.result()));
|
||||
ui->tableWidget->setCellWidget(rowCount, 7, gen_obj(future.result()));
|
||||
adjustColumnSize();
|
||||
});
|
||||
}else{
|
||||
|
||||
process[QString("%1%2").arg(path).arg(rowCount)]["md5"] = 1;
|
||||
this->ui->tableWidget->setItem(rowCount, 7, new QTableWidgetItem("---"));
|
||||
ui->tableWidget->setCellWidget(rowCount, 7, gen_obj("---"));
|
||||
}
|
||||
if(ui->checkBox_SHA1->isChecked()){
|
||||
QFuture<QString > future = QtConcurrent::run(GetSHA1, path,rowCount);
|
||||
QFutureWatcher<QString> *m_watcher = new QFutureWatcher<QString>(this);
|
||||
m_watcher = new QFutureWatcher<QString>(this);
|
||||
m_watcher->setFuture(future);
|
||||
connect(m_watcher, &QFutureWatcher<QString>::finished, this, [=](){
|
||||
this->ui->tableWidget->setItem(rowCount, 8, new QTableWidgetItem(future.result()));
|
||||
ui->tableWidget->setCellWidget(rowCount, 8, gen_obj(future.result()));
|
||||
adjustColumnSize();
|
||||
});
|
||||
}else{
|
||||
process[QString("%1%2").arg(path).arg(rowCount)]["sha1"] = 1;
|
||||
this->ui->tableWidget->setItem(rowCount, 8, new QTableWidgetItem("---"));
|
||||
ui->tableWidget->setCellWidget(rowCount, 8, gen_obj("---"));
|
||||
}
|
||||
if(ui->checkBox_SHA256->isChecked()){
|
||||
QFuture<QString > future = QtConcurrent::run(GetSHA256, path,rowCount);
|
||||
QFutureWatcher<QString> *m_watcher = new QFutureWatcher<QString>(this);
|
||||
m_watcher = new QFutureWatcher<QString>(this);
|
||||
m_watcher->setFuture(future);
|
||||
connect(m_watcher, &QFutureWatcher<QString>::finished, this, [=](){
|
||||
this->ui->tableWidget->setItem(rowCount, 9, new QTableWidgetItem(future.result()));
|
||||
ui->tableWidget->setCellWidget(rowCount, 9, gen_obj(future.result()));
|
||||
adjustColumnSize();
|
||||
});
|
||||
}else{
|
||||
process[QString("%1%2").arg(path).arg(rowCount)]["sha256"] = 1;
|
||||
this->ui->tableWidget->setItem(rowCount, 9, new QTableWidgetItem("---"));
|
||||
ui->tableWidget->setCellWidget(rowCount, 9, gen_obj("---"));
|
||||
}
|
||||
if(ui->checkBox_SHA384->isChecked()){
|
||||
QFuture<QString > future = QtConcurrent::run(GetSHA384, path,rowCount);
|
||||
QFutureWatcher<QString> *m_watcher = new QFutureWatcher<QString>(this);
|
||||
m_watcher = new QFutureWatcher<QString>(this);
|
||||
m_watcher->setFuture(future);
|
||||
connect(m_watcher, &QFutureWatcher<QString>::finished, this, [=](){
|
||||
this->ui->tableWidget->setItem(rowCount, 10, new QTableWidgetItem(future.result()));
|
||||
ui->tableWidget->setCellWidget(rowCount, 10, gen_obj(future.result()));
|
||||
adjustColumnSize();
|
||||
});
|
||||
}else{
|
||||
process[QString("%1%2").arg(path).arg(rowCount)]["sha384"] = 1;
|
||||
this->ui->tableWidget->setItem(rowCount, 10, new QTableWidgetItem("---"));
|
||||
ui->tableWidget->setCellWidget(rowCount, 10, gen_obj("---"));
|
||||
}
|
||||
|
||||
|
||||
if(ui->checkBox_SHA512->isChecked()){
|
||||
QFuture<QString > future = QtConcurrent::run(GetSHA512, path, rowCount);
|
||||
QFutureWatcher<QString> *m_watcher = new QFutureWatcher<QString>(this);
|
||||
m_watcher = new QFutureWatcher<QString>(this);
|
||||
m_watcher->setFuture(future);
|
||||
connect(m_watcher, &QFutureWatcher<QString>::finished, this, [=](){
|
||||
this->ui->tableWidget->setItem(rowCount, 11, new QTableWidgetItem(future.result()));
|
||||
ui->tableWidget->setCellWidget(rowCount, 11, gen_obj(future.result()));
|
||||
adjustColumnSize();
|
||||
});
|
||||
}else{
|
||||
process[QString("%1%2").arg(path).arg(rowCount)]["sha512"] = 1;
|
||||
this->ui->tableWidget->setItem(rowCount, 11, new QTableWidgetItem("---"));
|
||||
ui->tableWidget->setCellWidget(rowCount, 11, gen_obj("---"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
void MainWindow::dropEvent(QDropEvent *e)
|
||||
{
|
||||
QList<QUrl> urls = e->mimeData()->urls();
|
||||
if(urls.isEmpty())
|
||||
return ;
|
||||
foreach (QUrl u, urls)
|
||||
{
|
||||
QString filepath = u.toLocalFile();
|
||||
pathlist.append(filepath);
|
||||
}
|
||||
for(int i=0;i<pathlist.size();++i)
|
||||
{
|
||||
QString path = pathlist.at(i);
|
||||
Calculate(path);
|
||||
}
|
||||
pathlist.clear();
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::adjustColumnSize(){
|
||||
ui->tableWidget->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
ui->tableWidget->horizontalHeader()->setStretchLastSection(true);
|
||||
}
|
||||
void MainWindow::columnSwitcher(int id, int flag){
|
||||
if(flag==2) ui->tableWidget->showColumn(id+4);
|
||||
else ui->tableWidget->hideColumn(id+4);
|
||||
}
|
||||
|
||||
void MainWindow::on_checkBox_SHA512_stateChanged(int arg1)
|
||||
{
|
||||
columnSwitcher(7,arg1);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_checkBox_SHA384_stateChanged(int arg1)
|
||||
{
|
||||
columnSwitcher(6,arg1);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_checkBox_SHA256_stateChanged(int arg1)
|
||||
{
|
||||
columnSwitcher(5,arg1);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_checkBox_SHA1_stateChanged(int arg1)
|
||||
{
|
||||
columnSwitcher(4,arg1);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_checkBox_MD5_stateChanged(int arg1)
|
||||
{
|
||||
columnSwitcher(3,arg1);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_checkBox_MD4_stateChanged(int arg1)
|
||||
{
|
||||
columnSwitcher(2,arg1);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_checkBox_CRC32_stateChanged(int arg1)
|
||||
{
|
||||
columnSwitcher(1,arg1);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_checkBox_calc_time_stateChanged(int arg1)
|
||||
{
|
||||
columnSwitcher(-3,arg1);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_checkBox_file_name_stateChanged(int arg1)
|
||||
{
|
||||
columnSwitcher(-2,arg1);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_checkBox_file_size_stateChanged(int arg1)
|
||||
{
|
||||
columnSwitcher(-1,arg1);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_checkBox_file_path_stateChanged(int arg1)
|
||||
{
|
||||
columnSwitcher(0,arg1);
|
||||
}
|
||||
|
||||
|
50
mainwindow.h
Normal file
50
mainwindow.h
Normal file
@ -0,0 +1,50 @@
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QTextEdit>
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MainWindow(QWidget *parent = 0);
|
||||
void Calculate(QString path);
|
||||
auto gen_obj(QString text);
|
||||
~MainWindow();
|
||||
|
||||
protected:
|
||||
void dragEnterEvent(QDragEnterEvent *e);
|
||||
void dropEvent(QDropEvent *e);
|
||||
void columnSwitcher(int id, int flag);
|
||||
|
||||
private slots:
|
||||
|
||||
void on_checkBox_SHA384_stateChanged(int arg1);
|
||||
void on_checkBox_SHA512_stateChanged(int arg1);
|
||||
void on_checkBox_SHA256_stateChanged(int arg1);
|
||||
void on_checkBox_SHA1_stateChanged(int arg1);
|
||||
void on_checkBox_MD5_stateChanged(int arg1);
|
||||
void on_checkBox_MD4_stateChanged(int arg1);
|
||||
void on_checkBox_CRC32_stateChanged(int arg1);
|
||||
void on_checkBox_calc_time_stateChanged(int arg1);
|
||||
void on_checkBox_file_name_stateChanged(int arg1);
|
||||
void on_checkBox_file_size_stateChanged(int arg1);
|
||||
void on_checkBox_file_path_stateChanged(int arg1);
|
||||
signals:
|
||||
void send_hash_info(const QString &str, const QString &type);
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
QList<QString> pathlist;
|
||||
void adjustColumnSize();
|
||||
virtual void resizeEvent(QResizeEvent* event) override;
|
||||
void open_comp_window(int type,int curr_row);
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
246
mainwindow.ui
Normal file
246
mainwindow.ui
Normal file
@ -0,0 +1,246 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1120</width>
|
||||
<height>523</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Hasher</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="6" column="0" colspan="4">
|
||||
<widget class="QTableWidget" name="tableWidget">
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>操作</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>计算时间</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>文件名</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>文件大小</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>文件路径</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>CRC32</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>MD4</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>MD5</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>SHA1</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>SHA256</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>SHA384</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>SHA512</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="4">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>表头显示:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_calc_time">
|
||||
<property name="text">
|
||||
<string>计算时间</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_file_name">
|
||||
<property name="text">
|
||||
<string>文件名</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_file_size">
|
||||
<property name="text">
|
||||
<string>文件大小</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_file_path">
|
||||
<property name="text">
|
||||
<string>文件路径</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>计算:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_CRC32">
|
||||
<property name="text">
|
||||
<string>CRC32</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_MD4">
|
||||
<property name="text">
|
||||
<string>MD4</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_MD5">
|
||||
<property name="text">
|
||||
<string>MD5</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_SHA1">
|
||||
<property name="text">
|
||||
<string>SHA1</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_SHA256">
|
||||
<property name="text">
|
||||
<string>SHA256</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_SHA384">
|
||||
<property name="text">
|
||||
<string>SHA384</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_SHA512">
|
||||
<property name="text">
|
||||
<string>SHA512</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>移动文件至窗口内,进行哈希计算</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Reference in New Issue
Block a user