OSDN Git Service

say goodbye to QVariant(Qt::GlobalColor)
authorIvailo Monev <xakepa10@gmail.com>
Fri, 22 Jul 2016 21:46:00 +0000 (21:46 +0000)
committerIvailo Monev <xakepa10@gmail.com>
Fri, 22 Jul 2016 21:46:00 +0000 (21:46 +0000)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/core/kernel/qvariant.cpp
src/core/kernel/qvariant.h
src/gui/kernel/qguivariant.cpp

index 8d45019..e0c6ff8 100644 (file)
@@ -1759,19 +1759,6 @@ QVariant::QVariant(const char *val)
   Constructs a new variant with the regexp value \a regExp.
 */
 
-/*! \since 4.2
-  \fn QVariant::QVariant(Qt::GlobalColor color)
-
-  Constructs a new variant of type QVariant::Color and initializes
-  it with \a color.
-
-  This is a convenience constructor that allows \c{QVariant(Qt::blue);}
-  to create a valid QVariant storing a QColor.
-
-  Note: This constructor will assert if the application does not link
-  to the Qt GUI library.
- */
-
 QVariant::QVariant(Type type)
 { create(type, 0); }
 QVariant::QVariant(int typeOrUserType, const void *copy)
@@ -1857,7 +1844,6 @@ QVariant::QVariant(const QJsonObject &jsonObject) { d.is_null = false; d.type =
 QVariant::QVariant(const QJsonArray &jsonArray) { d.is_null = false; d.type = JsonArray; v_construct<QJsonArray>(&d, jsonArray); }
 QVariant::QVariant(const QJsonDocument &jsonDocument) { d.is_null = false; d.type = JsonDocument; v_construct<QJsonDocument>(&d, jsonDocument); }
 #endif
-QVariant::QVariant(Qt::GlobalColor color) { create(62, &color); }
 
 /*!
     Returns the storage type of the value stored in the variant.
index 763afa2..005a0c3 100644 (file)
@@ -210,7 +210,6 @@ class Q_CORE_EXPORT QVariant
 #ifndef QT_BOOTSTRAPPED
     QVariant(const QEasingCurve &easing);
 #endif
-    QVariant(Qt::GlobalColor color);
 
     QVariant& operator=(const QVariant &other);
 #ifdef Q_COMPILER_RVALUE_REFS
index a4ab97d..088f644 100644 (file)
@@ -136,14 +136,6 @@ static void construct(QVariant::Private *x, const void *copy)
         v_construct<QCursor>(x, copy);
         break;
 #endif
-    case 62: {
-        // small 'trick' to let a QVariant(Qt::blue) create a variant
-        // of type QColor
-        x->type = QVariant::Color;
-        QColor color(*reinterpret_cast<const Qt::GlobalColor *>(copy));
-        v_construct<QColor>(x, &color);
-        break;
-    }
 #ifndef QT_NO_MATRIX4X4
     case QVariant::Matrix4x4:
         v_construct<QMatrix4x4>(x, copy);