summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qguivariant.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qguivariant.cpp')
-rw-r--r--src/gui/kernel/qguivariant.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp
index 4ed9d032f6..596b7e44fd 100644
--- a/src/gui/kernel/qguivariant.cpp
+++ b/src/gui/kernel/qguivariant.cpp
@@ -178,25 +178,25 @@ static bool convert(const QVariant::Private *d, int t,
void *result, bool *ok)
{
switch (t) {
- case QVariant::ByteArray:
- if (d->type == QVariant::Color) {
+ case QMetaType::QByteArray:
+ if (d->type == QMetaType::QColor) {
const QColor *c = v_cast<QColor>(d);
*static_cast<QByteArray *>(result) = c->name(c->alpha() != 255 ? QColor::HexArgb : QColor::HexRgb).toLatin1();
return true;
}
break;
- case QVariant::String: {
+ case QMetaType::QString: {
QString *str = static_cast<QString *>(result);
switch (d->type) {
#ifndef QT_NO_SHORTCUT
- case QVariant::KeySequence:
+ case QMetaType::QKeySequence:
*str = (*v_cast<QKeySequence>(d)).toString(QKeySequence::NativeText);
return true;
#endif
- case QVariant::Font:
+ case QMetaType::QFont:
*str = v_cast<QFont>(d)->toString();
return true;
- case QVariant::Color: {
+ case QMetaType::QColor: {
const QColor *c = v_cast<QColor>(d);
*str = c->name(c->alpha() != 255 ? QColor::HexArgb : QColor::HexRgb);
return true;
@@ -206,85 +206,85 @@ static bool convert(const QVariant::Private *d, int t,
}
break;
}
- case QVariant::Pixmap:
- if (d->type == QVariant::Image) {
+ case QMetaType::QPixmap:
+ if (d->type == QMetaType::QImage) {
*static_cast<QPixmap *>(result) = QPixmap::fromImage(*v_cast<QImage>(d));
return true;
- } else if (d->type == QVariant::Bitmap) {
+ } else if (d->type == QMetaType::QBitmap) {
*static_cast<QPixmap *>(result) = *v_cast<QBitmap>(d);
return true;
- } else if (d->type == QVariant::Brush) {
+ } else if (d->type == QMetaType::QBrush) {
if (v_cast<QBrush>(d)->style() == Qt::TexturePattern) {
*static_cast<QPixmap *>(result) = v_cast<QBrush>(d)->texture();
return true;
}
}
break;
- case QVariant::Image:
- if (d->type == QVariant::Pixmap) {
+ case QMetaType::QImage:
+ if (d->type == QMetaType::QPixmap) {
*static_cast<QImage *>(result) = v_cast<QPixmap>(d)->toImage();
return true;
- } else if (d->type == QVariant::Bitmap) {
+ } else if (d->type == QMetaType::QBitmap) {
*static_cast<QImage *>(result) = v_cast<QBitmap>(d)->toImage();
return true;
}
break;
- case QVariant::Bitmap:
- if (d->type == QVariant::Pixmap) {
+ case QMetaType::QBitmap:
+ if (d->type == QMetaType::QPixmap) {
*static_cast<QBitmap *>(result) = *v_cast<QPixmap>(d);
return true;
- } else if (d->type == QVariant::Image) {
+ } else if (d->type == QMetaType::QImage) {
*static_cast<QBitmap *>(result) = QBitmap::fromImage(*v_cast<QImage>(d));
return true;
}
break;
#ifndef QT_NO_SHORTCUT
- case QVariant::Int:
- if (d->type == QVariant::KeySequence) {
+ case QMetaType::Int:
+ if (d->type == QMetaType::QKeySequence) {
const QKeySequence &seq = *v_cast<QKeySequence>(d);
*static_cast<int *>(result) = seq.isEmpty() ? 0 : seq[0];
return true;
}
break;
#endif
- case QVariant::Font:
- if (d->type == QVariant::String) {
+ case QMetaType::QFont:
+ if (d->type == QMetaType::QString) {
QFont *f = static_cast<QFont *>(result);
f->fromString(*v_cast<QString>(d));
return true;
}
break;
- case QVariant::Color:
- if (d->type == QVariant::String) {
+ case QMetaType::QColor:
+ if (d->type == QMetaType::QString) {
static_cast<QColor *>(result)->setNamedColor(*v_cast<QString>(d));
return static_cast<QColor *>(result)->isValid();
- } else if (d->type == QVariant::ByteArray) {
+ } else if (d->type == QMetaType::QByteArray) {
static_cast<QColor *>(result)->setNamedColor(QLatin1String(*v_cast<QByteArray>(d)));
return true;
- } else if (d->type == QVariant::Brush) {
+ } else if (d->type == QMetaType::QBrush) {
if (v_cast<QBrush>(d)->style() == Qt::SolidPattern) {
*static_cast<QColor *>(result) = v_cast<QBrush>(d)->color();
return true;
}
}
break;
- case QVariant::Brush:
- if (d->type == QVariant::Color) {
+ case QMetaType::QBrush:
+ if (d->type == QMetaType::QColor) {
*static_cast<QBrush *>(result) = QBrush(*v_cast<QColor>(d));
return true;
- } else if (d->type == QVariant::Pixmap) {
+ } else if (d->type == QMetaType::QPixmap) {
*static_cast<QBrush *>(result) = QBrush(*v_cast<QPixmap>(d));
return true;
}
break;
#ifndef QT_NO_SHORTCUT
- case QVariant::KeySequence: {
+ case QMetaType::QKeySequence: {
QKeySequence *seq = static_cast<QKeySequence *>(result);
switch (d->type) {
- case QVariant::String:
+ case QMetaType::QString:
*seq = QKeySequence(*v_cast<QString>(d));
return true;
- case QVariant::Int:
+ case QMetaType::Int:
*seq = QKeySequence(d->data.i);
return true;
default:
@@ -294,7 +294,7 @@ static bool convert(const QVariant::Private *d, int t,
}
#endif
#ifndef QT_NO_ICON
- case QVariant::Icon: {
+ case QMetaType::QIcon: {
if (ok)
*ok = false;
return false;