forked from qt-creator/qt-creator
More compile fix with recent Qt 6
Mostly by backporting Creator master hunks. It still compiles with Qt 5.15. Change-Id: I14d2e33c3ca2368cb848748d5f5b41aa47801f72 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -192,7 +192,11 @@ void SelectionBoxGeometry::doUpdateGeometry()
|
||||
m = targetRN->parent->globalTransform;
|
||||
}
|
||||
rootRN->localTransform = m;
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
|
||||
rootRN->markDirty(QSSGRenderNode::TransformDirtyFlag::TransformNotDirty);
|
||||
#else
|
||||
rootRN->markDirty(QSSGRenderNode::DirtyFlag::TransformDirty);
|
||||
#endif
|
||||
rootRN->calculateGlobalVariables();
|
||||
} else if (!m_spatialNodeUpdatePending) {
|
||||
// Necessary spatial nodes do not yet exist. Defer selection box creation one frame.
|
||||
@@ -236,8 +240,15 @@ void SelectionBoxGeometry::getBounds(
|
||||
|
||||
if (node != m_targetNode) {
|
||||
if (renderNode) {
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
|
||||
if (renderNode->flags.testFlag(QSSGRenderNode::Flag::TransformDirty))
|
||||
renderNode->calculateLocalTransform();
|
||||
#else
|
||||
if (renderNode->isDirty(QSSGRenderNode::DirtyFlag::TransformDirty)) {
|
||||
renderNode->localTransform = QSSGRenderNode::calculateTransformMatrix(
|
||||
node->position(), node->scale(), node->pivot(), node->rotation());
|
||||
}
|
||||
#endif
|
||||
localTransform = renderNode->localTransform;
|
||||
}
|
||||
trackNodeChanges(node);
|
||||
|
@@ -50,7 +50,12 @@ void import3D(const QString &sourceAsset, const QString &outDir, int exitId, con
|
||||
if (!optDoc.isNull() && optDoc.isObject()) {
|
||||
QString errorStr;
|
||||
QJsonObject optObj = optDoc.object();
|
||||
if (importer->importFile(sourceAsset, outDir, optObj.toVariantMap(), &errorStr)
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0))
|
||||
const auto &optionsMap = optObj;
|
||||
#else
|
||||
const auto optionsMap = optObj.toVariantMap();
|
||||
#endif // QT_VERSION >= 6.4.0
|
||||
if (importer->importFile(sourceAsset, outDir, optionsMap, &errorStr)
|
||||
!= QSSGAssetImportManager::ImportState::Success) {
|
||||
qWarning() << __FUNCTION__ << "Failed to import 3D asset"
|
||||
<< sourceAsset << "with error:" << errorStr;
|
||||
|
@@ -294,7 +294,14 @@ void Qt5InformationNodeInstanceServer::resolveImportSupport()
|
||||
#ifdef IMPORT_QUICK3D_ASSETS
|
||||
QSSGAssetImportManager importManager;
|
||||
const QHash<QString, QStringList> supportedExtensions = importManager.getSupportedExtensions();
|
||||
const QHash<QString, QVariantMap> supportedOptions = importManager.getAllOptions();
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0))
|
||||
#define AS_VARIANT_MAP(IT) IT.value().toVariantMap()
|
||||
using PluginOptionMaps = QSSGAssetImportManager::PluginOptionMaps;
|
||||
#else
|
||||
#define AS_VARIANT_MAP(IT) IT.value()
|
||||
using PluginOptionMaps = QHash<QString, QVariantMap>;
|
||||
#endif // QT_VERSION >= 6.4.0
|
||||
const PluginOptionMaps supportedOptions = importManager.getAllOptions();
|
||||
|
||||
QVariantMap supportMap;
|
||||
|
||||
@@ -308,7 +315,7 @@ void Qt5InformationNodeInstanceServer::resolveImportSupport()
|
||||
QVariantMap optMap;
|
||||
auto itOpt = supportedOptions.constBegin();
|
||||
while (itOpt != supportedOptions.constEnd()) {
|
||||
optMap.insert(itOpt.key(), itOpt.value());
|
||||
optMap.insert(itOpt.key(), AS_VARIANT_MAP(itOpt));
|
||||
++itOpt;
|
||||
}
|
||||
|
||||
|
@@ -556,7 +556,12 @@ bool isSubclassOf(QObject *object, const QByteArray &superTypeName)
|
||||
|
||||
void getPropertyCache(QObject *object, QQmlEngine *engine)
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
|
||||
QQuickDesignerSupportProperties::getPropertyCache(object, engine);
|
||||
#else
|
||||
Q_UNUSED(engine);
|
||||
QQuickDesignerSupportProperties::getPropertyCache(object);
|
||||
#endif
|
||||
}
|
||||
|
||||
void registerNotifyPropertyChangeCallBack(void (*callback)(QObject *, const PropertyName &))
|
||||
|
@@ -342,10 +342,12 @@ bool ServerCapabilities::SemanticHighlightingServerCapabilities::isValid() const
|
||||
{
|
||||
return contains(scopesKey) && value(scopesKey).isArray()
|
||||
&& Utils::allOf(value(scopesKey).toArray(), [](const QJsonValue &array) {
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
return array.isArray() && Utils::allOf(array.toArray(), &QJsonValue::isString);
|
||||
#else
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
|
||||
return array.isArray() && Utils::allOf(array.toArray(), &QJsonValueConstRef::isString);
|
||||
#elif QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
return array.isArray() && Utils::allOf(array.toArray(), &QJsonValueRef::isString);
|
||||
#else
|
||||
return array.isArray() && Utils::allOf(array.toArray(), &QJsonValue::isString);
|
||||
#endif
|
||||
});
|
||||
}
|
||||
|
@@ -31,9 +31,6 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QT_MODULE(Declarative)
|
||||
|
||||
|
||||
class EasingGraph: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@@ -27,6 +27,7 @@
|
||||
|
||||
#include <texteditor/codeassist/iassistproposalmodel.h>
|
||||
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
#include <QSharedPointer>
|
||||
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <QHash>
|
||||
#include <QObject>
|
||||
#include <QPointer>
|
||||
|
||||
namespace Utils {
|
||||
|
@@ -95,14 +95,6 @@ public:
|
||||
QDialogButtonBox *buttonBox;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
||||
Q_DECLARE_METATYPE(Debugger::Internal::StartApplicationParameters)
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// StartApplicationParameters
|
||||
@@ -944,3 +936,5 @@ void TypeFormatsDialog::addTypeFormats(const QString &type0,
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
||||
Q_DECLARE_METATYPE(Debugger::Internal::StartApplicationParameters)
|
||||
|
@@ -89,7 +89,7 @@ void DocumentLocatorFilter::updateSymbols(const DocumentUri &uri,
|
||||
return;
|
||||
QMutexLocker locker(&m_mutex);
|
||||
m_currentSymbols = symbols;
|
||||
emit symbolsUpToDate({});
|
||||
emit symbolsUpToDate(QPrivateSignal());
|
||||
}
|
||||
|
||||
void DocumentLocatorFilter::resetSymbols()
|
||||
|
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "texteditor_global.h"
|
||||
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
#include <QMetaType>
|
||||
#include <QSharedPointer>
|
||||
|
@@ -71,7 +71,7 @@ void StorageSettings::toMap(const QString &prefix, QVariantMap *map) const
|
||||
map->insert(prefix + QLatin1String(addFinalNewLineKey), m_addFinalNewLine);
|
||||
map->insert(prefix + QLatin1String(cleanIndentationKey), m_cleanIndentation);
|
||||
map->insert(prefix + QLatin1String(skipTrailingWhitespaceKey), m_skipTrailingWhitespace);
|
||||
map->insert(prefix + QLatin1String(ignoreFileTypesKey), m_ignoreFileTypes.toLatin1().data());
|
||||
map->insert(prefix + QLatin1String(ignoreFileTypesKey), m_ignoreFileTypes.toLatin1());
|
||||
}
|
||||
|
||||
void StorageSettings::fromMap(const QString &prefix, const QVariantMap &map)
|
||||
|
Reference in New Issue
Block a user