Commit 0c5bae64 authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/4.0'

Change-Id: I80bc3371c6d7cf9f2d46cbcf8e79e4761213d8aa
parents 1b9b59a4 b67b3160
Qt Creator version 4.0.1 contains bug fixes.
The most important changes are listed in this document. For a complete
list of changes, see the Git log for the Qt Creator sources that
you can check out from the public Git repository. For example:
git clone git://code.qt.io/qt-creator/qt-creator.git
git log --cherry-pick --pretty=oneline v4.0.0..v4.0.1
CMake Projects
* Added notification when `CMakeCache.txt` changes and introduces a
conflict with the build configuration settings, with the option
to adapt the build configuration settings
* Fixed that build configurations could not override kit settings, and added
a warning to build configurations that override kit settings
* Fixed that `yes` was not considered as boolean `true` value
* Fixed race between persisting and parsing CMake configuration
(QTCREATORBUG-16258)
QML Support
* Added wizard for Qt Quick Controls 2
* Fixed that `pragma` directives were removed when reformatting
Debugging
* Fixed QObject property expansion (QTCREATORBUG-15798)
* Fixed updating evaluated expressions
* Fixed crash on spontaneous debugger exit (QTCREATORBUG-16233)
Valgrind
* Fixed crash when changing filter
Clang Static Analyzer
* Fixed executing Clang with absolute path on Windows (QTCREATORBUG-16234)
Test Integration
* Fixed running tests on Windows with Qbs (QTCREATORBUG-16323)
Beautifier
* Fixed regression with `clang-format` and predefined style set to `File`
(QTCREATORBUG-16239)
Platform Specific
Windows
* Fixed detection of Microsoft Visual C++ Build Tools
doc/images/qmldesigner-new-project.png

15.1 KB | W: | H:

doc/images/qmldesigner-new-project.png

19.2 KB | W: | H:

doc/images/qmldesigner-new-project.png
doc/images/qmldesigner-new-project.png
doc/images/qmldesigner-new-project.png
doc/images/qmldesigner-new-project.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -120,10 +120,12 @@
\li Qt Quick Controls Application
Create a Qt Quick application using
\l{http://doc-snapshots.qt.io/qt5-5.7/qtquickcontrols2-index.html}
{Qt Quick Controls 2} (requires Qt 5.7 or later),
\l{http://doc.qt.io/qt-5/qtquickcontrols-index.html}
{Qt Quick Controls} or
{Qt Quick Controls}, or
\l{http://doc.qt.io/qt-5/qtlabscontrols-index.html}
{Qt Labs Controls}
{Qt Labs Controls} (only for Qt 5.6)
\li Qt Canvas 3D Application
......
......@@ -693,7 +693,7 @@
\code
{
"name": "LabelQQC_1_0",
"name": "LabelQQC_1_0",
"type": "Label",
"span": true,
"visible": "%{( '%{CS}' === 'QQC_1_0' ) ? 'yes' : ''}",
......
......@@ -50,13 +50,16 @@
a QQuickView. You can build the application and deploy it to desktop,
embedded, and mobile target platforms.
\li \uicontrol {Qt Quick Controls Application} and
\li \uicontrol {Qt Quick Controls Application},
\uicontrol {Qt Quick Controls 2 Application}, and
\uicontrol {Qt Labs Controls Application} are like
\uicontrol {Qt Quick Application}, but using
\l{http://doc-snapshots.qt.io/qt5-5.7/qtquickcontrols2-index.html}
{Qt Quick Controls 2} (requires Qt 5.7 or later),
\l{http://doc.qt.io/qt-5/qtquickcontrols-index.html}
{Qt Quick Controls} or
{Qt Quick Controls}, or
\l{http://doc.qt.io/qt-5/qtlabscontrols-index.html}
{Qt Labs Controls}
{Qt Labs Controls} (only for Qt 5.6)
\li \uicontrol {Qt Canvas 3D Application} creates a Qt Quick application
that imports the Qt Canvas 3D module and, optionally, includes
......
......@@ -188,7 +188,11 @@ class PlainDumper:
def importPlainDumpers(args):
if args == "off":
gdb.execute("disable pretty-printer .* .*")
try:
gdb.execute("disable pretty-printer .* .*")
except:
# Might occur in non-ASCII directories
warn("COULD NOT DISABLE PRETTY PRINTERS")
else:
theDumper.importPlainDumpers()
......
......@@ -2640,7 +2640,10 @@ def qdumpHelper__QJsonValue(d, data, base, pv):
if t == 2:
d.putType("QJsonValue (Number)")
if latinOrIntValue:
d.putValue(v)
w = toInteger(v)
if w >= 0x4000000:
w -= 0x8000000
d.putValue(w)
else:
data = base + v;
d.putValue(d.extractBlob(data, 8).extractDouble())
......@@ -2741,10 +2744,12 @@ def qdump__QJsonValue(d, value):
d.putType("QJsonValue (Bool)")
v = toInteger(value["b"])
d.putValue("true" if v else "false")
d.putNumChild(0)
return
if t == 2:
d.putType("QJsonValue (Number)")
d.putValue(value["dbl"])
d.putNumChild(0)
return
if t == 3:
d.putType("QJsonValue (String)")
......
......@@ -43,13 +43,14 @@ QHash<QObject *, DesignerCustomObjectData*> m_objectToDataHash;
DesignerCustomObjectData::DesignerCustomObjectData(QObject *object)
: m_object(object)
{
if (object)
if (object) {
populateResetHashes();
m_objectToDataHash.insert(object, this);
QObject::connect(object, &QObject::destroyed, [=] {
m_objectToDataHash.remove(object);
delete this;
});
}
}
void DesignerCustomObjectData::registerData(QObject *object)
......
......@@ -3,7 +3,7 @@
"supportedProjectTypes": [ "Qt4ProjectManager.Qt4Project" ],
"id": "W.QtLabsControlsApplication",
"category": "F.Application",
"trDescription": "Creates a deployable Qt Quick 2 application using Qt Labs Controls.",
"trDescription": "Creates a deployable Qt Quick 2 application using Qt Labs Controls.<br/><br/><b>Note:</b> Qt Labs Controls are only available with Qt 5.6. Choose <em>Qt Quick Controls 2 Application</em> when targeting Qt 5.7 or later.",
"trDisplayName": "Qt Labs Controls Application",
"trDisplayCategory": "Application",
"icon": "../qtquickapplication/qml_wizard.png",
......
......@@ -3,6 +3,9 @@ import QtQuick.Window %{QtQuickWindowVersion}
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
@if %{IsUiFileInUse}
MainForm {
......
import QtQuick %{QtQuickVersion}
Page1Form {
button1.onClicked: {
console.log("Button 1 clicked.");
}
button2.onClicked: {
console.log("Button 2 clicked.");
}
}
import QtQuick %{QtQuickVersion}
import QtQuick.Controls %{QtQuickControls2Version}
import QtQuick.Layouts %{QtQuickLayoutsVersion}
Item {
property alias button1: button1
property alias button2: button2
RowLayout {
anchors.centerIn: parent
Button {
id: button1
text: qsTr("Press Me 1")
}
Button {
id: button2
text: qsTr("Press Me 2")
}
}
}
QT += qml quick
CONFIG += c++11
SOURCES += %{MainCppFileName}
RESOURCES += qml.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Default rules for deployment.
include(deployment.pri)
%{Cpp:LicenseTemplate}\
%{JS: QtSupport.qtIncludes([], ["QtGui/QGuiApplication", "QtQml/QQmlApplicationEngine"])}
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
engine.load(QUrl(QLatin1String("qrc:/main.qml")));
return app.exec();
}
import QtQuick %{QtQuickVersion}
import QtQuick.Controls %{QtQuickControls2Version}
import QtQuick.Layouts %{QtQuickLayoutsVersion}
ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
SwipeView {
id: swipeView
anchors.fill: parent
currentIndex: tabBar.currentIndex
Page1 {
}
Page {
Label {
text: qsTr("Second page")
anchors.centerIn: parent
}
}
}
footer: TabBar {
id: tabBar
currentIndex: swipeView.currentIndex
TabButton {
text: qsTr("First")
}
TabButton {
text: qsTr("Second")
}
}
}
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>Page1.qml</file>
<file>Page1Form.ui.qml</file>
</qresource>
</RCC>
{
"version": 1,
"supportedProjectTypes": [ "Qt4ProjectManager.Qt4Project" ],
"id": "V.QtQuickControls2Application",
"category": "F.Application",
"trDescription": "Creates a deployable Qt Quick 2 application using Qt Quick Controls 2.<br/><br/><b>Note:</b> Qt Quick Controls 2 are available with Qt 5.7 and later. Choose <em>Qt Labs Controls Application</em> when targeting Qt 5.6.",
"trDisplayName": "Qt Quick Controls 2 Application",
"trDisplayCategory": "Application",
"icon": "../qtquickapplication/qml_wizard.png",
"featuresRequired": [ "QtSupport.Wizards.FeatureQtQuick.Controls.2" ],
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}",
"options":
[
{ "key": "ProFileName", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" },
{ "key": "MainCppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" },
{ "key": "QtQuickVersion", "value": "2.7" },
{ "key": "QtQuickControls2Version", "value": "2.0" },
{ "key": "QtQuickDialogsVersion", "value": "1.0" },
{ "key": "QtQuickLayoutsVersion", "value": "1.0" }
],
"pages":
[
{
"trDisplayName": "Project Location",
"trShortTitle": "Location",
"typeId": "Project"
},
{
"trDisplayName": "Kit Selection",
"trShortTitle": "Kits",
"typeId": "Kits",
"enabled": "%{IsTopLevelProject}",
"data": { "projectFilePath": "%{ProFileName}" }
},
{
"trDisplayName": "Project Management",
"trShortTitle": "Summary",
"typeId": "Summary"
}
],
"generators":
[
{
"typeId": "File",
"data":
[
{
"source": "app.pro",
"target": "%{ProFileName}",
"openAsProject": true
},
{
"source": "main.cpp",
"target": "%{MainCppFileName}"
},
{
"source": "main.qml.tpl",
"target": "main.qml",
"openInEditor": true
},
{
"source": "Page1.qml.tpl",
"target": "Page1.qml"
},
{
"source": "Page1Form.ui.qml.tpl",
"target": "Page1Form.ui.qml"
},
{
"source": "qml.qrc"
},
{
"source": "../../../../shared/qrcdeployment.pri",
"target": "%{ProjectDirectory}/deployment.pri"
},
{
"source": "../../git.ignore",
"target": "%{ProjectDirectory}/.gitignore",
"condition": "%{JS: !%{IsSubproject} && '%{VersionControl}' === 'G.Git'}"
}
]
}
]
}
......@@ -480,6 +480,13 @@ protected:
}
}
virtual bool visit(UiPragma *ast)
{
out("pragma ", ast->pragmaToken);
accept(ast->pragmaType);
return false;
}
virtual bool visit(UiImport *ast)
{
out("import ", ast->importToken);
......@@ -1187,6 +1194,12 @@ protected:
return false;
}
virtual bool visit(UiQualifiedPragmaId *ast)
{
out(ast->identifierToken);
return false;
}
virtual bool visit(Elision *ast)
{
for (Elision *it = ast; it; it = it->next) {
......
......@@ -447,8 +447,8 @@ static QStringList splitArgsUnix(const QString &args, bool abortOnMeta,
}
}
for (int i = 0; i < val.length(); i++) {
QChar cc = val.unicode()[i];
if (cc == 9 || cc == 10 || cc == 32) {
const QChar cc = val.unicode()[i];
if (cc.unicode() == 9 || cc.unicode() == 10 || cc.unicode() == 32) {
if (hadWord) {
ret += cret;
cret.clear();
......
......@@ -48,13 +48,6 @@ ToolTip::ToolTip() : m_tip(0), m_widget(0)
{
connect(&m_showTimer, &QTimer::timeout, this, &ToolTip::hideTipImmediately);
connect(&m_hideDelayTimer, &QTimer::timeout, this, &ToolTip::hideTipImmediately);
connect(static_cast<QGuiApplication *>(QGuiApplication::instance()),
&QGuiApplication::applicationStateChanged,
[this](Qt::ApplicationState state) {
if (state != Qt::ApplicationActive)
hideTipImmediately();
}
);
}
ToolTip::~ToolTip()
......@@ -290,6 +283,11 @@ void ToolTip::placeTip(const QPoint &pos, QWidget *w)
bool ToolTip::eventFilter(QObject *o, QEvent *event)
{
if (m_tip && event->type() == QEvent::ApplicationStateChange
&& qApp->applicationState() != Qt::ApplicationActive) {
hideTipImmediately();
}
if (!o->isWidgetType())
return false;
......
......@@ -194,9 +194,9 @@ void AutoTestUnitTests::testCodeParserGTest()
if (qgetenv("GOOGLETEST_DIR").isEmpty())
QSKIP("This test needs googletest - set GOOGLETEST_DIR (point to googletest repository)");
QFETCH(QString, projectFilePath);
CppTools::Tests::ProjectOpenerAndCloser projectManager;
CppTools::ProjectInfo projectInfo = projectManager.open(
QString(m_tmpDir->path() + QLatin1String("/simple_gt/simple_gt.pro")), true);
CppTools::ProjectInfo projectInfo = projectManager.open(projectFilePath, true);
QVERIFY(projectInfo.isValid());
QSignalSpy parserSpy(m_model->parser(), SIGNAL(parsingFinished()));
......@@ -226,5 +226,14 @@ void AutoTestUnitTests::testCodeParserGTest()
QCOMPARE(m_model->dataTagsCount(), 0);
}
void AutoTestUnitTests::testCodeParserGTest_data()
{
QTest::addColumn<QString>("projectFilePath");
QTest::newRow("simpleGoogletest")
<< QString(m_tmpDir->path() + QLatin1String("/simple_gt/simple_gt.pro"));
QTest::newRow("simpleGoogletestQbs")
<< QString(m_tmpDir->path() + QLatin1String("/simple_gt/simple_gt.qbs"));
}
} // namespace Internal
} // namespace Autotest
......@@ -51,6 +51,7 @@ private slots:
void testCodeParserSwitchStartup();
void testCodeParserSwitchStartup_data();
void testCodeParserGTest();
void testCodeParserGTest_data();
private:
TestTreeModel *m_model;
......
......@@ -41,17 +41,24 @@
<file>unit_test/mixed_atp/tests/auto/quickauto2/quickauto2.qbs</file>
<file>unit_test/simple_gt/src/main.cpp</file>
<file>unit_test/simple_gt/src/src.pro</file>
<file>unit_test/simple_gt/src/src.qbs</file>
<file>unit_test/simple_gt/tests/gt1/further.cpp</file>
<file>unit_test/simple_gt/tests/gt1/gt1.pro</file>
<file>unit_test/simple_gt/tests/gt1/gt1.qbs</file>
<file>unit_test/simple_gt/tests/gt1/main.cpp</file>
<file>unit_test/simple_gt/tests/gt2/gt2.pro</file>
<file>unit_test/simple_gt/tests/gt2/gt2.qbs</file>
<file>unit_test/simple_gt/tests/gt2/main.cpp</file>
<file>unit_test/simple_gt/tests/gt2/queuetest.h</file>
<file>unit_test/simple_gt/tests/tests.pro</file>
<file>unit_test/simple_gt/tests/tests.qbs</file>
<file>unit_test/simple_gt/simple_gt.pro</file>
<file>unit_test/simple_gt/simple_gt.qbs</file>
<file>unit_test/simple_gt/tests/gtest_dependency.pri</file>
<file>unit_test/simple_gt/tests/gt3/dummytest.h</file>
<file>unit_test/simple_gt/tests/gt3/gt3.pro</file>
<file>unit_test/simple_gt/tests/gt3/gt3.qbs</file>
<file>unit_test/simple_gt/tests/gt3/main.cpp</file>
<file>unit_test/simple_gt/tests/common/functions.js</file>
</qresource>
</RCC>
......@@ -115,7 +115,11 @@ void TestConfiguration::completeTestInformation()
foreach (const BuildTargetInfo &bti, appTargets.list) {
// some project manager store line/column information as well inside ProjectPart
if (bti.isValid() && m_proFile.startsWith(bti.projectFilePath.toString())) {
targetFile = Utils::HostOsInfo::withExecutableSuffix(bti.targetFilePath.toString());
targetFile = bti.targetFilePath.toString();
if (Utils::HostOsInfo::isWindowsHost()
&& !targetFile.toLower().endsWith(QLatin1String(".exe"))) {
targetFile = Utils::HostOsInfo::withExecutableSuffix(targetFile);
}
targetName = bti.targetName;
break;
}
......
......@@ -152,6 +152,10 @@ bool TestAstVisitor::visit(CPlusPlus::CallAST *ast)
bool TestAstVisitor::visit(CPlusPlus::CompoundStatementAST *ast)
{
if (!ast || !ast->symbol) {
m_currentScope = 0;
return false;
}
m_currentScope = ast->symbol->asScope();
return true;
}
......
......@@ -75,7 +75,7 @@ public:
private:
QString m_className;
CPlusPlus::Scope *m_currentScope;
CPlusPlus::Scope *m_currentScope = 0;
CPlusPlus::Document::Ptr m_currentDoc;
};
......
import qbs
Project {
name: "Simple GT"
references: [
"src/src.qbs",
"tests/tests.qbs"
]
}
import qbs
CppApplication {
type: "application"
name: "Dummy application"
Depends { name: "Qt.core" }
files: [ "main.cpp" ]
}
var FileInfo = loadExtension("qbs.FileInfo")
function getGTestDir(str) {
if (!str) {
if (qbs.hostOS.contains("linux"))
return "/usr/include/gtest";
} else {
return FileInfo.joinPaths(str, "googletest");
}
return "";
}
function getGMockDir(str) {
if (!str) {
if (qbs.hostOS.contains("linux"))
return "/usr/include/gmock";
} else {
return FileInfo.joinPaths(str, "googlemock");
}
return "";
}
function getGTestAll(str) {
var gtest = getGTestDir(str);
if (!gtest)
return [];
return [FileInfo.joinPaths(gtest, "src/gtest-all.cc")];
}
function getGMockAll(str) {
var gmock = getGMockDir(str);
if (!gmock)
return [];
return [FileInfo.joinPaths(gmock, "src/gmock-all.cc")];
}
function getGTestIncludes(str) {
var gtest = getGTestDir(str);
if (!gtest)
return [];
return [gtest, FileInfo.joinPaths(gtest, "include")];
}
function getGMockIncludes(str) {
var mock = getGMockDir(str);
if (!mock)
return [];
return [mock, FileInfo.joinPaths(mock, "include")];
}
import qbs
import qbs.File
import qbs.FileInfo
import "../common/functions.js" as googleCommon
CppApplication {
type: "application"
name: "googletest1"
property string gtestDir: googleCommon.getGTestDir(project.googletestDir)
property string gmockDir: googleCommon.getGMockDir(project.googletestDir)
condition: {
if (File.exists(gtestDir) && File.exists(gmockDir))
return true;
console.error("Cannot find Google Test - specify environment variable GOOGLETEST_DIR "
+ "or qbs property " + project.name + ".googletestDir" );
return false;
}
cpp.includePaths: [].concat(googleCommon.getGTestIncludes(project.googletestDir))
.concat(googleCommon.getGMockIncludes(project.googletestDir))
cpp.cxxLanguageVersion: "c++11"
cpp.defines: ["GTEST_LANG_CXX11"]
cpp.dynamicLibraries: [ "pthread" ]
files: [
// own stuff
"further.cpp",
"main.cpp",
].concat(googleCommon.getGTestAll(project.googletestDir))
.concat(googleCommon.getGMockAll(project.googletestDir))
}
import qbs
import qbs.File
import qbs.FileInfo
import "../common/functions.js" as googleCommon
CppApplication {
type: "application"
name: "googletest2"
property string gtestDir: googleCommon.getGTestDir(project.googletestDir)
property string gmockDir: googleCommon.getGMockDir(project.googletestDir)
Depends { name: "Qt.core" }
condition: {
if (File.exists(gtestDir) && File.exists(gmockDir))
return true;
console.error("Cannot find Google Test - specify environment variable GOOGLETEST_DIR "
+ "or qbs property " + project.name + ".googletestDir" );
return false;
}
cpp.includePaths: [].concat(googleCommon.getGTestIncludes(project.googletestDir))
.concat(googleCommon.getGMockIncludes(project.googletestDir))