Skip to content

Commit 3e09778

Browse files
committed
refactor: Optimie project global module[564802]
1 parent 8138b5b commit 3e09778

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

TTKCommon/ttkglobal.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,21 @@ Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) { return t; }
135135
# endif
136136
#endif
137137

138-
//
139-
#define TTK_DECLARE_MODULE(Class) \
140-
public: \
141-
inline static QString className() \
142-
{ \
143-
return #Class; \
138+
// disable copy
139+
#define TTK_DISABLE_COPY(Class) \
140+
private: \
141+
Class(const Class &) TTK_DELETE; \
142+
Class &operator=(const Class &) TTK_DELETE;
143+
144+
// make class name
145+
#define TTK_DECLARE_MODULE(Class) \
146+
public: \
147+
inline static QString className() \
148+
{ \
149+
return #Class; \
144150
}
145151

146-
//
152+
// marco str cat
147153
#ifndef _MSC_VER
148154
// gcc version less than 3.4.0
149155
# if __GNUC__ <= 3 && __GNUC_MINOR__ <= 4

TTKCommon/ttkprivate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class TTK_MODULE_EXPORT TTKPrivateInterface
118118

119119
private:
120120
TTKPrivate<PUB>* m_dptr;
121-
Q_DISABLE_COPY(TTKPrivateInterface)
121+
TTK_DISABLE_COPY(TTKPrivateInterface)
122122

123123
};
124124

TTKCommon/ttksingleton.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class TTK_MODULE_EXPORT TTKSingleton
4444

4545
static QMutex m_mutex;
4646
static QScopedPointer<T> m_instance;
47-
Q_DISABLE_COPY(TTKSingleton)
47+
TTK_DISABLE_COPY(TTKSingleton)
4848

4949
};
5050

0 commit comments

Comments
 (0)