mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-24 22:27:55 -05:00
Move pdmToVariant/pdmFromVariant overloads for cvf::Color3f, Vec3d, Mat4d, and Mat3d from namespace caf to namespace cvf. Templates in cafInternalPdmFieldTypeSpecializations.h use "using caf::pdmToVariant" followed by an unqualified call, so ADL searches the argument's namespace (cvf). With the overloads only in caf, the default template was selected, causing cvf::Color3f to be stored raw in a QVariant instead of as QColor — breaking color field editing and producing QVariant::save warnings. All call sites now use the unqualified "using caf::pdmXxx; pdmXxx(value)" pattern so ADL finds the correct overload without depending on cvf:: as a visible prefix. Add AdlVariantTest to cafPdmCoreColor3fTest.cpp that exercises this exact pattern. Adds caf::toVariant<T> and caf::fromVariant<T> to cafPdmFieldTraits.h as thin wrappers that encapsulate the ADL two-step internally. Client code can now call caf::toVariant(x) directly instead of requiring a using-declaration at every call site.