Bump minimum Qt version (to build Qt Creator) to 5.11

Recent adaptations to Qt 5.13's API deprecations require using APIs
which were introduces in Qt 5.11.

Change-Id: I6c077d824c9ce716e019543b290c355a5d512fad
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Alessandro Portale
2019-02-14 12:24:46 +01:00
parent 66fd5abe58
commit 88d1d92728
16 changed files with 6 additions and 89 deletions

View File

@@ -25,7 +25,7 @@ https://doc-snapshots.qt.io/qtcreator-extending/coding-style.html
Prerequisites:
* Qt 5.9.0 or later
* Qt 5.11.0 or later
* Qt WebEngine module for QtWebEngine based help viewer
* On Windows:
* ActiveState Active Perl
@@ -80,7 +80,7 @@ For detailed information on the supported compilers, see
for example, `c:\work`. If you plan to use MinGW and Microsoft Visual
Studio simultaneously or mix different Qt versions, we recommend
creating a directory structure which reflects that. For example:
`C:\work\qt5.9.0-vs12, C:\work\qt5.9.0-mingw`.
`C:\work\qt5.11.0-vs15, C:\work\qt5.11.0-mingw`.
4. Download and install Perl from <https://www.activestate.com/activeperl>
and check that perl.exe is added to the path. Run `perl -v` to verify

View File

@@ -168,7 +168,7 @@
The source code of ANGLE is part of the Qt libraries. For more
information about the licenses used in Qt GUI, see
\l{https://doc.qt.io/qt-5.9/licenses-used-in-qt.html#qt-gui}{Qt GUI}.
\l{https://doc.qt.io/qt-5.11/licenses-used-in-qt.html#qt-gui}{Qt GUI}.
\l{https://spdx.org/licenses/BSD-3-Clause.html}
{BSD 3-clause "New" or "Revised" License}

View File

@@ -27,7 +27,7 @@ Product {
enableFallback: false
}
}
Depends { name: "Qt.core"; versionAtLeast: "5.9.0" }
Depends { name: "Qt.core"; versionAtLeast: "5.11.0" }
// TODO: Should fall back to what came from Qt.core for Qt < 5.7, but we cannot express that
// atm. Conditionally pulling in a module that sets the property is also not possible,

View File

@@ -1,9 +1,9 @@
include(qtcreator.pri)
#version check qt
!minQtVersion(5, 9, 0) {
!minQtVersion(5, 11, 0) {
message("Cannot build $$IDE_DISPLAY_NAME with Qt version $${QT_VERSION}.")
error("Use at least Qt 5.9.0.")
error("Use at least Qt 5.11.0.")
}
include(doc/doc.pri)

View File

@@ -61,11 +61,7 @@ JsonObject &JsonObject::operator=(const JsonObject &other) = default;
JsonObject &JsonObject::operator=(JsonObject &&other)
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
m_jsonObject.swap(other.m_jsonObject);
#else
m_jsonObject = other.m_jsonObject; // NOTE use QJsonObject::swap when minimum required Qt version >= 5.10
#endif
return *this;
}

View File

@@ -436,12 +436,6 @@ bool ConsoleProcess::startTerminalEmulator(QSettings *settings, const QString &w
const Utils::Environment &env)
{
const TerminalCommand term = terminalEmulator(settings);
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
// for 5.9 and below we cannot set the environment
Q_UNUSED(env);
return QProcess::startDetached(term.command, QtcProcess::splitArgs(term.openArgs),
workingDir);
#else
QProcess process;
process.setProgram(term.command);
process.setArguments(QtcProcess::splitArgs(term.openArgs));
@@ -449,7 +443,6 @@ bool ConsoleProcess::startTerminalEmulator(QSettings *settings, const QString &w
process.setWorkingDirectory(workingDir);
return process.startDetached();
#endif
}
} // namespace Utils

View File

@@ -803,11 +803,7 @@ void MimeXMLProvider::ensureLoaded()
// if (!fdoXmlFound) {
// // We could instead install the file as part of installing Qt?
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
const char freedesktopOrgXml[] = ":/qt-project.org/qmime/packages/freedesktop.org.xml";
#else
const char freedesktopOrgXml[] = ":/qt-project.org/qmime/freedesktop.org.xml";
#endif
allFiles.prepend(QLatin1String(freedesktopOrgXml));
// }

View File

@@ -386,14 +386,10 @@ private:
static int widthLimit()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
auto screen = QGuiApplication::screenAt(QCursor::pos());
if (!screen)
screen = QGuiApplication::primaryScreen();
return screen->availableGeometry().width() / 2;
#else
return QApplication::desktop()->availableGeometry(QCursor::pos()).width() / 2;
#endif
}
private:

View File

@@ -78,11 +78,7 @@ void FilePropertiesDialog::refresh()
m_ui->owner->setText(fileInfo.owner());
m_ui->group->setText(fileInfo.group());
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
m_ui->size->setText(locale.formattedDataSize(fileInfo.size()));
#else
m_ui->size->setText(tr("%1 Bytes").arg(locale.toString(fileInfo.size())));
#endif
m_ui->readable->setChecked(fileInfo.isReadable());
m_ui->writable->setChecked(fileInfo.isWritable());
m_ui->executable->setChecked(fileInfo.isExecutable());

View File

@@ -323,18 +323,9 @@ bool fileSizeExceedsLimit(const QFileInfo &fileInfo, int sizeLimitInMb)
"C++ Indexer: Skipping file \"%1\" because it is too big.")
.arg(absoluteFilePath);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
QMetaObject::invokeMethod(Core::MessageManager::instance(), [msg]() {
Core::MessageManager::write(msg, Core::MessageManager::Silent);
});
#else
QMetaObject::invokeMethod(Core::MessageManager::instance(),
"write",
Qt::QueuedConnection,
Q_ARG(QString, msg),
Q_ARG(Core::MessageManager::PrintToOutputPaneFlags,
Core::MessageManager::Silent));
#endif
qWarning().noquote() << msg;
return true;

View File

@@ -624,15 +624,10 @@ void DebuggerToolTipWidget::computeSize()
// Add a bit of space to account for tooltip border, and not
// touch the border of the screen.
QPoint pos(x(), y());
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
auto screen = QGuiApplication::screenAt(pos);
if (!screen)
screen = QGuiApplication::primaryScreen();
QRect desktopRect = screen->availableGeometry();
#else
QTC_ASSERT(QApplication::desktop(), return);
QRect desktopRect = QApplication::desktop()->availableGeometry();
#endif
const int maxWidth = desktopRect.right() - pos.x() - 5 - 5;
const int maxHeight = desktopRect.bottom() - pos.y() - 5 - 5;

View File

@@ -74,11 +74,7 @@ PerfProfilerTraceView::PerfProfilerTraceView(QWidget *parent, PerfProfilerTool *
bool PerfProfilerTraceView::isUsable() const
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
return quickWindow()->rendererInterface()->graphicsApi() == QSGRendererInterface::OpenGL;
#else
return true;
#endif
}
void PerfProfilerTraceView::selectByTypeId(int typeId)

View File

@@ -208,9 +208,6 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails
d->m_terminalButton->setText(tr("Open &Terminal"));
d->m_terminalButton->setToolTip(tr("Open a terminal with this environment set up."));
buttonLayout->addWidget(d->m_terminalButton);
#if defined(Q_OS_UNIX) && QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
d->m_terminalButton->setVisible(false);
#endif
buttonLayout->addStretch();
horizontalLayout->addLayout(buttonLayout);

View File

@@ -889,7 +889,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
dd->m_openTerminalHereBuildEnv = new QAction(tr("Build Environment"), this);
dd->m_openTerminalHereRunEnv = new QAction(tr("Run Environment"), this);
#if !defined(Q_OS_UNIX) || QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
cmd = ActionManager::registerAction(dd->m_openTerminalHereBuildEnv,
"ProjectExplorer.OpenTerminalHereBuildEnv",
projecTreeContext);
@@ -899,7 +898,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
"ProjectExplorer.OpenTerminalHereRunEnv",
projecTreeContext);
dd->m_openTerminalMenu->addAction(dd->m_openTerminalHereRunEnv);
#endif
// Open With menu
mfileContextMenu->addMenu(openWith, Constants::G_FILE_OPEN);

View File

@@ -8252,11 +8252,7 @@ void TextEditorWidgetPrivate::updateTabStops()
// to be set as an int. A work around is to access directly the QTextOption.
qreal charWidth = QFontMetricsF(q->font()).width(QLatin1Char(' '));
QTextOption option = q->document()->defaultTextOption();
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
option.setTabStopDistance(charWidth * m_document->tabSettings().m_tabSize);
#else
option.setTabStop(charWidth * m_document->tabSettings().m_tabSize);
#endif
q->document()->setDefaultTextOption(option);
}

View File

@@ -149,38 +149,6 @@ private:
m_futures.erase(split, m_futures.end());
}
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
template <typename CallableType>
class CallableEvent : public QEvent {
public:
using Callable = std::decay_t<CallableType>;
CallableEvent(Callable &&callable)
: QEvent(QEvent::None),
callable(std::move(callable))
{}
CallableEvent(const Callable &callable)
: QEvent(QEvent::None),
callable(callable)
{}
~CallableEvent()
{
callable();
}
public:
Callable callable;
};
template <typename Callable>
void executeInLoop(Callable &&callable, QObject *object = QCoreApplication::instance()) {
if (QThread *thread = qobject_cast<QThread*>(object))
object = QAbstractEventDispatcher::instance(thread);
QCoreApplication::postEvent(object,
new CallableEvent<Callable>(std::forward<Callable>(callable)),
Qt::HighEventPriority);
}
#else
template <typename Callable>
void executeInLoop(Callable &&callable, QObject *object = QCoreApplication::instance()) {
if (QThread *thread = qobject_cast<QThread*>(object))
@@ -188,7 +156,6 @@ private:
QMetaObject::invokeMethod(object, std::forward<Callable>(callable));
}
#endif
private:
std::vector<Future> m_futures;