Loading QIcon directly from bytes is not supported in Qt6 it seems, so
this patch changes it to load it to pixmap first and then to QIcon
directly.
Plus add some alternative options to avoid tracebacks for compatibility,
as it seems that in Qt5 it either failed gracefully, or was able to load
directly from string/bytes.
Adds import/export support for unimplemented material fields.
This includes reference source and URLs, and tag fields. Tag support
remains unimplemented in the editor, but is supported by a number
of materials in the FCMat files. They can be accessed in both C++
and Python.
* Materials: Set array quantity format
When setting quantity formats, the default format is not actually the
default. Instead fixed format is, which causes issues for very small
and very large values. This was fixed for C++ but arrays created in
Python were not setting the format correctly.
* Apply suggestions from code review
Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
Improves handling and assignment of default units
When creating a material without specifying units, no units are
currently assigned. This commit will assign the default units when none are
given, or throw an error when incompatible units are given. In the
latter case, the units are set to the property defaults.
This commit also incidentally fixed an issue when saving the material that
resulted in accessing an uninitialized pointer.
Update module dependencies to ensure that automated testing code is considered as well as direct dependencies. Update some automated tests to eliminate unwanted dependencies.
The final PR for the external module feature that allows materials to
be stored in an external datastore, webservice, etc.
This includes the final material manager classes, and the UI support in
the form of commands and preference pages.
* Materials: Model Manager External Interface
Implement the ModelManagerExternal class for the external Materials
interface.
This is part of the ongoing merges of code to support external material
interfaces. In this PR the ModelManagerExternal class is implemented,
along with changes to supporting classes required for this class.
* Apply reviewer feedback
The ExternalManager class calls python functions in an external module
to create, read, update, and delete material definitions. The API
provided by the modules must conform to that defined in the
MaterialManagerExternal.py file.
All communications with the external module is routed through this
class.
Found via `codespell -q 3 -L aci,addmin,ake,aline,alle,alledges,alocation,als,ang,anid,anormal,aply,apoints,ba,beginn,behaviour,bloaded,bottome,brushin,bu,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childrens,childs,colour,colours,commen,connexion,currenty,documentin,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,findn,fle,freez,graphin,hist,iff,incrementin,indexin,indicies,initialisation,initialise,initialised,initialises,initialisiert,inout,ist,itsel,kilometre,leadin,localy,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oce,oder,ontop,orgin,orginx,orginy,ot,pard,parm,parms,pres,programm,que,rady,recurrance,renderin,rin,ro,rougly,sectionin,seperator,serie,shs,sinc,siz,som,strack,substraction,te,technic,thist,thru,tread,tru,ue,uint,unter,uptodate,vas,vertexes,vew,wallthickness,whitespaces -S "./.git,*.po,*.ts,*.pdf,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml,./src/Base/StackWalker.cpp,./build/doc/SourceDoc,./tools/build/WindowsInstaller/lang,./src/Mod/TechDraw/Templates/locale"`
-Changed info.baseName() to
info.fileName().remove(QStringLiteral(".FCMat"), Qt::CaseInsensitive)
in MaterialLibrary.cpp to ensure that only the extension ".FCmat"
is removed from the file name bacause the previous version was removing
everything in front of the first dot