Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • tohunger/qt-creator
1 result
Show changes
Commits on Source (63)
Showing
with 204 additions and 28 deletions
......@@ -14,6 +14,11 @@ function readOutput(executable, args)
return output;
}
function readListOutput(executable, args)
{
return readOutput(executable, args).split(/\s+/);
}
function isSuitableLLVMConfig(llvmConfigCandidate, qtcFunctions)
{
if (File.exists(llvmConfigCandidate)) {
......@@ -75,3 +80,66 @@ function libraries(targetOS)
{
return targetOS.contains("windows") ? ["libclang.lib", "advapi32.lib", "shell32.lib"] : ["clang"]
}
function toolingLibs(llvmConfig, targetOS)
{
var fixedList = [
"clangTooling",
"clangFrontend",
"clangIndex",
"clangParse",
"clangSerialization",
"clangSema",
"clangEdit",
"clangAnalysis",
"clangDriver",
"clangDynamicASTMatchers",
"clangASTMatchers",
"clangToolingCore",
"clangAST",
"clangLex",
"clangBasic",
];
if (targetOS.contains("windows"))
fixedList.push("version");
var dynamicList = readListOutput(llvmConfig, ["--libs"])
.concat(readListOutput(llvmConfig, ["--system-libs"]));
return fixedList.concat(dynamicList.map(function(s) {
return s.startsWith("-l") ? s.slice(2) : s;
}));
}
function toolingParameters(llvmConfig)
{
var params = {
defines: [],
includes: [],
cxxFlags: [],
};
var allCxxFlags = readListOutput(llvmConfig, ["--cxxflags"]);
for (var i = 0; i < allCxxFlags.length; ++i) {
var flag = allCxxFlags[i];
if (flag.startsWith("-D") || flag.startsWith("/D")) {
params.defines.push(flag.slice(2));
continue;
}
if (flag.startsWith("-I") || flag.startsWith("/I")) {
params.includes.push(flag.slice(2));
continue;
}
if (!flag.startsWith("-std") && !flag.startsWith("-O") && !flag.startsWith("/O")
&& !flag.startsWith("-march")
&& !flag.startsWith("/EH") && flag !== "-fno-exceptions"
&& flag !== "/W4" && flag !== "-Werror=date-time"
&& flag !== "-Wcovered-switch-default" && flag !== "-fPIC" && flag !== "-pedantic"
&& flag !== "-Wstring-conversion" && flag !== "-gsplit-dwarf") {
params.cxxFlags.push(flag);
}
}
return params;
}
function buildMode(llvmConfig)
{
return readOutput(llvmConfig, ["--build-mode"]);
}
import qbs
import qbs.Environment
import qbs.File
import qbs.Utilities
import QtcFunctions
import "functions.js" as ClangFunctions
......@@ -12,6 +14,11 @@ Module {
property string llvmIncludeDir
property string llvmLibDir
property stringList llvmLibs
property stringList llvmToolingLibs
property stringList llvmToolingDefines
property stringList llvmToolingIncludes
property stringList llvmToolingCxxFlags
property string llvmBuildMode
configure: {
llvmConfig = ClangFunctions.llvmConfig(qbs, QtcFunctions);
......@@ -19,6 +26,12 @@ Module {
llvmIncludeDir = ClangFunctions.includeDir(llvmConfig);
llvmLibDir = ClangFunctions.libDir(llvmConfig);
llvmLibs = ClangFunctions.libraries(qbs.targetOS);
llvmToolingLibs = ClangFunctions.toolingLibs(llvmConfig, qbs.targetOS);
llvmBuildMode = ClangFunctions.buildMode(llvmConfig);
var toolingParams = ClangFunctions.toolingParameters(llvmConfig);
llvmToolingDefines = toolingParams.defines;
llvmToolingIncludes = toolingParams.includes;
llvmToolingCxxFlags = toolingParams.cxxFlags;
found = llvmConfig && File.exists(llvmIncludeDir.concat("/clang-c/Index.h"));
}
}
......@@ -28,6 +41,17 @@ Module {
property string llvmIncludeDir: clangProbe.llvmIncludeDir
property string llvmLibDir: clangProbe.llvmLibDir
property stringList llvmLibs: clangProbe.llvmLibs
property stringList llvmToolingLibs: clangProbe.llvmToolingLibs
property string llvmBuildMode: clangProbe.llvmBuildMode
property bool llvmBuildModeMatches: qbs.buildVariant === llvmBuildMode.toLowerCase()
property stringList llvmToolingDefines: clangProbe.llvmToolingDefines
property stringList llvmToolingIncludes: clangProbe.llvmToolingIncludes.filter(function(incl) {
return incl != llvmIncludeDir;
})
property stringList llvmToolingCxxFlags: clangProbe.llvmToolingCxxFlags
property bool toolingEnabled: !Environment.getEnv("QTC_NO_CLANG_LIBTOOLING")
&& Utilities.versionCompare(llvmVersion, "3.9") > 0
&& Utilities.versionCompare(llvmVersion, "4") < 0
validate: {
if (!clangProbe.found) {
......
#!/usr/bin/perl -w
############################################################################
#
# Copyright (C) 2017 The Qt Company Ltd.
# Contact: https://www.qt.io/licensing/
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt licenses may use this file in
# accordance with the commercial license agreement provided with the
# Software or, alternatively, in accordance with the terms contained in
# a written agreement between you and The Qt Company. For licensing terms
# and conditions see https://www.qt.io/terms-conditions. For further
# information use the contact form at https://www.qt.io/contact-us.
#
# GNU General Public License Usage
# Alternatively, this file may be used under the terms of the GNU
# General Public License version 3 as published by the Free Software
# Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
# included in the packaging of this file. Please review the following
# information to ensure the GNU General Public License requirements will
# be met: https://www.gnu.org/licenses/gpl-3.0.html.
#
############################################################################
=head1 NAME
clazyweb2tasks.pl - Convert Clazy logs as displayed by the Web frontend into
Qt Creator task files.
Expected format:
Explanation for clazy-strict-iterators
./qtbase/src/tools/moc/preprocessor.cpp
line 995: for (Symbols::const_iterator j = mergeSymbol + 1; j != i; ++j)
=> Mixing iterators with const_iterators
=head1 SYNOPSIS
clazyweb2tasks.pl < logfile > taskfile
=cut
use strict;
my $message = '';
my $fileName = '';
while (my $line = <STDIN> ) {
chomp($line);
if ($line =~ /\s*Explanation for (.*)$/) {
$message = $1;
} elsif (index($line, './') == 0) {
$fileName = substr($line, 2);
} elsif ($line =~ /\s*line (\d+):/) {
my $lineNumber = $1;
print $fileName, "\t", $lineNumber, "\tclazy\t", $message,"\n";
}
}
......@@ -702,7 +702,7 @@ class Dumper(DumperBase):
self.typesToReport = {}
if self.forceQtNamespace:
self.qtNamepaceToReport = self.qtNamespace()
self.qtNamespaceToReport = self.qtNamespace()
if self.qtNamespaceToReport:
self.output += ',qtnamespace="%s"' % self.qtNamespaceToReport
......@@ -996,8 +996,13 @@ class Dumper(DumperBase):
name = objfile.filename
if self.isWindowsTarget():
isQtCoreObjFile = name.find('Qt5Cored.dll') >= 0 or name.find('Qt5Core.dll') >= 0
if not isQtCoreObjFile:
isQtCoreObjFile = name.find('QtCored.dll') >= 0 or name.find('QtCore.dll') >= 0
else:
isQtCoreObjFile = name.find('/libQt5Core') >= 0
if not isQtCoreObjFile:
isQtCoreObjFile = name.find('/libQtCore') >= 0
if isQtCoreObjFile:
self.handleQtCoreLoaded(objfile)
......@@ -1019,6 +1024,13 @@ class Dumper(DumperBase):
if len(ns):
ns += '::'
break
if line.find('currentThreadData ') >= 0:
# [ 0] b 0x7ffff67d3000 _ZN2UUL17currentThreadDataE
# section .tbss UU::currentThreadData qthread_unix.cpp\\n
ns = re.split('_ZN?(\d*)(\w*)L17currentThreadDataE? ', line)[2]
if len(ns):
ns += '::'
break
os.remove(tmppath)
lenns = len(ns)
......
......@@ -128,7 +128,7 @@
},
{
"name": "UseVirtualKeyboard",
"trDisplayName": "Use Qt Virtual Keyboard.",
"trDisplayName": "Use Qt Virtual Keyboard",
"type": "CheckBox",
"data":
{
......
......@@ -124,7 +124,7 @@
},
{
"name": "UseVirtualKeyboard",
"trDisplayName": "Use Qt Virtual Keyboard.",
"trDisplayName": "Use Qt Virtual Keyboard",
"type": "CheckBox",
"data":
{
......
......@@ -176,7 +176,7 @@
},
{
"name": "UseVirtualKeyboard",
"trDisplayName": "Use Qt Virtual Keyboard.",
"trDisplayName": "Use Qt Virtual Keyboard",
"type": "CheckBox",
"data":
{
......
......@@ -193,7 +193,7 @@
},
{
"name": "UseVirtualKeyboard",
"trDisplayName": "Use Qt Virtual Keyboard.",
"trDisplayName": "Use Qt Virtual Keyboard",
"type": "CheckBox",
"data":
{
......
......@@ -193,7 +193,7 @@
},
{
"name": "UseVirtualKeyboard",
"trDisplayName": "Use Qt Virtual Keyboard.",
"trDisplayName": "Use Qt Virtual Keyboard",
"type": "CheckBox",
"data":
{
......
......@@ -442,7 +442,7 @@ QString PluginManager::systemInformation() const
if (response.result == SynchronousProcessResponse::Finished)
result += response.allOutput() + "\n";
result += "Plugin information:\n\n";
auto longestSpec = std::max_element(plugins().cbegin(), plugins().cend(),
auto longestSpec = std::max_element(d->pluginSpecs.cbegin(), d->pluginSpecs.cend(),
[](const PluginSpec *left, const PluginSpec *right) {
return left->name().size() < right->name().size();
});
......
......@@ -421,8 +421,9 @@ void PluginView::updatePlugins()
QList<CollectionItem *> collections;
auto end = PluginManager::pluginCollections().cend();
for (auto it = PluginManager::pluginCollections().cbegin(); it != end; ++it) {
const QHash<QString, QList<PluginSpec *>> pluginCollections = PluginManager::pluginCollections();
const auto end = pluginCollections.cend();
for (auto it = pluginCollections.cbegin(); it != end; ++it) {
const QString name = it.key().isEmpty() ? tr("Utilities") : it.key();
collections.append(new CollectionItem(name, it.value(), this));
}
......
......@@ -40,13 +40,13 @@ int SavingRefMap::countDanglingReferences()
bool SavingRefMap::hasRef(const void *address, const char *typeName)
{
return m_references.find(KeyType(address, typeName)) != m_references.end();
return m_references.constFind(KeyType(address, typeName)) != m_references.constEnd();
}
bool SavingRefMap::hasDefinedRef(const void *address, const char *typeName)
{
MapType::const_iterator it = m_references.find(KeyType(address, typeName));
if (it == m_references.end())
const MapType::const_iterator it = m_references.constFind(KeyType(address, typeName));
if (it == m_references.constEnd())
return false;
return it.value().second;
}
......
......@@ -232,7 +232,8 @@ QString FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) const
// check if absolute path is found in sysroot
if (!m_sysroot.isEmpty()) {
const QString sysrootPath = m_sysroot + originalPath;
if (QFileInfo(sysrootPath).exists() && QFileInfo(sysrootPath).isFile()) {
QFileInfo sysrootInfo(sysrootPath);
if (sysrootInfo.exists() && sysrootInfo.isFile()) {
if (success)
*success = true;
m_cache.insert(originalPath, sysrootPath);
......
......@@ -258,13 +258,14 @@ void JsonSchema::enterNestedTypeSchema()
QStringList JsonSchema::properties(JsonObjectValue *v) const
{
typedef QHash<QString, JsonValue *>::ConstIterator MemberConstIterator;
using Members = QHash<QString, JsonValue *>;
QStringList all;
if (JsonObjectValue *ov = getObjectValue(kProperties(), v)) {
const MemberConstIterator cend = ov->members().constEnd();
for (MemberConstIterator it = ov->members().constBegin(); it != cend; ++it)
const Members members = ov->members();
const Members::ConstIterator cend = members.constEnd();
for (Members::ConstIterator it = members.constBegin(); it != cend; ++it)
if (hasPropertySchema(it.key()))
all.append(it.key());
}
......
......@@ -33,6 +33,8 @@ namespace Utils {
class QTCREATOR_UTILS_EXPORT SaveFile : public QTemporaryFile
{
Q_OBJECT
public:
explicit SaveFile(const QString &filename);
virtual ~SaveFile();
......
......@@ -107,6 +107,7 @@ IDevice::Ptr AndroidDevice::clone() const
QUrl AndroidDevice::toolControlChannel(const ControlChannelHint &) const
{
QUrl url;
url.setScheme(urlTcpScheme());
url.setHost("localhost");
return url;
}
......
......@@ -180,8 +180,8 @@ static void sdkManagerCommand(const AndroidConfig &config, const QStringList &ar
output.success = false;
output.stdOutput = response.stdOut();
output.stdError = QCoreApplication::translate("Android::Internal::AndroidSdkManager",
"Operation requires user interaction."
"Please use \"sdkmanager\" commandline tool");
"The operation requires user interaction. "
"Use the \"sdkmanager\" command-line tool.");
} else {
output.success = response.result == SynchronousProcessResponse::Finished;
}
......
......@@ -269,7 +269,7 @@ void AndroidSdkManagerWidget::onNativeSdkManager()
QProcess::startDetached(m_androidConfig.androidToolPath().toString());
} else {
QMessageBox::warning(this, tr("Native SDK Manager Not Available"),
tr("SDK manager UI tool is not available in the installed SDK tools"
tr("SDK manager UI tool is not available in the installed SDK tools "
"(version %1). Use the command line tool \"sdkmanager\" for "
"advanced SDK management.")
.arg(m_androidConfig.sdkToolsVersion().toString()));
......
......@@ -34,9 +34,9 @@
<item>
<widget class="QCheckBox" name="useXMLOutputCB">
<property name="toolTip">
<string>XML output recommended as it avoids parsing issues, while plain text is more human readable.
<string>XML output is recommended, because it avoids parsing issues, while plain text is more human readable.
Warning: Plain text output is missing some information (e.g. duration)</string>
Warning: Plain text misses some information, such as duration.</string>
</property>
<property name="text">
<string>Use XML output</string>
......
......@@ -33,6 +33,7 @@
#include <QAbstractItemView>
#include <QPainter>
#include <QTextLayout>
#include <QWindow>
namespace Autotest {
namespace Internal {
......@@ -57,20 +58,20 @@ void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
painter->save();
QFontMetrics fm(opt.font);
QBrush background;
QColor foreground;
const QAbstractItemView *view = qobject_cast<const QAbstractItemView *>(opt.widget);
const bool selected = opt.state & QStyle::State_Selected;
if (selected) {
painter->setBrush(opt.palette.highlight().color());
background = opt.palette.highlight().color();
foreground = opt.palette.highlightedText().color();
} else {
painter->setBrush(opt.palette.window().color());
background = opt.palette.window().color();
foreground = opt.palette.text().color();
}
painter->setPen(Qt::NoPen);
painter->drawRect(opt.rect);
painter->fillRect(opt.rect, background);
painter->setPen(foreground);
TestResultFilterModel *resultFilterModel = static_cast<TestResultFilterModel *>(view->model());
......@@ -78,10 +79,13 @@ void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
const TestResult *testResult = resultFilterModel->testResult(index);
QTC_ASSERT(testResult, painter->restore();return);
const QWidget *widget = dynamic_cast<const QWidget*>(painter->device());
QWindow *window = widget ? widget->window()->windowHandle() : nullptr;
QIcon icon = index.data(Qt::DecorationRole).value<QIcon>();
if (!icon.isNull())
painter->drawPixmap(positions.left(), positions.top(),
icon.pixmap(positions.iconSize(), positions.iconSize()));
icon.pixmap(window, QSize(positions.iconSize(), positions.iconSize())));
QString typeStr = TestResult::resultToString(testResult->result());
if (selected) {
......@@ -130,9 +134,10 @@ void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
painter->drawText(positions.lineAreaLeft(), positions.top() + fm.ascent(), line);
}
painter->setClipRect(opt.rect);
painter->setClipping(false);
painter->setPen(opt.palette.mid().color());
painter->drawLine(0, opt.rect.bottom(), opt.rect.right(), opt.rect.bottom());
const QRectF adjustedRect(QRectF(opt.rect).adjusted(0.5, 0.5, -0.5, -0.5));
painter->drawLine(adjustedRect.bottomLeft(), adjustedRect.bottomRight());
painter->restore();
}
......