| 1 | /**************************************************************************** | 
|---|
| 2 | ** | 
|---|
| 3 | ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 
|---|
| 4 | ** All rights reserved. | 
|---|
| 5 | ** Contact: Nokia Corporation (qt-info@nokia.com) | 
|---|
| 6 | ** | 
|---|
| 7 | ** This file is part of the QtGui module of the Qt Toolkit. | 
|---|
| 8 | ** | 
|---|
| 9 | ** $QT_BEGIN_LICENSE:LGPL$ | 
|---|
| 10 | ** Commercial Usage | 
|---|
| 11 | ** Licensees holding valid Qt Commercial licenses may use this file in | 
|---|
| 12 | ** accordance with the Qt Commercial License Agreement provided with the | 
|---|
| 13 | ** Software or, alternatively, in accordance with the terms contained in | 
|---|
| 14 | ** a written agreement between you and Nokia. | 
|---|
| 15 | ** | 
|---|
| 16 | ** GNU Lesser General Public License Usage | 
|---|
| 17 | ** Alternatively, this file may be used under the terms of the GNU Lesser | 
|---|
| 18 | ** General Public License version 2.1 as published by the Free Software | 
|---|
| 19 | ** Foundation and appearing in the file LICENSE.LGPL included in the | 
|---|
| 20 | ** packaging of this file.  Please review the following information to | 
|---|
| 21 | ** ensure the GNU Lesser General Public License version 2.1 requirements | 
|---|
| 22 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | 
|---|
| 23 | ** | 
|---|
| 24 | ** In addition, as a special exception, Nokia gives you certain additional | 
|---|
| 25 | ** rights.  These rights are described in the Nokia Qt LGPL Exception | 
|---|
| 26 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | 
|---|
| 27 | ** | 
|---|
| 28 | ** GNU General Public License Usage | 
|---|
| 29 | ** Alternatively, this file may be used under the terms of the GNU | 
|---|
| 30 | ** General Public License version 3.0 as published by the Free Software | 
|---|
| 31 | ** Foundation and appearing in the file LICENSE.GPL included in the | 
|---|
| 32 | ** packaging of this file.  Please review the following information to | 
|---|
| 33 | ** ensure the GNU General Public License version 3.0 requirements will be | 
|---|
| 34 | ** met: http://www.gnu.org/copyleft/gpl.html. | 
|---|
| 35 | ** | 
|---|
| 36 | ** If you have questions regarding the use of this file, please contact | 
|---|
| 37 | ** Nokia at qt-info@nokia.com. | 
|---|
| 38 | ** $QT_END_LICENSE$ | 
|---|
| 39 | ** | 
|---|
| 40 | ****************************************************************************/ | 
|---|
| 41 |  | 
|---|
| 42 | #include "qvariant.h" | 
|---|
| 43 |  | 
|---|
| 44 | #include "qbitmap.h" | 
|---|
| 45 | #include "qbrush.h" | 
|---|
| 46 | #include "qcolor.h" | 
|---|
| 47 | #include "qcursor.h" | 
|---|
| 48 | #include "qdatastream.h" | 
|---|
| 49 | #include "qdebug.h" | 
|---|
| 50 | #include "qfont.h" | 
|---|
| 51 | #include "qicon.h" | 
|---|
| 52 | #include "qimage.h" | 
|---|
| 53 | #include "qkeysequence.h" | 
|---|
| 54 | #include "qtransform.h" | 
|---|
| 55 | #include "qmatrix.h" | 
|---|
| 56 | #include "qpalette.h" | 
|---|
| 57 | #include "qpen.h" | 
|---|
| 58 | #include "qpixmap.h" | 
|---|
| 59 | #include "qpolygon.h" | 
|---|
| 60 | #include "qregion.h" | 
|---|
| 61 | #include "qsizepolicy.h" | 
|---|
| 62 | #include "qtextformat.h" | 
|---|
| 63 | #include "qmatrix4x4.h" | 
|---|
| 64 | #include "qvector2d.h" | 
|---|
| 65 | #include "qvector3d.h" | 
|---|
| 66 | #include "qvector4d.h" | 
|---|
| 67 | #include "qquaternion.h" | 
|---|
| 68 |  | 
|---|
| 69 | #include "private/qvariant_p.h" | 
|---|
| 70 |  | 
|---|
| 71 | QT_BEGIN_NAMESPACE | 
|---|
| 72 |  | 
|---|
| 73 | #ifdef QT3_SUPPORT | 
|---|
| 74 | extern QDataStream &qt_stream_out_qcolorgroup(QDataStream &s, const QColorGroup &g); | 
|---|
| 75 | extern QDataStream &qt_stream_in_qcolorgroup(QDataStream &s, QColorGroup &g); | 
|---|
| 76 | #endif | 
|---|
| 77 |  | 
|---|
| 78 | Q_CORE_EXPORT const QVariant::Handler *qcoreVariantHandler(); | 
|---|
| 79 |  | 
|---|
| 80 | static void construct(QVariant::Private *x, const void *copy) | 
|---|
| 81 | { | 
|---|
| 82 | switch (x->type) { | 
|---|
| 83 | case QVariant::Bitmap: | 
|---|
| 84 | v_construct<QBitmap>(x, copy); | 
|---|
| 85 | break; | 
|---|
| 86 | case QVariant::Region: | 
|---|
| 87 | v_construct<QRegion>(x, copy); | 
|---|
| 88 | break; | 
|---|
| 89 | case QVariant::Polygon: | 
|---|
| 90 | v_construct<QPolygon>(x, copy); | 
|---|
| 91 | break; | 
|---|
| 92 | case QVariant::Font: | 
|---|
| 93 | v_construct<QFont>(x, copy); | 
|---|
| 94 | break; | 
|---|
| 95 | case QVariant::Pixmap: | 
|---|
| 96 | v_construct<QPixmap>(x, copy); | 
|---|
| 97 | break; | 
|---|
| 98 | case QVariant::Image: | 
|---|
| 99 | v_construct<QImage>(x, copy); | 
|---|
| 100 | break; | 
|---|
| 101 | case QVariant::Brush: | 
|---|
| 102 | v_construct<QBrush>(x, copy); | 
|---|
| 103 | break; | 
|---|
| 104 | case QVariant::Color: | 
|---|
| 105 | v_construct<QColor>(x, copy); | 
|---|
| 106 | break; | 
|---|
| 107 | case QVariant::Palette: | 
|---|
| 108 | v_construct<QPalette>(x, copy); | 
|---|
| 109 | break; | 
|---|
| 110 | #ifdef QT3_SUPPORT | 
|---|
| 111 | case QVariant::ColorGroup: | 
|---|
| 112 | v_construct<QColorGroup>(x, copy); | 
|---|
| 113 | break; | 
|---|
| 114 | #endif | 
|---|
| 115 | #ifndef QT_NO_ICON | 
|---|
| 116 | case QVariant::Icon: | 
|---|
| 117 | v_construct<QIcon>(x, copy); | 
|---|
| 118 | break; | 
|---|
| 119 | #endif | 
|---|
| 120 | case QVariant::Matrix: | 
|---|
| 121 | v_construct<QMatrix>(x, copy); | 
|---|
| 122 | break; | 
|---|
| 123 | case QVariant::Transform: | 
|---|
| 124 | v_construct<QTransform>(x, copy); | 
|---|
| 125 | break; | 
|---|
| 126 | case QVariant::TextFormat: | 
|---|
| 127 | v_construct<QTextFormat>(x, copy); | 
|---|
| 128 | break; | 
|---|
| 129 | case QVariant::TextLength: | 
|---|
| 130 | v_construct<QTextLength>(x, copy); | 
|---|
| 131 | break; | 
|---|
| 132 | #ifndef QT_NO_SHORTCUT | 
|---|
| 133 | case QVariant::KeySequence: | 
|---|
| 134 | v_construct<QKeySequence>(x, copy); | 
|---|
| 135 | break; | 
|---|
| 136 | #endif | 
|---|
| 137 | case QVariant::Pen: | 
|---|
| 138 | v_construct<QPen>(x, copy); | 
|---|
| 139 | break; | 
|---|
| 140 | case QVariant::SizePolicy: | 
|---|
| 141 | v_construct<QSizePolicy>(x, copy); | 
|---|
| 142 | break; | 
|---|
| 143 | #ifndef QT_NO_CURSOR | 
|---|
| 144 | case QVariant::Cursor: | 
|---|
| 145 | v_construct<QCursor>(x, copy); | 
|---|
| 146 | break; | 
|---|
| 147 | #endif | 
|---|
| 148 | case 62: { | 
|---|
| 149 | // small 'trick' to let a QVariant(Qt::blue) create a variant | 
|---|
| 150 | // of type QColor | 
|---|
| 151 | x->type = QVariant::Color; | 
|---|
| 152 | QColor color(*reinterpret_cast<const Qt::GlobalColor *>(copy)); | 
|---|
| 153 | v_construct<QColor>(x, &color); | 
|---|
| 154 | break; | 
|---|
| 155 | } | 
|---|
| 156 | #ifndef QT_NO_MATRIX4X4 | 
|---|
| 157 | case QVariant::Matrix4x4: | 
|---|
| 158 | v_construct<QMatrix4x4>(x, copy); | 
|---|
| 159 | break; | 
|---|
| 160 | #endif | 
|---|
| 161 | #ifndef QT_NO_VECTOR2D | 
|---|
| 162 | case QVariant::Vector2D: | 
|---|
| 163 | v_construct<QVector2D>(x, copy); | 
|---|
| 164 | break; | 
|---|
| 165 | #endif | 
|---|
| 166 | #ifndef QT_NO_VECTOR3D | 
|---|
| 167 | case QVariant::Vector3D: | 
|---|
| 168 | v_construct<QVector3D>(x, copy); | 
|---|
| 169 | break; | 
|---|
| 170 | #endif | 
|---|
| 171 | #ifndef QT_NO_VECTOR4D | 
|---|
| 172 | case QVariant::Vector4D: | 
|---|
| 173 | v_construct<QVector4D>(x, copy); | 
|---|
| 174 | break; | 
|---|
| 175 | #endif | 
|---|
| 176 | #ifndef QT_NO_QUATERNION | 
|---|
| 177 | case QVariant::Quaternion: | 
|---|
| 178 | v_construct<QQuaternion>(x, copy); | 
|---|
| 179 | break; | 
|---|
| 180 | #endif | 
|---|
| 181 | default: | 
|---|
| 182 | qcoreVariantHandler()->construct(x, copy); | 
|---|
| 183 | return; | 
|---|
| 184 | } | 
|---|
| 185 | x->is_null = !copy; | 
|---|
| 186 | } | 
|---|
| 187 |  | 
|---|
| 188 | static void clear(QVariant::Private *d) | 
|---|
| 189 | { | 
|---|
| 190 | switch (d->type) { | 
|---|
| 191 | case QVariant::Bitmap: | 
|---|
| 192 | v_clear<QBitmap>(d); | 
|---|
| 193 | break; | 
|---|
| 194 | case QVariant::Cursor: | 
|---|
| 195 | v_clear<QCursor>(d); | 
|---|
| 196 | break; | 
|---|
| 197 | case QVariant::Region: | 
|---|
| 198 | v_clear<QRegion>(d); | 
|---|
| 199 | break; | 
|---|
| 200 | case QVariant::Polygon: | 
|---|
| 201 | v_clear<QPolygon>(d); | 
|---|
| 202 | break; | 
|---|
| 203 | case QVariant::Font: | 
|---|
| 204 | v_clear<QFont>(d); | 
|---|
| 205 | break; | 
|---|
| 206 | case QVariant::Pixmap: | 
|---|
| 207 | v_clear<QPixmap>(d); | 
|---|
| 208 | break; | 
|---|
| 209 | case QVariant::Image: | 
|---|
| 210 | v_clear<QImage>(d); | 
|---|
| 211 | break; | 
|---|
| 212 | case QVariant::Brush: | 
|---|
| 213 | v_clear<QBrush>(d); | 
|---|
| 214 | break; | 
|---|
| 215 | case QVariant::Color: | 
|---|
| 216 | v_clear<QColor>(d); | 
|---|
| 217 | break; | 
|---|
| 218 | case QVariant::Palette: | 
|---|
| 219 | v_clear<QPalette>(d); | 
|---|
| 220 | break; | 
|---|
| 221 | #ifdef QT3_SUPPORT | 
|---|
| 222 | case QVariant::ColorGroup: | 
|---|
| 223 | v_clear<QColorGroup>(d); | 
|---|
| 224 | break; | 
|---|
| 225 | #endif | 
|---|
| 226 | #ifndef QT_NO_ICON | 
|---|
| 227 | case QVariant::Icon: | 
|---|
| 228 | v_clear<QIcon>(d); | 
|---|
| 229 | break; | 
|---|
| 230 | #endif | 
|---|
| 231 | case QVariant::Matrix: | 
|---|
| 232 | v_clear<QMatrix>(d); | 
|---|
| 233 | break; | 
|---|
| 234 | case QVariant::Transform: | 
|---|
| 235 | v_clear<QTransform>(d); | 
|---|
| 236 | break; | 
|---|
| 237 | case QVariant::TextFormat: | 
|---|
| 238 | v_clear<QTextFormat>(d); | 
|---|
| 239 | break; | 
|---|
| 240 | case QVariant::TextLength: | 
|---|
| 241 | v_clear<QTextLength>(d); | 
|---|
| 242 | break; | 
|---|
| 243 | case QVariant::SizePolicy: | 
|---|
| 244 | v_clear<QSizePolicy>(d); | 
|---|
| 245 | break; | 
|---|
| 246 | #ifndef QT_NO_SHORTCUT | 
|---|
| 247 | case QVariant::KeySequence: | 
|---|
| 248 | v_clear<QKeySequence>(d); | 
|---|
| 249 | break; | 
|---|
| 250 | #endif | 
|---|
| 251 | case QVariant::Pen: | 
|---|
| 252 | v_clear<QPen>(d); | 
|---|
| 253 | break; | 
|---|
| 254 | #ifndef QT_NO_MATRIX4X4 | 
|---|
| 255 | case QVariant::Matrix4x4: | 
|---|
| 256 | v_clear<QMatrix4x4>(d); | 
|---|
| 257 | break; | 
|---|
| 258 | #endif | 
|---|
| 259 | #ifndef QT_NO_VECTOR2D | 
|---|
| 260 | case QVariant::Vector2D: | 
|---|
| 261 | v_clear<QVector2D>(d); | 
|---|
| 262 | break; | 
|---|
| 263 | #endif | 
|---|
| 264 | #ifndef QT_NO_VECTOR3D | 
|---|
| 265 | case QVariant::Vector3D: | 
|---|
| 266 | v_clear<QVector3D>(d); | 
|---|
| 267 | break; | 
|---|
| 268 | #endif | 
|---|
| 269 | #ifndef QT_NO_VECTOR4D | 
|---|
| 270 | case QVariant::Vector4D: | 
|---|
| 271 | v_clear<QVector4D>(d); | 
|---|
| 272 | break; | 
|---|
| 273 | #endif | 
|---|
| 274 | #ifndef QT_NO_QUATERNION | 
|---|
| 275 | case QVariant::Quaternion: | 
|---|
| 276 | v_clear<QVector4D>(d); | 
|---|
| 277 | break; | 
|---|
| 278 | #endif | 
|---|
| 279 | default: | 
|---|
| 280 | qcoreVariantHandler()->clear(d); | 
|---|
| 281 | return; | 
|---|
| 282 | } | 
|---|
| 283 |  | 
|---|
| 284 | d->type = QVariant::Invalid; | 
|---|
| 285 | d->is_null = true; | 
|---|
| 286 | d->is_shared = false; | 
|---|
| 287 | } | 
|---|
| 288 |  | 
|---|
| 289 |  | 
|---|
| 290 | static bool isNull(const QVariant::Private *d) | 
|---|
| 291 | { | 
|---|
| 292 | switch(d->type) { | 
|---|
| 293 | case QVariant::Bitmap: | 
|---|
| 294 | return v_cast<QBitmap>(d)->isNull(); | 
|---|
| 295 | case QVariant::Region: | 
|---|
| 296 | return v_cast<QRegion>(d)->isEmpty(); | 
|---|
| 297 | case QVariant::Polygon: | 
|---|
| 298 | return v_cast<QPolygon>(d)->isEmpty(); | 
|---|
| 299 | case QVariant::Pixmap: | 
|---|
| 300 | return v_cast<QPixmap>(d)->isNull(); | 
|---|
| 301 | case QVariant::Image: | 
|---|
| 302 | return v_cast<QImage>(d)->isNull(); | 
|---|
| 303 | #ifndef QT_NO_ICON | 
|---|
| 304 | case QVariant::Icon: | 
|---|
| 305 | return v_cast<QIcon>(d)->isNull(); | 
|---|
| 306 | #endif | 
|---|
| 307 | case QVariant::Matrix: | 
|---|
| 308 | case QVariant::TextFormat: | 
|---|
| 309 | case QVariant::TextLength: | 
|---|
| 310 | case QVariant::Cursor: | 
|---|
| 311 | case QVariant::StringList: | 
|---|
| 312 | case QVariant::Font: | 
|---|
| 313 | case QVariant::Brush: | 
|---|
| 314 | case QVariant::Color: | 
|---|
| 315 | case QVariant::Palette: | 
|---|
| 316 | #ifdef QT3_SUPPORT | 
|---|
| 317 | case QVariant::ColorGroup: | 
|---|
| 318 | #endif | 
|---|
| 319 | case QVariant::SizePolicy: | 
|---|
| 320 | #ifndef QT_NO_SHORTCUT | 
|---|
| 321 | case QVariant::KeySequence: | 
|---|
| 322 | #endif | 
|---|
| 323 | case QVariant::Pen: | 
|---|
| 324 | #ifndef QT_NO_MATRIX4X4 | 
|---|
| 325 | case QVariant::Matrix4x4: | 
|---|
| 326 | #endif | 
|---|
| 327 | break; | 
|---|
| 328 | #ifndef QT_NO_VECTOR2D | 
|---|
| 329 | case QVariant::Vector2D: | 
|---|
| 330 | return v_cast<QVector2D>(d)->isNull(); | 
|---|
| 331 | #endif | 
|---|
| 332 | #ifndef QT_NO_VECTOR3D | 
|---|
| 333 | case QVariant::Vector3D: | 
|---|
| 334 | return v_cast<QVector3D>(d)->isNull(); | 
|---|
| 335 | #endif | 
|---|
| 336 | #ifndef QT_NO_VECTOR4D | 
|---|
| 337 | case QVariant::Vector4D: | 
|---|
| 338 | return v_cast<QVector4D>(d)->isNull(); | 
|---|
| 339 | #endif | 
|---|
| 340 | #ifndef QT_NO_QUATERNION | 
|---|
| 341 | case QVariant::Quaternion: | 
|---|
| 342 | return v_cast<QQuaternion>(d)->isNull(); | 
|---|
| 343 | #endif | 
|---|
| 344 | default: | 
|---|
| 345 | return qcoreVariantHandler()->isNull(d); | 
|---|
| 346 | } | 
|---|
| 347 | return d->is_null; | 
|---|
| 348 | } | 
|---|
| 349 |  | 
|---|
| 350 | static bool compare(const QVariant::Private *a, const QVariant::Private *b) | 
|---|
| 351 | { | 
|---|
| 352 | Q_ASSERT(a->type == b->type); | 
|---|
| 353 | switch(a->type) { | 
|---|
| 354 | case QVariant::Cursor: | 
|---|
| 355 | #ifndef QT_NO_CURSOR | 
|---|
| 356 | return v_cast<QCursor>(a)->shape() == v_cast<QCursor>(b)->shape(); | 
|---|
| 357 | #endif | 
|---|
| 358 | case QVariant::Bitmap: | 
|---|
| 359 | return v_cast<QBitmap>(a)->cacheKey() | 
|---|
| 360 | == v_cast<QBitmap>(b)->cacheKey(); | 
|---|
| 361 | case QVariant::Polygon: | 
|---|
| 362 | return *v_cast<QPolygon>(a) == *v_cast<QPolygon>(b); | 
|---|
| 363 | case QVariant::Region: | 
|---|
| 364 | return *v_cast<QRegion>(a) == *v_cast<QRegion>(b); | 
|---|
| 365 | case QVariant::Font: | 
|---|
| 366 | return *v_cast<QFont>(a) == *v_cast<QFont>(b); | 
|---|
| 367 | case QVariant::Pixmap: | 
|---|
| 368 | return v_cast<QPixmap>(a)->cacheKey() == v_cast<QPixmap>(b)->cacheKey(); | 
|---|
| 369 | case QVariant::Image: | 
|---|
| 370 | return *v_cast<QImage>(a) == *v_cast<QImage>(b); | 
|---|
| 371 | case QVariant::Brush: | 
|---|
| 372 | return *v_cast<QBrush>(a) == *v_cast<QBrush>(b); | 
|---|
| 373 | case QVariant::Color: | 
|---|
| 374 | return *v_cast<QColor>(a) == *v_cast<QColor>(b); | 
|---|
| 375 | case QVariant::Palette: | 
|---|
| 376 | return *v_cast<QPalette>(a) == *v_cast<QPalette>(b); | 
|---|
| 377 | #ifdef QT3_SUPPORT | 
|---|
| 378 | case QVariant::ColorGroup: | 
|---|
| 379 | return *v_cast<QColorGroup>(a) == *v_cast<QColorGroup>(b); | 
|---|
| 380 | #endif | 
|---|
| 381 | #ifndef QT_NO_ICON | 
|---|
| 382 | case QVariant::Icon: | 
|---|
| 383 | /* QIcon::operator==() cannot be reasonably implemented for QIcon, | 
|---|
| 384 | * so we always return false. */ | 
|---|
| 385 | return false; | 
|---|
| 386 | #endif | 
|---|
| 387 | case QVariant::Matrix: | 
|---|
| 388 | return *v_cast<QMatrix>(a) == *v_cast<QMatrix>(b); | 
|---|
| 389 | case QVariant::Transform: | 
|---|
| 390 | return *v_cast<QTransform>(a) == *v_cast<QTransform>(b); | 
|---|
| 391 | case QVariant::TextFormat: | 
|---|
| 392 | return *v_cast<QTextFormat>(a) == *v_cast<QTextFormat>(b); | 
|---|
| 393 | case QVariant::TextLength: | 
|---|
| 394 | return *v_cast<QTextLength>(a) == *v_cast<QTextLength>(b); | 
|---|
| 395 | case QVariant::SizePolicy: | 
|---|
| 396 | return *v_cast<QSizePolicy>(a) == *v_cast<QSizePolicy>(b); | 
|---|
| 397 | #ifndef QT_NO_SHORTCUT | 
|---|
| 398 | case QVariant::KeySequence: | 
|---|
| 399 | return *v_cast<QKeySequence>(a) == *v_cast<QKeySequence>(b); | 
|---|
| 400 | #endif | 
|---|
| 401 | case QVariant::Pen: | 
|---|
| 402 | return *v_cast<QPen>(a) == *v_cast<QPen>(b); | 
|---|
| 403 | #ifndef QT_NO_MATRIX4X4 | 
|---|
| 404 | case QVariant::Matrix4x4: | 
|---|
| 405 | return *v_cast<QMatrix4x4>(a) == *v_cast<QMatrix4x4>(b); | 
|---|
| 406 | #endif | 
|---|
| 407 | #ifndef QT_NO_VECTOR2D | 
|---|
| 408 | case QVariant::Vector2D: | 
|---|
| 409 | return *v_cast<QVector2D>(a) == *v_cast<QVector2D>(b); | 
|---|
| 410 | #endif | 
|---|
| 411 | #ifndef QT_NO_VECTOR3D | 
|---|
| 412 | case QVariant::Vector3D: | 
|---|
| 413 | return *v_cast<QVector3D>(a) == *v_cast<QVector3D>(b); | 
|---|
| 414 | #endif | 
|---|
| 415 | #ifndef QT_NO_VECTOR4D | 
|---|
| 416 | case QVariant::Vector4D: | 
|---|
| 417 | return *v_cast<QVector4D>(a) == *v_cast<QVector4D>(b); | 
|---|
| 418 | #endif | 
|---|
| 419 | #ifndef QT_NO_QUATERNION | 
|---|
| 420 | case QVariant::Quaternion: | 
|---|
| 421 | return *v_cast<QQuaternion>(a) == *v_cast<QQuaternion>(b); | 
|---|
| 422 | #endif | 
|---|
| 423 | default: | 
|---|
| 424 | break; | 
|---|
| 425 | } | 
|---|
| 426 | return qcoreVariantHandler()->compare(a, b); | 
|---|
| 427 | } | 
|---|
| 428 |  | 
|---|
| 429 |  | 
|---|
| 430 |  | 
|---|
| 431 | static bool convert(const QVariant::Private *d, QVariant::Type t, | 
|---|
| 432 | void *result, bool *ok) | 
|---|
| 433 | { | 
|---|
| 434 | switch (t) { | 
|---|
| 435 | case QVariant::ByteArray: | 
|---|
| 436 | if (d->type == QVariant::Color) { | 
|---|
| 437 | *static_cast<QByteArray *>(result) = v_cast<QColor>(d)->name().toLatin1(); | 
|---|
| 438 | return true; | 
|---|
| 439 | } | 
|---|
| 440 | break; | 
|---|
| 441 | case QVariant::String: { | 
|---|
| 442 | QString *str = static_cast<QString *>(result); | 
|---|
| 443 | switch (d->type) { | 
|---|
| 444 | #ifndef QT_NO_SHORTCUT | 
|---|
| 445 | case QVariant::KeySequence: | 
|---|
| 446 | *str = QString(*v_cast<QKeySequence>(d)); | 
|---|
| 447 | return true; | 
|---|
| 448 | #endif | 
|---|
| 449 | case QVariant::Font: | 
|---|
| 450 | *str = v_cast<QFont>(d)->toString(); | 
|---|
| 451 | return true; | 
|---|
| 452 | case QVariant::Color: | 
|---|
| 453 | *str = v_cast<QColor>(d)->name(); | 
|---|
| 454 | return true; | 
|---|
| 455 | default: | 
|---|
| 456 | break; | 
|---|
| 457 | } | 
|---|
| 458 | break; | 
|---|
| 459 | } | 
|---|
| 460 | case QVariant::Pixmap: | 
|---|
| 461 | if (d->type == QVariant::Image) { | 
|---|
| 462 | *static_cast<QPixmap *>(result) = QPixmap::fromImage(*v_cast<QImage>(d)); | 
|---|
| 463 | return true; | 
|---|
| 464 | } else if (d->type == QVariant::Bitmap) { | 
|---|
| 465 | *static_cast<QPixmap *>(result) = *v_cast<QBitmap>(d); | 
|---|
| 466 | return true; | 
|---|
| 467 | } else if (d->type == QVariant::Brush) { | 
|---|
| 468 | if (v_cast<QBrush>(d)->style() == Qt::TexturePattern) { | 
|---|
| 469 | *static_cast<QPixmap *>(result) = v_cast<QBrush>(d)->texture(); | 
|---|
| 470 | return true; | 
|---|
| 471 | } | 
|---|
| 472 | } | 
|---|
| 473 | break; | 
|---|
| 474 | case QVariant::Image: | 
|---|
| 475 | if (d->type == QVariant::Pixmap) { | 
|---|
| 476 | *static_cast<QImage *>(result) = v_cast<QPixmap>(d)->toImage(); | 
|---|
| 477 | return true; | 
|---|
| 478 | } else if (d->type == QVariant::Bitmap) { | 
|---|
| 479 | *static_cast<QImage *>(result) = v_cast<QBitmap>(d)->toImage(); | 
|---|
| 480 | return true; | 
|---|
| 481 | } | 
|---|
| 482 | break; | 
|---|
| 483 | case QVariant::Bitmap: | 
|---|
| 484 | if (d->type == QVariant::Pixmap) { | 
|---|
| 485 | *static_cast<QBitmap *>(result) = *v_cast<QPixmap>(d); | 
|---|
| 486 | return true; | 
|---|
| 487 | } else if (d->type == QVariant::Image) { | 
|---|
| 488 | *static_cast<QBitmap *>(result) = QBitmap::fromImage(*v_cast<QImage>(d)); | 
|---|
| 489 | return true; | 
|---|
| 490 | } | 
|---|
| 491 | break; | 
|---|
| 492 | #ifndef QT_NO_SHORTCUT | 
|---|
| 493 | case QVariant::Int: | 
|---|
| 494 | if (d->type == QVariant::KeySequence) { | 
|---|
| 495 | *static_cast<int *>(result) = (int)(*(v_cast<QKeySequence>(d))); | 
|---|
| 496 | return true; | 
|---|
| 497 | } | 
|---|
| 498 | break; | 
|---|
| 499 | #endif | 
|---|
| 500 | case QVariant::Font: | 
|---|
| 501 | if (d->type == QVariant::String) { | 
|---|
| 502 | QFont *f = static_cast<QFont *>(result); | 
|---|
| 503 | f->fromString(*v_cast<QString>(d)); | 
|---|
| 504 | return true; | 
|---|
| 505 | } | 
|---|
| 506 | break; | 
|---|
| 507 | case QVariant::Color: | 
|---|
| 508 | if (d->type == QVariant::String) { | 
|---|
| 509 | static_cast<QColor *>(result)->setNamedColor(*v_cast<QString>(d)); | 
|---|
| 510 | return static_cast<QColor *>(result)->isValid(); | 
|---|
| 511 | } else if (d->type == QVariant::ByteArray) { | 
|---|
| 512 | static_cast<QColor *>(result)->setNamedColor(QString::fromLatin1( | 
|---|
| 513 | *v_cast<QByteArray>(d))); | 
|---|
| 514 | return true; | 
|---|
| 515 | } else if (d->type == QVariant::Brush) { | 
|---|
| 516 | if (v_cast<QBrush>(d)->style() == Qt::SolidPattern) { | 
|---|
| 517 | *static_cast<QColor *>(result) = v_cast<QBrush>(d)->color(); | 
|---|
| 518 | return true; | 
|---|
| 519 | } | 
|---|
| 520 | } | 
|---|
| 521 | break; | 
|---|
| 522 | case QVariant::Brush: | 
|---|
| 523 | if (d->type == QVariant::Color) { | 
|---|
| 524 | *static_cast<QBrush *>(result) = QBrush(*v_cast<QColor>(d)); | 
|---|
| 525 | return true; | 
|---|
| 526 | } else if (d->type == QVariant::Pixmap) { | 
|---|
| 527 | *static_cast<QBrush *>(result) = QBrush(*v_cast<QPixmap>(d)); | 
|---|
| 528 | return true; | 
|---|
| 529 | } | 
|---|
| 530 | break; | 
|---|
| 531 | #ifndef QT_NO_SHORTCUT | 
|---|
| 532 | case QVariant::KeySequence: { | 
|---|
| 533 | QKeySequence *seq = static_cast<QKeySequence *>(result); | 
|---|
| 534 | switch (d->type) { | 
|---|
| 535 | case QVariant::String: | 
|---|
| 536 | *seq = QKeySequence(*v_cast<QString>(d)); | 
|---|
| 537 | return true; | 
|---|
| 538 | case QVariant::Int: | 
|---|
| 539 | *seq = QKeySequence(d->data.i); | 
|---|
| 540 | return true; | 
|---|
| 541 | default: | 
|---|
| 542 | break; | 
|---|
| 543 | } | 
|---|
| 544 | } | 
|---|
| 545 | #endif | 
|---|
| 546 | default: | 
|---|
| 547 | break; | 
|---|
| 548 | } | 
|---|
| 549 | return qcoreVariantHandler()->convert(d, t, result, ok); | 
|---|
| 550 | } | 
|---|
| 551 |  | 
|---|
| 552 | #if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM) | 
|---|
| 553 | static void streamDebug(QDebug dbg, const QVariant &v) | 
|---|
| 554 | { | 
|---|
| 555 | switch(v.type()) { | 
|---|
| 556 | case QVariant::Cursor: | 
|---|
| 557 | #ifndef QT_NO_CURSOR | 
|---|
| 558 | //        dbg.nospace() << qvariant_cast<QCursor>(v); //FIXME | 
|---|
| 559 | #endif | 
|---|
| 560 | break; | 
|---|
| 561 | case QVariant::Bitmap: | 
|---|
| 562 | //        dbg.nospace() << qvariant_cast<QBitmap>(v); //FIXME | 
|---|
| 563 | break; | 
|---|
| 564 | case QVariant::Polygon: | 
|---|
| 565 | dbg.nospace() << qvariant_cast<QPolygon>(v); | 
|---|
| 566 | break; | 
|---|
| 567 | case QVariant::Region: | 
|---|
| 568 | dbg.nospace() << qvariant_cast<QRegion>(v); | 
|---|
| 569 | break; | 
|---|
| 570 | case QVariant::Font: | 
|---|
| 571 | //        dbg.nospace() << qvariant_cast<QFont>(v);  //FIXME | 
|---|
| 572 | break; | 
|---|
| 573 | case QVariant::Matrix: | 
|---|
| 574 | dbg.nospace() << qvariant_cast<QMatrix>(v); | 
|---|
| 575 | break; | 
|---|
| 576 | case QVariant::Transform: | 
|---|
| 577 | dbg.nospace() << qvariant_cast<QTransform>(v); | 
|---|
| 578 | break; | 
|---|
| 579 | case QVariant::Pixmap: | 
|---|
| 580 | //        dbg.nospace() << qvariant_cast<QPixmap>(v); //FIXME | 
|---|
| 581 | break; | 
|---|
| 582 | case QVariant::Image: | 
|---|
| 583 | //        dbg.nospace() << qvariant_cast<QImage>(v); //FIXME | 
|---|
| 584 | break; | 
|---|
| 585 | case QVariant::Brush: | 
|---|
| 586 | dbg.nospace() << qvariant_cast<QBrush>(v); | 
|---|
| 587 | break; | 
|---|
| 588 | case QVariant::Color: | 
|---|
| 589 | dbg.nospace() << qvariant_cast<QColor>(v); | 
|---|
| 590 | break; | 
|---|
| 591 | case QVariant::Palette: | 
|---|
| 592 | //        dbg.nospace() << qvariant_cast<QPalette>(v); //FIXME | 
|---|
| 593 | break; | 
|---|
| 594 | #ifndef QT_NO_ICON | 
|---|
| 595 | case QVariant::Icon: | 
|---|
| 596 | //        dbg.nospace() << qvariant_cast<QIcon>(v); // FIXME | 
|---|
| 597 | break; | 
|---|
| 598 | #endif | 
|---|
| 599 | case QVariant::SizePolicy: | 
|---|
| 600 | //        dbg.nospace() << qvariant_cast<QSizePolicy>(v); //FIXME | 
|---|
| 601 | break; | 
|---|
| 602 | #ifndef QT_NO_SHORTCUT | 
|---|
| 603 | case QVariant::KeySequence: | 
|---|
| 604 | dbg.nospace() << qvariant_cast<QKeySequence>(v); | 
|---|
| 605 | break; | 
|---|
| 606 | #endif | 
|---|
| 607 | case QVariant::Pen: | 
|---|
| 608 | dbg.nospace() << qvariant_cast<QPen>(v); | 
|---|
| 609 | break; | 
|---|
| 610 | #ifndef QT_NO_MATRIX4X4 | 
|---|
| 611 | case QVariant::Matrix4x4: | 
|---|
| 612 | dbg.nospace() << qvariant_cast<QMatrix4x4>(v); | 
|---|
| 613 | break; | 
|---|
| 614 | #endif | 
|---|
| 615 | #ifndef QT_NO_VECTOR2D | 
|---|
| 616 | case QVariant::Vector2D: | 
|---|
| 617 | dbg.nospace() << qvariant_cast<QVector2D>(v); | 
|---|
| 618 | break; | 
|---|
| 619 | #endif | 
|---|
| 620 | #ifndef QT_NO_VECTOR3D | 
|---|
| 621 | case QVariant::Vector3D: | 
|---|
| 622 | dbg.nospace() << qvariant_cast<QVector3D>(v); | 
|---|
| 623 | break; | 
|---|
| 624 | #endif | 
|---|
| 625 | #ifndef QT_NO_VECTOR4D | 
|---|
| 626 | case QVariant::Vector4D: | 
|---|
| 627 | dbg.nospace() << qvariant_cast<QVector4D>(v); | 
|---|
| 628 | break; | 
|---|
| 629 | #endif | 
|---|
| 630 | #ifndef QT_NO_QUATERNION | 
|---|
| 631 | case QVariant::Quaternion: | 
|---|
| 632 | dbg.nospace() << qvariant_cast<QQuaternion>(v); | 
|---|
| 633 | break; | 
|---|
| 634 | #endif | 
|---|
| 635 | default: | 
|---|
| 636 | qcoreVariantHandler()->debugStream(dbg, v); | 
|---|
| 637 | break; | 
|---|
| 638 | } | 
|---|
| 639 | } | 
|---|
| 640 | #endif | 
|---|
| 641 |  | 
|---|
| 642 | const QVariant::Handler qt_gui_variant_handler = { | 
|---|
| 643 | construct, | 
|---|
| 644 | clear, | 
|---|
| 645 | isNull, | 
|---|
| 646 | #ifndef QT_NO_DATASTREAM | 
|---|
| 647 | 0, | 
|---|
| 648 | 0, | 
|---|
| 649 | #endif | 
|---|
| 650 | compare, | 
|---|
| 651 | convert, | 
|---|
| 652 | 0, | 
|---|
| 653 | #if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM) | 
|---|
| 654 | streamDebug | 
|---|
| 655 | #else | 
|---|
| 656 | 0 | 
|---|
| 657 | #endif | 
|---|
| 658 | }; | 
|---|
| 659 |  | 
|---|
| 660 | struct QMetaTypeGuiHelper | 
|---|
| 661 | { | 
|---|
| 662 | QMetaType::Constructor constr; | 
|---|
| 663 | QMetaType::Destructor destr; | 
|---|
| 664 | #ifndef QT_NO_DATASTREAM | 
|---|
| 665 | QMetaType::SaveOperator saveOp; | 
|---|
| 666 | QMetaType::LoadOperator loadOp; | 
|---|
| 667 | #endif | 
|---|
| 668 | }; | 
|---|
| 669 |  | 
|---|
| 670 | extern Q_CORE_EXPORT const QMetaTypeGuiHelper *qMetaTypeGuiHelper; | 
|---|
| 671 |  | 
|---|
| 672 |  | 
|---|
| 673 | #ifdef QT_NO_DATASTREAM | 
|---|
| 674 | #  define Q_DECL_METATYPE_HELPER(TYPE) \ | 
|---|
| 675 | typedef void *(*QConstruct##TYPE)(const TYPE *); \ | 
|---|
| 676 | static const QConstruct##TYPE qConstruct##TYPE = qMetaTypeConstructHelper<TYPE>; \ | 
|---|
| 677 | typedef void (*QDestruct##TYPE)(TYPE *); \ | 
|---|
| 678 | static const QDestruct##TYPE qDestruct##TYPE = qMetaTypeDeleteHelper<TYPE>; | 
|---|
| 679 | #else | 
|---|
| 680 | #  define Q_DECL_METATYPE_HELPER(TYPE) \ | 
|---|
| 681 | typedef void *(*QConstruct##TYPE)(const TYPE *); \ | 
|---|
| 682 | static const QConstruct##TYPE qConstruct##TYPE = qMetaTypeConstructHelper<TYPE>; \ | 
|---|
| 683 | typedef void (*QDestruct##TYPE)(TYPE *); \ | 
|---|
| 684 | static const QDestruct##TYPE qDestruct##TYPE = qMetaTypeDeleteHelper<TYPE>; \ | 
|---|
| 685 | typedef void (*QSave##TYPE)(QDataStream &, const TYPE *); \ | 
|---|
| 686 | static const QSave##TYPE qSave##TYPE = qMetaTypeSaveHelper<TYPE>; \ | 
|---|
| 687 | typedef void (*QLoad##TYPE)(QDataStream &, TYPE *); \ | 
|---|
| 688 | static const QLoad##TYPE qLoad##TYPE = qMetaTypeLoadHelper<TYPE>; | 
|---|
| 689 | #endif | 
|---|
| 690 |  | 
|---|
| 691 | #ifdef QT3_SUPPORT | 
|---|
| 692 | Q_DECL_METATYPE_HELPER(QColorGroup) | 
|---|
| 693 | #endif | 
|---|
| 694 | Q_DECL_METATYPE_HELPER(QFont) | 
|---|
| 695 | Q_DECL_METATYPE_HELPER(QPixmap) | 
|---|
| 696 | Q_DECL_METATYPE_HELPER(QBrush) | 
|---|
| 697 | Q_DECL_METATYPE_HELPER(QColor) | 
|---|
| 698 | Q_DECL_METATYPE_HELPER(QPalette) | 
|---|
| 699 | #ifndef QT_NO_ICON | 
|---|
| 700 | Q_DECL_METATYPE_HELPER(QIcon) | 
|---|
| 701 | #endif | 
|---|
| 702 | Q_DECL_METATYPE_HELPER(QImage) | 
|---|
| 703 | Q_DECL_METATYPE_HELPER(QPolygon) | 
|---|
| 704 | Q_DECL_METATYPE_HELPER(QRegion) | 
|---|
| 705 | Q_DECL_METATYPE_HELPER(QBitmap) | 
|---|
| 706 | #ifndef QT_NO_CURSOR | 
|---|
| 707 | Q_DECL_METATYPE_HELPER(QCursor) | 
|---|
| 708 | #endif | 
|---|
| 709 | Q_DECL_METATYPE_HELPER(QSizePolicy) | 
|---|
| 710 | #ifndef QT_NO_SHORTCUT | 
|---|
| 711 | Q_DECL_METATYPE_HELPER(QKeySequence) | 
|---|
| 712 | #endif | 
|---|
| 713 | Q_DECL_METATYPE_HELPER(QPen) | 
|---|
| 714 | Q_DECL_METATYPE_HELPER(QTextLength) | 
|---|
| 715 | Q_DECL_METATYPE_HELPER(QTextFormat) | 
|---|
| 716 | Q_DECL_METATYPE_HELPER(QMatrix) | 
|---|
| 717 | Q_DECL_METATYPE_HELPER(QTransform) | 
|---|
| 718 | #ifndef QT_NO_MATRIX4X4 | 
|---|
| 719 | Q_DECL_METATYPE_HELPER(QMatrix4x4) | 
|---|
| 720 | #endif | 
|---|
| 721 | #ifndef QT_NO_VECTOR2D | 
|---|
| 722 | Q_DECL_METATYPE_HELPER(QVector2D) | 
|---|
| 723 | #endif | 
|---|
| 724 | #ifndef QT_NO_VECTOR3D | 
|---|
| 725 | Q_DECL_METATYPE_HELPER(QVector3D) | 
|---|
| 726 | #endif | 
|---|
| 727 | #ifndef QT_NO_VECTOR4D | 
|---|
| 728 | Q_DECL_METATYPE_HELPER(QVector4D) | 
|---|
| 729 | #endif | 
|---|
| 730 | #ifndef QT_NO_QUATERNION | 
|---|
| 731 | Q_DECL_METATYPE_HELPER(QQuaternion) | 
|---|
| 732 | #endif | 
|---|
| 733 |  | 
|---|
| 734 | #ifdef QT_NO_DATASTREAM | 
|---|
| 735 | #  define Q_IMPL_METATYPE_HELPER(TYPE) \ | 
|---|
| 736 | { reinterpret_cast<QMetaType::Constructor>(qConstruct##TYPE), \ | 
|---|
| 737 | reinterpret_cast<QMetaType::Destructor>(qDestruct##TYPE) } | 
|---|
| 738 | #else | 
|---|
| 739 | #  define Q_IMPL_METATYPE_HELPER(TYPE) \ | 
|---|
| 740 | { reinterpret_cast<QMetaType::Constructor>(qConstruct##TYPE), \ | 
|---|
| 741 | reinterpret_cast<QMetaType::Destructor>(qDestruct##TYPE), \ | 
|---|
| 742 | reinterpret_cast<QMetaType::SaveOperator>(qSave##TYPE), \ | 
|---|
| 743 | reinterpret_cast<QMetaType::LoadOperator>(qLoad##TYPE) \ | 
|---|
| 744 | } | 
|---|
| 745 | #endif | 
|---|
| 746 |  | 
|---|
| 747 | static const QMetaTypeGuiHelper qVariantGuiHelper[] = { | 
|---|
| 748 | #ifdef QT3_SUPPORT | 
|---|
| 749 | Q_IMPL_METATYPE_HELPER(QColorGroup), | 
|---|
| 750 | #else | 
|---|
| 751 | {0, 0, 0, 0}, | 
|---|
| 752 | #endif | 
|---|
| 753 | Q_IMPL_METATYPE_HELPER(QFont), | 
|---|
| 754 | Q_IMPL_METATYPE_HELPER(QPixmap), | 
|---|
| 755 | Q_IMPL_METATYPE_HELPER(QBrush), | 
|---|
| 756 | Q_IMPL_METATYPE_HELPER(QColor), | 
|---|
| 757 | Q_IMPL_METATYPE_HELPER(QPalette), | 
|---|
| 758 | #ifdef QT_NO_ICON | 
|---|
| 759 | {0, 0, 0, 0}, | 
|---|
| 760 | #else | 
|---|
| 761 | Q_IMPL_METATYPE_HELPER(QIcon), | 
|---|
| 762 | #endif | 
|---|
| 763 | Q_IMPL_METATYPE_HELPER(QImage), | 
|---|
| 764 | Q_IMPL_METATYPE_HELPER(QPolygon), | 
|---|
| 765 | Q_IMPL_METATYPE_HELPER(QRegion), | 
|---|
| 766 | Q_IMPL_METATYPE_HELPER(QBitmap), | 
|---|
| 767 | #ifdef QT_NO_CURSOR | 
|---|
| 768 | {0, 0, 0, 0}, | 
|---|
| 769 | #else | 
|---|
| 770 | Q_IMPL_METATYPE_HELPER(QCursor), | 
|---|
| 771 | #endif | 
|---|
| 772 | Q_IMPL_METATYPE_HELPER(QSizePolicy), | 
|---|
| 773 | #ifdef QT_NO_SHORTCUT | 
|---|
| 774 | {0, 0, 0, 0}, | 
|---|
| 775 | #else | 
|---|
| 776 | Q_IMPL_METATYPE_HELPER(QKeySequence), | 
|---|
| 777 | #endif | 
|---|
| 778 | Q_IMPL_METATYPE_HELPER(QPen), | 
|---|
| 779 | Q_IMPL_METATYPE_HELPER(QTextLength), | 
|---|
| 780 | Q_IMPL_METATYPE_HELPER(QTextFormat), | 
|---|
| 781 | Q_IMPL_METATYPE_HELPER(QMatrix), | 
|---|
| 782 | Q_IMPL_METATYPE_HELPER(QTransform), | 
|---|
| 783 | #ifndef QT_NO_MATRIX4X4 | 
|---|
| 784 | Q_IMPL_METATYPE_HELPER(QMatrix4x4), | 
|---|
| 785 | #else | 
|---|
| 786 | {0, 0, 0, 0}, | 
|---|
| 787 | #endif | 
|---|
| 788 | #ifndef QT_NO_VECTOR2D | 
|---|
| 789 | Q_IMPL_METATYPE_HELPER(QVector2D), | 
|---|
| 790 | #else | 
|---|
| 791 | {0, 0, 0, 0}, | 
|---|
| 792 | #endif | 
|---|
| 793 | #ifndef QT_NO_VECTOR3D | 
|---|
| 794 | Q_IMPL_METATYPE_HELPER(QVector3D), | 
|---|
| 795 | #else | 
|---|
| 796 | {0, 0, 0, 0}, | 
|---|
| 797 | #endif | 
|---|
| 798 | #ifndef QT_NO_VECTOR4D | 
|---|
| 799 | Q_IMPL_METATYPE_HELPER(QVector4D), | 
|---|
| 800 | #else | 
|---|
| 801 | {0, 0, 0, 0}, | 
|---|
| 802 | #endif | 
|---|
| 803 | #ifndef QT_NO_QUATERNION | 
|---|
| 804 | Q_IMPL_METATYPE_HELPER(QQuaternion) | 
|---|
| 805 | #else | 
|---|
| 806 | {0, 0, 0, 0} | 
|---|
| 807 | #endif | 
|---|
| 808 | }; | 
|---|
| 809 |  | 
|---|
| 810 | static const QVariant::Handler *qt_guivariant_last_handler = 0; | 
|---|
| 811 | int qRegisterGuiVariant() | 
|---|
| 812 | { | 
|---|
| 813 | qt_guivariant_last_handler = QVariant::handler; | 
|---|
| 814 | QVariant::handler = &qt_gui_variant_handler; | 
|---|
| 815 | qMetaTypeGuiHelper = qVariantGuiHelper; | 
|---|
| 816 | return 1; | 
|---|
| 817 | } | 
|---|
| 818 | Q_CONSTRUCTOR_FUNCTION(qRegisterGuiVariant) | 
|---|
| 819 |  | 
|---|
| 820 | int qUnregisterGuiVariant() | 
|---|
| 821 | { | 
|---|
| 822 | QVariant::handler = qt_guivariant_last_handler; | 
|---|
| 823 | qMetaTypeGuiHelper = 0; | 
|---|
| 824 | return 1; | 
|---|
| 825 | } | 
|---|
| 826 | Q_DESTRUCTOR_FUNCTION(qUnregisterGuiVariant) | 
|---|
| 827 |  | 
|---|
| 828 | QT_END_NAMESPACE | 
|---|