Commit 021b64b5 authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/2.6'

parents 68a78612 fbf6a8da
......@@ -196,6 +196,7 @@ Credits go to:
Kaffeine
Kai Köhne
kh1
Knut Petter Svendsen
Konstantin Ritt
Konstantin Tokarev
Leandro Melo
......@@ -214,7 +215,7 @@ Credits go to:
Orgad Shaneh
Oswald Buddenhagen
Oto Magaldadze
Peter Kuemmel
Peter Kümmel
Pierre Rossi
Robert Loehning
Ryan May
......
greaterThan(QT_MAJOR_VERSION, 4) {
HELPGENERATOR = $$targetPath($$[QT_INSTALL_BINS]/qhelpgenerator) -platform minimal
QDOC_BIN = $$targetPath($$[QT_INSTALL_BINS]/qdoc)
} else {
HELPGENERATOR = $$targetPath($$[QT_INSTALL_BINS]/qhelpgenerator)
QDOC_BIN = $$targetPath($$[QT_INSTALL_BINS]/qdoc3)
}
HELPGENERATOR = $$targetPath($$[QT_INSTALL_BINS]/qhelpgenerator)
VERSION_TAG = $$replace(QTCREATOR_VERSION, "[-.]", )
......
......@@ -132,8 +132,7 @@
Python-enabled GDB. Follow the instructions in
\l{http://qt-project.org/wiki/QtCreatorBuildGdb}{Building GDB}.
You must use at least Python version 2.5, but we recommend that you use
version 2.6.
You must use Python version 2.6 or 2.7.
For more information on setting up debugger, see \l{Setting Up Debugger}.
......@@ -149,13 +148,6 @@
context menu in the \gui Snapshot view. The core file is deleted when you
stop debugging.
\section1 Code Editor Questions
\bold {How can I get code-completion to work on the standard headers and
phonon?}
Install a build from March 31, 2009, or later.
\section1 Compiler Questions
\bold {How can I make use of my multi-core CPU with \QC?}
......@@ -181,7 +173,7 @@
The Qt build in the SDK is built with QT_NO_OPENSSL defined. Rebuilding it
is possible. For more information, see
\l{http://www.qtcentre.org/forum/f-qt-programming-2/t-qssl-19222-post94842.html}.
\l{http://www.qtcentre.org/threads/19222-Qssl}.
\bold {Which development packages from the distribution are needed on
Ubuntu or Debian?}
......
#!/bin/bash
macdeployqt "$1" \
"-executable=$1/Contents/MacOS/qmlpuppet.app/Contents/MacOS/qmlpuppet" \
"-executable=$1/Contents/Resources/qtpromaker" || exit 1
"-executable=$1/Contents/Resources/qtpromaker" \
"-executable=$1/Contents/Resources/sdktool" || exit 1
qmlpuppetResources="$1/Contents/MacOS/qmlpuppet.app/Contents/Resources"
test -d "$qmlpuppetResources" || mkdir -p "$qmlpuppetResources"
cp "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/qmlpuppet_qt.conf" "$qmlpuppetResources/qt.conf"
......@@ -18,6 +18,9 @@
<publisher>PUBLISHER</publisher>
<copyright>COPYRIGHT</copyright>
<arg>-platform</arg>
<arg>qnx</arg>
<action system="true">run_native</action>
<asset entry="true" path="%ProjectName%" type="Qnx/Elf">%ProjectName%</asset>
......
......@@ -36,7 +36,7 @@
featuresRequired="QtSupport.Wizards.FeatureBlackBerry">
<icon>icon.png</icon>
<displayname>BlackBerry Qt5 Gui Application</displayname>;
<description>Creates a Qt5 Gui application for BlackBerry.</description>
<description>Creates an experimental Qt5 Gui application for BlackBerry 10. You need an own Qt5 build for BlackBerry 10 since Qt5 is not provided in the current BlackBerry 10 NDK and is not included in DevAlpha devices.</description>
<files>
<file source="main.cpp" openeditor="true"/>
<file source="mainwidget.cpp" openeditor="true"/>
......
......@@ -18,6 +18,9 @@
<env var="QT_PLUGIN_PATH" value="app/native/plugins"/>
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
<arg>-platform</arg>
<arg>qnx</arg>
<action system="true">run_native</action>
<asset entry="true" path="%ProjectName%" type="Qnx/Elf">%ProjectName%</asset>
......
......@@ -36,7 +36,7 @@
featuresRequired="QtSupport.Wizards.FeatureBlackBerry">
<icon>icon.png</icon>
<displayname>BlackBerry Qt Quick 2 Application</displayname>;
<description>Creates a Qt Quick 2 application for BlackBerry.</description>
<description>Creates an experimental Qt Quick 2 application for BlackBerry 10. You need an own Qt5 build for BlackBerry 10 since Qt5 is not provided in the current BlackBerry 10 NDK and is not included in DevAlpha devices.</description>
<files>
<file source="main.cpp" openeditor="true"/>
<file source="qml/main.qml" openeditor="true"/>
......
This diff is collapsed.
......@@ -263,11 +263,23 @@ ClassOrNamespace *LookupContext::lookupType(const Name *name, Scope *scope) cons
return 0;
} else if (Block *block = scope->asBlock()) {
for (unsigned i = 0; i < block->memberCount(); ++i) {
if (UsingNamespaceDirective *u = block->memberAt(i)->asUsingNamespaceDirective()) {
Symbol *m = block->memberAt(i);
if (UsingNamespaceDirective *u = m->asUsingNamespaceDirective()) {
if (ClassOrNamespace *uu = lookupType(u->name(), scope->enclosingNamespace())) {
if (ClassOrNamespace *r = uu->lookupType(name))
return r;
}
} else if (Declaration *d = m->asDeclaration()) {
if (d->name() && d->name()->isEqualTo(name->asNameId())) {
if (d->isTypedef() && d->type()) {
#ifdef DEBUG_LOOKUP
Overview oo;
qDebug() << "Looks like" << oo(name) << "is a typedef for" << oo(d->type());
#endif // DEBUG_LOOKUP
if (const NamedType *namedTy = d->type()->asNamedType())
return lookupType(namedTy->name(), scope);
}
}
}
}
return lookupType(name, scope->enclosingScope());
......@@ -380,6 +392,9 @@ ClassOrNamespace *LookupContext::lookupParent(Symbol *symbol) const
ClassOrNamespace::ClassOrNamespace(CreateBindings *factory, ClassOrNamespace *parent)
: _factory(factory), _parent(parent), _templateId(0), _instantiationOrigin(0)
#ifdef DEBUG_LOOKUP
, _name(0)
#endif // DEBUG_LOOKUP
{
}
......@@ -574,6 +589,11 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope,
else if (s->name()->isQualifiedNameId())
continue; // skip qualified ids.
#ifdef DEBUG_LOOKUP
Overview oo;
qDebug() << "Found" << id->chars() << "in" << (binding ? oo(binding->_name) : "<null>");
#endif // DEBUG_LOOKUP
LookupItem item;
item.setDeclaration(s);
item.setBinding(binding);
......@@ -616,6 +636,11 @@ ClassOrNamespace *ClassOrNamespace::lookupType_helper(const Name *name,
bool searchInEnclosingScope,
ClassOrNamespace *origin)
{
#ifdef DEBUG_LOOKUP
Overview oo;
qDebug() << "Looking up" << oo(name) << "in" << oo(_name);
#endif // DEBUG_LOOKUP
if (const QualifiedNameId *q = name->asQualifiedNameId()) {
QSet<ClassOrNamespace *> innerProcessed;
......@@ -721,6 +746,9 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
if (templId) {
_alreadyConsideredTemplates.insert(templId);
ClassOrNamespace *instantiation = _factory->allocClassOrNamespace(reference);
#ifdef DEBUG_LOOKUP
instantiation->_name = templId;
#endif // DEBUG_LOOKUP
instantiation->_templateId = templId;
instantiation->_instantiationOrigin = origin;
......@@ -734,6 +762,7 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
const unsigned argumentCount = templId->templateArgumentCount();
if (_factory->expandTemplates()) {
Clone cloner(_control.data());
Subst subst(_control.data());
for (unsigned i = 0, ei = std::min(argumentCount, templ->templateParameterCount()); i < ei; ++i) {
const TypenameArgument *tParam = templ->templateParameterAt(i)->asTypenameArgument();
......@@ -743,12 +772,16 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
if (!name)
continue;
const FullySpecifiedType &ty = templId->templateArgumentAt(i);
subst.bind(name, ty);
subst.bind(cloner.name(name, &subst), ty);
}
Clone cloner(_control.data());
foreach (Symbol *s, reference->symbols()) {
instantiation->_symbols.append(cloner.symbol(s, &subst));
Symbol *clone = cloner.symbol(s, &subst);
instantiation->_symbols.append(clone);
#ifdef DEBUG_LOOKUP
Overview oo;oo.setShowFunctionSignatures(true);oo.setShowReturnTypes(true);oo.setShowTemplateParameters(true);
qDebug()<<"cloned"<<oo(clone->type());
#endif // DEBUG_LOOKUP
}
} else {
instantiation->_symbols.append(reference->symbols());
......@@ -917,6 +950,9 @@ ClassOrNamespace *ClassOrNamespace::findOrCreateType(const Name *name, ClassOrNa
if (! e) {
e = _factory->allocClassOrNamespace(this);
#ifdef DEBUG_LOOKUP
e->_name = name;
#endif // DEBUG_LOOKUP
_classOrNamespaces[name] = e;
}
......
......@@ -136,6 +136,10 @@ private:
AlreadyConsideredClassContainer<Class> _alreadyConsideredClasses;
AlreadyConsideredClassContainer<TemplateNameId> _alreadyConsideredTemplates;
#ifdef DEBUG_LOOKUP
const Name *_name;
#endif // DEBUG_LOOKUP
friend class CreateBindings;
};
......
......@@ -830,16 +830,22 @@ ClassOrNamespace *ResolveExpression::findClass(const FullySpecifiedType &origina
static void resolveTypedefs(const LookupContext &context,
FullySpecifiedType *type,
Scope **scope)
Scope **scope, ClassOrNamespace *binding)
{
QSet<Symbol *> visited;
while (NamedType *namedTy = (*type)->asNamedType()) {
ClassOrNamespace *scopeCoN = context.lookupType(*scope);
if (!scopeCoN)
break;
// check if namedTy->name() resolves to a typedef
QList<LookupItem> namedTypeItems = scopeCoN->lookup(namedTy->name());
QList<LookupItem> namedTypeItems;
if (binding)
namedTypeItems = binding->lookup(namedTy->name());
if (ClassOrNamespace *scopeCon = context.lookupType(*scope))
namedTypeItems += scopeCon->lookup(namedTy->name());
#ifdef DEBUG_LOOKUP
qDebug() << "-- we have" << namedTypeItems.size() << "candidates";
#endif // DEBUG_LOOKUP
bool foundTypedef = false;
foreach (const LookupItem &it, namedTypeItems) {
if (it.declaration() && it.declaration()->isTypedef()) {
......@@ -864,11 +870,26 @@ ClassOrNamespace *ResolveExpression::baseExpression(const QList<LookupItem> &bas
int accessOp,
bool *replacedDotOperator) const
{
#ifdef DEBUG_LOOKUP
qDebug() << "In ResolveExpression::baseExpression with" << baseResults.size() << "results...";
int i = 0;
Overview oo;
#endif // DEBUG_LOOKUP
foreach (const LookupItem &r, baseResults) {
FullySpecifiedType ty = r.type().simplified();
Scope *scope = r.scope();
resolveTypedefs(_context, &ty, &scope);
#ifdef DEBUG_LOOKUP
qDebug("trying result #%d", ++i);
qDebug()<<"- before typedef resolving we have:"<<oo(ty);
#endif // DEBUG_LOOKUP
resolveTypedefs(_context, &ty, &scope, r.binding());
#ifdef DEBUG_LOOKUP
qDebug()<<"- after typedef resolving:"<<oo(ty);
#endif // DEBUG_LOOKUP
if (accessOp == T_ARROW) {
if (PointerType *ptrTy = ty->asPointerType()) {
......@@ -892,7 +913,7 @@ ClassOrNamespace *ResolveExpression::baseExpression(const QList<LookupItem> &bas
FullySpecifiedType retTy = instantiatedFunction->returnType().simplified();
resolveTypedefs(_context, &retTy, &functionScope);
resolveTypedefs(_context, &retTy, &functionScope, r.binding());
if (PointerType *ptrTy = retTy->asPointerType()) {
if (ClassOrNamespace *retBinding = findClass(ptrTy->elementType(), functionScope))
......
......@@ -2,6 +2,7 @@ TEMPLATE = lib
TARGET = CPlusPlus
DEFINES += NDEBUG
#DEFINES += DEBUG_LOOKUP
unix:QMAKE_CXXFLAGS_DEBUG += -O2
include(../../qtcreatorlibrary.pri)
......
......@@ -197,6 +197,7 @@ CMakeBuildConfiguration *CMakeBuildConfigurationFactory::create(ProjectExplorer:
CMakeOpenProjectWizard::BuildInfo info;
info.sourceDirectory = project->projectDirectory();
info.environment = Utils::Environment::systemEnvironment();
parent->kit()->addToEnvironment(info.environment);
info.buildDirectory = project->defaultBuildDirectory();
info.kit = parent->kit();
info.useNinja = false; // This is ignored anyway
......
......@@ -36,14 +36,12 @@
#include <QSysInfo>
#include <qglobal.h>
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_6
enum {
NSWindowCollectionBehaviorFullScreenPrimary = (1 << 7)
Qtc_NSWindowCollectionBehaviorFullScreenPrimary = (1 << 7)
};
static const NSString *NSWindowDidEnterFullScreenNotification = @"NSWindowDidEnterFullScreenNotification";
static const NSString *NSWindowDidExitFullScreenNotification = @"NSWindowDidExitFullScreenNotification";
#endif
static NSString *Qtc_NSWindowDidEnterFullScreenNotification = @"NSWindowDidEnterFullScreenNotification";
static NSString *Qtc_NSWindowDidExitFullScreenNotification = @"NSWindowDidExitFullScreenNotification";
@interface WindowObserver : NSObject {
Core::Internal::MainWindow *window;
......@@ -86,11 +84,7 @@ using namespace Core::Internal;
bool MacFullScreen::supportsFullScreen()
{
#if QT_VERSION >= 0x040800
return QSysInfo::MacintoshVersion >= QSysInfo::MV_LION;
#else
return QSysInfo::MacintoshVersion >= 0x0009; /* MV_LION not defined */
#endif
}
void MacFullScreen::addFullScreen(MainWindow *window)
......@@ -98,15 +92,15 @@ void MacFullScreen::addFullScreen(MainWindow *window)
if (supportsFullScreen()) {
NSView *nsview = (NSView *) window->winId();
NSWindow *nswindow = [nsview window];
[nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
[nswindow setCollectionBehavior:Qtc_NSWindowCollectionBehaviorFullScreenPrimary];
if (observer == nil)
observer = [[WindowObserver alloc] initWithMainWindow:window];
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc addObserver:observer selector:@selector(notifyDidEnterFullScreen:)
name:NSWindowDidEnterFullScreenNotification object:nswindow];
name:Qtc_NSWindowDidEnterFullScreenNotification object:nswindow];
[nc addObserver:observer selector:@selector(notifyDidExitFullScreen:)
name:NSWindowDidExitFullScreenNotification object:nswindow];
name:Qtc_NSWindowDidExitFullScreenNotification object:nswindow];
}
}
......
......@@ -296,6 +296,76 @@ void CppToolsPlugin::test_completion_template_3()
QVERIFY(completions.contains("Tupple"));
QVERIFY(completions.contains("a"));
QVERIFY(completions.contains("b"));
}
void CppToolsPlugin::test_completion_template_4()
{
TestData data;
data.srcText = "\n"
"template <class T>\n"
"struct List\n"
"{\n"
" typedef T U;\n"
" U u;\n"
"};\n"
"\n"
"struct Tupple { int a; int b; };\n"
"\n"
"void func() {\n"
" List<Tupple> l;\n"
" @\n"
" // padding so we get the scope right\n"
"}";
setup(&data);
Utils::ChangeSet change;
QString txt = QLatin1String("l.u.");
change.insert(data.pos, txt);
QTextCursor cursor(data.doc);
change.apply(&cursor);
data.pos += txt.length();
QStringList completions = getCompletions(data);
QCOMPARE(completions.size(), 3);
QVERIFY(completions.contains("Tupple"));
QVERIFY(completions.contains("a"));
QVERIFY(completions.contains("b"));
}
void CppToolsPlugin::test_completion_template_5()
{
TestData data;
data.srcText = "\n"
"template <class T>\n"
"struct List\n"
"{\n"
" T u;\n"
"};\n"
"\n"
"struct Tupple { int a; int b; };\n"
"\n"
"void func() {\n"
" typedef List<Tupple> LT;\n"
" LT l;"
" @\n"
" // padding so we get the scope right\n"
"}";
setup(&data);
Utils::ChangeSet change;
QString txt = QLatin1String("l.u.");
change.insert(data.pos, txt);
QTextCursor cursor(data.doc);
change.apply(&cursor);
data.pos += txt.length();
QStringList completions = getCompletions(data);
QCOMPARE(completions.size(), 3);
QVERIFY(completions.contains("Tupple"));
QVERIFY(completions.contains("a"));
QVERIFY(completions.contains("b"));
}
......
......@@ -74,7 +74,6 @@ public:
private slots:
void switchHeaderSource();
#ifdef WITH_TESTS
// codegen tests
......@@ -95,6 +94,8 @@ private slots:
void test_completion_template_1();
void test_completion_template_2();
void test_completion_template_3();
void test_completion_template_4();
void test_completion_template_5();
void test_completion_template_as_base();
void test_completion_template_as_base_data();
void test_completion_use_global_identifier_as_base_class();
......
......@@ -4,7 +4,7 @@ TARGET = Help
QT += network
greaterThan(QT_MAJOR_VERSION, 4) {
QT += printsupport help
!isEmpty(QT.webkit.name): QT += webkit
!isEmpty(QT.webkitwidgets.name): QT += webkitwidgets
else: DEFINES += QT_NO_WEBKIT
} else {
CONFIG += help
......
......@@ -322,8 +322,6 @@ HelpViewer::HelpViewer(qreal zoom, QWidget *parent)
setAcceptDrops(false);
installEventFilter(this);
QWebSettings::globalSettings()->setAttribute(QWebSettings::JavaEnabled, true);
QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);
QWebSettings::globalSettings()->setAttribute(QWebSettings::DnsPrefetchEnabled, true);
setPage(new HelpPage(this));
......
......@@ -130,6 +130,8 @@ ToolChainKitInformation::ToolChainKitInformation()
this, SIGNAL(validationNeeded()));
connect(ToolChainManager::instance(), SIGNAL(toolChainUpdated(ProjectExplorer::ToolChain*)),
this, SIGNAL(validationNeeded()));
connect(ToolChainManager::instance(), SIGNAL(toolChainUpdated(ProjectExplorer::ToolChain*)),
this, SLOT(toolChainUpdated(ProjectExplorer::ToolChain*)));
}
Core::Id ToolChainKitInformation::dataId() const
......@@ -235,6 +237,13 @@ QString ToolChainKitInformation::msgNoToolChainInTarget()
return tr("No compiler set in kit.");
}
void ToolChainKitInformation::toolChainUpdated(ToolChain *tc)
{
foreach (Kit *k, KitManager::instance()->kits())
if (toolChain(k) == tc)
notifyAboutUpdate(k);
}
// --------------------------------------------------------------------------
// DeviceTypeInformation:
// --------------------------------------------------------------------------
......@@ -317,6 +326,8 @@ DeviceKitInformation::DeviceKitInformation()
this, SIGNAL(validationNeeded()));
connect(DeviceManager::instance(), SIGNAL(deviceUpdated(Core::Id)),
this, SIGNAL(validationNeeded()));
connect(DeviceManager::instance(), SIGNAL(deviceUpdated(Core::Id)),
this, SLOT(deviceUpdated(Core::Id)));
}
Core::Id DeviceKitInformation::dataId() const
......@@ -403,4 +414,11 @@ void DeviceKitInformation::setDeviceId(Kit *k, const Core::Id id)
k->setValue(Core::Id(DEVICE_INFORMATION), id.toString());
}
void DeviceKitInformation::deviceUpdated(const Core::Id &id)
{
foreach (Kit *k, KitManager::instance()->kits())
if (deviceId(k) == id)
notifyAboutUpdate(k);
}
} // namespace ProjectExplorer
......@@ -117,6 +117,8 @@ public:
static void setToolChain(Kit *k, ToolChain *tc);
static QString msgNoToolChainInTarget();
private slots:
void toolChainUpdated(ProjectExplorer::ToolChain *tc);
};
class PROJECTEXPLORER_EXPORT ToolChainMatcher : public KitMatcher
......@@ -207,6 +209,8 @@ public:
static Core::Id deviceId(const Kit *k);
static void setDevice(Kit *k, IDevice::ConstPtr dev);
static void setDeviceId(Kit *k, const Core::Id id);
private slots:
void deviceUpdated(const Core::Id &id);
};
class PROJECTEXPLORER_EXPORT DeviceMatcher : public KitMatcher
......
......@@ -460,4 +460,9 @@ QString KitInformation::displayNamePostfix(const Kit *k) const
return QString();
}
void KitInformation::notifyAboutUpdate(Kit *k)
{
KitManager::instance()->notifyAboutUpdate(k);
}
} // namespace ProjectExplorer
......@@ -85,6 +85,9 @@ public:
virtual QString displayNamePostfix(const Kit *k) const;
protected:
void notifyAboutUpdate(Kit *k);
signals:
void validationNeeded();
};
......@@ -165,6 +168,7 @@ private:
friend class ProjectExplorerPlugin; // for constructor
friend class Kit;
friend class Internal::KitModel;
friend class KitInformation; // for notifyAbutUpdate
};
} // namespace ProjectExplorer
......
......@@ -115,6 +115,7 @@ BlackBerryApplicationRunner::BlackBerryApplicationRunner(bool debugMode, BlackBe
m_runningStateTimer->setInterval(3000);
m_runningStateTimer->setSingleShot(true);
connect(m_runningStateTimer, SIGNAL(timeout()), this, SLOT(determineRunningState()));
connect(this, SIGNAL(started()), this, SLOT(checkSlog2Info()));
}
void BlackBerryApplicationRunner::start()
......
......@@ -47,14 +47,13 @@ BlackBerryRunControl::BlackBerryRunControl(BlackBerryRunConfiguration *runConfig
m_connector = BlackBerryConnect::instance(runConfiguration);
connect(m_runner, SIGNAL(started()), this, SIGNAL(started()));
connect(m_runner, SIGNAL(started()), m_connector, SLOT(connectToDevice()));
connect(m_runner, SIGNAL(finished()), this, SIGNAL(finished()));
connect(m_runner, SIGNAL(finished()), m_connector, SLOT(disconnectFromDevice()));
connect