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;
|
m = targetRN->parent->globalTransform;
|
||||||
}
|
}
|
||||||
rootRN->localTransform = m;
|
rootRN->localTransform = m;
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
|
||||||
rootRN->markDirty(QSSGRenderNode::TransformDirtyFlag::TransformNotDirty);
|
rootRN->markDirty(QSSGRenderNode::TransformDirtyFlag::TransformNotDirty);
|
||||||
|
#else
|
||||||
|
rootRN->markDirty(QSSGRenderNode::DirtyFlag::TransformDirty);
|
||||||
|
#endif
|
||||||
rootRN->calculateGlobalVariables();
|
rootRN->calculateGlobalVariables();
|
||||||
} else if (!m_spatialNodeUpdatePending) {
|
} else if (!m_spatialNodeUpdatePending) {
|
||||||
// Necessary spatial nodes do not yet exist. Defer selection box creation one frame.
|
// 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 (node != m_targetNode) {
|
||||||
if (renderNode) {
|
if (renderNode) {
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
|
||||||
if (renderNode->flags.testFlag(QSSGRenderNode::Flag::TransformDirty))
|
if (renderNode->flags.testFlag(QSSGRenderNode::Flag::TransformDirty))
|
||||||
renderNode->calculateLocalTransform();
|
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;
|
localTransform = renderNode->localTransform;
|
||||||
}
|
}
|
||||||
trackNodeChanges(node);
|
trackNodeChanges(node);
|
||||||
|
@@ -50,7 +50,12 @@ void import3D(const QString &sourceAsset, const QString &outDir, int exitId, con
|
|||||||
if (!optDoc.isNull() && optDoc.isObject()) {
|
if (!optDoc.isNull() && optDoc.isObject()) {
|
||||||
QString errorStr;
|
QString errorStr;
|
||||||
QJsonObject optObj = optDoc.object();
|
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) {
|
!= QSSGAssetImportManager::ImportState::Success) {
|
||||||
qWarning() << __FUNCTION__ << "Failed to import 3D asset"
|
qWarning() << __FUNCTION__ << "Failed to import 3D asset"
|
||||||
<< sourceAsset << "with error:" << errorStr;
|
<< sourceAsset << "with error:" << errorStr;
|
||||||
|
@@ -294,7 +294,14 @@ void Qt5InformationNodeInstanceServer::resolveImportSupport()
|
|||||||
#ifdef IMPORT_QUICK3D_ASSETS
|
#ifdef IMPORT_QUICK3D_ASSETS
|
||||||
QSSGAssetImportManager importManager;
|
QSSGAssetImportManager importManager;
|
||||||
const QHash<QString, QStringList> supportedExtensions = importManager.getSupportedExtensions();
|
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;
|
QVariantMap supportMap;
|
||||||
|
|
||||||
@@ -308,7 +315,7 @@ void Qt5InformationNodeInstanceServer::resolveImportSupport()
|
|||||||
QVariantMap optMap;
|
QVariantMap optMap;
|
||||||
auto itOpt = supportedOptions.constBegin();
|
auto itOpt = supportedOptions.constBegin();
|
||||||
while (itOpt != supportedOptions.constEnd()) {
|
while (itOpt != supportedOptions.constEnd()) {
|
||||||
optMap.insert(itOpt.key(), itOpt.value());
|
optMap.insert(itOpt.key(), AS_VARIANT_MAP(itOpt));
|
||||||
++itOpt;
|
++itOpt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -556,7 +556,12 @@ bool isSubclassOf(QObject *object, const QByteArray &superTypeName)
|
|||||||
|
|
||||||
void getPropertyCache(QObject *object, QQmlEngine *engine)
|
void getPropertyCache(QObject *object, QQmlEngine *engine)
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
|
||||||
QQuickDesignerSupportProperties::getPropertyCache(object, engine);
|
QQuickDesignerSupportProperties::getPropertyCache(object, engine);
|
||||||
|
#else
|
||||||
|
Q_UNUSED(engine);
|
||||||
|
QQuickDesignerSupportProperties::getPropertyCache(object);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void registerNotifyPropertyChangeCallBack(void (*callback)(QObject *, const PropertyName &))
|
void registerNotifyPropertyChangeCallBack(void (*callback)(QObject *, const PropertyName &))
|
||||||
|
@@ -342,10 +342,12 @@ bool ServerCapabilities::SemanticHighlightingServerCapabilities::isValid() const
|
|||||||
{
|
{
|
||||||
return contains(scopesKey) && value(scopesKey).isArray()
|
return contains(scopesKey) && value(scopesKey).isArray()
|
||||||
&& Utils::allOf(value(scopesKey).toArray(), [](const QJsonValue &array) {
|
&& Utils::allOf(value(scopesKey).toArray(), [](const QJsonValue &array) {
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
|
||||||
return array.isArray() && Utils::allOf(array.toArray(), &QJsonValue::isString);
|
return array.isArray() && Utils::allOf(array.toArray(), &QJsonValueConstRef::isString);
|
||||||
#else
|
#elif QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
return array.isArray() && Utils::allOf(array.toArray(), &QJsonValueRef::isString);
|
return array.isArray() && Utils::allOf(array.toArray(), &QJsonValueRef::isString);
|
||||||
|
#else
|
||||||
|
return array.isArray() && Utils::allOf(array.toArray(), &QJsonValue::isString);
|
||||||
#endif
|
#endif
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -31,9 +31,6 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
QT_MODULE(Declarative)
|
|
||||||
|
|
||||||
|
|
||||||
class EasingGraph: public QWidget
|
class EasingGraph: public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include <texteditor/codeassist/iassistproposalmodel.h>
|
#include <texteditor/codeassist/iassistproposalmodel.h>
|
||||||
|
|
||||||
|
#include <QList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
|
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
#include <QObject>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
@@ -95,14 +95,6 @@ public:
|
|||||||
QDialogButtonBox *buttonBox;
|
QDialogButtonBox *buttonBox;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Debugger
|
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(Debugger::Internal::StartApplicationParameters)
|
|
||||||
|
|
||||||
namespace Debugger {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// StartApplicationParameters
|
// StartApplicationParameters
|
||||||
@@ -944,3 +936,5 @@ void TypeFormatsDialog::addTypeFormats(const QString &type0,
|
|||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(Debugger::Internal::StartApplicationParameters)
|
||||||
|
@@ -89,7 +89,7 @@ void DocumentLocatorFilter::updateSymbols(const DocumentUri &uri,
|
|||||||
return;
|
return;
|
||||||
QMutexLocker locker(&m_mutex);
|
QMutexLocker locker(&m_mutex);
|
||||||
m_currentSymbols = symbols;
|
m_currentSymbols = symbols;
|
||||||
emit symbolsUpToDate({});
|
emit symbolsUpToDate(QPrivateSignal());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DocumentLocatorFilter::resetSymbols()
|
void DocumentLocatorFilter::resetSymbols()
|
||||||
|
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include "texteditor_global.h"
|
#include "texteditor_global.h"
|
||||||
|
|
||||||
|
#include <QList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
#include <QSharedPointer>
|
#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(addFinalNewLineKey), m_addFinalNewLine);
|
||||||
map->insert(prefix + QLatin1String(cleanIndentationKey), m_cleanIndentation);
|
map->insert(prefix + QLatin1String(cleanIndentationKey), m_cleanIndentation);
|
||||||
map->insert(prefix + QLatin1String(skipTrailingWhitespaceKey), m_skipTrailingWhitespace);
|
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)
|
void StorageSettings::fromMap(const QString &prefix, const QVariantMap &map)
|
||||||
|
Reference in New Issue
Block a user