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 #10

Merged
merged 6 commits into from
Feb 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions TTKCommon/TTKCommon.pri
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
# ***************************************************************************

INCLUDEPATH += $$PWD
HEADERS += \

HEADERS += \
$$PWD/ttkglobal.h \
$$PWD/ttkglobaldefine.h \
$$PWD/ttkprivate.h \
$$PWD/ttksingleton.h \
$$PWD/ttkversion.h \
$$PWD/ttkdesktopwrapper.h

SOURCES += \
$$PWD/ttkdesktopwrapper.cpp
SOURCES += $$PWD/ttkdesktopwrapper.cpp
21 changes: 13 additions & 8 deletions TTKCommon/ttkglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <QMap>
#include <QSet>
#include <QVariant>
#include <QtCore/qglobal.h>

#ifdef Q_CC_GNU
# pragma GCC diagnostic ignored "-Wunused-function"
Expand Down Expand Up @@ -135,15 +134,21 @@ Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) { return t; }
# endif
#endif

//
#define TTK_DECLARE_MODULE(Class) \
public: \
inline static QString className() \
{ \
return #Class; \
// disable copy
#define TTK_DISABLE_COPY(Class) \
private: \
Class(const Class &) TTK_DELETE; \
Class &operator=(const Class &) TTK_DELETE;

// make class name
#define TTK_DECLARE_MODULE(Class) \
public: \
inline static QString className() \
{ \
return #Class; \
}

//
// marco str cat
#ifndef _MSC_VER
// gcc version less than 3.4.0
# if __GNUC__ <= 3 && __GNUC_MINOR__ <= 4
Expand Down
67 changes: 52 additions & 15 deletions TTKCommon/ttkprivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,30 @@ template <typename PUB>
class TTK_MODULE_EXPORT TTKPrivate
{
public:
TTKPrivate() { ttk_q_ptr = nullptr; }
virtual ~TTKPrivate() { }
TTKPrivate()
: m_qptr(nullptr)
{

inline void setPublic(PUB* pub) { ttk_q_ptr = pub; }
}

virtual ~TTKPrivate()
{

}

inline void setPublic(PUB* pub)
{
m_qptr = pub;
}

protected:
inline PUB *ttk_q() const { return ttk_q_ptr; }
inline PUB *ttk_q() const
{
return m_qptr;
}

private:
PUB* ttk_q_ptr;
PUB* m_qptr;

};

Expand All @@ -69,20 +83,43 @@ class TTK_MODULE_EXPORT TTKPrivateInterface
{
friend class TTKPrivate<PUB>;
public:
TTKPrivateInterface(PVT* pvt) : pvt_ptr(pvt) { }
TTKPrivateInterface() : pvt_ptr(nullptr) { }
~TTKPrivateInterface() { delete pvt_ptr; }
TTKPrivateInterface()
: m_dptr(nullptr)
{

}

TTKPrivateInterface(PVT* pvt)
: m_dptr(pvt)
{

inline void setPrivate(PVT* pvt) { delete pvt_ptr; pvt_ptr = pvt; }
inline void setPublic(PUB* pub) { pvt_ptr->setPublic(pub); }
inline PVT *operator()() const { return static_cast<PVT*>(pvt_ptr); }
}

~TTKPrivateInterface()
{
delete m_dptr;
}

inline void setPrivate(PVT* pvt)
{
delete m_dptr;
m_dptr = pvt;
}

inline void setPublic(PUB* pub)
{
m_dptr->setPublic(pub);
}

inline PVT *operator()() const
{
return static_cast<PVT*>(m_dptr);
}

private:
TTKPrivateInterface(const TTKPrivateInterface&) { }
TTKPrivateInterface& operator=(const TTKPrivateInterface&) { }
TTKPrivate<PUB>* pvt_ptr;
TTKPrivate<PUB>* m_dptr;
TTK_DISABLE_COPY(TTKPrivateInterface)

};


#endif // TTKPRIVATE_H
2 changes: 1 addition & 1 deletion TTKCommon/ttksingleton.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class TTK_MODULE_EXPORT TTKSingleton

static QMutex m_mutex;
static QScopedPointer<T> m_instance;
Q_DISABLE_COPY(TTKSingleton)
TTK_DISABLE_COPY(TTKSingleton)

};

Expand Down
17 changes: 8 additions & 9 deletions TTKCommon/ttkversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@
* with this program; If not, see <http://www.gnu.org/licenses/>.
***************************************************************************/

//update time 2021.10.27
#define TTKTOOLS_VERSION_STR "2.3.0.0"
#define TTKTOOLS_VERSION_WSTR L"2.3.0.0"
#define TTKTOOLS_VER_TIME_STR "(2021/10/27)"
//update time 2022.01.29
#define TTK_VERSION_STR "2.4.0.0"
#define TTK_VER_TIME_STR "(2022/01/29)"

#define TTKTOOLS_MAJOR_VERSION 2
#define TTKTOOLS_MIDLE_VERSION 3
#define TTKTOOLS_MINOR_VERSION 0
#define TTKTOOLS_PATCH_VERSION 0
#define TTK_MAJOR_VERSION 2
#define TTK_MIDLE_VERSION 4
#define TTK_MINOR_VERSION 0
#define TTK_PATCH_VERSION 0

#define TTKTOOLS_VERSION 0x02300
#define TTK_VERSION 0x02400

#define TTK_VERSION_CHECK(major, middle, minor, patch) ((major<<12)|(middle<<8)|(minor<<4)|(patch))

Expand Down
8 changes: 4 additions & 4 deletions TTKModule/TTKCore.rc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
IDI_ICON1 ICON DISCARDABLE "../TTKResource/lb_app_logo.ico"

VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,3,0,0
PRODUCTVERSION 2,3,0,0
FILEVERSION 2,4,0,0
PRODUCTVERSION 2,4,0,0
FILEFLAGSMASK 0x3fL

#ifdef _DEBUG
Expand All @@ -27,10 +27,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Greedysky Studio, Ltd."
VALUE "FileDescription", "TTKTinyTools"
VALUE "FileVersion", "2.3.0.0"
VALUE "FileVersion", "2.4.0.0"
VALUE "LegalCopyright", "Copyright By Greedysky Studio(C)2022"
VALUE "ProductName", "TTKTinyTools"
VALUE "ProductVersion", "2.3.0.0"
VALUE "ProductVersion", "2.4.0.0"
END
END
BLOCK "VarFileInfo"
Expand Down
9 changes: 4 additions & 5 deletions TTKModule/TTKImage/TTKBarcodeMaker/TTKBarcodeMaker.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ include($$PWD/../../../TTKTinyTools.pri)

TARGET = TTKBarcodeMaker

SOURCES += \
main.cpp \
mainwindow.cpp
HEADERS += $$PWD/mainwindow.h

HEADERS += \
mainwindow.h
SOURCES += \
$$PWD/main.cpp \
$$PWD/mainwindow.cpp
9 changes: 4 additions & 5 deletions TTKModule/TTKImage/TTKFontPng/TTKFontPng.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ include($$PWD/../../../TTKTinyTools.pri)

TARGET = TTKFontPng

SOURCES += \
main.cpp \
mainwindow.cpp
HEADERS += $$PWD/mainwindow.h

HEADERS += \
mainwindow.h
SOURCES += \
$$PWD/main.cpp \
$$PWD/mainwindow.cpp
17 changes: 8 additions & 9 deletions TTKModule/TTKImage/TTKGaussianBlur/TTKGaussianBlur.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@ include($$PWD/../../../TTKTinyTools.pri)

TARGET = TTKGaussianBlur

SOURCES += \
main.cpp \
mainwindow.cpp \
gaussianblur.cpp

HEADERS += \
mainwindow.h \
gaussianblur.h
$$PWD/mainwindow.h \
$$PWD/gaussianblur.h

SOURCES += \
$$PWD/main.cpp \
$$PWD/mainwindow.cpp \
$$PWD/gaussianblur.cpp

FORMS += \
mainwindow.ui
FORMS += $$PWD/mainwindow.ui
12 changes: 5 additions & 7 deletions TTKModule/TTKImage/TTKGetColor/TTKGetColor.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ include($$PWD/../../../TTKTinyTools.pri)

TARGET = TTKGetColor

SOURCES += \
main.cpp \
mainwindow.cpp
HEADERS += $$PWD/mainwindow.h

HEADERS += \
mainwindow.h
SOURCES += \
$$PWD/main.cpp \
$$PWD/mainwindow.cpp

FORMS += \
mainwindow.ui
FORMS += $$PWD/mainwindow.ui
14 changes: 6 additions & 8 deletions TTKModule/TTKImage/TTKGifWidget/TTKGifWidget.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ include($$PWD/../../../TTKTinyTools.pri)

TARGET = TTKGifWidget

CONFIG += warn_off
CONFIG += warn_off

SOURCES += \
main.cpp \
mainwindow.cpp
HEADERS += $$PWD/mainwindow.h

HEADERS += \
mainwindow.h
SOURCES += \
$$PWD/main.cpp \
$$PWD/mainwindow.cpp

FORMS += \
mainwindow.ui
FORMS += $$PWD/mainwindow.ui
6 changes: 3 additions & 3 deletions TTKModule/TTKImage/TTKGifWidget/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public Q_SLOTS:
void setBackgroundgColor(const QColor &color);

protected:
virtual bool eventFilter(QObject *watched, QEvent *event) override;
virtual void resizeEvent(QResizeEvent *event) override;
virtual void paintEvent(QPaintEvent *event) override;
virtual bool eventFilter(QObject *watched, QEvent *event) override final;
virtual void resizeEvent(QResizeEvent *event) override final;
virtual void paintEvent(QPaintEvent *event) override final;

private:
Ui::MainWindow *m_ui;
Expand Down
9 changes: 4 additions & 5 deletions TTKModule/TTKImage/TTKIconMaker/TTKIconMaker.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ include($$PWD/../../../TTKTinyTools.pri)

TARGET = TTKIconMaker

SOURCES += \
main.cpp \
mainwindow.cpp
HEADERS += $$PWD/mainwindow.h

HEADERS += \
mainwindow.h
SOURCES += \
$$PWD/main.cpp \
$$PWD/mainwindow.cpp
20 changes: 9 additions & 11 deletions TTKModule/TTKImage/TTKImageView/TTKImageView.pro
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,15 @@ TARGET = TTKImageView

INCLUDEPATH += $$PWD

SOURCES += \
main.cpp \
mainwindow.cpp \
imageview.cpp

HEADERS += \
mainwindow.h \
imageview.h
$$PWD/mainwindow.h \
$$PWD/imageview.h

SOURCES += \
$$PWD/main.cpp \
$$PWD/mainwindow.cpp \
$$PWD/imageview.cpp

FORMS += \
mainwindow.ui
FORMS += $$PWD/mainwindow.ui

RESOURCES += \
TTKImageView.qrc
RESOURCES += $$PWD/TTKImageView.qrc
10 changes: 5 additions & 5 deletions TTKModule/TTKImage/TTKImageView/imageview.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TTK_MODULE_EXPORT ImageIndex : public QWidget
ImageIndex(QWidget *parent = nullptr);

protected:
virtual void paintEvent(QPaintEvent *event) override;
virtual void paintEvent(QPaintEvent *event) override final;
void drawBg(QPainter *painter);
void drawText(QPainter *painter);

Expand Down Expand Up @@ -83,10 +83,10 @@ public Q_SLOTS:
void moveToPage(int index);

protected:
virtual void paintEvent(QPaintEvent *event) override;
virtual void keyPressEvent(QKeyEvent *event) override;
virtual void resizeEvent(QResizeEvent *event) override;
virtual void showEvent(QShowEvent *event) override;
virtual void paintEvent(QPaintEvent *event) override final;
virtual void keyPressEvent(QKeyEvent *event) override final;
virtual void resizeEvent(QResizeEvent *event) override final;
virtual void showEvent(QShowEvent *event) override final;
void drawBg(QPainter *painter);
void drawImage(QPainter *painter);

Expand Down
12 changes: 5 additions & 7 deletions TTKModule/TTKImage/TTKPngHelper/TTKPngHelper.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ include($$PWD/../../../TTKTinyTools.pri)

TARGET = TTKPngHelper

SOURCES += \
main.cpp \
mainwindow.cpp
HEADERS += $$PWD/mainwindow.h

HEADERS += \
mainwindow.h
SOURCES += \
$$PWD/main.cpp \
$$PWD/mainwindow.cpp

FORMS += \
mainwindow.ui
FORMS += $$PWD/mainwindow.ui
Loading