Merge pull request #10863 from wwmayer/material_fixes
Material: fix build failure with Qt6
This commit is contained in:
@@ -28,7 +28,10 @@
|
||||
#include <Base/Placement.h>
|
||||
#include <Base/Quantity.h>
|
||||
#include <App/DocumentObserver.h>
|
||||
#include <QMetaType>
|
||||
#include <QList>
|
||||
|
||||
// NOLINTBEGIN
|
||||
Q_DECLARE_METATYPE(Base::Vector3f)
|
||||
Q_DECLARE_METATYPE(Base::Vector3d)
|
||||
Q_DECLARE_METATYPE(QList<Base::Vector3d>)
|
||||
@@ -39,5 +42,6 @@ Q_DECLARE_METATYPE(Base::Quantity)
|
||||
Q_DECLARE_METATYPE(QList<Base::Quantity>)
|
||||
Q_DECLARE_METATYPE(App::SubObjectT)
|
||||
Q_DECLARE_METATYPE(QList<App::SubObjectT>)
|
||||
// NOLINTEND
|
||||
|
||||
#endif // GUI_METATYPES_H
|
||||
|
||||
@@ -81,7 +81,9 @@ Material* MaterialLibrary::saveMaterial(Material& material, const QString& path,
|
||||
|
||||
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
QTextStream stream(&file);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
|
||||
stream.setCodec("UTF-8");
|
||||
#endif
|
||||
stream.setGenerateByteOrderMark(true);
|
||||
|
||||
// Write the contents
|
||||
|
||||
@@ -346,7 +346,7 @@ static PyObject* _pyObjectFromVariant(const QVariant& value)
|
||||
return new PyObject();
|
||||
}
|
||||
|
||||
if (value.userType() == QMetaType::type("Base::Quantity")) {
|
||||
if (value.userType() == qMetaTypeId<Base::Quantity>()) {
|
||||
return new Base::QuantityPy(new Base::Quantity(value.value<Base::Quantity>()));
|
||||
}
|
||||
else if (value.userType() == QMetaType::Double) {
|
||||
|
||||
@@ -175,7 +175,20 @@ public:
|
||||
const QVariant getValue(int row, int column);
|
||||
|
||||
protected:
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
|
||||
std::map<QVariant, std::vector<std::vector<QVariant>*>> _rowMap;
|
||||
#else
|
||||
struct variant_comp
|
||||
{
|
||||
bool operator()(const QVariant& var1,
|
||||
const QVariant& var2) const
|
||||
{
|
||||
return QVariant::compare(var1, var2) == QPartialOrdering::Less;
|
||||
}
|
||||
};
|
||||
std::map<QVariant, std::vector<std::vector<QVariant>*>, variant_comp> _rowMap;
|
||||
#endif
|
||||
|
||||
bool _defaultSet;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user