Merge remote-tracking branch 'origin/4.5' into 4.6

Change-Id: I3ab4084095d90daf064475157b9a3cdce56dbdec
This commit is contained in:
Eike Ziller
2018-02-07 12:03:43 +01:00
4 changed files with 31 additions and 11 deletions

View File

@@ -34,6 +34,7 @@
#include <QBuffer>
#include <QContextMenuEvent>
#include <QCoreApplication>
#include <QTimer>
#include <QVBoxLayout>
#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#include <QWebEngineContextMenuData>
@@ -89,7 +90,20 @@ WebEngineHelpViewer::WebEngineHelpViewer(QWidget *parent) :
setPalette(p);
connect(m_widget, &QWebEngineView::urlChanged, this, &WebEngineHelpViewer::sourceChanged);
connect(m_widget, &QWebEngineView::loadStarted, this, &WebEngineHelpViewer::slotLoadStarted);
connect(m_widget, &QWebEngineView::loadStarted, this, [this] {
slotLoadStarted();
// Work around QTBUG-65223: if only anchor changed, we never get a loadFinished signal
// If a link is clicked in a page, it can happen that the new URL has not yet been set,
// so we need to delay a bit...
QTimer::singleShot(/*magic timeout=*/150, this, [this] {
QUrl urlWithoutFragment = source();
urlWithoutFragment.setFragment(QString());
qDebug() << urlWithoutFragment << m_previousUrlWithoutFragment;
if (urlWithoutFragment == m_previousUrlWithoutFragment)
slotLoadFinished();
m_previousUrlWithoutFragment = urlWithoutFragment;
});
});
connect(m_widget, &QWebEngineView::loadFinished, this, &WebEngineHelpViewer::slotLoadFinished);
connect(m_widget, &QWebEngineView::titleChanged, this, &WebEngineHelpViewer::titleChanged);
connect(m_widget->page(), &QWebEnginePage::linkHovered, this, &WebEngineHelpViewer::setToolTip);

View File

@@ -97,6 +97,7 @@ public:
private:
WebView *m_widget;
QUrl m_previousUrlWithoutFragment;
};
} // namespace Internal

View File

@@ -648,13 +648,21 @@ void CustomToolChainConfigWidget::applyImpl()
tc->setCompilerCommand(m_compilerCommand->fileName());
tc->setMakeCommand(m_makeCommand->fileName());
tc->setTargetAbi(m_abiWidget->currentAbi());
tc->setPredefinedMacros(Macro::toMacros(m_predefinedDetails->text().toUtf8()));
Macros macros = Utils::transform<QVector>(
m_predefinedDetails->text().split('\n', QString::SkipEmptyParts),
[](const QString &m) {
return Macro::fromKeyValue(m);
});
tc->setPredefinedMacros(macros);
tc->setHeaderPaths(m_headerDetails->entries());
tc->setCxx11Flags(m_cxx11Flags->text().split(QLatin1Char(',')));
tc->setMkspecs(m_mkspecs->text());
tc->setDisplayName(displayName); // reset display name
tc->setOutputParserId(Core::Id::fromSetting(m_errorParserComboBox->currentData()));
tc->setCustomParserSettings(m_customParserSettings);
setFromToolchain(); // Refresh with actual data from the toolchain. This shows what e.g. the
// macro parser did with the input.
}
void CustomToolChainConfigWidget::setFromToolchain()
@@ -665,7 +673,10 @@ void CustomToolChainConfigWidget::setFromToolchain()
m_compilerCommand->setFileName(tc->compilerCommand());
m_makeCommand->setFileName(FileName::fromString(tc->makeCommand(Environment())));
m_abiWidget->setAbis(QList<Abi>(), tc->targetAbi());
m_predefinedMacros->setPlainText(QString::fromUtf8(Macro::toByteArray(tc->rawPredefinedMacros())));
const QStringList macroLines = Utils::transform<QList>(tc->rawPredefinedMacros(), [](const Macro &m) {
return QString::fromUtf8(m.toKeyValue(QByteArray()));
});
m_predefinedMacros->setPlainText(macroLines.join('\n'));
m_headerPaths->setPlainText(tc->headerPathsList().join('\n'));
m_cxx11Flags->setText(tc->cxx11Flags().join(QLatin1Char(',')));
m_mkspecs->setText(tc->mkspecs());

View File

@@ -1,18 +1,12 @@
import qbs
import qbs.Utilities
CppApplication {
QtcTool {
name: "valgrind-fake"
consoleApplication: true
destinationDirectory: qtc.ide_bin_path
install: false
Depends { name: "Qt"; submodules: ["network", "xml"]; }
Depends { name: "qtc" }
cpp.cxxLanguageVersion: "c++11"
Properties {
condition: Utilities.versionCompare(Qt.core.version, "5.7") < 0
cpp.minimumMacosVersion: project.minimumMacosVersion
}
files: [
"main.cpp",