forked from qt-creator/qt-creator
Fix more compilation issues with Qt6
Various Windows related issues and issues with additional QML designer components. Don't use very generic template definitions if the type has to provide not so generic base functionality (in this case providing a stream operator for QDataStream). Task-number: QTCREATORBUG-24098 Change-Id: Id0729c249d1b81e4e939fdaeb2e02b8a64e7e8f9 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include "cppfileiterationorder.h"
|
||||
|
||||
#include <QHash>
|
||||
#include <QSet>
|
||||
#include <QStringList>
|
||||
|
||||
#include <set>
|
||||
|
||||
@@ -145,10 +145,12 @@ GDB 32bit | Api | Api | NA | Win32
|
||||
? QCoreApplication::applicationDirPath() + "/win32interrupt.exe"
|
||||
: QCoreApplication::applicationDirPath() + "/win64interrupt.exe";
|
||||
if (!QFile::exists(executable)) {
|
||||
*errorMessage = QString::fromLatin1("%1 does not exist. If you have built %2 "
|
||||
"on your own, checkout "
|
||||
"https://code.qt.io/cgit/qt-creator/binary-artifacts.git/.").
|
||||
arg(QDir::toNativeSeparators(executable), Core::Constants::IDE_DISPLAY_NAME);
|
||||
*errorMessage = QString::fromLatin1(
|
||||
"%1 does not exist. If you have built %2 "
|
||||
"on your own, checkout "
|
||||
"https://code.qt.io/cgit/qt-creator/binary-artifacts.git/.")
|
||||
.arg(QDir::toNativeSeparators(executable),
|
||||
QString(Core::Constants::IDE_DISPLAY_NAME));
|
||||
break;
|
||||
}
|
||||
switch (QProcess::execute(executable, QStringList(QString::number(pID)))) {
|
||||
|
||||
@@ -181,11 +181,12 @@ GDB 32bit | Api | Api | N/A | Win32
|
||||
? QLatin1String("/win32interrupt.exe")
|
||||
: QLatin1String("/win64interrupt.exe");
|
||||
if (!QFile::exists(executable)) {
|
||||
appendMsgCannotInterrupt(pid, tr( "%1 does not exist. If you built %2 "
|
||||
"yourself, check out https://code.qt.io/cgit/"
|
||||
"qt-creator/binary-artifacts.git/.").
|
||||
arg(QDir::toNativeSeparators(executable),
|
||||
Core::Constants::IDE_DISPLAY_NAME));
|
||||
appendMsgCannotInterrupt(pid,
|
||||
tr("%1 does not exist. If you built %2 "
|
||||
"yourself, check out https://code.qt.io/cgit/"
|
||||
"qt-creator/binary-artifacts.git/.")
|
||||
.arg(QDir::toNativeSeparators(executable),
|
||||
QString(Core::Constants::IDE_DISPLAY_NAME)));
|
||||
}
|
||||
switch (QProcess::execute(executable, QStringList(QString::number(pid)))) {
|
||||
case -2:
|
||||
|
||||
@@ -265,11 +265,11 @@ void ItemLibraryAssetImporter::parseQuick3DAsset(const QString &file, const QVar
|
||||
if (!currentChar.isLetter() && !currentChar.isDigit())
|
||||
currentChar = QLatin1Char('_');
|
||||
}
|
||||
QCharRef firstChar = assetName[0];
|
||||
const QChar firstChar = assetName[0];
|
||||
if (firstChar.isDigit())
|
||||
firstChar = QLatin1Char('_');
|
||||
assetName[0] = QLatin1Char('_');
|
||||
if (firstChar.isLower())
|
||||
firstChar = firstChar.toUpper();
|
||||
assetName[0] = firstChar.toUpper();
|
||||
}
|
||||
|
||||
QString targetDirPath = targetDir.filePath(assetName);
|
||||
@@ -378,9 +378,9 @@ void ItemLibraryAssetImporter::parseQuick3DAsset(const QString &file, const QVar
|
||||
QFile file(outDir.path() + '/' + fi.baseName() + ".hints");
|
||||
file.open(QIODevice::WriteOnly | QIODevice::Text);
|
||||
QTextStream out(&file);
|
||||
out << "visibleInNavigator: true" << endl;
|
||||
out << "canBeDroppedInFormEditor: false" << endl;
|
||||
out << "canBeDroppedInView3D: true" << endl;
|
||||
out << "visibleInNavigator: true" << Qt::endl;
|
||||
out << "canBeDroppedInFormEditor: false" << Qt::endl;
|
||||
out << "canBeDroppedInView3D: true" << Qt::endl;
|
||||
file.close();
|
||||
}
|
||||
QString outIconSource = QString::fromUtf8(content);
|
||||
|
||||
@@ -435,6 +435,31 @@ QDebug &operator<<(QDebug &stream, const EasingCurve &curve)
|
||||
return stream;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &stream, const std::vector<int> &vec)
|
||||
{
|
||||
stream << static_cast<quint64>(vec.size());
|
||||
for (const auto &elem : vec)
|
||||
stream << elem;
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &stream, std::vector<int> &vec)
|
||||
{
|
||||
quint64 s;
|
||||
stream >> s;
|
||||
|
||||
vec.clear();
|
||||
vec.reserve(s);
|
||||
|
||||
int val;
|
||||
for (quint64 i = 0; i < s; ++i) {
|
||||
stream >> val;
|
||||
vec.push_back(val);
|
||||
}
|
||||
return stream;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &stream, const EasingCurve &curve)
|
||||
{
|
||||
// Ignore the active flag.
|
||||
|
||||
@@ -81,48 +81,4 @@ public:
|
||||
|
||||
} // End namespace TimelineUtils.
|
||||
|
||||
template<typename T>
|
||||
inline std::istream &operator>>(std::istream &stream, std::vector<T> &vec)
|
||||
{
|
||||
quint64 s;
|
||||
stream >> s;
|
||||
|
||||
vec.clear();
|
||||
vec.reserve(s);
|
||||
|
||||
T val;
|
||||
for (quint64 i = 0; i < s; ++i) {
|
||||
stream >> val;
|
||||
vec.push_back(val);
|
||||
}
|
||||
return stream;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline QDataStream &operator<<(QDataStream &stream, const std::vector<T> &vec)
|
||||
{
|
||||
stream << static_cast<quint64>(vec.size());
|
||||
for (const auto &elem : vec)
|
||||
stream << elem;
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline QDataStream &operator>>(QDataStream &stream, std::vector<T> &vec)
|
||||
{
|
||||
quint64 s;
|
||||
stream >> s;
|
||||
|
||||
vec.clear();
|
||||
vec.reserve(s);
|
||||
|
||||
T val;
|
||||
for (quint64 i = 0; i < s; ++i) {
|
||||
stream >> val;
|
||||
vec.push_back(val);
|
||||
}
|
||||
return stream;
|
||||
}
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
||||
Reference in New Issue
Block a user