From 508804d6ab19e473e6455191391a38791e530f2e Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 18 Aug 2026 14:29:39 +0200 Subject: [PATCH] #14544 Make mime data hasFormat() consistent with formats() MimeDataWithIndexes and MimeDataWithReferences advertised every stored format in formats() but denied all of them except their own format name in hasFormat(). The object reference paths that the tree view stores under the ObjectReferenceList mime type were therefore reported as absent, and only worked because QMimeData::data() does not consult hasFormat(). Fall back to QMimeData::hasFormat() so the two functions agree. --- ApplicationLibCode/ProjectDataModel/RimMimeData.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/RimMimeData.cpp b/ApplicationLibCode/ProjectDataModel/RimMimeData.cpp index da52530bc1..09fd36a978 100644 --- a/ApplicationLibCode/ProjectDataModel/RimMimeData.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimMimeData.cpp @@ -55,7 +55,7 @@ const QModelIndexList& MimeDataWithIndexes::indexes() const //-------------------------------------------------------------------------------------------------- bool MimeDataWithIndexes::hasFormat( const QString& mimetype ) const { - return ( mimetype == formatName() ); + return ( mimetype == formatName() ) || QMimeData::hasFormat( mimetype ); } //-------------------------------------------------------------------------------------------------- @@ -114,7 +114,7 @@ const std::vector& MimeDataWithReferences::references() const //-------------------------------------------------------------------------------------------------- bool MimeDataWithReferences::hasFormat( const QString& mimetype ) const { - return ( mimetype == formatName() ); + return ( mimetype == formatName() ) || QMimeData::hasFormat( mimetype ); } //--------------------------------------------------------------------------------------------------