Browse Source

v1.0.1

master
tianzhendong 2 years ago
parent
commit
ad90a4810f
  1. 28
      CMakeLists.txt
  2. 2
      README.md
  3. 0
      resources/favicon.ico
  4. 11
      resources/img.qrc
  5. 14
      src/widget.cpp
  6. 2
      src/widget.ui

28
CMakeLists.txt

@ -1,22 +1,44 @@
cmake_minimum_required(VERSION 3.22)
project(DuplicateFilesCheck)
# qrc
#file(GLOB_RECURSE QRC_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.qrc)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
# qrc
#set(QRC_SOURCE_FILES img.qrc)
#
set(CMAKE_PREFIX_PATH "C:/Qt/Qt5.14.2/5.14.2/mingw73_64")
# qt
find_package(Qt5 COMPONENTS
Core
Gui
Widgets
REQUIRED)
#
aux_source_directory(${PROJECT_SOURCE_DIR} DIR_MAIN_SRCS)
aux_source_directory(${PROJECT_SOURCE_DIR}/resources DIR_RESOURCES_SRCS)
aux_source_directory(${PROJECT_SOURCE_DIR}/src DIR_SRC_SRCS)
# qrc
qt5_add_resources(QRC_FILES resources/img.qrc)
#SOURCE_GROUP("Resource Files" FILES ${QRC_SOURCE_FILES})
include_directories(resources)
# debug releasereleasecmd
IF (CMAKE_BUILD_TYPE STREQUAL Debug)
add_executable(${PROJECT_NAME}
resources/app_win32.rc
${DIR_MAIN_SRCS} ${DIR_RESOURCES_SRCS} ${DIR_SRC_SRCS}
${QRC_FILES})
else(CMAKE_BUILD_TYPE STREQUAL Release)
add_executable(${PROJECT_NAME}
WIN32 resources/app_win32.rc ${QRC_FILES}
${DIR_MAIN_SRCS} ${DIR_RESOURCES_SRCS} ${DIR_SRC_SRCS} ${QRC_FILES})
ENDIF()
add_executable(DuplicateFilesCheck src/main.cpp app_win32.rc src/widget.cpp src/widget.h src/widget.ui src/DuplicateFiles.cpp src/DuplicateFiles.h)
target_link_libraries(DuplicateFilesCheck
Qt5::Core
Qt5::Gui

2
README.md

@ -5,4 +5,4 @@
## 功能
- 单个文件计算md5
- 文件夹内重复文件检测

0
favicon.ico → resources/favicon.ico

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

11
resources/img.qrc

@ -0,0 +1,11 @@
<RCC>
<qresource prefix="img">
<file>favicon.ico</file>
</qresource>
<qresource prefix="png">
<file>close.png</file>
<file>fullscreen3.png</file>
<file>fullscreen4.png</file>
<file>min.png</file>
</qresource>
</RCC>

14
src/widget.cpp

@ -31,9 +31,9 @@ Widget::Widget(QWidget *parent)
connect(ui->btnMin, SIGNAL(clicked()), this, SLOT(btnMinClickedSlot()));
connect(ui->btnClose, SIGNAL(clicked()), this, SLOT(btnCloseClickedSlot()));
ui->btnMin->setStyleSheet("border-image: url(../resources/min.png)");
ui->btnMax->setStyleSheet("border-image: url(../resources/fullscreen3.png)");
ui->btnClose->setStyleSheet("border-image: url(../resources/close.png)");
ui->btnMin->setStyleSheet("border-image: url(:/png/min.png)");
ui->btnMax->setStyleSheet("border-image: url(:/png/fullscreen3.png)");
ui->btnClose->setStyleSheet("border-image: url(:/png/close.png)");
duplicateFiles = new DuplicateFiles();
@ -43,7 +43,7 @@ Widget::Widget(QWidget *parent)
connect(duplicateFiles, SIGNAL(destroyed(QObject *)),
myThread, SLOT(deleteLater()));
ui->labelTitle->setText("文件一致性检测工具");
// ui->labelTitle->setText("文件一致性检测工具");
connect(ui->btnSelectFile, SIGNAL(clicked(bool)), this, SLOT(calMd5ofFileSlot()));
connect(ui->btnSelectDir, SIGNAL(clicked(bool)), this, SLOT(selectDirSlot()));
connect(this, SIGNAL(calFileMd5Signal(const QString &)),
@ -109,15 +109,15 @@ void Widget::closeEvent(QCloseEvent *event)
void Widget::btnMaxClickedSlot()
{
ui->btnMax->setStyleSheet("border-image: url(../resources/fullscreen4.png)");
ui->btnMax->setStyleSheet("border-image: url(:/png/fullscreen4.png)");
if(this->isMaximized()){
ui->layoutMain->setMargin(9);
ui->btnMax->setStyleSheet("border-image: url(../resources/fullscreen3.png)");
ui->btnMax->setStyleSheet("border-image: url(:/png/fullscreen3.png)");
this->showNormal();
}
else{
ui->layoutMain->setMargin(0);
ui->btnMax->setStyleSheet("border-image: url(../resources/fullscreen4.png)");
ui->btnMax->setStyleSheet("border-image: url(:/png/fullscreen4.png)");
this->showMaximized();
}
}

2
src/widget.ui

@ -82,7 +82,7 @@
</font>
</property>
<property name="text">
<string>windowTitle</string>
<string> 重复文件检测工具</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>

Loading…
Cancel
Save