summaryrefslogtreecommitdiffstats
path: root/qtinterface/interface_tqt3/tqvariant.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2023-08-28 10:59:35 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2023-09-03 19:32:16 +0900
commit2505a01dd2ae2c9696210783d677d7d45caa665f (patch)
tree21cccb348d5a6062d9f612f1ec54cb5c59fb4d7f /qtinterface/interface_tqt3/tqvariant.cpp
parent8745f781ced6d3f7dcb75daada02eafb2b583139 (diff)
downloadtqtinterface-2505a01dd2ae2c9696210783d677d7d45caa665f.tar.gz
tqtinterface-2505a01dd2ae2c9696210783d677d7d45caa665f.zip
Drop USE_QT3/4 code
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 701d92857caed18c0099b264c45a0b0edce782f2)
Diffstat (limited to 'qtinterface/interface_tqt3/tqvariant.cpp')
-rw-r--r--qtinterface/interface_tqt3/tqvariant.cpp106
1 files changed, 0 insertions, 106 deletions
diff --git a/qtinterface/interface_tqt3/tqvariant.cpp b/qtinterface/interface_tqt3/tqvariant.cpp
index da08e5a..6459cdf 100644
--- a/qtinterface/interface_tqt3/tqvariant.cpp
+++ b/qtinterface/interface_tqt3/tqvariant.cpp
@@ -21,109 +21,3 @@ Boston, MA 02110-1301, USA.
#include <tqt.h>
#include <ntqvariant.h>
-
-#ifdef USE_QT4
-
-#include <Qt/ntqbitmap.h>
-
-// This is taken straight from <private/qvariant_p.h>
-#ifdef Q_CC_SUN // Sun CC picks the wrong overload, so introduce awful hack
-
-template <typename T>
-inline T *v_cast(const QVariant::Private *nd, T * = 0)
-{
- QVariant::Private *d = const_cast<QVariant::Private *>(nd);
- return ((sizeof(T) > sizeof(QVariant::Private::Data))
- ? static_cast<T *>(d->data.shared->ptr)
- : static_cast<T *>(static_cast<void *>(&d->data.c)));
-}
-
-#else // every other compiler in this world
-
-template <typename T>
-inline const T *v_cast(const QVariant::Private *d, T * = 0)
-{
- return ((sizeof(T) > sizeof(QVariant::Private::Data))
- ? static_cast<const T *>(d->data.shared->ptr)
- : static_cast<const T *>(static_cast<const void *>(&d->data.c)));
-}
-
-template <typename T>
-inline T *v_cast(QVariant::Private *d, T * = 0)
-{
- return ((sizeof(T) > sizeof(QVariant::Private::Data))
- ? static_cast<T *>(d->data.shared->ptr)
- : static_cast<T *>(static_cast<void *>(&d->data.c)));
-}
-
-#endif
-
-template <typename T>
-inline T qVariantToHelper(const QVariant::Private &d, QVariant::Type t,
- const QVariant::Handler *handler, T * = 0)
-{
- if (d.type == t)
- return *v_cast<T>(&d);
-
- T ret;
- handler->convert(&d, t, &ret, 0);
- return ret;
-}
-
-QFont QVariant::toFont() const {
- return qVariantToHelper<QFont>(d, Font, handler);
-}
-
-QColor QVariant::toColor() const {
- return qVariantToHelper<QColor>(d, Color, handler);
-}
-
-QCursor QVariant::toCursor() const {
- return qVariantToHelper<QCursor>(d, Cursor, handler);
-}
-
-QBitmap QVariant::toBitmap() const {
- return qVariantToHelper<QBitmap>(d, Bitmap, handler);
-}
-
-Q3PointArray QVariant::toPointArray() const {
- return qVariantToHelper<Q3PointArray>(d, PointArray, handler);
-}
-
-QRegion QVariant::toRegion() const {
- return qVariantToHelper<QRegion>(d, Region, handler);
-}
-
-QPixmap QVariant::toPixmap() const {
- return qVariantToHelper<QPixmap>(d, Pixmap, handler);
-}
-
-QImage QVariant::toImage() const {
- return qVariantToHelper<QImage>(d, Image, handler);
-}
-
-QBrush QVariant::toBrush() const {
- return qVariantToHelper<QBrush>(d, Brush, handler);
-}
-
-QPalette QVariant::toPalette() const {
- return qVariantToHelper<QPalette>(d, Palette, handler);
-}
-
-QColorGroup QVariant::toColorGroup() const {
- return qVariantToHelper<QColorGroup>(d, ColorGroup, handler);
-}
-
-QIconSet QVariant::toIconSet() const {
- return qVariantToHelper<QIconSet>(d, IconSet, handler);
-}
-
-QFont QVariant::asFont() {
- return toFont();
-}
-
-QColor QVariant::asColor() {
- return toColor();
-}
-
-#endif // USE_QT4