- Timestamp:
- Oct 24, 2023 12:14:07 AM (15 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICustomFileSystemModel.cpp
r100604 r101566 137 137 { 138 138 QVariant data = m_itemData.value(UICustomFileSystemModelData_Name, QVariant()); 139 #ifndef VBOX_IS_QT6_OR_LATER /* QVariant/QMetaType ::Type is replaced with QMetaType in Qt6 for canConvert */140 if (!data.canConvert(QMetaType::QString))141 #else142 139 if (!data.canConvert(QMetaType(QMetaType::QString))) 143 #endif144 140 return QString(); 145 141 return data.toString(); … … 437 433 if (index.isValid() && role == Qt::EditRole) 438 434 { 439 #ifndef VBOX_IS_QT6_OR_LATER /* QVariant/QMetaType ::Type is replaced with QMetaType in Qt6 for canConvert */440 if (index.column() == 0 && value.canConvert(QMetaType::QString))441 #else442 435 if (index.column() == 0 && value.canConvert(QMetaType(QMetaType::QString))) 443 #endif444 436 { 445 437 UICustomFileSystemItem *pItem = static_cast<UICustomFileSystemItem*>(index.internalPointer()); … … 471 463 return QVariant(); 472 464 /* Format date/time column: */ 473 #ifndef VBOX_IS_QT6_OR_LATER /* QVariant/QMetaType ::Type is replaced with QMetaType in Qt6 for canConvert */474 if (item->data(index.column()).canConvert(QMetaType::QDateTime))475 #else476 465 if (item->data(index.column()).canConvert(QMetaType(QMetaType::QDateTime))) 477 #endif478 466 { 479 467 QDateTime dateTime = item->data(index.column()).toDateTime(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDMIMEData.cpp
r100347 r101566 97 97 * @return QVariant 98 98 */ 99 #ifndef VBOX_IS_QT6_OR_LATER /* QVariant::Type is replaced with QMetaType in Qt6 for retrieveData */100 QVariant UIDnDMIMEData::retrieveData(const QString &strMIMEType, QVariant::Type enmType) const101 {102 /* Acquire QMetaType::Type: */103 const QMetaType::Type vaType = (QMetaType::Type)enmType;104 105 LogFlowFunc(("state=%RU32, curAction=0x%x, defAction=0x%x, mimeType=%s, type=%d (%s)\n",106 m_enmState, m_curAction, m_defAction, strMIMEType.toStdString().c_str(), vaType, QVariant::typeToName(vaType)));107 #else108 99 QVariant UIDnDMIMEData::retrieveData(const QString &strMIMEType, QMetaType metaType) const 109 100 { … … 113 104 LogFlowFunc(("state=%RU32, curAction=0x%x, defAction=0x%x, mimeType=%s, type=%d (%s)\n", 114 105 m_enmState, m_curAction, m_defAction, strMIMEType.toStdString().c_str(), vaType, metaType.name())); 115 #endif116 106 117 107 int rc = VINF_SUCCESS; … … 171 161 || vaType == QMetaType::QStringList)) 172 162 { 173 # ifndef VBOX_IS_QT6_OR_LATER /* QVariant is replaced with QMetaType in Qt6 */174 LogRel(("DnD: Unsupported data type '%s'\n", QVariant::typeToName(vaType)));175 # else176 163 LogRel(("DnD: Unsupported data type '%s'\n", metaType.name())); 177 # endif178 164 rc = VERR_NOT_SUPPORTED; 179 165 } … … 189 175 if (RT_SUCCESS(rc)) 190 176 { 191 #ifndef VBOX_IS_QT6_OR_LATER /* QVariant is replaced with QMetaType in Qt6 */192 LogRel3(("DnD: Returning data for MIME type=%s, variant type=%s, rc=%Rrc\n",193 strMIMEType.toStdString().c_str(), QVariant::typeToName(vaData.type()), rc));194 #else195 177 LogRel3(("DnD: Returning data for MIME type=%s, variant type=%s, rc=%Rrc\n", 196 178 strMIMEType.toStdString().c_str(), metaType.name(), rc)); 197 #endif198 179 199 180 return vaData; … … 230 211 vaType = QMetaType::UnknownType; 231 212 232 #ifndef VBOX_IS_QT6_OR_LATER /* QVariant is replaced with QMetaType in Qt6 */233 LogFlowFunc(("strMIMEType=%s -> vaType=%s\n", qPrintable(strMIMEType), QVariant::typeToName(vaType)));234 #else235 213 LogFlowFunc(("strMIMEType=%s -> vaType=%s\n", qPrintable(strMIMEType), QMetaType(vaType).name())); 236 #endif237 214 return vaType; 238 215 } … … 245 222 { 246 223 RT_NOREF(strMIMEType); 247 #ifndef VBOX_IS_QT6_OR_LATER /* QVariant is replaced with QMetaType in Qt6 */248 LogFlowFunc(("vecDataSize=%d, strMIMEType=%s vaType=%s\n",249 vecData.size(), qPrintable(strMIMEType), QVariant::typeToName(vaType)));250 #else251 224 LogFlowFunc(("vecDataSize=%d, strMIMEType=%s vaType=%s\n", 252 225 vecData.size(), qPrintable(strMIMEType), QMetaType(vaType).name())); 253 #endif254 226 255 227 int rc = VINF_SUCCESS; … … 260 232 { 261 233 vaData = QVariant::fromValue(QString(reinterpret_cast<const char *>(vecData.constData()))); 262 #ifndef VBOX_IS_QT6_OR_LATER /* type() is replaced with typeId() in Qt6 */263 Assert(vaData.type() == QVariant::String);264 #else265 234 Assert(vaData.typeId() == QMetaType::QString); 266 #endif267 235 268 236 break; … … 274 242 275 243 vaData = QVariant::fromValue(ba); 276 #ifndef VBOX_IS_QT6_OR_LATER /* type() is replaced with typeId() in Qt6 */277 Assert(vaData.type() == QVariant::ByteArray);278 #else279 244 Assert(vaData.typeId() == QMetaType::QByteArray); 280 #endif281 245 break; 282 246 } … … 297 261 { 298 262 QVariant vaURL = QVariant::fromValue(QUrl(strCur)); 299 #ifndef VBOX_IS_QT6_OR_LATER /* type() is replaced with typeId() in Qt6 */300 Assert(vaURL.type() == QVariant::Url);301 #else302 263 Assert(vaURL.typeId() == QMetaType::QUrl); 303 #endif304 264 lstVariant.append(vaURL); 305 265 } 306 266 307 267 vaData = QVariant::fromValue(lstVariant); 308 #ifndef VBOX_IS_QT6_OR_LATER /* type() is replaced with typeId() in Qt6 */309 Assert(vaData.type() == QVariant::List);310 #else311 268 Assert(vaData.typeId() == QMetaType::QVariantList); 312 #endif313 269 break; 314 270 } … … 329 285 #endif 330 286 vaData = QVariant::fromValue(lstString); 331 #ifndef VBOX_IS_QT6_OR_LATER /* type() is replaced with typeId() in Qt6 */332 Assert(vaData.type() == QVariant::StringList);333 #else334 287 Assert(vaData.typeId() == QMetaType::QStringList); 335 #endif336 288 break; 337 289 } … … 339 291 default: 340 292 { 341 #ifndef VBOX_IS_QT6_OR_LATER /* QVariant is replaced with QMetaType in Qt6 */342 LogRel2(("DnD: Converting data (%d bytes) from guest to variant type '%s' not supported\n",343 vecData.size(), QVariant::typeToName(vaType) ? QVariant::typeToName(vaType) : "<Invalid>"));344 #else345 293 LogRel2(("DnD: Converting data (%d bytes) from guest to variant type '%s' not supported\n", 346 294 vecData.size(), QMetaType(vaType).name() ? QMetaType(vaType).name() : "<Invalid>")); 347 #endif348 295 349 296 rc = VERR_NOT_SUPPORTED; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDMIMEData.h
r100347 r101566 105 105 virtual bool hasFormat(const QString &mimeType) const; 106 106 107 #ifndef VBOX_IS_QT6_OR_LATER /* QVariant::Type is replaced with QMetaType in Qt6 for retrieveData */108 virtual QVariant retrieveData(const QString &strMIMEType, QVariant::Type enmType) const RT_OVERRIDE;109 #else110 107 virtual QVariant retrieveData(const QString &strMIMEType, QMetaType metaType) const RT_OVERRIDE; 111 #endif112 108 /** @} */ 113 109
Note:
See TracChangeset
for help on using the changeset viewer.