forked from qt-creator/qt-creator
Merge "Merge remote-tracking branch 'origin/4.15'"
This commit is contained in:
@@ -23,7 +23,7 @@ instructions:
|
|||||||
maxTimeBetweenOutput: 360
|
maxTimeBetweenOutput: 360
|
||||||
userMessageOnFailure: "Failed to extract LLVM package, check logs."
|
userMessageOnFailure: "Failed to extract LLVM package, check logs."
|
||||||
- type: ExecuteCommand
|
- type: ExecuteCommand
|
||||||
command: "python {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --elfutils-path {{.AgentWorkingDir}}/build/qt_temp/elfutils --llvm-path {{.AgentWorkingDir}}/build/qt_temp/libclang --with-tests --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
|
command: "python -u {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --elfutils-path {{.AgentWorkingDir}}/build/qt_temp/elfutils --llvm-path {{.AgentWorkingDir}}/build/qt_temp/libclang --with-tests --no-zip --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
|
||||||
maxTimeInSeconds: 36000
|
maxTimeInSeconds: 36000
|
||||||
maxTimeBetweenOutput: 3600
|
maxTimeBetweenOutput: 3600
|
||||||
userMessageOnFailure: "Failed to run build.py, check logs."
|
userMessageOnFailure: "Failed to run build.py, check logs."
|
||||||
@@ -50,7 +50,7 @@ instructions:
|
|||||||
maxTimeBetweenOutput: 360
|
maxTimeBetweenOutput: 360
|
||||||
userMessageOnFailure: "Failed to extract LLVM package, check logs."
|
userMessageOnFailure: "Failed to extract LLVM package, check logs."
|
||||||
- type: ExecuteCommand
|
- type: ExecuteCommand
|
||||||
command: "python {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --llvm-path {{.AgentWorkingDir}}/build/qt_temp/libclang --keychain-unlock-script /Users/qt/unlock-keychain.sh --with-tests --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
|
command: "python -u {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --llvm-path {{.AgentWorkingDir}}/build/qt_temp/libclang --keychain-unlock-script /Users/qt/unlock-keychain.sh --with-tests --no-zip --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
|
||||||
maxTimeInSeconds: 36000
|
maxTimeInSeconds: 36000
|
||||||
maxTimeBetweenOutput: 3600
|
maxTimeBetweenOutput: 3600
|
||||||
userMessageOnFailure: "Failed to run build.py, check logs."
|
userMessageOnFailure: "Failed to run build.py, check logs."
|
||||||
@@ -92,7 +92,7 @@ instructions:
|
|||||||
maxTimeBetweenOutput: 360
|
maxTimeBetweenOutput: 360
|
||||||
userMessageOnFailure: "Failed to extract LLVM package, check logs."
|
userMessageOnFailure: "Failed to extract LLVM package, check logs."
|
||||||
- type: ExecuteCommand
|
- type: ExecuteCommand
|
||||||
command: "python -u {{.AgentWorkingDir}}\\qt-creator\\qt-creator\\scripts\\build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}\\qt-creator\\qt-creator --build {{.AgentWorkingDir}}\\qt-creator\\qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --python-path {{.AgentWorkingDir}}\\build\\qt_temp\\python --elfutils-path {{.AgentWorkingDir}}\\buid\\qt_temp\\elfutils --llvm-path {{.AgentWorkingDir}}\\build\\qt_temp\\libclang --with-tests --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache --add-config=-DWITH_SCCACHE_SUPPORT=ON"
|
command: "python -u {{.AgentWorkingDir}}\\qt-creator\\qt-creator\\scripts\\build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}\\qt-creator\\qt-creator --build {{.AgentWorkingDir}}\\qt-creator\\qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt5_install_dir --python-path {{.AgentWorkingDir}}\\build\\qt_temp\\python --elfutils-path {{.AgentWorkingDir}}\\buid\\qt_temp\\elfutils --llvm-path {{.AgentWorkingDir}}\\build\\qt_temp\\libclang --with-tests --no-zip --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache --add-config=-DWITH_SCCACHE_SUPPORT=ON"
|
||||||
maxTimeInSeconds: 36000
|
maxTimeInSeconds: 36000
|
||||||
maxTimeBetweenOutput: 3600
|
maxTimeBetweenOutput: 3600
|
||||||
userMessageOnFailure: "Failed to run build.py, check logs."
|
userMessageOnFailure: "Failed to run build.py, check logs."
|
||||||
@@ -124,7 +124,7 @@ instructions:
|
|||||||
maxTimeBetweenOutput: 360
|
maxTimeBetweenOutput: 360
|
||||||
userMessageOnFailure: "Failed to extract python package, check logs."
|
userMessageOnFailure: "Failed to extract python package, check logs."
|
||||||
- type: ExecuteCommand
|
- type: ExecuteCommand
|
||||||
command: "python -u {{.AgentWorkingDir}}\\qt-creator\\qt-creator\\scripts\\build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}\\qt-creator\\qt-creator --build {{.AgentWorkingDir}}\\qt-creator\\qt-creator_build --python-path {{.AgentWorkingDir}}\\buid\\qt_temp\\python --no-qtcreator"
|
command: "python -u {{.AgentWorkingDir}}\\qt-creator\\qt-creator\\scripts\\build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}\\qt-creator\\qt-creator --build {{.AgentWorkingDir}}\\qt-creator\\qt-creator_build --python-path {{.AgentWorkingDir}}\\buid\\qt_temp\\python --no-qtcreator --no-zip"
|
||||||
maxTimeInSeconds: 36000
|
maxTimeInSeconds: 36000
|
||||||
maxTimeBetweenOutput: 3600
|
maxTimeBetweenOutput: 3600
|
||||||
userMessageOnFailure: "Failed to run build.py, check logs."
|
userMessageOnFailure: "Failed to run build.py, check logs."
|
||||||
|
@@ -141,7 +141,7 @@
|
|||||||
|
|
||||||
For example:
|
For example:
|
||||||
\badcode
|
\badcode
|
||||||
git clone "ssh://user@codereview.qt-project.org:29418/qt-labs/qtquickdesigner-components"
|
git clone "https://codereview.qt-project.org/qt-labs/qtquickdesigner-components"
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
Then use qmake from your Qt installation to build the module and to add it
|
Then use qmake from your Qt installation to build the module and to add it
|
||||||
@@ -166,7 +166,7 @@
|
|||||||
|
|
||||||
For example:
|
For example:
|
||||||
\badcode
|
\badcode
|
||||||
git clone ssh://user@codereview.qt-project.org:29418/qt/qtquicktimeline
|
git clone "https://codereview.qt-project.org/qt/qtquicktimeline"
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
Then build the module and add it to your Qt as described in the previous
|
Then build the module and add it to your Qt as described in the previous
|
||||||
|
@@ -35,6 +35,24 @@ int %{CN}::rowCount(const QModelIndex &parent) const
|
|||||||
|
|
||||||
// FIXME: Implement me!
|
// FIXME: Implement me!
|
||||||
}
|
}
|
||||||
|
@if %{DynamicFetch}
|
||||||
|
|
||||||
|
bool %{CN}::hasChildren(const QModelIndex &parent) const
|
||||||
|
{
|
||||||
|
// FIXME: Implement me!
|
||||||
|
}
|
||||||
|
|
||||||
|
bool %{CN}::canFetchMore(const QModelIndex &parent) const
|
||||||
|
{
|
||||||
|
// FIXME: Implement me!
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void %{CN}::fetchMore(const QModelIndex &parent)
|
||||||
|
{
|
||||||
|
// FIXME: Implement me!
|
||||||
|
}
|
||||||
|
@endif
|
||||||
|
|
||||||
QVariant %{CN}::data(const QModelIndex &index, int role) const
|
QVariant %{CN}::data(const QModelIndex &index, int role) const
|
||||||
{
|
{
|
||||||
|
@@ -28,6 +28,14 @@ public:
|
|||||||
// Basic functionality:
|
// Basic functionality:
|
||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||||
|
|
||||||
|
@if %{DynamicFetch}
|
||||||
|
// Fetch data dynamically:
|
||||||
|
bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
|
||||||
|
|
||||||
|
bool canFetchMore(const QModelIndex &parent) const override;
|
||||||
|
void fetchMore(const QModelIndex &parent) override;
|
||||||
|
|
||||||
|
@endif
|
||||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||||
|
|
||||||
@if %{Editable}
|
@if %{Editable}
|
||||||
|
@@ -42,6 +42,24 @@ int %{CN}::columnCount(const QModelIndex &parent) const
|
|||||||
|
|
||||||
// FIXME: Implement me!
|
// FIXME: Implement me!
|
||||||
}
|
}
|
||||||
|
@if %{DynamicFetch}
|
||||||
|
|
||||||
|
bool %{CN}::hasChildren(const QModelIndex &parent) const
|
||||||
|
{
|
||||||
|
// FIXME: Implement me!
|
||||||
|
}
|
||||||
|
|
||||||
|
bool %{CN}::canFetchMore(const QModelIndex &parent) const
|
||||||
|
{
|
||||||
|
// FIXME: Implement me!
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void %{CN}::fetchMore(const QModelIndex &parent)
|
||||||
|
{
|
||||||
|
// FIXME: Implement me!
|
||||||
|
}
|
||||||
|
@endif
|
||||||
|
|
||||||
QVariant %{CN}::data(const QModelIndex &index, int role) const
|
QVariant %{CN}::data(const QModelIndex &index, int role) const
|
||||||
{
|
{
|
||||||
|
@@ -29,6 +29,14 @@ public:
|
|||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||||
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||||
|
|
||||||
|
@if %{DynamicFetch}
|
||||||
|
// Fetch data dynamically:
|
||||||
|
bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
|
||||||
|
|
||||||
|
bool canFetchMore(const QModelIndex &parent) const override;
|
||||||
|
void fetchMore(const QModelIndex &parent) override;
|
||||||
|
|
||||||
|
@endif
|
||||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||||
|
|
||||||
@if %{Editable}
|
@if %{Editable}
|
||||||
|
@@ -212,10 +212,18 @@ jobs:
|
|||||||
|
|
||||||
set(ENV{NINJA_STATUS} "[%f/%t %o/sec] ")
|
set(ENV{NINJA_STATUS} "[%f/%t %o/sec] ")
|
||||||
|
|
||||||
|
set(build_plugin_py "scripts/build_plugin.py")
|
||||||
|
foreach(dir "share/qtcreator/scripts" "Qt Creator.app/Contents/Resources/scripts" "Contents/Resources/scripts")
|
||||||
|
if(EXISTS "${{ steps.qt_creator.outputs.qtc_dir }}/${dir}/build_plugin.py")
|
||||||
|
set(build_plugin_py "${dir}/build_plugin.py")
|
||||||
|
break()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND python
|
COMMAND python
|
||||||
-u
|
-u
|
||||||
${{ steps.qt_creator.outputs.qtc_dir }}/scripts/build_plugin.py
|
"${{ steps.qt_creator.outputs.qtc_dir }}/${build_plugin_py}"
|
||||||
--name "$ENV{PLUGIN_NAME}-$ENV{QT_CREATOR_VERSION}-${{ matrix.config.artifact }}"
|
--name "$ENV{PLUGIN_NAME}-$ENV{QT_CREATOR_VERSION}-${{ matrix.config.artifact }}"
|
||||||
--src .
|
--src .
|
||||||
--build build
|
--build build
|
||||||
|
@@ -206,7 +206,12 @@ void TextTip::configure(const QPoint &pos)
|
|||||||
// Try to find a nice width without unnecessary wrapping.
|
// Try to find a nice width without unnecessary wrapping.
|
||||||
setWordWrap(false);
|
setWordWrap(false);
|
||||||
int tipWidth = sizeHint().width();
|
int tipWidth = sizeHint().width();
|
||||||
const int screenWidth = QGuiApplication::screenAt(pos)->availableGeometry().width();
|
|
||||||
|
QScreen *screen = QGuiApplication::screenAt(pos);
|
||||||
|
if (!screen)
|
||||||
|
screen = QGuiApplication::primaryScreen();
|
||||||
|
|
||||||
|
const int screenWidth = screen->availableGeometry().width();
|
||||||
const int maxDesiredWidth = int(screenWidth * .5);
|
const int maxDesiredWidth = int(screenWidth * .5);
|
||||||
if (tipWidth > maxDesiredWidth) {
|
if (tipWidth > maxDesiredWidth) {
|
||||||
setWordWrap(true);
|
setWordWrap(true);
|
||||||
|
@@ -666,7 +666,10 @@ void ExternalToolRunner::run()
|
|||||||
const CommandLine cmd{m_resolvedExecutable, m_resolvedArguments, CommandLine::Raw};
|
const CommandLine cmd{m_resolvedExecutable, m_resolvedArguments, CommandLine::Raw};
|
||||||
m_process->setCommand(cmd);
|
m_process->setCommand(cmd);
|
||||||
m_process->setEnvironment(m_resolvedEnvironment);
|
m_process->setEnvironment(m_resolvedEnvironment);
|
||||||
MessageManager::writeDisrupting(tr("Starting external tool \"%1\"").arg(cmd.toUserOutput()));
|
const auto write = m_tool->outputHandling() == ExternalTool::ShowInPane
|
||||||
|
? QOverload<const QString &>::of(MessageManager::writeDisrupting)
|
||||||
|
: QOverload<const QString &>::of(MessageManager::writeSilently);
|
||||||
|
write(tr("Starting external tool \"%1\"").arg(cmd.toUserOutput()));
|
||||||
m_process->start();
|
m_process->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -686,7 +689,10 @@ void ExternalToolRunner::finished(int exitCode, QProcess::ExitStatus status)
|
|||||||
}
|
}
|
||||||
if (m_tool->modifiesCurrentDocument())
|
if (m_tool->modifiesCurrentDocument())
|
||||||
DocumentManager::unexpectFileChange(m_expectedFileName);
|
DocumentManager::unexpectFileChange(m_expectedFileName);
|
||||||
MessageManager::writeFlashing(tr("\"%1\" finished").arg(m_resolvedExecutable.toUserOutput()));
|
const auto write = m_tool->outputHandling() == ExternalTool::ShowInPane
|
||||||
|
? QOverload<const QString &>::of(MessageManager::writeFlashing)
|
||||||
|
: QOverload<const QString &>::of(MessageManager::writeSilently);
|
||||||
|
write(tr("\"%1\" finished").arg(m_resolvedExecutable.toUserOutput()));
|
||||||
deleteLater();
|
deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -234,8 +234,9 @@ bool TestCase::waitUntilProjectIsFullyOpened(Project *project, int timeOutInMs)
|
|||||||
|
|
||||||
return QTest::qWaitFor(
|
return QTest::qWaitFor(
|
||||||
[project]() {
|
[project]() {
|
||||||
return !SessionManager::startupBuildSystem()->isParsing()
|
return SessionManager::startupBuildSystem()
|
||||||
&& CppModelManager::instance()->projectInfo(project).isValid();
|
&& !SessionManager::startupBuildSystem()->isParsing()
|
||||||
|
&& CppModelManager::instance()->projectInfo(project).isValid();
|
||||||
},
|
},
|
||||||
timeOutInMs);
|
timeOutInMs);
|
||||||
}
|
}
|
||||||
|
@@ -1470,9 +1470,9 @@ void ClangClToolChainConfigWidget::setFromClangClToolChain()
|
|||||||
|
|
||||||
const auto *clangClToolChain = static_cast<const ClangClToolChain *>(toolChain());
|
const auto *clangClToolChain = static_cast<const ClangClToolChain *>(toolChain());
|
||||||
if (clangClToolChain->isAutoDetected())
|
if (clangClToolChain->isAutoDetected())
|
||||||
m_llvmDirLabel->setText(clangClToolChain->compilerCommand().toUserOutput());
|
m_llvmDirLabel->setText(QDir::toNativeSeparators(clangClToolChain->clangPath()));
|
||||||
else
|
else
|
||||||
m_compilerCommand->setFilePath(clangClToolChain->compilerCommand());
|
m_compilerCommand->setFilePath(Utils::FilePath::fromString(clangClToolChain->clangPath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
static const MsvcToolChain *findMsvcToolChain(unsigned char wordWidth, Abi::OSFlavor flavor)
|
static const MsvcToolChain *findMsvcToolChain(unsigned char wordWidth, Abi::OSFlavor flavor)
|
||||||
@@ -1569,7 +1569,7 @@ static QList<ToolChain *> detectClangClToolChainInPath(const QString &clangClPat
|
|||||||
res << tc;
|
res << tc;
|
||||||
} else {
|
} else {
|
||||||
auto cltc = new ClangClToolChain;
|
auto cltc = new ClangClToolChain;
|
||||||
cltc->setCompilerCommand(FilePath::fromString(clangClPath));
|
cltc->setClangPath(clangClPath);
|
||||||
cltc->setDisplayName(name);
|
cltc->setDisplayName(name);
|
||||||
cltc->setDetection(ToolChain::AutoDetection);
|
cltc->setDetection(ToolChain::AutoDetection);
|
||||||
cltc->setLanguage(language);
|
cltc->setLanguage(language);
|
||||||
@@ -1587,18 +1587,18 @@ static QString compilerFromPath(const QString &path)
|
|||||||
|
|
||||||
void ClangClToolChainConfigWidget::applyImpl()
|
void ClangClToolChainConfigWidget::applyImpl()
|
||||||
{
|
{
|
||||||
FilePath compilerCommand = m_compilerCommand->filePath();
|
Utils::FilePath clangClPath = m_compilerCommand->filePath();
|
||||||
auto clangClToolChain = static_cast<ClangClToolChain *>(toolChain());
|
auto clangClToolChain = static_cast<ClangClToolChain *>(toolChain());
|
||||||
clangClToolChain->setCompilerCommand(compilerCommand);
|
clangClToolChain->setClangPath(clangClPath.toString());
|
||||||
|
|
||||||
if (compilerCommand.fileName() != "clang-cl.exe") {
|
if (clangClPath.fileName() != "clang-cl.exe") {
|
||||||
clangClToolChain->resetVarsBat();
|
clangClToolChain->resetVarsBat();
|
||||||
setFromClangClToolChain();
|
setFromClangClToolChain();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString displayedVarsBat = m_varsBatDisplayCombo->currentText();
|
const QString displayedVarsBat = m_varsBatDisplayCombo->currentText();
|
||||||
QList<ToolChain *> results = detectClangClToolChainInPath(compilerCommand.toString(),
|
QList<ToolChain *> results = detectClangClToolChainInPath(clangClPath.toString(),
|
||||||
{},
|
{},
|
||||||
displayedVarsBat);
|
displayedVarsBat);
|
||||||
|
|
||||||
@@ -1638,22 +1638,26 @@ ClangClToolChain::ClangClToolChain()
|
|||||||
{
|
{
|
||||||
setDisplayName("clang-cl");
|
setDisplayName("clang-cl");
|
||||||
setTypeDisplayName(QCoreApplication::translate("ProjectExplorer::ClangToolChainFactory", "Clang"));
|
setTypeDisplayName(QCoreApplication::translate("ProjectExplorer::ClangToolChainFactory", "Clang"));
|
||||||
setCompilerCommandKey("ProjectExplorer.ClangClToolChain.LlvmDir");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ClangClToolChain::isValid() const
|
bool ClangClToolChain::isValid() const
|
||||||
{
|
{
|
||||||
return MsvcToolChain::isValid() && compilerCommand().exists()
|
const QFileInfo fi(clangPath());
|
||||||
&& compilerCommand().fileName() == "clang-cl.exe";
|
return MsvcToolChain::isValid() && fi.exists() && fi.fileName() == "clang-cl.exe";
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClangClToolChain::addToEnvironment(Utils::Environment &env) const
|
void ClangClToolChain::addToEnvironment(Utils::Environment &env) const
|
||||||
{
|
{
|
||||||
MsvcToolChain::addToEnvironment(env);
|
MsvcToolChain::addToEnvironment(env);
|
||||||
QDir path = compilerCommand().toFileInfo().absoluteDir(); // bin folder
|
QDir path = QFileInfo(m_clangPath).absoluteDir(); // bin folder
|
||||||
env.prependOrSetPath(path.canonicalPath());
|
env.prependOrSetPath(path.canonicalPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Utils::FilePath ClangClToolChain::compilerCommand() const
|
||||||
|
{
|
||||||
|
return Utils::FilePath::fromString(m_clangPath);
|
||||||
|
}
|
||||||
|
|
||||||
QStringList ClangClToolChain::suggestedMkspecList() const
|
QStringList ClangClToolChain::suggestedMkspecList() const
|
||||||
{
|
{
|
||||||
const QString mkspec = "win32-clang-" + Abi::toString(targetAbi().osFlavor());
|
const QString mkspec = "win32-clang-" + Abi::toString(targetAbi().osFlavor());
|
||||||
@@ -1665,11 +1669,44 @@ QList<OutputLineParser *> ClangClToolChain::createOutputParsers() const
|
|||||||
return {new ClangClParser};
|
return {new ClangClParser};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline QString llvmDirKey()
|
||||||
|
{
|
||||||
|
return QStringLiteral("ProjectExplorer.ClangClToolChain.LlvmDir");
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariantMap ClangClToolChain::toMap() const
|
||||||
|
{
|
||||||
|
QVariantMap result = MsvcToolChain::toMap();
|
||||||
|
result.insert(llvmDirKey(), m_clangPath);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ClangClToolChain::fromMap(const QVariantMap &data)
|
||||||
|
{
|
||||||
|
if (!MsvcToolChain::fromMap(data))
|
||||||
|
return false;
|
||||||
|
const QString clangPath = data.value(llvmDirKey()).toString();
|
||||||
|
if (clangPath.isEmpty())
|
||||||
|
return false;
|
||||||
|
m_clangPath = clangPath;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
std::unique_ptr<ToolChainConfigWidget> ClangClToolChain::createConfigurationWidget()
|
std::unique_ptr<ToolChainConfigWidget> ClangClToolChain::createConfigurationWidget()
|
||||||
{
|
{
|
||||||
return std::make_unique<ClangClToolChainConfigWidget>(this);
|
return std::make_unique<ClangClToolChainConfigWidget>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ClangClToolChain::operator==(const ToolChain &other) const
|
||||||
|
{
|
||||||
|
if (!MsvcToolChain::operator==(other))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
const auto *clangClTc = static_cast<const ClangClToolChain *>(&other);
|
||||||
|
return m_clangPath == clangClTc->m_clangPath;
|
||||||
|
}
|
||||||
|
|
||||||
Macros ClangClToolChain::msvcPredefinedMacros(const QStringList &cxxflags,
|
Macros ClangClToolChain::msvcPredefinedMacros(const QStringList &cxxflags,
|
||||||
const Utils::Environment &env) const
|
const Utils::Environment &env) const
|
||||||
{
|
{
|
||||||
@@ -1683,7 +1720,7 @@ Macros ClangClToolChain::msvcPredefinedMacros(const QStringList &cxxflags,
|
|||||||
QStringList arguments = cxxflags;
|
QStringList arguments = cxxflags;
|
||||||
arguments.append(gccPredefinedMacrosOptions(language()));
|
arguments.append(gccPredefinedMacrosOptions(language()));
|
||||||
arguments.append("-");
|
arguments.append("-");
|
||||||
cpp.runBlocking({compilerCommand(), arguments});
|
cpp.runBlocking({clangPath(), arguments});
|
||||||
if (cpp.result() != Utils::QtcProcess::Finished || cpp.exitCode() != 0) {
|
if (cpp.result() != Utils::QtcProcess::Finished || cpp.exitCode() != 0) {
|
||||||
// Show the warning but still parse the output.
|
// Show the warning but still parse the output.
|
||||||
QTC_CHECK(false && "clang-cl exited with non-zero code.");
|
QTC_CHECK(false && "clang-cl exited with non-zero code.");
|
||||||
|
@@ -164,18 +164,28 @@ public:
|
|||||||
bool isValid() const override;
|
bool isValid() const override;
|
||||||
QStringList suggestedMkspecList() const override;
|
QStringList suggestedMkspecList() const override;
|
||||||
void addToEnvironment(Utils::Environment &env) const override;
|
void addToEnvironment(Utils::Environment &env) const override;
|
||||||
|
Utils::FilePath compilerCommand() const override; // FIXME: Remove
|
||||||
QList<Utils::OutputLineParser *> createOutputParsers() const override;
|
QList<Utils::OutputLineParser *> createOutputParsers() const override;
|
||||||
|
QVariantMap toMap() const override;
|
||||||
|
bool fromMap(const QVariantMap &data) override;
|
||||||
std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override;
|
std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override;
|
||||||
BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(
|
BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(
|
||||||
const Utils::Environment &env) const override;
|
const Utils::Environment &env) const override;
|
||||||
|
|
||||||
const QList<MsvcToolChain *> &msvcToolchains() const;
|
const QList<MsvcToolChain *> &msvcToolchains() const;
|
||||||
|
QString clangPath() const { return m_clangPath; }
|
||||||
|
void setClangPath(const QString &path) { m_clangPath = path; }
|
||||||
|
|
||||||
Macros msvcPredefinedMacros(const QStringList &cxxflags,
|
Macros msvcPredefinedMacros(const QStringList &cxxflags,
|
||||||
const Utils::Environment &env) const override;
|
const Utils::Environment &env) const override;
|
||||||
Utils::LanguageVersion msvcLanguageVersion(const QStringList &cxxflags,
|
Utils::LanguageVersion msvcLanguageVersion(const QStringList &cxxflags,
|
||||||
const Utils::Id &language,
|
const Utils::Id &language,
|
||||||
const Macros ¯os) const override;
|
const Macros ¯os) const override;
|
||||||
|
|
||||||
|
bool operator==(const ToolChain &) const override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString m_clangPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
@@ -279,14 +279,7 @@ void ToolChain::toolChainUpdated()
|
|||||||
|
|
||||||
void ToolChain::setDetection(ToolChain::Detection de)
|
void ToolChain::setDetection(ToolChain::Detection de)
|
||||||
{
|
{
|
||||||
if (d->m_detection == de)
|
d->m_detection = de;
|
||||||
return;
|
|
||||||
if (d->m_detection == ToolChain::UninitializedDetection) {
|
|
||||||
d->m_detection = de;
|
|
||||||
} else {
|
|
||||||
d->m_detection = de;
|
|
||||||
toolChainUpdated();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ToolChain::typeDisplayName() const
|
QString ToolChain::typeDisplayName() const
|
||||||
|
@@ -146,7 +146,7 @@ public:
|
|||||||
|
|
||||||
Utils::Id language() const;
|
Utils::Id language() const;
|
||||||
|
|
||||||
Utils::FilePath compilerCommand() const;
|
virtual Utils::FilePath compilerCommand() const; // FIXME: De-virtualize.
|
||||||
void setCompilerCommand(const Utils::FilePath &command);
|
void setCompilerCommand(const Utils::FilePath &command);
|
||||||
|
|
||||||
virtual QList<Utils::OutputLineParser *> createOutputParsers() const = 0;
|
virtual QList<Utils::OutputLineParser *> createOutputParsers() const = 0;
|
||||||
|
@@ -16,6 +16,7 @@ add_qtc_plugin(QmlDesigner
|
|||||||
PLUGIN_DEPENDS
|
PLUGIN_DEPENDS
|
||||||
Core ProjectExplorer QmlJSEditor QmakeProjectManager QmlProjectManager
|
Core ProjectExplorer QmlJSEditor QmakeProjectManager QmlProjectManager
|
||||||
QtSupport TextEditor
|
QtSupport TextEditor
|
||||||
|
PLUGIN_RECOMMENDS QmlPreview
|
||||||
SOURCES
|
SOURCES
|
||||||
designersettings.cpp designersettings.h
|
designersettings.cpp designersettings.h
|
||||||
designmodecontext.cpp designmodecontext.h
|
designmodecontext.cpp designmodecontext.h
|
||||||
|
@@ -190,6 +190,7 @@ Core::IDocument::OpenResult ResourceFile::load()
|
|||||||
const QString alias = felt.attribute(QLatin1String("alias"));
|
const QString alias = felt.attribute(QLatin1String("alias"));
|
||||||
File * const file = new File(p, fileName, alias);
|
File * const file = new File(p, fileName, alias);
|
||||||
file->compress = felt.attribute(QLatin1String("compress"));
|
file->compress = felt.attribute(QLatin1String("compress"));
|
||||||
|
file->compressAlgo = felt.attribute(QLatin1String("compress-algo"));
|
||||||
file->threshold = felt.attribute(QLatin1String("threshold"));
|
file->threshold = felt.attribute(QLatin1String("threshold"));
|
||||||
p->file_list.append(file);
|
p->file_list.append(file);
|
||||||
}
|
}
|
||||||
@@ -226,6 +227,8 @@ QString ResourceFile::contents() const
|
|||||||
felt.setAttribute(QLatin1String("alias"), file.alias);
|
felt.setAttribute(QLatin1String("alias"), file.alias);
|
||||||
if (!file.compress.isEmpty())
|
if (!file.compress.isEmpty())
|
||||||
felt.setAttribute(QLatin1String("compress"), file.compress);
|
felt.setAttribute(QLatin1String("compress"), file.compress);
|
||||||
|
if (!file.compressAlgo.isEmpty())
|
||||||
|
felt.setAttribute(QLatin1String("compress-algo"), file.compressAlgo);
|
||||||
if (!file.threshold.isEmpty())
|
if (!file.threshold.isEmpty())
|
||||||
felt.setAttribute(QLatin1String("threshold"), file.threshold);
|
felt.setAttribute(QLatin1String("threshold"), file.threshold);
|
||||||
}
|
}
|
||||||
|
@@ -84,6 +84,7 @@ public:
|
|||||||
|
|
||||||
// not used, only loaded and saved
|
// not used, only loaded and saved
|
||||||
QString compress;
|
QString compress;
|
||||||
|
QString compressAlgo;
|
||||||
QString threshold;
|
QString threshold;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -482,7 +482,7 @@ void CodeAssistantPrivate::destroyContext()
|
|||||||
cancelCurrentRequest();
|
cancelCurrentRequest();
|
||||||
} else if (m_proposalWidget) {
|
} else if (m_proposalWidget) {
|
||||||
m_editorWidget->keepAutoCompletionHighlight(false);
|
m_editorWidget->keepAutoCompletionHighlight(false);
|
||||||
if (m_proposalWidget->isVisible())
|
if (m_proposalWidget->proposalIsVisible())
|
||||||
m_proposalWidget->closeProposal();
|
m_proposalWidget->closeProposal();
|
||||||
disconnect(m_proposalWidget, &QObject::destroyed,
|
disconnect(m_proposalWidget, &QObject::destroyed,
|
||||||
this, &CodeAssistantPrivate::finalizeProposal);
|
this, &CodeAssistantPrivate::finalizeProposal);
|
||||||
|
@@ -384,7 +384,9 @@ void TokenInfo::identifierKind(const Cursor &cursor, Recursion recursion)
|
|||||||
if (cursor.isInvalidDeclaration())
|
if (cursor.isInvalidDeclaration())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (recursion == Recursion::FirstPass && cursor.kind() != CXCursor_NotImplemented) {
|
if (recursion == Recursion::FirstPass
|
||||||
|
&& cursor.kind() != CXCursor_NotImplemented
|
||||||
|
&& cursor.kind() != CXCursor_PreprocessingDirective) {
|
||||||
const Cursor c = realCursor(cursor);
|
const Cursor c = realCursor(cursor);
|
||||||
if (!clang_isInvalid(c.kind()) && c != cursor) {
|
if (!clang_isInvalid(c.kind()) && c != cursor) {
|
||||||
identifierKind(c, Recursion::FirstPass);
|
identifierKind(c, Recursion::FirstPass);
|
||||||
|
@@ -790,3 +790,7 @@ static inline constexpr vecn<T, S> operator<(vecn<T, S> a, vecn<T, S> b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char *cyrillic = "б";
|
const char *cyrillic = "б";
|
||||||
|
|
||||||
|
struct foo {
|
||||||
|
#define blubb
|
||||||
|
};
|
||||||
|
@@ -1813,6 +1813,12 @@ TEST_F(TokenProcessor, CyrillicString)
|
|||||||
ASSERT_THAT(infos[5], IsHighlightingMark(792u, 24u, 3u, HighlightingType::StringLiteral));
|
ASSERT_THAT(infos[5], IsHighlightingMark(792u, 24u, 3u, HighlightingType::StringLiteral));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(TokenProcessor, PreProcessorInStruct)
|
||||||
|
{
|
||||||
|
const auto infos = translationUnit.tokenInfosInRange(sourceRange(793, 14));
|
||||||
|
ASSERT_THAT(infos[1], HasOnlyType(HighlightingType::Preprocessor));
|
||||||
|
}
|
||||||
|
|
||||||
Data *TokenProcessor::d;
|
Data *TokenProcessor::d;
|
||||||
|
|
||||||
void TokenProcessor::SetUpTestCase()
|
void TokenProcessor::SetUpTestCase()
|
||||||
|
Reference in New Issue
Block a user