Merge remote-tracking branch 'origin/2.5'

This commit is contained in:
Eike Ziller
2012-04-26 07:06:04 +02:00
61 changed files with 21096 additions and 12140 deletions

1
.gitignore vendored
View File

@@ -76,6 +76,7 @@ doc/html/*
doc/html-dev/* doc/html-dev/*
doc/api/html/* doc/api/html/*
doc/pluginhowto/html/* doc/pluginhowto/html/*
dist/gdb/python
.rcc .rcc
.pch .pch
dist/gdb/qtcreator-* dist/gdb/qtcreator-*

43
dist/changes-2.5.0 vendored
View File

@@ -15,6 +15,13 @@ General
* Add Execute filter to the locator, for executing external commands [by * Add Execute filter to the locator, for executing external commands [by
Yuchen Deng] Yuchen Deng]
Experimental Plugins
* Show todo items in files [by Dmitry Savchenko initial version by
Vasiliy Sorokin]
* Support for autotools-based projects [by Patricia Santana Cruz]
Go to Help->About plugins to enable these!
Editing Editing
* Use the QML/JS editor for opening json files (QTCREATORBUG-4639) * Use the QML/JS editor for opening json files (QTCREATORBUG-4639)
* Add basic JSON validation according to the draft at * Add basic JSON validation according to the draft at
@@ -32,8 +39,6 @@ Editing
* Fix layout update when folding/unfolding regions (QTCREATORBUG-6666) * Fix layout update when folding/unfolding regions (QTCREATORBUG-6666)
* Fix position of code-assist popup when cursor is outside viewport * Fix position of code-assist popup when cursor is outside viewport
(QTCREATORBUG-6843) (QTCREATORBUG-6843)
* Add experimental plugin for showing "TODO"s in files
[by Dmitry Savchenko, initial version by Vasiliy Sorokin]
* Add "Open with" context menu in resource editor (QTCREATORBUG-4224) * Add "Open with" context menu in resource editor (QTCREATORBUG-4224)
* Add task indicators in the left margin of a line * Add task indicators in the left margin of a line
@@ -166,7 +171,41 @@ FakeVim
Version control plugins Version control plugins
* Rename the ScmGit plugin to Git * Rename the ScmGit plugin to Git
* Rename the VCSBase plugin to VcsBase * Rename the VCSBase plugin to VcsBase
* URL and email support in log editors [by Hugues Delorme]
* Completion of classes, files, methods and namespace in commit message
editor [by Hugues Delorme]
* Show icons for files in submit editor [by Hugues Delorme]
Additional credits go to: Additional credits go to:
Adam Treat (editor improvements)
Andre Hartmann (generic project improvements)
Axsia (translation)
Bai Jing (translation)
Bojan Petrovic (C++ quickfix)
Campbell Barton (color scheme fix)
cnavarro (debugger fix)
Denis Mingulov (Qt5 related fix, debugger fixes, editor fix)
Dmitry Savchenko (todo plugin)
Element9 (C++ quickfix)
Felix Geyer (debugger fix)
Flex Ferrum (C++0x improvements)
Francois Ferrand (Generic Project improvements, C++ improvements)
Hugues Delorme (version control system improvements and fixes)
Jan Kerekes (unit testing)
Joe Hermaszewski (debugging impromevents)
Konstantin Tokarev (generic project fix, Mac related fix)
Martin Aumüller (fakevim fix)
Nicolas Arnaud-Cormos (many fixes, analyzer work)
Orgad Shaneh (*many* bug fixes and lots of polish)
Patricia Santana Cruz (autotools plugin)
Ruben Van Boxem (mingw fixes)
Sergey Belyashov (cmake translation fix)
Steve King (WinCE support fixed)
Tobias Nätterlund (small improment to wizards, QNX work)
tomdeblauwe (whitespace fixes)
Tommi Asp (C++ fix, Symbian fixes)
Vasiliy Sorokin (todo plugin)
Victor Ostashevsky (bug fixes and translations)
Yuchen Deng (*many* bug fixes, exectute command support for the locator)

View File

@@ -72,7 +72,7 @@ ${gdbtargets}: ${targetdir}/gdb-%: ${staging}/gdb-${version}/configure ${staging
export PATH="${staging}/bin/:$$PATH" && \ export PATH="${staging}/bin/:$$PATH" && \
export LDFLAGS="-pthread -lm" && \ export LDFLAGS="-pthread -lm" && \
cd ${staging}/gdb-${version}-$* && \ cd ${staging}/gdb-${version}-$* && \
${staging}/gdb-${version}/configure --disable-nls --target=$* --with-python=${staging} --with-libexpat-prefix=${staging} && \ ${staging}/gdb-${version}/configure --disable-nls --target=$* --disable-werror --with-python=${staging} --with-libexpat-prefix=${staging} && \
sleep 3 && \ sleep 3 && \
${MAKE} MAKEFLAGS+=-j1 && \ ${MAKE} MAKEFLAGS+=-j1 && \
strip gdb/gdb && \ strip gdb/gdb && \
@@ -84,7 +84,7 @@ ${targetdir}/gdb: ${staging}/gdb-${version}/configure ${staging}/lib/libpython${
export PATH="${staging}/bin/:$$PATH" && \ export PATH="${staging}/bin/:$$PATH" && \
export LDFLAGS="-pthread -lm" && \ export LDFLAGS="-pthread -lm" && \
cd ${staging}/gdb-${version}-${arch} && \ cd ${staging}/gdb-${version}-${arch} && \
${staging}/gdb-${version}/configure --disable-nls --with-python=${staging} --with-libexpat-prefix=${staging} && \ ${staging}/gdb-${version}/configure --disable-nls --disable-werror --with-python=${staging} --with-libexpat-prefix=${staging} && \
${MAKE} MAKEFLAGS+=-j1 && \ ${MAKE} MAKEFLAGS+=-j1 && \
strip gdb/gdb && \ strip gdb/gdb && \
cp -T gdb/gdb ${targetdir}/gdb cp -T gdb/gdb ${targetdir}/gdb

View File

@@ -35,6 +35,18 @@ maketargetdir:
makestagingdir: makestagingdir:
test -e ${staging} || mkdir ${staging} test -e ${staging} || mkdir ${staging}
checkunzip:
unzip -v &> /dev/null || mingw-get install msys-unzip
${source}/python.zip: | makesourcedir checkwget
cd ${source} && \
wget http://download.qt.nokia.com/misc/gdb/7.4/build-prerequisits/python.zip && \
touch python.zip
${broot}/python/python.exe: ${source}/python.zip | checkunzip
cd ${broot} && \
unzip ${source}/python.zip
checkwget: checkwget:
wget -V &> /dev/null || mingw-get install msys-wget-bin wget -V &> /dev/null || mingw-get install msys-wget-bin
@@ -76,13 +88,13 @@ ${staging}/lib/libexpat.a: ${source}/expat-${expatversion}.tar.gz | makestagingd
./configure -prefix=${staging} --enable-static && \ ./configure -prefix=${staging} --enable-static && \
${MAKE} && ${MAKE} install ${MAKE} && ${MAKE} install
${gdbtargets}: ${targetdir}/gdb-%: ${staging}/lib/libexpat.a ${staging}/lib/libiconv.a ${staging}/gdb-${version}/configure | maketargetdir ${gdbtargets}: ${targetdir}/gdb-%: ${staging}/lib/libexpat.a ${staging}/lib/libiconv.a ${staging}/gdb-${version}/configure | maketargetdir ${broot}/python/python.exe
test -e ${staging}/gdb-${version}-$* || mkdir ${staging}/gdb-${version}-$* test -e ${staging}/gdb-${version}-$* || mkdir ${staging}/gdb-${version}-$*
export PYTHONHOME=${pydir} && \ export PYTHONHOME=${pydir} && \
LDFLAGS="L${pydir} -lpthread -ldl -lutil -lpython27" && \ LDFLAGS="L${pydir} -lpthread -ldl -lutil -lpython27" && \
CFLAGS="-I${pydir}/include" && \ CFLAGS="-I${pydir}/include" && \
cd ${staging}/gdb-${version}-$* && \ cd ${staging}/gdb-${version}-$* && \
${staging}/gdb-${version}/configure --target=$* --disable-nls \ ${staging}/gdb-${version}/configure --target=$* --disable-nls --disable-werror \
--with-libiconv-prefix=${staging} \ --with-libiconv-prefix=${staging} \
--with-expat --with-libexpat-prefix=${staging} \ --with-expat --with-libexpat-prefix=${staging} \
--with-python=${pydir} &&\ --with-python=${pydir} &&\
@@ -90,12 +102,11 @@ ${gdbtargets}: ${targetdir}/gdb-%: ${staging}/lib/libexpat.a ${staging}/lib/libi
strip gdb/gdb.exe && \ strip gdb/gdb.exe && \
cp -T gdb/gdb.exe ${targetdir}/gdb-$*.exe cp -T gdb/gdb.exe ${targetdir}/gdb-$*.exe
package: ${gdbtargets} package: ${gdbtargets} ${broot}/python/python.exe
cp ${staging}/bin/libiconv* ${targetdir} && \ cp ${staging}/bin/libiconv* ${targetdir} && \
cp ${staging}/bin/libexpat* ${targetdir} && \ cp ${staging}/bin/libexpat* ${targetdir} && \
cp ${pydir}/python*.dll ${targetdir} && \ cp ${pydir}/python*.dll ${targetdir} && \
cp -r ${pydir}/lib ${targetdir} && \ cp -r ${pydir}/lib ${targetdir} && \
cp -r ${pydir}/include ${targetdir} && \
mv ${targetdir} ${targetdir}-${arch} && \ mv ${targetdir} ${targetdir}-${arch} && \
tar cvzf ${packagename} qtcreator-gdb-${version}-${arch} && \ tar cvzf ${packagename} qtcreator-gdb-${version}-${arch} && \
mv ${targetdir}-${arch} ${targetdir} mv ${targetdir}-${arch} ${targetdir}

View File

@@ -68,7 +68,7 @@ ${gdbtargets}: ${targetdir}/gdb-%: ${staging}/gdb-${version}/configure ${staging
export PYTHONHOME=${staging} && \ export PYTHONHOME=${staging} && \
export PATH="${staging}/bin/:$$PATH" && \ export PATH="${staging}/bin/:$$PATH" && \
cd ${staging}/gdb-${version}-$* && \ cd ${staging}/gdb-${version}-$* && \
${staging}/gdb-${version}/configure --disable-nls --target=$* --with-python=${staging} --with-libexpat-prefix=${staging} && \ ${staging}/gdb-${version}/configure --disable-nls --disable-werror --target=$* --with-python=${staging} --with-libexpat-prefix=${staging} && \
${MAKE} MAKEFLAGS+=-j1 && \ ${MAKE} MAKEFLAGS+=-j1 && \
strip gdb/gdb && \ strip gdb/gdb && \
mv gdb/gdb ${targetdir}/gdb-$* mv gdb/gdb ${targetdir}/gdb-$*
@@ -78,7 +78,7 @@ ${targetdir}/gdb: ${staging}/gdb-${version}/configure ${staging}/lib/libpython${
export PYTHONHOME=${staging} && \ export PYTHONHOME=${staging} && \
export PATH="${staging}/bin/:$$PATH" && \ export PATH="${staging}/bin/:$$PATH" && \
cd ${staging}/gdb-${version}-${arch} && \ cd ${staging}/gdb-${version}-${arch} && \
${staging}/gdb-${version}/configure --disable-nls --with-python=${staging} --with-libexpat-prefix=${staging} --disable-werror && \ ${staging}/gdb-${version}/configure --disable-nls --disable-werror --with-python=${staging} --with-libexpat-prefix=${staging} && \
${MAKE} MAKEFLAGS+=-j1 && \ ${MAKE} MAKEFLAGS+=-j1 && \
strip gdb/gdb && \ strip gdb/gdb && \
mv gdb/gdb ${targetdir}/gdb mv gdb/gdb ${targetdir}/gdb

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 920 B

After

Width:  |  Height:  |  Size: 728 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 847 B

After

Width:  |  Height:  |  Size: 677 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 616 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 878 B

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -33,7 +33,8 @@
\title Using Valgrind Code Analysis Tools \title Using Valgrind Code Analysis Tools
\QC integrates Valgrind code analysis tools for detecting memory leaks and \QC integrates \l{http://valgrind.org/info/tools.html}{Valgrind code
analysis tools} for detecting memory leaks and
profiling function execution. You must download and install them separately profiling function execution. You must download and install them separately
to use them from \QC. to use them from \QC.

View File

@@ -34,7 +34,7 @@
\title Detecting Memory Leaks \title Detecting Memory Leaks
You can use the Memcheck tool included in the You can use the Memcheck tool included in the
\l{http://valgrind.org/info/tools.html}{Valgrind tool suite} to detect Valgrind tool suite to detect
problems that are related to memory management in applications. problems that are related to memory management in applications.
\note Memcheck is supported locally on Linux and Mac OS. You can run it on \note Memcheck is supported locally on Linux and Mac OS. You can run it on
@@ -60,7 +60,7 @@
\o Use the application to analyze it. \o Use the application to analyze it.
\o Select the \o Select the
\inlineimage qtcreator-analyzer-stop-button.png "Stop button" \inlineimage qtcreator-debug-button-stop.png "Stop button"
button to view the results of the analysis in the button to view the results of the analysis in the
\gui {Analysis} view. \gui {Analysis} view.
@@ -151,7 +151,7 @@
\o Use the application to analyze it. \o Use the application to analyze it.
\o Select the \o Select the
\inlineimage qtcreator-analyzer-stop-button.png "Stop button" \inlineimage qtcreator-debug-button-stop.png "Stop button"
button to view the results of the analysis in the \gui Profile button to view the results of the analysis in the \gui Profile
view. view.

View File

@@ -50,21 +50,24 @@
\o Select \gui {Analyze > QML Profiler} to profile the current \o Select \gui {Analyze > QML Profiler} to profile the current
application. application.
\o Select the \gui Start button (1) to start the application from the \o Select the
\inlineimage qtcreator-analyze-start-button.png
(\gui Start) button to start the application from the
QML Profiler. QML Profiler.
\image qtcreator-qml-performance-monitor-toolbar.png "QML Profiler toolbar"
\note If data collection does not start automatically, select the \note If data collection does not start automatically, select the
\gui {Enable Profiling} button (3). \inlineimage qtcreator-analyzer-button.png
(\gui {Enable Profiling}) button.
\endlist \endlist
When you start analyzing an application, the application is launched, and When you start analyzing an application, the application is launched, and
the QML Profiler immediately begins to collect data. This is indicated by the QML Profiler immediately begins to collect data. This is indicated by
the time running in the \gui Elapsed field (4). the time running in the \gui Elapsed field.
Data is collected until you select the \gui Stop button (2). Data collection Data is collected until you select the
\inlineimage qtcreator-debug-button-stop.png
(\gui Stop) button. Data collection
takes time, and therefore, there might be a delay takes time, and therefore, there might be a delay
before the data is displayed. before the data is displayed.
@@ -73,7 +76,7 @@
The application continues to run for some seconds, after which it is stopped The application continues to run for some seconds, after which it is stopped
automatically. If you exit the application, the data is not sent. automatically. If you exit the application, the data is not sent.
Select the \gui {Disable Profiling} button (3) to disable the automatic Select the \gui {Disable Profiling} button to disable the automatic
start of the data collection when an start of the data collection when an
application is launched. Data collection starts when you select the button application is launched. Data collection starts when you select the button
again. again.

View File

@@ -97,7 +97,7 @@
additional tools in \QC \gui Options. additional tools in \QC \gui Options.
You can use \QC variables in the fields that you can select from You can use \QC variables in the fields that you can select from
lists of available \QC variables. lists of available \QC variables (1).
\image qtcreator-external-tools.png "External Tools options" \image qtcreator-external-tools.png "External Tools options"

View File

@@ -123,6 +123,7 @@ Project {
name: "qtcreator" name: "qtcreator"
type: ["application", "installed_content"] type: ["application", "installed_content"]
destination: "bin" destination: "bin"
consoleApplication: qbs.debugInformation
cpp.rpaths: ["$ORIGIN/../lib"] cpp.rpaths: ["$ORIGIN/../lib"]
cpp.defines: project.additionalCppDefines cpp.defines: project.additionalCppDefines

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -151,11 +151,19 @@ int containerSize(KnownType kt, const SymbolGroupValue &v)
break; break;
case KT_QLinkedList: case KT_QLinkedList:
case KT_QHash: case KT_QHash:
case KT_QMap:
case KT_QVector:
if (const SymbolGroupValue sizeV = v["d"]["size"]) if (const SymbolGroupValue sizeV = v["d"]["size"])
return sizeV.intValue(); return sizeV.intValue();
break; break;
case KT_QMap:
case KT_QVector: {
// Inheritance from QVectorTypedData, QMapData<> in Qt 5.
const SymbolGroupValue sizeV =
QtInfo::get(v.context()).version >= 5 ?
v["d"][unsigned(0)]["size"] : v["d"]["size"];
if (sizeV)
return sizeV.intValue();
}
break;
case KT_QMultiHash: case KT_QMultiHash:
if (const SymbolGroupValue qHash = v[unsigned(0)]) if (const SymbolGroupValue qHash = v[unsigned(0)])
return containerSize(KT_QHash, qHash); return containerSize(KT_QHash, qHash);
@@ -646,16 +654,33 @@ static inline AbstractSymbolGroupNodePtrVector
static inline AbstractSymbolGroupNodePtrVector static inline AbstractSymbolGroupNodePtrVector
qVectorChildList(SymbolGroupNode *n, int count, const SymbolGroupValueContext &ctx) qVectorChildList(SymbolGroupNode *n, int count, const SymbolGroupValueContext &ctx)
{ {
if (count) { if (!count)
// QVector<T>: p/array is declared as array of T. Dereference first return AbstractSymbolGroupNodePtrVector();
// element to obtain address.
const SymbolGroupValue vec(n, ctx); const SymbolGroupValue vec(n, ctx);
const int qtVersion = QtInfo::get(vec.context()).version;
if (qtVersion < 5) {
// Qt 4: QVector<T>: p/array is declared as array of T. Dereference first
// element to obtain address.
if (const SymbolGroupValue firstElementV = vec["p"]["array"][unsigned(0)]) { if (const SymbolGroupValue firstElementV = vec["p"]["array"][unsigned(0)]) {
if (const ULONG64 arrayAddress = firstElementV.address()) { if (const ULONG64 arrayAddress = firstElementV.address()) {
const std::string fixedInnerType = fixInnerType(firstElementV.type(), vec); const std::string fixedInnerType = fixInnerType(firstElementV.type(), vec);
return arrayChildList(n->symbolGroup(), arrayAddress, n->module(), fixedInnerType, count); return arrayChildList(n->symbolGroup(), arrayAddress, n->module(), fixedInnerType, count);
} }
} }
return AbstractSymbolGroupNodePtrVector();
}
// Qt 5: Data are located in a pool behind 'd' (similar to QString,
// QByteArray).
const SymbolGroupValue dV = vec["d"][unsigned(0)];
const SymbolGroupValue offsetV = dV["offset"];
if (!dV || !offsetV)
return AbstractSymbolGroupNodePtrVector();
const ULONG64 arrayAddress = dV.address() + offsetV.intValue();
std::vector<std::string> innerTypes = SymbolGroupValue::innerTypesOf(vec.type());
if (arrayAddress && !innerTypes.empty()) {
return arrayChildList(n->symbolGroup(), arrayAddress, n->module(),
fixInnerType(innerTypes.front(), vec),
count);
} }
return AbstractSymbolGroupNodePtrVector(); return AbstractSymbolGroupNodePtrVector();
} }
@@ -939,6 +964,8 @@ static inline AbstractSymbolGroupNodePtrVector
if (!count) if (!count)
return AbstractSymbolGroupNodePtrVector(); return AbstractSymbolGroupNodePtrVector();
if (QtInfo::get(v.context()).version >= 5) // ### fixme: Qt 5 map is a rb tree.
return AbstractSymbolGroupNodePtrVector();
// Get node type: 'class namespace::QMap<K,T>' // Get node type: 'class namespace::QMap<K,T>'
// ->'QtCored4!namespace::QMapNode<K,T>' // ->'QtCored4!namespace::QMapNode<K,T>'
// Note: Any types QMapNode<> will not be found without modules! // Note: Any types QMapNode<> will not be found without modules!

View File

@@ -1414,7 +1414,8 @@ struct QtStringAddressData
/* Helper to determine the location and size of the data of /* Helper to determine the location and size of the data of
* QStrings/QByteArrays for versions 4,5. In Qt 4, 'd' has a 'data' * QStrings/QByteArrays for versions 4,5. In Qt 4, 'd' has a 'data'
* pointer. In Qt 5, the d-elements and the data are in a storage pool * pointer. In Qt 5, the d-elements and the data are in a storage pool
* and the data are at an offset behind the d-structures. */ * and the data are at an offset behind the d-structures (QString,
* QByteArray, QVector). */
QtStringAddressData readQtStringAddressData(const SymbolGroupValue &dV, QtStringAddressData readQtStringAddressData(const SymbolGroupValue &dV,
int qtMajorVersion) int qtMajorVersion)
{ {
@@ -1431,15 +1432,13 @@ QtStringAddressData readQtStringAddressData(const SymbolGroupValue &dV,
} else { } else {
// Qt 5: Memory pool after the data element. // Qt 5: Memory pool after the data element.
const SymbolGroupValue offsetV = dV["offset"]; const SymbolGroupValue offsetV = dV["offset"];
const SymbolGroupValue arrayV = dV["d"]; if (!offsetV)
if (!offsetV || !arrayV)
return QtStringAddressData(); return QtStringAddressData();
int offset = offsetV.intValue(); // Take the address for QTypeArrayData of QByteArray, else
if (arrayV.type().find("short") != std::string::npos) // pointer value of D-pointer.
offset /= sizeof(short); // QString: offset is in short[]. const ULONG64 baseAddress = SymbolGroupValue::isPointerType(dV.type()) ?
result.address = arrayV.address() dV.pointerValue() : dV.address();
+ SymbolGroupValue::pointerDiffSize() result.address = baseAddress + offsetV.intValue();
+ offset;
} }
return result; return result;
} }
@@ -1578,7 +1577,10 @@ static inline bool dumpQByteArray(const SymbolGroupValue &v, std::wostream &str)
char *memory; char *memory;
unsigned fullSize; unsigned fullSize;
unsigned size; unsigned size;
if (!readQt5StringData(dV, qtInfo.version, false, 10240, &fullSize, &size, &memory)) const SymbolGroupValue typeArrayV = dV[unsigned(0)];
if (!typeArrayV)
return false;
if (!readQt5StringData(typeArrayV, qtInfo.version, false, 10240, &fullSize, &size, &memory))
return false; return false;
if (size) { if (size) {
// Emulate CDB's behavior of replacing unprintable characters // Emulate CDB's behavior of replacing unprintable characters

View File

@@ -95,8 +95,8 @@ namespace Internal {
class CppClassLabel : public QLabel class CppClassLabel : public QLabel
{ {
public: public:
CppClassLabel(CPPEditorWidget *editor, QWidget *parent) CppClassLabel(QWidget *parent)
: QLabel(parent), m_editor(editor) : QLabel(parent)
{} {}
void setup(CppClass *cppClass) void setup(CppClass *cppClass)
@@ -108,10 +108,15 @@ public:
private: private:
void mousePressEvent(QMouseEvent *) void mousePressEvent(QMouseEvent *)
{ {
m_editor->openLink(m_link); if (m_link.fileName.isEmpty())
return;
TextEditor::BaseTextEditorWidget::openEditorAt(m_link.fileName,
m_link.line,
m_link.column,
Constants::CPPEDITOR_ID);
} }
CPPEditorWidget *m_editor;
CPPEditorWidget::Link m_link; CPPEditorWidget::Link m_link;
}; };
@@ -133,7 +138,7 @@ CppTypeHierarchyWidget::CppTypeHierarchyWidget(Core::IEditor *editor) :
if (CPPEditor *cppEditor = qobject_cast<CPPEditor *>(editor)) { if (CPPEditor *cppEditor = qobject_cast<CPPEditor *>(editor)) {
m_cppEditor = static_cast<CPPEditorWidget *>(cppEditor->widget()); m_cppEditor = static_cast<CPPEditorWidget *>(cppEditor->widget());
m_inspectedClass = new CppClassLabel(m_cppEditor, this); m_inspectedClass = new CppClassLabel(this);
m_inspectedClass->setMargin(5); m_inspectedClass->setMargin(5);
layout->addWidget(m_inspectedClass); layout->addWidget(m_inspectedClass);
m_model = new QStandardItemModel(this); m_model = new QStandardItemModel(this);

View File

@@ -13,6 +13,7 @@ QtcPlugin {
Depends { name: "Locator" } Depends { name: "Locator" }
Depends { name: "cpp" } Depends { name: "cpp" }
cpp.defines: base.concat(["QT_NO_CAST_FROM_ASCII"])
cpp.includePaths: [ cpp.includePaths: [
".", ".",
"gitorious", "gitorious",

View File

@@ -1863,18 +1863,9 @@ void Qt4ProFileNode::applyEvaluate(EvalResult evalResult, bool async)
newVarValues[DefinesVar] = m_readerExact->values(QLatin1String("DEFINES")); newVarValues[DefinesVar] = m_readerExact->values(QLatin1String("DEFINES"));
newVarValues[IncludePathVar] = includePaths(m_readerExact); newVarValues[IncludePathVar] = includePaths(m_readerExact);
newVarValues[CppFlagsVar] = m_readerExact->values("QMAKE_CXXFLAGS"); newVarValues[CppFlagsVar] = m_readerExact->values("QMAKE_CXXFLAGS");
newVarValues[CppHeaderVar] = m_readerExact->absoluteFileValues(QLatin1String("HEADERS"), newVarValues[CppHeaderVar] = fileListForVar(m_readerExact, m_readerCumulative, QLatin1String("HEADERS"), m_projectDir);
m_projectDir, newVarValues[CppSourceVar] = fileListForVar(m_readerExact, m_readerCumulative, QLatin1String("SOURCES"), m_projectDir);
QStringList() << m_projectDir, newVarValues[ObjCSourceVar] = fileListForVar(m_readerExact, m_readerCumulative, QLatin1String("OBJECTIVE_SOURCES"), m_projectDir);
0);
newVarValues[CppSourceVar] = m_readerExact->absoluteFileValues(QLatin1String("SOURCES"),
m_projectDir,
QStringList() << m_projectDir,
0);
newVarValues[ObjCSourceVar] = m_readerExact->absoluteFileValues(QLatin1String("OBJECTIVE_SOURCES"),
m_projectDir,
QStringList() << m_projectDir,
0);
newVarValues[UiDirVar] = QStringList() << uiDirPath(m_readerExact); newVarValues[UiDirVar] = QStringList() << uiDirPath(m_readerExact);
newVarValues[MocDirVar] = QStringList() << mocDirPath(m_readerExact); newVarValues[MocDirVar] = QStringList() << mocDirPath(m_readerExact);
newVarValues[PkgConfigVar] = m_readerExact->values(QLatin1String("PKGCONFIG")); newVarValues[PkgConfigVar] = m_readerExact->values(QLatin1String("PKGCONFIG"));
@@ -1925,6 +1916,23 @@ void Qt4ProFileNode::applyEvaluate(EvalResult evalResult, bool async)
m_readerCumulative = 0; m_readerCumulative = 0;
} }
QStringList Qt4ProFileNode::fileListForVar(QtSupport::ProFileReader *readerExact, QtSupport::ProFileReader *readerCumulative,
const QString &varName, const QString &projectDir) const
{
QStringList result;
result = readerExact->absoluteFileValues(varName,
projectDir,
QStringList() << projectDir,
0);
if (readerCumulative)
result += readerCumulative->absoluteFileValues(varName,
projectDir,
QStringList() << projectDir,
0);
result.removeDuplicates();
return result;
}
// This function is triggered after a build, and updates the state ui files // This function is triggered after a build, and updates the state ui files
// It does so by storing a modification time for each ui file we know about. // It does so by storing a modification time for each ui file we know about.

View File

@@ -393,6 +393,8 @@ private:
void createUiCodeModelSupport(); void createUiCodeModelSupport();
QStringList updateUiFiles(); QStringList updateUiFiles();
QStringList fileListForVar(QtSupport::ProFileReader *readerExact, QtSupport::ProFileReader *readerCumulative,
const QString &varName, const QString &projectDir) const;
QString uiDirPath(QtSupport::ProFileReader *reader) const; QString uiDirPath(QtSupport::ProFileReader *reader) const;
QString mocDirPath(QtSupport::ProFileReader *reader) const; QString mocDirPath(QtSupport::ProFileReader *reader) const;
QStringList includePaths(QtSupport::ProFileReader *reader) const; QStringList includePaths(QtSupport::ProFileReader *reader) const;

View File

@@ -113,7 +113,8 @@ void QtOptionsPage::apply()
return; return;
m_widget->finish(); m_widget->finish();
m_widget->apply(); QtVersionManager *vm = QtVersionManager::instance();
vm->setNewQtVersions(m_widget->versions());
} }
bool QtOptionsPage::matches(const QString &s) const bool QtOptionsPage::matches(const QString &s) const
@@ -1048,18 +1049,6 @@ void QtOptionsPageWidget::finish()
fixQtVersionName(indexForTreeItem(item)); fixQtVersionName(indexForTreeItem(item));
} }
void QtOptionsPageWidget::apply()
{
disconnect(QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
this, SLOT(updateQtVersions(QList<int>,QList<int>,QList<int>)));
QtVersionManager *vm = QtVersionManager::instance();
vm->setNewQtVersions(versions());
connect(QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
this, SLOT(updateQtVersions(QList<int>,QList<int>,QList<int>)));
}
/* Checks that the qt version name is unique /* Checks that the qt version name is unique
* and otherwise changes the name * and otherwise changes the name
* *

View File

@@ -68,7 +68,6 @@ public:
~QtOptionsPageWidget(); ~QtOptionsPageWidget();
QList<BaseQtVersion *> versions() const; QList<BaseQtVersion *> versions() const;
void finish(); void finish();
void apply();
QString searchKeywords() const; QString searchKeywords() const;
virtual bool eventFilter(QObject *o, QEvent *e); virtual bool eventFilter(QObject *o, QEvent *e);

View File

@@ -58,7 +58,7 @@ class QTSUPPORT_EXPORT QtVersionManager : public QObject
Q_OBJECT Q_OBJECT
// for getUniqueId(); // for getUniqueId();
friend class BaseQtVersion; friend class BaseQtVersion;
friend class Internal::QtOptionsPageWidget; friend class Internal::QtOptionsPage;
public: public:
static QtVersionManager *instance(); static QtVersionManager *instance();
QtVersionManager(); QtVersionManager();

View File

@@ -14,7 +14,7 @@ QtcPlugin {
Depends { name: "QmlJs" } Depends { name: "QmlJs" }
Depends { name: "cpp" } Depends { name: "cpp" }
cpp.defines: base.concat(["QT_NO_CAST_TO_ASCII"]) cpp.defines: base.concat(["QT_NO_CAST_FROM_ASCII"])
cpp.includePaths: [ cpp.includePaths: [
"..", "..",
"../../libs", "../../libs",

View File

@@ -38,3 +38,13 @@ def checkSyntaxError(issuesView, expectedTextsArray, warnIfMoreIssues = True):
def checkIfObjectExists(name, shouldExist = True, timeout = 3000): def checkIfObjectExists(name, shouldExist = True, timeout = 3000):
return waitFor("object.exists(name) == shouldExist", timeout) return waitFor("object.exists(name) == shouldExist", timeout)
# change autocomplete options to manual
def changeAutocompleteToManual():
invokeMenuItem("Tools", "Options...")
mouseClick(waitForObjectItem(":Options_QListView", "Text Editor"), 5, 5, 0, Qt.LeftButton)
clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Completion")
ensureChecked(waitForObject(":Behavior.Autocomplete common prefix_QCheckBox"), False)
selectFromCombo(":Behavior.completionTrigger_QComboBox", "Manually")
verifyEnabled(":Options.OK_QPushButton")
clickButton(waitForObject(":Options.OK_QPushButton"))

View File

@@ -43,15 +43,8 @@ def main():
"Step 4: Verifying if: Word 'void' is completed because only one option is available.") "Step 4: Verifying if: Word 'void' is completed because only one option is available.")
# Step 5: From "Tools -> Options -> Text Editor -> Completion" select Activate completion Manually, # Step 5: From "Tools -> Options -> Text Editor -> Completion" select Activate completion Manually,
# uncheck Autocomplete common prefix and press Apply and then Ok . Return to Edit mode. # uncheck Autocomplete common prefix and press Apply and then Ok . Return to Edit mode.
invokeMenuItem("Tools", "Options...") test.log("Step 5: Change Code Completion settings")
waitForObjectItem(":Options_QListView", "Text Editor") changeAutocompleteToManual()
clickItem(":Options_QListView", "Text Editor", 5, 5, 0, Qt.LeftButton)
clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Completion")
clickButton(waitForObject(":Behavior.Autocomplete common prefix_QCheckBox"))
selectFromCombo(":Behavior.completionTrigger_QComboBox", "Manually")
test.verify(object.exists(":Options.OK_QPushButton"),
"Step 5: Verifying if: Code completion preferences can be changed.")
clickButton(waitForObject(":Options.OK_QPushButton"))
# Step 6: Insert text "ret" and press Ctrl+Space. # Step 6: Insert text "ret" and press Ctrl+Space.
editorWidget = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") editorWidget = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
mouseClick(editorWidget, 5, 5, 0, Qt.LeftButton) mouseClick(editorWidget, 5, 5, 0, Qt.LeftButton)

View File

@@ -0,0 +1 @@
QT_PLATFORM_PLUGIN=nonesuch

View File

@@ -0,0 +1,19 @@
:Behavior.Autocomplete common prefix_QCheckBox {container=':CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox' name='partiallyComplete' text='Autocomplete common prefix' type='QCheckBox' visible='1'}
:Behavior.completionTrigger_QComboBox {container=':CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox' name='completionTrigger' type='QComboBox' visible='1'}
:CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox {container=':qt_tabwidget_stackedwidget.CppTools__Internal__CompletionSettingsPage_QWidget' name='groupBox' title='Behavior' type='QGroupBox' visible='1'}
:New Qt Quick Application.Add to version control:_QLabel {name='addToVersionControlLabel' text='Add to version control:' type='QLabel' visible='1'}
:Next_QPushButton {name='__qt__passive_wizardbutton1' text~='(Next.*|Continue)' type='QPushButton' visible='1'}
:Options.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Options_Core::Internal::SettingsDialog'}
:Options.qt_tabwidget_stackedwidget_QStackedWidget {name='qt_tabwidget_stackedwidget' type='QStackedWidget' visible='1' window=':Options_Core::Internal::SettingsDialog'}
:Options.qt_tabwidget_tabbar_QTabBar {name='qt_tabwidget_tabbar' type='QTabBar' visible='1' window=':Options_Core::Internal::SettingsDialog'}
:Options_Core::Internal::SettingsDialog {type='Core::Internal::SettingsDialog' unnamed='1' visible='1' windowTitle~='(Options|Preferences)'}
:Options_QListView {type='QListView' unnamed='1' visible='1' window=':Options_Core::Internal::SettingsDialog'}
:Qt Creator.Issues_QListView {type='QListView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Issues'}
:Qt Creator.QtCreator.MenuBar_QMenuBar {name='QtCreator.MenuBar' type='QMenuBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Core::Internal::MainWindow {type='Core::Internal::MainWindow' unnamed='1' visible='1'}
:Qt Creator_QmlJSEditor::QmlJSTextEditorWidget {type='QmlJSEditor::QmlJSTextEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Utils::NavigationTreeView {type='Utils::NavigationTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:addToVersionControlComboBox_QComboBox {buddy=':New Qt Quick Application.Add to version control:_QLabel' name='addToVersionControlComboBox' type='QComboBox' visible='1'}
:m_popupFrame_QListView {container=':m_popupFrame_TextEditor::GenericProposalWidget' type='QListView' unnamed='1' visible='1'}
:m_popupFrame_TextEditor::GenericProposalWidget {name='m_popupFrame' type='TextEditor::GenericProposalWidget' visible='1'}
:qt_tabwidget_stackedwidget.CppTools__Internal__CompletionSettingsPage_QWidget {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' name='CppTools__Internal__CompletionSettingsPage' type='QWidget' visible='1'}

View File

@@ -0,0 +1,10 @@
AUT=qtcreator
CLASS=
CLASSPATH=
ENVVARS=envvars
HOOK_SUB_PROCESSES=false
IMPLICITAUTSTART=0
LANGUAGE=Python
TEST_CASES=tst_QMLS01 tst_QMLS02
VERSION=2
WRAPPERS=Qt

View File

@@ -0,0 +1,113 @@
source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
# go to proper line, make backup, type needed text
def __beginTestSuggestions__(editorArea, lineText, textToType):
# make source code backup to clipboard
type(editorArea, "<Ctrl+A>")
type(editorArea, "<Ctrl+C>")
# place cursor to proper position and start typing
if not placeCursorToLine(editorArea, lineText):
return False
type(editorArea, "<Return>")
type(editorArea, textToType)
return True
# verify whether suggestions makes sense for typed textToType
def verifySuggestions(textToType):
popup = findObject(":m_popupFrame_QListView")
model = popup.model()
for row in range(model.rowCount()):
index = model.index(row, 0)
text = str(model.data(index).toString())
test.verify(textToType.lower() in text.lower(),
"Checking whether suggestion '%s' makes sense for typed '%s'"
% (text, textToType))
# restore source code from clipboard backup
def __endTestSuggestions__(editorArea):
type(editorArea, "<Ctrl+A>")
type(editorArea, "<Ctrl+V>")
def testSuggestionsAuto(lineText, textToType, expectedText, keyToUseSuggestion):
# get editor
editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
# go to proper line, make backup, type needed text
if not __beginTestSuggestions__(editorArea, lineText, textToType):
return False
# check if suggestions are shown
test.verify(checkIfObjectExists(":m_popupFrame_QListView"),
"Verifying if suggestions in automatic mode are shown.")
# verify proposed suggestions
verifySuggestions(textToType)
# test if suggestion can be selected with keyToUseSuggestion
type(findObject(":m_popupFrame_QListView"), keyToUseSuggestion)
# get text which was written by usage of suggestion
typedText = str(lineUnderCursor(editorArea)).strip()
# verify if expected text is written
test.compare(typedText, expectedText,
"Verifying automatic suggestions usage with: " + keyToUseSuggestion + ", for text: " + textToType)
__endTestSuggestions__(editorArea)
return True
def testSuggestionsManual(lineText, textToType, expectedText):
# get editor
editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
# go to proper line, make backup, type needed text
if not __beginTestSuggestions__(editorArea, lineText, textToType):
return False
# wait if automatic popup displayed - if yes then fail, because we are in manual mode
test.verify(checkIfObjectExists(":m_popupFrame_QListView", False),
"Verifying if suggestions in manual mode are properly not automatically shown")
# test if suggestion can be invoked manually
if platform.system() == "Darwin":
type(editorArea, "<Meta+Space>")
else:
type(editorArea, "<Ctrl+Space>")
# check if suggestions are shown
test.verify(checkIfObjectExists(":m_popupFrame_QListView"),
"Verifying if suggestions in manual mode are shown manually")
# verify proposed suggestions
verifySuggestions(textToType)
# test if suggestion can be used
type(findObject(":m_popupFrame_QListView"), "<Return>")
# get text which was written by usage of suggestion
typedText = str(lineUnderCursor(editorArea)).strip()
# verify if expected text is written
test.compare(typedText, expectedText,
"Verifying manual suggestions usage for text: " + textToType)
__endTestSuggestions__(editorArea)
return True
def saveAndExit():
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
def main():
startApplication("qtcreator" + SettingsPath)
# create qt quick application
createNewQtQuickApplication(tempDir(), "SampleApp")
# open qml file
doubleClickItem(":Qt Creator_Utils::NavigationTreeView", "SampleApp.QML.qml/SampleApp.main\\.qml", 5, 5, 0, Qt.LeftButton)
# test "color: " suggestion usage with Enter key
if not testSuggestionsAuto("Text {", "col", "color:", "<Return>"):
saveAndExit()
return
# test "color: " suggestion usage with Tab key
if not testSuggestionsAuto("Text {", "col", "color:", "<Tab>"):
saveAndExit()
return
# test "textChanged: " suggestion - automatic insert, because only one suggestion available
shortcutToSuggestions = "<Ctrl+Space>"
if platform.system() == "Darwin":
shortcutToSuggestions = "<Meta+Space>"
if not testSuggestionsAuto("Text {","textChan", "textChanged:", shortcutToSuggestions):
saveAndExit()
return
# change settings to manual insertion of suggestions
changeAutocompleteToManual()
# test manual suggestions
testSuggestionsManual("Text {", "col", "color:")
# exit qt creator
saveAndExit()

View File

@@ -0,0 +1,41 @@
source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
def main():
startApplication("qtcreator" + SettingsPath)
# create qt quick application
createNewQtQuickApplication(tempDir(), "SampleApp")
# open qml file
doubleClickItem(":Qt Creator_Utils::NavigationTreeView", "SampleApp.QML.qml/SampleApp.main\\.qml", 5, 5, 0, Qt.LeftButton)
# get editor
editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
if not placeCursorToLine(editorArea, "Text {"):
invokeMenuItem("File", "Exit")
return
# write code with error (C should be lower case)
testingCodeLine = 'Color : "blue"'
type(editorArea, "<Return>")
type(editorArea, testingCodeLine)
# invoke QML parsing
invokeMenuItem("Tools", "QML/JS", "Run Checks")
# verify that error properly reported
issuesView = waitForObject(":Qt Creator.Issues_QListView")
test.verify(checkSyntaxError(issuesView, ["invalid property name 'Color'"], True),
"Verifying if error is properly reported")
# repair error - go to written line
placeCursorToLine(editorArea, testingCodeLine)
moveTextCursor(editorArea, QTextCursor.Left, QTextCursor.MoveAnchor, 14)
moveTextCursor(editorArea, QTextCursor.Right, QTextCursor.KeepAnchor, 1)
type(editorArea, "c")
# invoke QML parsing
invokeMenuItem("Tools", "QML/JS", "Run Checks")
# verify that there is no error/errors cleared
issuesView = waitForObject(":Qt Creator.Issues_QListView")
issuesModel = issuesView.model()
# wait for issues
test.verify(waitFor("issuesModel.rowCount() == 0", 3000),
"Verifying if error was properly cleared after code fix")
#save and exit
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")

View File

@@ -43,6 +43,9 @@ def main():
pos = size pos = size
if key == "<Left>": if key == "<Left>":
pos -= 1 pos -= 1
if platform.system() != 'Darwin' and JIRA.isBugStillOpen(7215, JIRA.Bug.CREATOR):
test.warning("Using workaround for %s-%d" % (JIRA.Bug.CREATOR, 7215))
pos = 0
test.compare(editor.textCursor().selectionStart(), pos) test.compare(editor.textCursor().selectionStart(), pos)
test.compare(editor.textCursor().selectionEnd(), pos) test.compare(editor.textCursor().selectionEnd(), pos)
test.compare(editor.textCursor().position(), pos) test.compare(editor.textCursor().position(), pos)