30 #if TTK_QT_VERSION_CHECK(5,11,0)
31 # define QtFontWidth(p, t) p.horizontalAdvance(t)
33 # define QtFontWidth(p, t) p.width(t)
37 #if TTK_QT_VERSION_CHECK(5,10,0)
38 # define QtImageBytes(p) p.sizeInBytes()
40 # define QtImageBytes(p) p.byteCount()
44 #if TTK_QT_VERSION_CHECK(6,4,0)
45 # define QtItemSetTextAlignment(p, a) p->setTextAlignment(Qt::Alignment(a));
47 # define QtItemSetTextAlignment(p, a) p->setTextAlignment(a);
51 #if TTK_QT_VERSION_CHECK(5,13,0)
52 # define QtContainerSwap(p, i, j) p->swapItemsAt(i, j)
54 # define QtContainerSwap(p, i, j) p->swap(i, j)
58 #if TTK_QT_VERSION_CHECK(5,15,0)
59 # define QtNetworkErrorConnect(p, q, f, s) QObject::connect(p, SIGNAL(errorOccurred(QNetworkReply::NetworkError)), q, s(f(QNetworkReply::NetworkError)))
61 # define QtNetworkErrorConnect(p, q, f, s) QObject::connect(p, SIGNAL(error(QNetworkReply::NetworkError)), q, s(f(QNetworkReply::NetworkError)))
65 #if TTK_QT_VERSION_CHECK(5,15,0)
66 # define QtNetworkErrorVoidConnect(p, q, f, s) QObject::connect(p, SIGNAL(errorOccurred(QNetworkReply::NetworkError)), q, s(f()))
68 # define QtNetworkErrorVoidConnect(p, q, f, s) QObject::connect(p, SIGNAL(error(QNetworkReply::NetworkError)), q, s(f()))
72 #if TTK_QT_VERSION_CHECK(5,15,0)
73 # define QtSocketErrorConnect(p, q, f, s) QObject::connect(p, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), q, s(f(QAbstractSocket::SocketError)))
75 # define QtSocketErrorConnect(p, q, f, s) QObject::connect(p, SIGNAL(error(QAbstractSocket::SocketError)), q, s(f(QAbstractSocket::SocketError)))
79 #if TTK_QT_VERSION_CHECK(5,15,0)
80 # define QtSocketErrorVoidConnect(p, q, f, s) QObject::connect(p, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), q, s(f()))
82 # define QtSocketErrorVoidConnect(p, q, f, s) QObject::connect(p, SIGNAL(error(QAbstractSocket::SocketError)), q, s(f()))
86 #if TTK_QT_VERSION_CHECK(5,6,0)
87 # define QtProcessErrorConnect(p, q, f, s) QObject::connect(p, SIGNAL(errorOccurred(QProcess::ProcessError)), q, s(f(QProcess::ProcessError)))
89 # define QtProcessErrorConnect(p, q, f, s) QObject::connect(p, SIGNAL(error(QProcess::ProcessError)), q, s(f(QProcess::ProcessError)))
93 #if TTK_QT_VERSION_CHECK(5,6,0)
94 # define QtProcessErrorVoidConnect(p, q, f, s) QObject::connect(p, SIGNAL(errorOccurred(QProcess::ProcessError)), q, s(f()))
96 # define QtProcessErrorVoidConnect(p, q, f, s) QObject::connect(p, SIGNAL(error(QProcess::ProcessError)), q, s(f()))
100 #if TTK_QT_VERSION_CHECK(5,13,0)
101 # define QtProcessFinishConnect(p, q, f, s) QObject::connect(p, SIGNAL(finished(int,QProcess::ExitStatus)), q, s(f(int)))
103 # define QtProcessFinishConnect(p, q, f, s) QObject::connect(p, SIGNAL(finished(int)), q, s(f(int)))
107 #if TTK_QT_VERSION_CHECK(5,13,0)
108 # define QtProcessFinishVoidConnect(p, q, f, s) QObject::connect(p, SIGNAL(finished(int,QProcess::ExitStatus)), q, s(f()))
110 # define QtProcessFinishVoidConnect(p, q, f, s) QObject::connect(p, SIGNAL(finished(int)), q, s(f()))
114 #if TTK_QT_VERSION_CHECK(5,15,0)
115 # define QtButtonGroupConnect(p, q, f, s) QObject::connect(p, SIGNAL(idClicked(int)), q, s(f(int)))
117 # define QtButtonGroupConnect(p, q, f, s) QObject::connect(p, SIGNAL(buttonClicked(int)), q, s(f(int)))
121 #if TTK_QT_VERSION_CHECK(5,15,0)
122 # define QtButtonGroupVoidConnect(p, q, f, s) QObject::connect(p, SIGNAL(idClicked(int)), q, s(f()))
124 # define QtButtonGroupVoidConnect(p, q, f, s) QObject::connect(p, SIGNAL(buttonClicked(int)), q, s(f()))
128 #if TTK_QT_VERSION_CHECK(5,15,0)
129 # define QtNamespace(p) Qt::p
131 # define QtNamespace(p) p
135 #if TTK_QT_VERSION_CHECK(5,15,0)
136 # define QtLablePixmap(p) p->pixmap(Qt::ReturnByValue)
138 # define QtLablePixmap(p) p->pixmap() ? *p->pixmap() : QPixmap();
142 #if TTK_QT_VERSION_CHECK(5,15,0)
143 # define QtSkipEmptyParts Qt::SkipEmptyParts
145 # define QtSkipEmptyParts QString::SkipEmptyParts
149 #if TTK_QT_VERSION_CHECK(5,14,0)
150 # define QtWheelDelta(p) p->angleDelta().y()
152 # define QtWheelDelta(p) p->delta()
156 #if TTK_QT_VERSION_CHECK(6,0,0)
157 # define QtPosition(p) p->position().toPoint()
158 # define QtPositionF(p) p->position()
159 # define QtPositionX(p) p->position().x()
160 # define QtPositionY(p) p->position().y()
161 # define QtGlobalPosition(p) p->globalPosition().toPoint()
162 # define QtGlobalPositionF(p) p->globalPosition()
163 # define QtGlobalPositionX(p) p->globalPosition().x()
164 # define QtGlobalPositionY(p) p->globalPosition().y()
166 # define QtPosition(p) p->pos()
167 # define QtPositionF(p) p->pos()
168 # define QtPositionX(p) p->x()
169 # define QtPositionY(p) p->y()
170 # define QtGlobalPosition(p) p->globalPos()
171 # define QtGlobalPositionF(p) p->globalPos()
172 # define QtGlobalPositionX(p) p->globalX()
173 # define QtGlobalPositionY(p) p->globalY()
177 #if TTK_QT_VERSION_CHECK(6,0,0)
178 # define QtEnterEvent QEnterEvent
180 # define QtEnterEvent QEvent
184 #if TTK_QT_VERSION_CHECK(6,0,0)
185 # define QtVariantType(p) p.typeId()
187 # define QtVariantType(p) p.type()
191 #if TTK_QT_VERSION_CHECK(6,0,0)
192 # define QtKeySequence(k, m) QKeySequence(QKeyCombination(m, k))
194 # define QtKeySequence(k, m) QKeySequence(k + m)
198 #if TTK_QT_VERSION_CHECK(6,0,0)
199 # define QtKeyCombine(p) p.toCombined()
201 # define QtKeyCombine(p) p
205 #if TTK_QT_VERSION_CHECK(6,0,0)
206 # define QtFontFamilies() QFontDatabase::families()
208 # define QtFontFamilies() QFontDatabase().families()
214 #if !TTK_QT_VERSION_CHECK(5,7,0)
215 template <
typename... Args>
216 struct QNonConstOverload
218 template <
typename R,
typename T>
219 Q_DECL_CONSTEXPR
auto operator()(R (
T::*ptr)(Args...))
const noexcept -> decltype(ptr)
222 template <
typename R,
typename T>
223 static Q_DECL_CONSTEXPR
auto of(R (
T::*ptr)(Args...)) noexcept -> decltype(ptr)
227 template <
typename... Args>
228 struct QConstOverload
230 template <
typename R,
typename T>
231 Q_DECL_CONSTEXPR
auto operator()(R (
T::*ptr)(Args...)
const)
const noexcept -> decltype(ptr)
234 template <
typename R,
typename T>
235 static Q_DECL_CONSTEXPR
auto of(R (
T::*ptr)(Args...)
const) noexcept -> decltype(ptr)
239 template <
typename... Args>
240 struct QOverload : QConstOverload<Args...>, QNonConstOverload<Args...>
242 using QConstOverload<Args...>::of;
243 using QConstOverload<Args...>::operator();
244 using QNonConstOverload<Args...>::of;
245 using QNonConstOverload<Args...>::operator();
247 template <
typename R>
248 Q_DECL_CONSTEXPR
auto operator()(R (*ptr)(Args...))
const noexcept -> decltype(ptr)
251 template <
typename R>
252 static Q_DECL_CONSTEXPR
auto of(R (*ptr)(Args...)) noexcept -> decltype(ptr)
264 #endif // TTKQTCOMPAT_H
The namespace of the qt compat function wrapper.