forked from qt-creator/qt-creator
Remove some obsolete code inside QT_VERSION_CHECK sections
With Qt 5.9 as minimal build version, we don't need to handle 5.7 or 5.8 Change-Id: Ie1eed95ab46364452b0633f78bebc565a4a63f4a Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -1228,13 +1228,12 @@ void AndroidConfigurations::load()
|
||||
QSettings::NativeFormat));
|
||||
allVersions = settings->childGroups();
|
||||
#ifdef Q_OS_WIN
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||
if (allVersions.isEmpty()) {
|
||||
settings.reset(new QSettings(jdkSettingsPath, QSettings::Registry64Format));
|
||||
allVersions = settings->childGroups();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // Q_OS_WIN
|
||||
|
||||
QString javaHome;
|
||||
int major = -1;
|
||||
int minor = -1;
|
||||
|
@@ -36,9 +36,7 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QTimer>
|
||||
#include <QVBoxLayout>
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||
#include <QWebEngineContextMenuData>
|
||||
#endif
|
||||
#include <QWebEngineHistory>
|
||||
#include <QWebEngineProfile>
|
||||
#include <QWebEngineSettings>
|
||||
@@ -289,14 +287,6 @@ WebEngineHelpPage::WebEngineHelpPage(QObject *parent)
|
||||
{
|
||||
}
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
|
||||
QWebEnginePage *WebEngineHelpPage::createWindow(QWebEnginePage::WebWindowType)
|
||||
{
|
||||
auto viewer = static_cast<WebEngineHelpViewer *>(OpenPagesManager::instance().createPage());
|
||||
return viewer->page();
|
||||
}
|
||||
#endif
|
||||
|
||||
WebView::WebView(WebEngineHelpViewer *viewer)
|
||||
: QWebEngineView(viewer),
|
||||
m_viewer(viewer)
|
||||
@@ -314,12 +304,6 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
|
||||
// insert after
|
||||
++it;
|
||||
QAction *before = (it == actions.cend() ? 0 : *it);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
|
||||
if (m_viewer->isActionVisible(HelpViewer::Action::NewPage)) {
|
||||
QAction *openLinkInNewTab = page()->action(QWebEnginePage::OpenLinkInNewTab);
|
||||
menu->insertAction(before, openLinkInNewTab);
|
||||
}
|
||||
#else
|
||||
QUrl url = page()->contextMenuData().linkUrl();
|
||||
if (m_viewer->isActionVisible(HelpViewer::Action::NewPage)) {
|
||||
auto openLink = new QAction(QCoreApplication::translate("HelpViewer",
|
||||
@@ -337,7 +321,6 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
|
||||
});
|
||||
menu->insertAction(before, openLink);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
connect(menu, &QMenu::aboutToHide, menu, &QObject::deleteLater);
|
||||
|
@@ -46,9 +46,6 @@ class WebEngineHelpPage : public QWebEnginePage
|
||||
{
|
||||
public:
|
||||
explicit WebEngineHelpPage(QObject *parent = nullptr);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
|
||||
QWebEnginePage *createWindow(QWebEnginePage::WebWindowType) override;
|
||||
#endif
|
||||
};
|
||||
|
||||
class WebView : public QWebEngineView
|
||||
|
@@ -295,12 +295,8 @@ void QmlProfilerTraceView::showContextMenu(QPoint position)
|
||||
|
||||
bool QmlProfilerTraceView::isUsable() const
|
||||
{
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
|
||||
return d->m_mainView->quickWindow()->rendererInterface()->graphicsApi()
|
||||
== QSGRendererInterface::OpenGL;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool QmlProfilerTraceView::isSuspended() const
|
||||
|
@@ -52,15 +52,8 @@ SerialControl::SerialControl(const Settings &settings, QObject *parent) :
|
||||
|
||||
connect(&m_serialPort, &QSerialPort::readyRead,
|
||||
this, &SerialControl::handleReadyRead);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
|
||||
connect(&m_serialPort, &QSerialPort::errorOccurred,
|
||||
this, &SerialControl::handleError);
|
||||
#else
|
||||
connect(&m_serialPort,
|
||||
static_cast<void (QSerialPort::*)(QSerialPort::SerialPortError)>(&QSerialPort::error),
|
||||
this, &SerialControl::handleError);
|
||||
#endif
|
||||
|
||||
connect(&m_reconnectTimer, &QTimer::timeout,
|
||||
this, &SerialControl::reconnectTimeout);
|
||||
}
|
||||
|
Reference in New Issue
Block a user