Changeset View
Changeset View
Standalone View
Standalone View
debug_console.cpp
Show First 20 Lines • Show All 703 Lines • ▼ Show 20 Line(s) | 703 | DebugConsoleDelegate::DebugConsoleDelegate(QObject *parent) | |||
---|---|---|---|---|---|
704 | : QStyledItemDelegate(parent) | 704 | : QStyledItemDelegate(parent) | ||
705 | { | 705 | { | ||
706 | } | 706 | } | ||
707 | 707 | | |||
708 | DebugConsoleDelegate::~DebugConsoleDelegate() = default; | 708 | DebugConsoleDelegate::~DebugConsoleDelegate() = default; | ||
709 | 709 | | |||
710 | QString DebugConsoleDelegate::displayText(const QVariant &value, const QLocale &locale) const | 710 | QString DebugConsoleDelegate::displayText(const QVariant &value, const QLocale &locale) const | ||
711 | { | 711 | { | ||
712 | switch (value.type()) { | 712 | switch (value.userType()) { | ||
713 | case QMetaType::QPoint: { | 713 | case QMetaType::QPoint: { | ||
zzag: According to Qt documentation, we should interpret QVariant::Type as QMetaType::Type.
>… | |||||
Could you please revert this change? The documentation says that we should use QMetaType. I assume the compiler doesn't like conversions between QVariant::Type and QMetaType::Type. If that's the case, we could cast the return value of value.type() or use value.userType() as Qt folks do. zzag: Could you please revert this change? The documentation says that we should use QMetaType.
I… | |||||
It doesn't make much sense since QVartiant's are defined in terms of QMetaType: SizeF = QMetaType::QSizeF. But sure, changing for your peace of mind. apol: It doesn't make much sense since QVartiant's are defined in terms of QMetaType: `SizeF =… | |||||
714 | const QPoint p = value.toPoint(); | 714 | const QPoint p = value.toPoint(); | ||
715 | return QStringLiteral("%1,%2").arg(p.x()).arg(p.y()); | 715 | return QStringLiteral("%1,%2").arg(p.x()).arg(p.y()); | ||
716 | } | 716 | } | ||
717 | case QMetaType::QPointF: { | 717 | case QMetaType::QPointF: { | ||
718 | const QPointF p = value.toPointF(); | 718 | const QPointF p = value.toPointF(); | ||
719 | return QStringLiteral("%1,%2").arg(p.x()).arg(p.y()); | 719 | return QStringLiteral("%1,%2").arg(p.x()).arg(p.y()); | ||
720 | } | 720 | } | ||
721 | case QMetaType::QSize: { | 721 | case QMetaType::QSize: { | ||
▲ Show 20 Lines • Show All 874 Lines • Show Last 20 Lines |
According to Qt documentation, we should interpret QVariant::Type as QMetaType::Type.
https://doc.qt.io/qt-5/qvariant.html#type