Commit 52bf71fb authored by Oswald Buddenhagen's avatar Oswald Buddenhagen

Merge remote-tracking branch 'origin/3.1'

Conflicts:
	README
	tests/auto/debugger/tst_dumpers.cpp

Change-Id: Ib9aef37a246bc3bb9bca0c32a902af3b09ef3146
parents ee299651 01715c61
......@@ -12,7 +12,7 @@ Mac OS X 10.7 or later
Building the sources requires Qt 5.2.0 or later.
It is also possible to build with Qt 4.8.x, but in that case the Welcome mode,
Qt Quick Designer, QML Profiler and Qbs support are disabled.
Qt Quick Designer, QML Profiler, and the WinRT and Qbs support are disabled.
Compiling Qt Creator
====================
......
......@@ -662,7 +662,7 @@
Also, the debugger displays access data for QFileInfo and provides
access to the "real" contents of QVariant.
Right-click in the the \gui{Locals and Expressions} view to open a context
Right-click in the \gui{Locals and Expressions} view to open a context
menu that provides additional options for viewing data. The available
options depend on the type of the current items, and are provided by the
\l{Using Debugging Helpers}{Debugging Helpers}. Typically, string-like data,
......
/****************************************************************************
**
** Copyright (c) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator
**
**
** GNU Free Documentation License
**
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of this
** file.
**
**
****************************************************************************/
// **********************************************************************
// NOTE: the sections are not ordered by their logical order to avoid
// reshuffling the file each time the index order changes (i.e., often).
// Run the fixnavi.pl script to adjust the links to the index order.
// **********************************************************************
/*!
\contentspage index.html
\previouspage creator-editor-refactoring.html
\page creator-beautifier.html
\nextpage creator-editor-options.html
\title Beautifying Source Code
You can use the experimental Beautifier plugin to format your source code
by using the following external tools:
\list
\li \l{http://astyle.sourceforge.net}{Artistic Style}
\li \l{http://clang.llvm.org/docs/ClangFormat.html}{ClangFormat}
\li \l{http://uncrustify.sourceforge.net}{Uncrustify}
\endlist
The Beautifier plugin parses the source code into component structures, such
as assignment statements, if blocks, loops, and so on, and formats them as
specified in the Beautifier options. You can use a predefined style or
define your own style.
To use the Beautifier plugin:
\list 1
\li Download and install the tool to use for formatting source code:
\list
\li \l{http://sourceforge.net/projects/astyle/files/astyle}
{Artistic Style}
\li \l{http://llvm.org/releases/download.html}{ClangFormat}
\li \l{http://sourceforge.net/projects/uncrustify/files/uncrustify}
{Uncrustify}
\endlist
You might have to build the tools from sources for some platforms.
\li Select \gui Help > \gui {About Plugins} > \gui {C++} >
\gui Beautifier to enable the plugin.
\li Restart \QC to be able to use the plugin.
\li Select \gui Tools > \gui Options > \gui Beautifier to specify
settings for the tool you want to use.
\image beautifier_options.png
\li In the \gui {Artistic Style command}, \gui {Clang Format command},
or \gui {Uncrustify command} field, specify the path to the tool
executable.
\li In the \gui Options group, select the configuration file that
defines the style to use in the source files. If you select several
options, they are applied from top down.
\list
\li Select the \gui {Use file defined in project files} option
to use the configuration file defined in the qmake
OTHER_FILES variable as the configuration file for the
selected tool.
\li Select the \gui {Use $HOME} option to use the specified file
in the user's home directory as the configuration file for
the selected tool.
\li Select the \gui {Use self-defined style} option, and then
\gui Add to define your own style.
\li Define code formatting in the \gui {Edit Configuration}
dialog. It provides syntax highlighting, auto-completion,
and context-sensitive help. For these features, you must
have the tool installed.
\image beautifier_editor.png
\li Select \gui Tools > \gui Beautifier > \gui {Artistic Style},
\gui ClangFormat, or \gui Uncrustify > \gui {Format Current File}
to format the currently open file.
You can \l{Keyboard Shortcuts}{create keyboard shortcuts} for the
functions.
\endlist
In addition to the \gui {Format Current File} command, ClangFormat provides
the \gui {Format Selected Text} command. If you select it when no text is
selected, nothing happens. To format the entire file in this case, select
the \gui {Format entire file if no text was selected} check box in the
\gui {Clang Format} options.
*/
......@@ -55,10 +55,16 @@
can easily find and rename symbols and apply predefined actions to
refactor code.
\li \l{Beautifying Source Code}
Beautifying code means applying indentation and style to source
code files. You can use the Artistic Style, ClangFormat, or
Uncrustify tool to format source files.
\li \l{Configuring the Editor}
You can change the fonts, colors, highlighting, and indentation.
If you are used to the the Vim editor, you can even run the main
If you are used to the Vim editor, you can even run the main
editor in a manner similar to it in the \gui{FakeVim} mode.
\endlist
......
......@@ -24,7 +24,7 @@
/*!
\contentspage index.html
\previouspage creator-editor-refactoring.html
\previouspage creator-beautifier.html
\page creator-editor-options.html
\nextpage creator-editor-options-text.html
......
......@@ -1430,7 +1430,7 @@
\contentspage index.html
\previouspage creator-editor-locator.html
\page creator-editor-refactoring.html
\nextpage creator-editor-options.html
\nextpage creator-beautifier.html
\title Refactoring
......
......@@ -84,6 +84,12 @@
requires the BlackBerry NDK or the QNX SDK to be installed on the
development PC.
\li \l{Connecting Windows Runtime Devices}
You can build Windows Store Apps and run them on Windows Phones, the
Windows Phone Emulator, or the Windows computer in Modern UI mode.
You can install the necessary tool chains as part of Qt 5.3.
\endlist
*/
......@@ -16,6 +16,8 @@
\li QNX
\li Windows Runtime (including Windows Phone)
\endlist
The following table summarizes operating system support for developing
......@@ -55,6 +57,11 @@
\li Yes
\li Yes
\li Yes (see \l{Running on QNX Devices} for limitations)
\row
\li Windows Runtime
\li No
\li No
\li Yes
\endtable
\note Symbian support has been removed from \QC 2.6. To develop for Symbian,
......
......@@ -24,7 +24,7 @@
/*!
\contentspage index.html
\previouspage creator-developing-qnx.html
\previouspage creator-developing-winrt.html
\page creator-build-process-customizing.html
\nextpage creator-testing.html
......
......@@ -22,7 +22,7 @@
\contentspage index.html
\previouspage creator-developing-ios.html
\page creator-developing-qnx.html
\nextpage creator-build-process-customizing.html
\nextpage creator-developing-winrt.html
\title Connecting QNX Devices
......
......@@ -200,6 +200,7 @@
\li \l{Searching with the Locator}
\endlist
\li \l{Refactoring}
\li \l{Beautifying Source Code}
\li \l{Configuring the Editor}
\list
\li \l{Specifying Text Editor Settings}
......@@ -226,6 +227,7 @@
\li \l{Connecting Embedded Linux Devices}
\li \l{Connecting iOS Devices}
\li \l{Connecting QNX Devices}
\li \l{Connecting Windows Runtime Devices}
\endlist
\li \l{Customizing the Build Process}
\endlist
......
/****************************************************************************
**
** Copyright (c) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator
**
**
** GNU Free Documentation License
**
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of this
** file.
**
**
****************************************************************************/
/*!
\contentspage index.html
\previouspage creator-developing-qnx.html
\page creator-developing-winrt.html
\nextpage creator-build-process-customizing.html
\title Connecting Windows Runtime Devices
You can build Windows Store Apps and run them on Windows Phones, Windows
Phone Emulator, or the Windows computer in Modern UI mode.
\QC uses the integrated \c windeployqt and \c winrtrunner tools to deploy
and run applications. You can also run the tools manually from the command
line.
The Qt 5.3 installer adds Windows Runtime and Windows Phone Qt versions to
\QC and creates the necessary kits.
\image creator-winrt-kits.png "WinRT kits"
To connect Windows Runtime devices:
\list 1
\li Select \gui Help > \gui {About Plugins} > \gui {Device Support} >
\gui WinRT to enable the experimental Winows Runtime plugin.
\li Restart \QC to be able to use the plugin.
\li To specify build settings:
\list 1
\li Open a project for an application you want to develop for the
device.
\li Select \gui Projects > \gui {Build & Run} > \gui {Add Kit} to
add a kit for building and running applications on Windows
Runtime devices (the local computer, for now) Windows Phones,
or the Windows Phone emulator.
\endlist
\li Select \gui Run to specify run settings.
Usually, you can use the default settings.
\endlist
*/
......@@ -714,6 +714,19 @@ class DumperBase:
warn("CANNOT CONVERT TYPE: %s" % type(addr))
return str(addr)
def tryPutArrayContents(self, typeobj, base, n):
enc = self.simpleEncoding(typeobj)
if not enc:
return False
size = n * typeobj.sizeof;
self.put('childtype="%s",' % typeobj)
self.put('addrbase="0x%x",' % toInteger(base))
self.put('addrstep="0x%x",' % toInteger(typeobj.sizeof))
self.put('arrayencoding="%s",' % enc)
self.put('arraydata="')
self.put(self.readMemory(base, size))
self.put('",')
return True
def putFormattedPointer(self, value):
#warn("POINTER: %s" % value)
......
......@@ -331,7 +331,11 @@ registerCommand("bbedit", bbedit)
def bb(args):
print(theDumper.run(args))
try:
print(theDumper.run(args))
except:
import traceback
traceback.print_exc()
registerCommand("bb", bb)
......@@ -409,11 +413,13 @@ class Dumper(DumperBase):
self.useDynamicType = "dyntype" in options
self.useFancy = "fancy" in options
self.forceQtNamespace = "forcens" in options
self.passExceptions = "pe" in options
#self.passExceptions = True
self.autoDerefPointers = "autoderef" in options
self.partialUpdate = "partial" in options
self.tooltipOnly = "tooltiponly" in options
self.fallbackQtVersion = 0x50200
#warn("NAMESPACE: '%s'" % self.qtNamespace())
#warn("VARIABLES: %s" % varList)
#warn("EXPANDED INAMES: %s" % self.expandedINames)
......@@ -495,6 +501,9 @@ class Dumper(DumperBase):
self.output.append(']')
self.typesToReport = {}
if "forcens" in options:
self.qtNamepaceToRport = self.qtNamespace()
if self.qtNamespaceToReport:
self.output.append(',qtnamespace="%s"' % self.qtNamespaceToReport)
self.qtNamespaceToReport = None
......@@ -846,7 +855,9 @@ class Dumper(DumperBase):
pass
# Older GDB ~7.4
try:
return gdb.parse_and_eval(symbolName)
address = gdb.parse_and_eval("&'%s'" % symbolName)
type = gdb.lookup_type(self.qtNamespace() + "QMetaObject")
return self.createPointerValue(address, type)
except:
return 0
......@@ -905,25 +916,28 @@ class Dumper(DumperBase):
def isQnxTarget(self):
return 'qnx' in gdb.TARGET_CONFIG.lower()
def qtVersion(self):
def qtVersionString(self):
try:
return str(gdb.lookup_symbol("qVersion")[0].value()())
except:
pass
try:
ns = self.qtNamespace()
version = str(gdb.parse_and_eval("((const char*(*)())'%s::qVersion')()" % ns))
(major, minor, patch) = version[version.find('"')+1:version.rfind('"')].split('.')
self.cachedQtVersion = 0x10000 * int(major) + 0x100 * int(minor) + int(patch)
return str(gdb.parse_and_eval("((const char*(*)())'%sqVersion')()" % ns))
except:
try:
# This will fail on Qt 5
gdb.execute("ptype QString::shared_null", to_string=True)
self.cachedQtVersion = 0x040800
except:
#self.cachedQtVersion = 0x050000
# Assume Qt 5.3 until we have a definitive answer.
return 0x050300
pass
return None
# Memoize good results.
self.qtVersion = lambda: self.cachedQtVersion
return self.cachedQtVersion
def qtVersion(self):
try:
version = self.qtVersionString()
(major, minor, patch) = version[version.find('"')+1:version.rfind('"')].split('.')
qtversion = 0x10000 * int(major) + 0x100 * int(minor) + int(patch)
self.qtVersion = lambda: qtversion
return qtversion
except:
# Use fallback until we have a better answer.
return self.fallbackQtVersion
def isQt3Support(self):
if self.qtVersion() >= 0x050000:
......@@ -1044,20 +1058,6 @@ class Dumper(DumperBase):
return Hex2EncodedFloat8
return None
def tryPutArrayContents(self, typeobj, base, n):
enc = self.simpleEncoding(typeobj)
if not enc:
return False
size = n * typeobj.sizeof;
self.put('childtype="%s",' % typeobj)
self.put('addrbase="0x%x",' % toInteger(base))
self.put('addrstep="0x%x",' % toInteger(typeobj.sizeof))
self.put('arrayencoding="%s",' % enc)
self.put('arraydata="')
self.put(self.readMemory(base, size))
self.put('",')
return True
def isReferenceType(self, typeobj):
return typeobj.code == gdb.TYPE_CODE_REF
......@@ -1560,29 +1560,32 @@ class Dumper(DumperBase):
self.importPlainDumper(printer)
def qtNamespace(self):
# FIXME: This only works when call from inside a Qt function frame.
namespace = ""
# This only works when called from a valid frame.
try:
cand = "QArrayData::shared_null"
symbol = gdb.lookup_symbol(cand)[0]
if symbol:
ns = symbol.name[:-len(cand)]
self.qtNamespaceToReport = ns
self.qtNamespace = lambda: ns
return ns
except:
pass
try:
out = gdb.execute("ptype QString::Null", to_string=True)
# The result looks like:
# "type = const struct myns::QString::Null {"
# " <no data fields>"
# "}"
pos1 = out.find("struct") + 7
pos2 = out.find("QString::Null")
if pos1 > -1 and pos2 > -1:
namespace = out[pos1:pos2]
# Doesn't work
#gdb.write('=qt-namespace-detected,ns="%s"' % namespace)
self.qtNamespaceToReport = namespace
self.cachedQtNamespace = namespace
self.qtNamespace = lambda: self.cachedQtNamespace
# This is Qt, but not 5.x.
cand = "QByteArray::shared_null"
symbol = gdb.lookup_symbol(cand)[0]
if symbol:
ns = symbol.name[:-len(cand)]
self.qtNamespaceToReport = ns
self.qtNamespace = lambda: ns
self.fallbackQtVersion = 0x40800
return ns
except:
pass
return namespace
return ""
def bbedit(self, args):
(typeName, expr, data) = args.split(',')
......
This diff is collapsed.
......@@ -402,10 +402,10 @@ def qdump__QDir(d, value):
def qdump__QFile(d, value):
# 9fc0965 changes the layout of the private structure
qtVersion = d.qtVersion()
if qtVersion >= 0x050300:
offset = 172 if d.is32bit() else 272
if qtVersion >= 0x050200:
offset = 176 if d.is32bit() else 272
elif qtVersion >= 0x050000:
offset = 176 if d.is32bit() else 280
offset = 180 if d.is32bit() else 280
else:
offset = 140 if d.is32bit() else 232
privAddress = d.extractPointer(d.addressOf(value) + d.ptrSize())
......
......@@ -66,17 +66,8 @@ Controls.CheckBox {
backendValue.value = checkBox.checked;
}
style: CheckBoxStyle {
spacing: 8
label: Controls.Label { text: control.text ; color: checkBox.textColor }
indicator: Item {
implicitWidth: 16
implicitHeight: 16
Image { source: "qrc:qmldesigner/images/checkbox_" +
(control.checked ? "checked": "unchecked") +
(control.pressed ? "_pressed": "") + ".png" }
}
} //control.pressed ? "qrc:qmldesigner/images/checkbox_unchecked_pressed.png" :
style: CustomCheckBoxStyle {
}
}
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
import QtQuick 2.1
import QtQuick.Controls 1.1 as Controls
import QtQuick.Controls.Styles 1.1
CheckBoxStyle {
spacing: 8
label: Controls.Label { text: control.text ; color: checkBox.textColor }
indicator: Item {
implicitWidth: 16