forked from qt-creator/qt-creator
Partial compile fix for current Qt dev and/or Qt 6
This does not cover Utils::MapReduceOption with QVector, and code that's not compiled on my machine. Change-Id: Ib63923985c52b1bb74e5ec2068a2bb37469ac618 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -31,7 +31,6 @@
|
||||
#include <QQmlEngine>
|
||||
#include <QQmlContext>
|
||||
#include <QQmlExpression>
|
||||
#include <QMutableListIterator>
|
||||
|
||||
namespace QmlDesigner {
|
||||
namespace Internal {
|
||||
|
||||
@@ -52,7 +52,7 @@ bool ASTDump::preVisit(AST *ast)
|
||||
char *cppId = abi::__cxa_demangle(id, nullptr, nullptr, nullptr);
|
||||
id = cppId;
|
||||
#endif
|
||||
out << QByteArray(_depth, ' ') << id << endl;
|
||||
out << QByteArray(_depth, ' ') << id << Qt::endl;
|
||||
#ifdef Q_CC_GNU
|
||||
free(cppId);
|
||||
#endif
|
||||
|
||||
@@ -1262,6 +1262,7 @@ OutputIterator set_union(InputIterator1 first1,
|
||||
|
||||
// Replacement for deprecated Qt functionality
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
template <class T>
|
||||
QSet<T> toSet(const QList<T> &list)
|
||||
{
|
||||
@@ -1271,6 +1272,7 @@ QSet<T> toSet(const QList<T> &list)
|
||||
return QSet<T>(list.begin(), list.end());
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
template<class T>
|
||||
QSet<T> toSet(const QVector<T> &vec)
|
||||
|
||||
@@ -28,8 +28,6 @@
|
||||
#include <QtGlobal>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
template<typename Type>
|
||||
class QList;
|
||||
class QTreeView;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
static QString rectangleToString(const QRect &r)
|
||||
{
|
||||
QString result;
|
||||
QTextStream(&result) << r.width() << 'x' << r.height() << forcesign << r.x() << r.y();
|
||||
QTextStream(&result) << r.width() << 'x' << r.height() << Qt::forcesign << r.x() << r.y();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,8 +82,8 @@ QDebug operator<<(QDebug d, const CompletionEntry &e)
|
||||
QDebugStateSaver saver(d);
|
||||
d.noquote();
|
||||
d.nospace();
|
||||
d << "CompletionEntry(\"" << e.text << "\", flags=" << hex
|
||||
<< showbase << int(e.findFlags) << dec << noshowbase << ')';
|
||||
d << "CompletionEntry(\"" << e.text << "\", flags=" << Qt::hex
|
||||
<< Qt::showbase << int(e.findFlags) << Qt::dec << Qt::noshowbase << ')';
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "core_global.h"
|
||||
#include "id.h"
|
||||
|
||||
#include <QList>
|
||||
#include <QMainWindow>
|
||||
#include <QObject>
|
||||
#include <QRect>
|
||||
@@ -39,7 +40,6 @@ QT_BEGIN_NAMESPACE
|
||||
class QPrinter;
|
||||
class QStatusBar;
|
||||
class QWidget;
|
||||
template <typename T> class QList;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include <coreplugin/inavigationwidgetfactory.h>
|
||||
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
#include <QStackedWidget>
|
||||
@@ -37,7 +38,6 @@ class QLabel;
|
||||
class QModelIndex;
|
||||
class QStackedLayout;
|
||||
class QStandardItem;
|
||||
template <class> class QList;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace TextEditor { class TextEditorLinkLabel; }
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QList>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QString;
|
||||
|
||||
@@ -27,9 +27,7 @@
|
||||
|
||||
#include "cpptools_global.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
template <class> class QList;
|
||||
QT_END_NAMESPACE
|
||||
#include <QList>
|
||||
|
||||
namespace CPlusPlus {
|
||||
class Class;
|
||||
|
||||
@@ -92,8 +92,10 @@ QString StringTablePrivate::insert(const QString &string)
|
||||
if (string.isEmpty())
|
||||
return string;
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
#ifndef QT_NO_UNSHARABLE_CONTAINERS
|
||||
QTC_ASSERT(const_cast<QString&>(string).data_ptr()->ref.isSharable(), return string);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
m_stopGCRequested.fetchAndStoreAcquire(true);
|
||||
|
||||
@@ -150,10 +150,10 @@ bool AuthenticationDialog::setupCredentials()
|
||||
replaceEntry(line, "login", user);
|
||||
replaceEntry(line, "password", password);
|
||||
}
|
||||
out << line << endl;
|
||||
out << line << Qt::endl;
|
||||
}
|
||||
if (!found)
|
||||
out << "machine " << m_server->host << " login " << user << " password " << password << endl;
|
||||
out << "machine " << m_server->host << " login " << user << " password " << password << Qt::endl;
|
||||
Utils::FileSaver saver(m_netrcFileName, QFile::WriteOnly | QFile::Truncate | QFile::Text);
|
||||
saver.write(netrcContents.toUtf8());
|
||||
return saver.finalize();
|
||||
|
||||
@@ -55,6 +55,8 @@ enum { debug = 0 };
|
||||
|
||||
using namespace VcsBase;
|
||||
|
||||
using namespace Qt;
|
||||
|
||||
namespace Gerrit {
|
||||
namespace Internal {
|
||||
|
||||
|
||||
@@ -458,9 +458,17 @@ void TextBrowserHelpWidget::resizeEvent(QResizeEvent *e)
|
||||
scrollToTextPosition(topTextPosition);
|
||||
}
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
void TextBrowserHelpWidget::setSource(const QUrl &name)
|
||||
#else
|
||||
void TextBrowserHelpWidget::doSetSource(const QUrl &name, QTextDocument::ResourceType type)
|
||||
#endif
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
QTextBrowser::setSource(name);
|
||||
#else
|
||||
QTextBrowser::doSetSource(name, type);
|
||||
#endif
|
||||
|
||||
QTextCursor cursor(document());
|
||||
while (!cursor.atEnd()) {
|
||||
|
||||
@@ -92,7 +92,11 @@ public:
|
||||
void scaleUp();
|
||||
void scaleDown();
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
void setSource(const QUrl &name) override;
|
||||
#else
|
||||
void doSetSource(const QUrl &url, QTextDocument::ResourceType type) override;
|
||||
#endif
|
||||
|
||||
void withFixedTopPosition(const std::function<void()> &action);
|
||||
|
||||
|
||||
@@ -140,13 +140,13 @@ void NimBuildSystem::updateProject()
|
||||
|
||||
// Sync watched dirs
|
||||
const QSet<QString> fsDirs = Utils::transform<QSet>(nodes, &FileNode::directory);
|
||||
const QSet<QString> projectDirs = m_directoryWatcher.directories().toSet();
|
||||
const QSet<QString> projectDirs = Utils::toSet(m_directoryWatcher.directories());
|
||||
m_directoryWatcher.addDirectories(Utils::toList(fsDirs - projectDirs), FileSystemWatcher::WatchAllChanges);
|
||||
m_directoryWatcher.removeDirectories(Utils::toList(projectDirs - fsDirs));
|
||||
|
||||
// Sync project files
|
||||
const QSet<FilePath> fsFiles = Utils::transform<QSet>(nodes, &FileNode::filePath);
|
||||
const QSet<FilePath> projectFiles = project()->files([](const Node *n) { return Project::AllFiles(n); }).toSet();
|
||||
const QSet<FilePath> projectFiles = Utils::toSet(project()->files([](const Node *n) { return Project::AllFiles(n); }));
|
||||
|
||||
if (fsFiles != projectFiles) {
|
||||
auto projectNode = std::make_unique<ProjectNode>(project()->projectDirectory());
|
||||
|
||||
@@ -101,6 +101,8 @@ using namespace QmlJS::AST;
|
||||
using namespace QmlJSTools;
|
||||
using namespace TextEditor;
|
||||
|
||||
using namespace Qt;
|
||||
|
||||
namespace QmlJSEditor {
|
||||
|
||||
//
|
||||
|
||||
@@ -32,10 +32,6 @@
|
||||
#include <QColor>
|
||||
#include <QCoreApplication>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
template <class> class QList;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace QmlJS {
|
||||
class ScopeChain;
|
||||
class Context;
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
this->state = state;
|
||||
}
|
||||
|
||||
bool operator ==(const ConfigState& cs)
|
||||
bool operator ==(const ConfigState &cs) const
|
||||
{
|
||||
return config == cs.config && state == cs.state;
|
||||
}
|
||||
|
||||
@@ -27,10 +27,6 @@
|
||||
|
||||
#include "texteditoroptionspage.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
template <class> class QList;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace TextEditor {
|
||||
|
||||
class HighlighterSettings;
|
||||
|
||||
@@ -41,12 +41,12 @@ bool Keyword::equals(const Keyword &other) const
|
||||
&& (this->color == other.color);
|
||||
}
|
||||
|
||||
bool operator ==(Keyword &k1, Keyword &k2)
|
||||
bool operator ==(const Keyword &k1, const Keyword &k2)
|
||||
{
|
||||
return k1.equals(k2);
|
||||
}
|
||||
|
||||
bool operator !=(Keyword &k1, Keyword &k2)
|
||||
bool operator !=(const Keyword &k1, const Keyword &k2)
|
||||
{
|
||||
return !k1.equals(k2);
|
||||
}
|
||||
|
||||
@@ -49,8 +49,8 @@ public:
|
||||
|
||||
using KeywordList = QList<Keyword>;
|
||||
|
||||
bool operator ==(Keyword &k1, Keyword &k2);
|
||||
bool operator !=(Keyword &k1, Keyword &k2);
|
||||
bool operator ==(const Keyword &k1, const Keyword &k2);
|
||||
bool operator !=(const Keyword &k1, const Keyword &k2);
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Todo
|
||||
|
||||
@@ -138,12 +138,12 @@ bool Settings::equals(const Settings &other) const
|
||||
&& (keywordsEdited == other.keywordsEdited);
|
||||
}
|
||||
|
||||
bool operator ==(Settings &s1, Settings &s2)
|
||||
bool operator ==(const Settings &s1, const Settings &s2)
|
||||
{
|
||||
return s1.equals(s2);
|
||||
}
|
||||
|
||||
bool operator !=(Settings &s1, Settings &s2)
|
||||
bool operator !=(const Settings &s1, const Settings &s2)
|
||||
{
|
||||
return !s1.equals(s2);
|
||||
}
|
||||
|
||||
@@ -52,8 +52,8 @@ public:
|
||||
bool equals(const Settings &other) const;
|
||||
};
|
||||
|
||||
bool operator ==(Settings &s1, Settings &s2);
|
||||
bool operator !=(Settings &s1, Settings &s2);
|
||||
bool operator ==(const Settings &s1, const Settings &s2);
|
||||
bool operator !=(const Settings &s1, const Settings &s2);
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Todo
|
||||
|
||||
@@ -86,5 +86,5 @@ void CompilerOutputProcessor::handleTask(const ProjectExplorer::Task &task)
|
||||
*m_ostream << ':' << task.line;
|
||||
*m_ostream << ": ";
|
||||
}
|
||||
*m_ostream << task.description << endl;
|
||||
*m_ostream << task.description << Qt::endl;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
|
||||
using namespace Valgrind::Fake;
|
||||
|
||||
using namespace Qt;
|
||||
|
||||
QTextStream qerr(stderr);
|
||||
QTextStream qout(stdout);
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ void OutputGenerator::produceRuntimeError()
|
||||
blockingWrite(m_output, "<</GARBAGE = '\"''asdfaqre");
|
||||
m_output->flush();
|
||||
} else if (m_wait) {
|
||||
qDebug() << "waiting in fake valgrind for " << m_wait << " seconds..." << endl;
|
||||
qDebug() << "waiting in fake valgrind for " << m_wait << " seconds..." << Qt::endl;
|
||||
doSleep(1000 * m_wait);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user