Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update #15

Merged
merged 41 commits into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
e0abd4a
refactor: Optimize common library module[190651]
Greedysky Jan 13, 2023
0165967
style: Code format clean[974921]
Greedysky Jan 17, 2023
5620786
refactor: Optimize common library module[500211]
Greedysky Jan 19, 2023
8ead0f4
refactor: Optimize common library module[612311]
Greedysky Jan 27, 2023
3c86f2d
refactor: Optimize time sleep module[055122]
Greedysky Jan 30, 2023
e1995d6
Bump version 2.6.0.0 Final
Greedysky Jan 30, 2023
3ace52d
refactor: Optimize widget ui object definitions[389551]
Greedysky Jan 30, 2023
efb269d
style: Code format clean[697551]
Greedysky Feb 2, 2023
bd6215c
refactor: Optimize common library module[712004]
Greedysky Feb 8, 2023
0eaa216
refactor: Optimize common library module[991001]
Greedysky Feb 10, 2023
7f37bbb
refactor: Optimize common resizable window module[051200]
Greedysky Feb 13, 2023
4e64618
refactor: Optimize common xml module[540912]
Greedysky Feb 14, 2023
52d5b2e
refactor: Optimize file dialog filter data[401921]
Greedysky Feb 14, 2023
cb176a8
refactor: Optimize network module[655122]
Greedysky Feb 15, 2023
abc90f3
refactor: Optimize common xml module[605479]
Greedysky Feb 23, 2023
8849984
refactor: Optimize common thread module[054417]
Greedysky Feb 24, 2023
270ba1e
style: Code format clean[597220]
Greedysky Feb 24, 2023
a59ee4c
refactor: Optimize common main module[497847]
Greedysky Mar 3, 2023
40e0c09
refactor: Optimize common desktop module[142946]
Greedysky Mar 5, 2023
e41c263
refactor: Optimize global ttk namespace[096221]
Greedysky Mar 10, 2023
a6819f0
refactor: Fixed some clang-tidy and clazy warnings[671857]
Greedysky Mar 12, 2023
652e41f
refactor: Optimize global project module[298701]
Greedysky Mar 15, 2023
03b1f5c
refactor: Optimize common any module[509756]
Greedysky Mar 16, 2023
b621ba3
refactor: Optimize common any module[479801]
Greedysky Mar 16, 2023
30ba944
refactor: Optimize module for msvc version[795687]
Greedysky Mar 17, 2023
8943cda
docs: Update resource document[823164]
Greedysky Mar 19, 2023
c847f1d
refactor: Optimize global ttk cast module[067789]
Greedysky Mar 22, 2023
158b3f2
docs: Update resource document[434754]
Greedysky Mar 27, 2023
60e44f5
docs: Update resource document[348701]
Greedysky Mar 29, 2023
eda4443
refactor: Optimize network module[649785]
Greedysky Mar 29, 2023
0273c01
refactor: Optimize common thread module[003904]
Greedysky Mar 30, 2023
ddd801b
refactor: Optimize common thread module[478014]
Greedysky Mar 31, 2023
46d8e88
style: Code format clean[924785]
Greedysky Apr 5, 2023
a982b34
docs: Update resource document[159015]
Greedysky Apr 11, 2023
6713379
refactor: Optimize common thread module[348601]
Greedysky Apr 11, 2023
31c4046
refactor: Optimize common definition module[963011]
Greedysky Apr 12, 2023
65644c1
Bump version 2.7.0.0 Final
Greedysky Apr 14, 2023
96a3f41
refactor: Clean code[096631]
Greedysky Apr 19, 2023
ae8c627
refactor: Optimize global variable explicitly[503662]
Greedysky Apr 25, 2023
f9883c5
refactor: Optimize global command line module[396554]
Greedysky May 12, 2023
31cb878
refactor: Optimize global delegate module[604877]
Greedysky May 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 46 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,46 @@
# TTKTinyTools
Qt 自定义小工具集合
![TTKTinyTools](https://img.shields.io/badge/Greedysky-TTKTinyTools-green.svg?style=flat-square)
![Version](https://img.shields.io/badge/Version-2.6.0.0-blue.svg?style=flat-square)
![License](https://img.shields.io/badge/License-GPL%20V3-yellowgreen.svg?style=flat-square)

![LOGO](https://github.com/Greedysky/TTKTinyTools/blob/master/TTKResource/logo_banner.png?raw=true)

### **|[About](https://github.com/Greedysky/TTKTinyTools#usage)|[License](https://github.com/Greedysky/TTKTinyTools#license)|[Download](https://github.com/Greedysky/TTKTinyTools#download)|[Features](https://github.com/Greedysky/TTKTinyTools#features)|[Screenshots](https://github.com/Greedysky/TTKTinyTools#screenshots)|[Copyright](https://github.com/Greedysky/TTKTinyTools#copyright)|[Contribute](https://github.com/Greedysky/TTKTinyTools#how-to-contribute)|**

Usage
--------
**TTKTinyTools 是基于 Qt 的自定义小工具集合,支持Windows和Linux平台.**

## CI Status
* Qt stable version be tested on Qt4.8.7 for windows-mingw 32bit
* Qt stable version be tested on Qt4.8.7 for ubuntu-linux-gcc 64bit
* Qt stable version be tested on Qt5.9.9 for ubuntu-linux-gcc 64bit
* Qt stable version be tested on Qt5.5.1 for windows-msvc 32bit
* Qt stable version be tested on Qt5.x for windows-mingw 32bit
* Qt stable version be tested on Qt6.x for windows-mingw 64bit

| Platform | Qt & Compiler | Status |
| :---: | :---: | :---: |
| Linux | 4.8.7 GCC & 5.9.9 GCC | ![Linux](https://img.shields.io/badge/build-passing-brightgreen.svg) |
| Windows | 4.8.7 GCC & 5.x GCC & 6.x GCC | ![Windows](https://img.shields.io/badge/build-passing-brightgreen.svg) |
| Windows | 5.5.1 MSVC | ![Windows](https://img.shields.io/badge/build-passing-brightgreen.svg) |
| OS X | Clang | ![OSX](https://img.shields.io/badge/build-unknown-lightgrey.svg) |

Module
----
* Qt stable version is tested on Qt4.x for windows-mingw 32bit
* Qt stable version is tested on Qt4.x for ubuntu-linux-gcc 64bit
* Qt stable version is tested on Qt5.x for ubuntu-linux-gcc 64bit
* Qt stable version is tested on Qt5.x for windows-msvc 32bit
* Qt stable version is tested on Qt5.x for windows-msvc 64bit
* Qt stable version is tested on Qt5.x for windows-mingw 32bit
* Qt stable version is tested on Qt6.x for windows-mingw 64bit

| Platform | Qt & Compiler | Status |
| :---: | :---: | :---: |
| Linux | 4.x GCC & 5.x GCC | ![Linux](https://img.shields.io/badge/build-passing-brightgreen.svg) |
| Windows | 4.x GCC & 5.x GCC & 6.x GCC | ![Windows](https://img.shields.io/badge/build-passing-brightgreen.svg) |
| Windows | 5.x MSVC | ![Windows](https://img.shields.io/badge/build-passing-brightgreen.svg) |
| OS X | Clang | ![OSX](https://img.shields.io/badge/build-unknown-lightgrey.svg) |

# For Developers

License
--------
TTKTinyTools is free software licensed under the term of [Licence GPL v3](https://github.com/Greedysky/TTKTinyTools/blob/master/LICENSE). If you use TTKTinyTools or its constituent libraries, you must adhere to the terms of the license in question.

Download
--------
Gitee URL: **<u>https://gitee.com/Greedysky/TTKTinyTools</u>**

Github URL: **<u>https://github.com/Greedysky/TTKTinyTools</u>**

Features
--------
| Module | Description | Status |
| :---: | :---: | :---: |
| TTKPngHelper | Qt 去除加载png图像文件时候的iccp警告 | 完成 |
Expand Down Expand Up @@ -49,14 +72,17 @@ Module
| TTKWaterWave | Qt 图片水波效果 | 完成 |
| TTKNetTraffic | Qt CPU内存网速显示 | 完成 |

Screenshots
--------

Copyright
-------
--------
* This file is part of the TTK Tiny Tools project.
* Copyright (C) 2015 - 2023 Greedysky Studio.
* mail: [email protected].
* Mail: [email protected].

How To Contribute
-------
--------
* Fork this project on github and make a branch. Commit in that branch, and push, then create a pull request to be reviewed and merged.
* Create an issue if you have any problem when using project or you find a bug, etc.
* What you can do: translation, write document, wiki, find or fix bugs, give your idea for this project etc.
Expand Down
9 changes: 0 additions & 9 deletions TTKCommon/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
cmake_minimum_required(VERSION 2.8.11)

if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 OLD)
cmake_policy(SET CMP0005 OLD)
cmake_policy(SET CMP0028 OLD)
endif(COMMAND cmake_policy)

add_definitions(-DQT_NO_DEBUG)
add_definitions(-DQT_THREAD)

add_subdirectory(TTKLibrary)
add_subdirectory(TTKDumper)
3 changes: 3 additions & 0 deletions TTKCommon/TTKCommon.pri
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@ win32{
$$PWD/TTKLibrary/ttkabstractresizeinterface.h \
$$PWD/TTKLibrary/ttkabstractthread.h \
$$PWD/TTKLibrary/ttkabstractxml.h \
$$PWD/TTKLibrary/ttkany.h \
$$PWD/TTKLibrary/ttkclickedgroup.h \
$$PWD/TTKLibrary/ttkclickedlabel.h \
$$PWD/TTKLibrary/ttkclickedslider.h \
$$PWD/TTKLibrary/ttkcommandline.h \
$$PWD/TTKLibrary/ttkconcurrentqueue.h \
$$PWD/TTKLibrary/ttkcryptographichash.h \
$$PWD/TTKLibrary/ttkdesktopwrapper.h \
$$PWD/TTKLibrary/ttkglobalhelper.h \
$$PWD/TTKLibrary/ttkitemdelegate.h \
$$PWD/TTKLibrary/ttklibrary.h \
$$PWD/TTKLibrary/ttklibraryversion.h \
$$PWD/TTKLibrary/ttksemaphoreloop.h \
$$PWD/TTKLibrary/ttksuperenum.h \
$$PWD/TTKLibrary/ttktabbutton.h \
Expand Down
8 changes: 4 additions & 4 deletions TTKCommon/TTKDumper/miniprocess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static bool killProcess(LPCWSTR processName)
return true;
}

void TTKObject::killProcessByName(const QString &process)
void TTK::killProcessByName(const QString &process)
{
const QStringList list(processList());
if(list.contains(process) && killProcess(process.toStdWString().c_str()))
Expand All @@ -86,7 +86,7 @@ void TTKObject::killProcessByName(const QString &process)
}
}

void TTKObject::killProcessByName(const QStringList &processes)
void TTK::killProcessByName(const QStringList &processes)
{
const QStringList list(processList());
for(const QString &process : qAsConst(processes))
Expand Down Expand Up @@ -146,7 +146,7 @@ static bool killProcess(int pid)
return true;
}

void TTKObject::killProcessByName(const QString &process)
void TTK::killProcessByName(const QString &process)
{
const QList<PIDInfo> list(processList());
for(const PIDInfo &info : qAsConst(list))
Expand All @@ -159,7 +159,7 @@ void TTKObject::killProcessByName(const QString &process)
}
}

void TTKObject::killProcessByName(const QStringList &processes)
void TTK::killProcessByName(const QStringList &processes)
{
const QList<PIDInfo> list(processList());
for(const QString &process : qAsConst(processes))
Expand Down
2 changes: 1 addition & 1 deletion TTKCommon/TTKDumper/miniprocess.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "ttkglobaldefine.h"

namespace TTKObject
namespace TTK
{
/*!
* Kill process by name.
Expand Down
2 changes: 1 addition & 1 deletion TTKCommon/TTKDumper/ttkdumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ LONG TTKDumperPrivate::errorHandler(EXCEPTION_POINTERS *info)

if(instance)
{
MINIDUMPWRITEDUMP dump = TTKVoid_cast(MINIDUMPWRITEDUMP)GetProcAddress(instance, "MiniDumpWriteDump");
MINIDUMPWRITEDUMP dump = TTKVoidCast(MINIDUMPWRITEDUMP)GetProcAddress(instance, "MiniDumpWriteDump");
if(dump)
{
WCHAR dumpPath[_MAX_PATH];
Expand Down
37 changes: 16 additions & 21 deletions TTKCommon/TTKLibrary/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,39 @@ cmake_minimum_required(VERSION 2.8.11)

project(TTKLibrary)

if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 OLD)
cmake_policy(SET CMP0005 OLD)
cmake_policy(SET CMP0028 OLD)
endif(COMMAND cmake_policy)

add_definitions(-DQT_NO_DEBUG)
add_definitions(-DQT_THREAD)

set(MUSIC_HEADERS
set(HEADER_FILES
ttkabstractmovedialog.h
ttkabstractmoveresizewidget.h
ttkabstractmovewidget.h
ttkabstractresizeinterface.h
ttkabstractthread.h
ttkabstractxml.h
ttkany.h
ttkclickedgroup.h
ttkclickedlabel.h
ttkclickedslider.h
ttkcommandline.h
ttkconcurrentqueue.h
ttkcryptographichash.h
ttkdesktopwrapper.h
ttkglobalhelper.h
ttkitemdelegate.h
ttklibrary.h
ttklibraryversion.h
ttksemaphoreloop.h
ttksuperenum.h
ttktabbutton.h
ttktime.h
ttktoastlabel.h
)

set(MUSIC_SOURCES
set(SOURCE_FILES
ttkabstractmovedialog.cpp
ttkabstractmoveresizewidget.cpp
ttkabstractmovewidget.cpp
ttkabstractthread.cpp
ttkabstractxml.cpp
ttkany.cpp
ttkclickedgroup.cpp
ttkclickedlabel.cpp
ttkclickedslider.cpp
Expand All @@ -55,34 +50,34 @@ set(MUSIC_SOURCES
ttktoastlabel.cpp
)

SET(MUSIC_QRC
SET(QRC_FILES
${PROJECT_NAME}.qrc
)

if(WIN32)
list(APPEND MUSIC_SOURCES ${PROJECT_NAME}.rc)
list(APPEND SOURCE_FILES ${PROJECT_NAME}.rc)
endif()

if(TTK_QT_VERSION VERSION_GREATER "4")
QT5_WRAP_CPP(MUSIC_MOC_H ${MUSIC_HEADERS})
QT5_ADD_RESOURCES(MUSIC_RCC_SRCS ${MUSIC_QRC})
qt5_wrap_cpp(MOC_FILES ${HEADER_FILES})
qt5_add_resources(RCC_FILES ${QRC_FILES})

if(TTK_BUILD_SHARED)
add_library(${PROJECT_NAME} SHARED ${MUSIC_SOURCES} ${MUSIC_MOC_H} ${MUSIC_HEADERS})
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${MOC_FILES} ${HEADER_FILES})
else()
add_library(${PROJECT_NAME} STATIC ${MUSIC_SOURCES} ${MUSIC_MOC_H} ${MUSIC_HEADERS})
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES} ${MOC_FILES} ${HEADER_FILES})
endif()

set(QT5_LIBS Qt5::Core Qt5::Xml Qt5::Gui Qt5::Widgets)
target_link_libraries(${PROJECT_NAME} ${QT5_LIBS})
else()
QT4_WRAP_CPP(MUSIC_MOC_H ${MUSIC_HEADERS})
QT4_ADD_RESOURCES(MUSIC_RCC_SRCS ${MUSIC_QRC})
qt4_wrap_cpp(MOC_FILES ${HEADER_FILES})
qt4_add_resources(RCC_FILES ${QRC_FILES})

if(TTK_BUILD_SHARED)
add_library(${PROJECT_NAME} SHARED ${MUSIC_SOURCES} ${MUSIC_MOC_H} ${MUSIC_RCC_SRCS} ${MUSIC_HEADERS})
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${MOC_FILES} ${RCC_FILES} ${HEADER_FILES})
else()
add_library(${PROJECT_NAME} STATIC ${MUSIC_SOURCES} ${MUSIC_MOC_H} ${MUSIC_RCC_SRCS} ${MUSIC_HEADERS})
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES} ${MOC_FILES} ${RCC_FILES} ${HEADER_FILES})
endif()

set(QT4_LIBS ${QT_QTCORE_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTGUI_LIBRARY})
Expand Down
6 changes: 5 additions & 1 deletion TTKCommon/TTKLibrary/TTKLibrary.pro
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ INCLUDEPATH += $$PWD/../
HEADERS += \
$$PWD/../ttkversion.h \
$$PWD/../ttksingleton.h \
$$PWD/../ttkqtwrapper.h \
$$PWD/../ttkqtcompat.h \
$$PWD/../ttkprivate.h \
$$PWD/../ttklogger.h \
$$PWD/../ttknumberdefine.h \
Expand All @@ -60,15 +60,18 @@ HEADERS += \
$$PWD/ttkabstractresizeinterface.h \
$$PWD/ttkabstractthread.h \
$$PWD/ttkabstractxml.h \
$$PWD/ttkany.h \
$$PWD/ttkclickedgroup.h \
$$PWD/ttkclickedlabel.h \
$$PWD/ttkclickedslider.h \
$$PWD/ttkcommandline.h \
$$PWD/ttkconcurrentqueue.h \
$$PWD/ttkcryptographichash.h \
$$PWD/ttkdesktopwrapper.h \
$$PWD/ttkglobalhelper.h \
$$PWD/ttkitemdelegate.h \
$$PWD/ttklibrary.h \
$$PWD/ttklibraryversion.h \
$$PWD/ttksemaphoreloop.h \
$$PWD/ttksuperenum.h \
$$PWD/ttktabbutton.h \
Expand All @@ -81,6 +84,7 @@ SOURCES += \
$$PWD/ttkabstractmovewidget.cpp \
$$PWD/ttkabstractthread.cpp \
$$PWD/ttkabstractxml.cpp \
$$PWD/ttkany.cpp \
$$PWD/ttkclickedgroup.cpp \
$$PWD/ttkclickedlabel.cpp \
$$PWD/ttkclickedslider.cpp \
Expand Down
12 changes: 6 additions & 6 deletions TTKCommon/TTKLibrary/ttkabstractmovedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void TTKAbstractMoveDialog::paintEvent(QPaintEvent *event)
if(m_showShadow)
{
QPainter painter(this);
TTKObject::setBorderShadow(this, &painter);
TTK::setBorderShadow(this, &painter);
}
}

Expand All @@ -35,7 +35,7 @@ void TTKAbstractMoveDialog::mousePressEvent(QMouseEvent *event)
m_leftButtonPress = true;
}

m_pressAt = QtMouseEventGlobalPos(event);
m_pressAt = QtMouseGlobalPos(event);
}

void TTKAbstractMoveDialog::mouseMoveEvent(QMouseEvent *event)
Expand All @@ -47,15 +47,15 @@ void TTKAbstractMoveDialog::mouseMoveEvent(QMouseEvent *event)
return;
}

const int xpos = QtMouseEventGlobalX(event) - m_pressAt.x();
const int ypos = QtMouseEventGlobalY(event) - m_pressAt.y();
m_pressAt = QtMouseEventGlobalPos(event);
const int xpos = QtMouseGlobalX(event) - m_pressAt.x();
const int ypos = QtMouseGlobalY(event) - m_pressAt.y();
m_pressAt = QtMouseGlobalPos(event);
move(x() + xpos, y() + ypos);
}

void TTKAbstractMoveDialog::mouseReleaseEvent(QMouseEvent *event)
{
QDialog::mouseReleaseEvent(event);
m_pressAt = QtMouseEventGlobalPos(event);
m_pressAt = QtMouseGlobalPos(event);
m_leftButtonPress = false;
}
Loading