Commit ba1d5f2c authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/2.6'

Conflicts:
	share/share.qbs
	src/plugins/cpptools/cppchecksymbols.cpp
	src/plugins/texteditor/behaviorsettingswidget.cpp

Change-Id: Ia34060984f9c036b2f28a6411d796d41f55a3e37
parents c384f52b deeef530
......@@ -120,15 +120,15 @@
custom look and feel and QML and C++ code to implement the
application logic
\o Qt Quick Application for MeeGo Harmattan
\o Qt Quick 1 Application for MeeGo Harmattan
Use Qt Quick Components for MeeGo Harmattan to design a user
interface with the platform look and feel
\o Qt Quick Application (from Existing QML File)
\o Qt Quick 1 Application (from Existing QML File)
Convert existing QML applications to projects that you can run
in \QC or deploy to mobile devices
Convert existing Qt Quick 1 applications to projects that you
can run in \QC or deploy to mobile devices
\o Qt Console Application
......@@ -158,12 +158,18 @@
Shared or static C++ library based on qmake
\o Custom QML Extension Plugin
\o Qt Quick 1 Extension Plugin
C++ plugin that makes it possible to offer extensions
that can be loaded dynamically into applications by using the
C++ plugin that makes it possible to offer extensions that can
be loaded dynamically into Qt Quick 1 applications by using the
QDeclarativeEngine class
\o Qt Quick 2 Extension Plugin
C++ plugin that makes it possible to offer extensions that can
be loaded dynamically into Qt Quick 2 applications by using the
QQmlEngine class
\o \QC Plugin
......
......@@ -64,15 +64,17 @@
need to have the development environment installed on your
computer to create and run this type of project.
\o \gui {Qt Quick Application (from Existing QML File)} converts
existing QML applications to Qt Quick application projects. This
enables you to run them from \QC and to deploy them to mobile
\o \gui {Qt Quick 1 Application (from Existing QML File)} converts
existing Qt Quick 1 applications to Qt Quick application projects.
This enables you to run them from \QC and to deploy them to mobile
devices.
\o \gui {Custom QML Extension Plugin} (in the \gui Libraries category)
creates a C++ plugin that makes
it possible to offer extensions that can be loaded dynamically into
applications by using the QDeclarativeEngine class.
\o \gui {Qt Quick Extension Plugins} (in the \gui Libraries category)
create C++ plugins that make it possible to offer extensions that
can be loaded dynamically into Qt Quick applications. Select
\gui {Qt Quick 1 Extension Plugin} to create extensions for
Qt Quick 1 applications and \gui {Qt Quick 2 Extension Plugin} to
create extensions for Qt Quick 2 applications.
\endlist
......
#include "%ProjectName:l%_plugin.%CppHeaderSuffix%"
#include "%ObjectName:l%.%CppHeaderSuffix%"
#include <qdeclarative.h>
void %ProjectName:s%Plugin::registerTypes(const char *uri)
{
// @uri %Uri%
qmlRegisterType<%ObjectName%>(uri, 1, 0, "%ObjectName%");
}
#if QT_VERSION < 0x050000
Q_EXPORT_PLUGIN2(%ProjectName:s%, %ProjectName:s%Plugin)
#endif
......@@ -6,6 +6,9 @@
class %ProjectName:s%Plugin : public QDeclarativeExtensionPlugin
{
Q_OBJECT
#if QT_VERSION >= 0x050000
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
#endif
public:
void registerTypes(const char *uri);
......
......@@ -36,11 +36,11 @@ leave room for the Qt 4 target page.
-->
<wizard version="1" kind="project"
class="qt4project" firstpage="10"
id="QmlExtensionPlugin" category="G.Libraries"
id="QtQuick1ExtensionPlugin" category="G.Libraries"
featuresRequired="QtSupport.Wizards.FeatureQtQuick,QtSupport.Wizards.FeatureQtQuick.1">
<icon>lib.png</icon>
<description>Creates a C++ plugin that makes it possible to offer extensions that can be loaded dynamically into applications using the QDeclarativeEngine class.</description>
<displayname>Custom QML Extension Plugin</displayname>
<displayname>Qt Quick 1 Extension Plugin</displayname>
<displaycategory>Libraries</displaycategory>
<files>
<file source="qmldir" target="qmldir"/>
......
#include "%ObjectName:l%.%CppHeaderSuffix%"
%ObjectName%::%ObjectName%(QQuickItem *parent):
QQuickItem(parent)
{
// By default, QQuickItem does not draw anything. If you subclass
// QQuickItem to create a visual item, you will need to uncomment the
// following line and re-implement updatePaintNode()
// setFlag(ItemHasContents, true);
}
%ObjectName%::~%ObjectName%()
{
}
#ifndef %ObjectName:u%_H
#define %ObjectName:u%_H
#include <QQuickItem>
class %ObjectName% : public QQuickItem
{
Q_OBJECT
Q_DISABLE_COPY(%ObjectName%)
public:
%ObjectName%(QQuickItem *parent = 0);
~%ObjectName%();
};
QML_DECLARE_TYPE(%ObjectName%)
#endif // %ObjectName:u%_H
#include "%ProjectName:l%_plugin.%CppHeaderSuffix%"
#include "%ObjectName:l%.%CppHeaderSuffix%"
#include <qdeclarative.h>
#include <qqml.h>
void %ProjectName:s%Plugin::registerTypes(const char *uri)
{
......@@ -9,4 +9,3 @@ void %ProjectName:s%Plugin::registerTypes(const char *uri)
qmlRegisterType<%ObjectName%>(uri, 1, 0, "%ObjectName%");
}
Q_EXPORT_PLUGIN2(%ProjectName:s%, %ProjectName:s%Plugin)
#ifndef %ProjectName:h%_PLUGIN_H
#define %ProjectName:h%_PLUGIN_H
#include <QQmlExtensionPlugin>
class %ProjectName:s%Plugin : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
public:
void registerTypes(const char *uri);
};
#endif // %ProjectName:h%_PLUGIN_H
TEMPLATE = lib
TARGET = %ProjectName%
QT += qml quick
CONFIG += qt plugin
TARGET = $$qtLibraryTarget($$TARGET)
uri = %Uri%
# Input
SOURCES += \
%ProjectName:l%_plugin.%CppSourceSuffix% \
%ObjectName:l%.%CppSourceSuffix%
HEADERS += \
%ProjectName:l%_plugin.%CppHeaderSuffix% \
%ObjectName:l%.%CppHeaderSuffix%
OTHER_FILES = qmldir
!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
copy_qmldir.target = $$OUT_PWD/qmldir
copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir
copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\"
QMAKE_EXTRA_TARGETS += copy_qmldir
PRE_TARGETDEPS += $$copy_qmldir.target
}
qmldir.files = qmldir
unix {
installPath = $$[QT_INSTALL_IMPORTS]/$$replace(uri, \\., /)
qmldir.path = $$installPath
target.path = $$installPath
INSTALLS += target qmldir
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
/****************************************************************************
**
** Copyright (C) 2012 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.
**
****************************************************************************/
Custom project wizard configuration example file. Note that by convention,
the project file goes last.
The "class" and "firstpage" attributes specify that it is a Qt 4 wizard and
leave room for the Qt 4 target page.
-->
<wizard version="1" kind="project"
class="qt4project" firstpage="10"
id="QtQuick2ExtensionPlugin" category="G.Libraries"
featuresRequired="QtSupport.Wizards.FeatureQtQuick,QtSupport.Wizards.FeatureQtQuick.2">
<icon>lib.png</icon>
<description>Creates a C++ plugin that makes it possible to offer extensions that can be loaded dynamically into applications using the QQmlEngine class.</description>
<displayname>Qt Quick 2 Extension Plugin</displayname>
<displaycategory>Libraries</displaycategory>
<files>
<file source="qmldir" target="qmldir"/>
<file source="plugin.h" target="%ProjectName:l%_plugin.%CppHeaderSuffix%"/>
<file source="plugin.cpp" target="%ProjectName:l%_plugin.%CppSourceSuffix%"/>
<file source="object.h" target="%ObjectName:l%.%CppHeaderSuffix%"/>
<file source="object.cpp" target="%ObjectName:l%.%CppSourceSuffix%" openeditor="true"/>
<file source="project.pro" target="%ProjectName:l%.pro" openproject="true"/>
</files>
<!-- Create a 2nd wizard page with parameters -->
<fieldpagetitle>Custom QML Extension Plugin Parameters</fieldpagetitle>
<fields>
<field mandatory="true" name="ObjectName">
<fieldcontrol class="QLineEdit" validator='^[A-Za-z0-9_]+$' defaulttext="MyItem"/>
<fielddescription>Object Class-name:</fielddescription>
</field>
<field mandatory="true" name="Uri">
<fieldcontrol class="QLineEdit" validator='^[A-Za-z0-9]+([A-Za-z0-9-]*[A-Za-z0-9]+)?(\.[A-Za-z0-9]+([-A-Za-z0-9]*[A-Za-z0-9]+)?)*$' defaulttext="com.mycompany.qmlcomponents"/>
<fielddescription>URI:</fielddescription>
</field>
</fields>
<validationrules>
<validationrule condition='"%ObjectName%" != "%ProjectName%_plugin"'>
<message>The project name and the object class-name cannot be the same.</message>
</validationrule>
</validationrules>
</wizard>
......@@ -19,8 +19,6 @@ Product {
}
Group {
condition: qbs.targetOS == "macx"
qbs.installDir: "share/qtcreator/scripts"
fileTags: ["install"]
files: "qtcreator/scripts/openTerminal.command"
}
......
......@@ -359,7 +359,11 @@ int main(int argc, char **argv)
const QString &creatorTrPath = QCoreApplication::applicationDirPath()
+ QLatin1String(SHARE_PATH "/translations");
foreach (QString locale, uiLanguages) {
#if (QT_VERSION >= 0x050000)
locale = QLocale(locale).name();
#else
locale.replace(QLatin1Char('-'), QLatin1Char('_')); // work around QTBUG-25973
#endif
if (translator.load(QLatin1String("qtcreator_") + locale, creatorTrPath)) {
const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
const QString &qtTrFile = QLatin1String("qt_") + locale;
......
......@@ -70,6 +70,8 @@ BaseTreeView::BaseTreeView(QWidget *parent)
connect(this, SIGNAL(activated(QModelIndex)),
SLOT(rowActivatedHelper(QModelIndex)));
connect(this, SIGNAL(clicked(QModelIndex)),
SLOT(rowClickedHelper(QModelIndex)));
connect(header(), SIGNAL(sectionClicked(int)),
SLOT(headerSectionClicked(int)));
......
......@@ -49,6 +49,7 @@ public:
void setModel(QAbstractItemModel *model);
virtual void rowActivated(const QModelIndex &) {}
virtual void rowClicked(const QModelIndex &) {}
void mousePressEvent(QMouseEvent *ev);
public slots:
......@@ -61,6 +62,7 @@ protected slots:
private slots:
void rowActivatedHelper(const QModelIndex &index) { rowActivated(index); }
void rowClickedHelper(const QModelIndex &index) { rowClicked(index); }
void headerSectionClicked(int logicalIndex);
private:
......
......@@ -1274,9 +1274,13 @@ IEditor *EditorManager::openEditor(Core::Internal::EditorView *view, const QStri
qDebug() << Q_FUNC_INFO << fileName << editorId.name();
QString fn = fileName;
QFileInfo fi(fn);
int lineNumber = -1;
if (flags && EditorManager::CanContainLineNumber)
if ((flags & EditorManager::CanContainLineNumber) && !fi.exists()) {
lineNumber = extractLineNumber(&fn);
if (lineNumber != -1)
fi.setFile(fn);
}
if (fn.isEmpty())
return 0;
......@@ -1287,13 +1291,12 @@ IEditor *EditorManager::openEditor(Core::Internal::EditorView *view, const QStri
const QList<IEditor *> editors = editorsForFileName(fn);
if (!editors.isEmpty()) {
IEditor *editor = editors.first();
if (flags && EditorManager::CanContainLineNumber)
if (flags & EditorManager::CanContainLineNumber)
editor->gotoLine(lineNumber, -1);
return activateEditor(view, editor, flags);
}
QString realFn = autoSaveName(fn);
QFileInfo fi(fn);
QFileInfo rfi(realFn);
if (!fi.exists() || !rfi.exists() || fi.lastModified() >= rfi.lastModified()) {
QFile::remove(realFn);
......@@ -1327,7 +1330,7 @@ IEditor *EditorManager::openEditor(Core::Internal::EditorView *view, const QStri
if (editor == result)
restoreEditorState(editor);
if (flags && EditorManager::CanContainLineNumber)
if (flags & EditorManager::CanContainLineNumber)
editor->gotoLine(lineNumber, -1);
QApplication::restoreOverrideCursor();
......
......@@ -509,9 +509,11 @@ bool CheckSymbols::visit(SimpleDeclarationAST *ast)
// Add a diagnostic message if non-virtual function has override/final marker
if ((_usages.back().kind != SemanticInfo::VirtualMethodUse)) {
if (funTy->isOverride())
warning(declrIdNameAST, QCoreApplication::translate("CPlusplus::CheckSymbols", "Only virtual methods can be marked `override'"));
warning(declrIdNameAST, QCoreApplication::translate(
"CPlusplus::CheckSymbols", "Only virtual methods can be marked `override'"));
else if (funTy->isFinal())
warning(declrIdNameAST, QCoreApplication::translate("CPlusPlus::CheckSymbols", "Only virtual methods can be marked `final'"));
warning(declrIdNameAST, QCoreApplication::translate(
"CPlusPlus::CheckSymbols", "Only virtual methods can be marked `final'"));
}
}
}
......
......@@ -1415,6 +1415,10 @@ void DebuggerEngine::updateWatchData(const WatchData &, const WatchUpdateFlags &
{
}
void DebuggerEngine::watchDataSelected(const QByteArray &iname)
{
}
void DebuggerEngine::watchPoint(const QPoint &)
{
}
......
......@@ -149,6 +149,8 @@ public:
virtual void updateWatchData(const Internal::WatchData &data,
const Internal::WatchUpdateFlags & flags = Internal::WatchUpdateFlags());
virtual void watchDataSelected(const QByteArray &iname);
virtual void startDebugger(DebuggerRunControl *runControl);
virtual void watchPoint(const QPoint &);
......
......@@ -34,6 +34,7 @@
#include "stackhandler.h"
#include "qmlengine.h"
#include "watchdata.h"
#include "watchhandler.h"
#include <coreplugin/icore.h>
#include <utils/qtcassert.h>
......@@ -135,6 +136,13 @@ void QmlCppEngine::updateWatchData(const WatchData &data,
d->m_activeEngine->updateWatchData(data, flags);
}
void QmlCppEngine::watchDataSelected(const QByteArray &iname)
{
const WatchData *wd = watchHandler()->findData(iname);
if (wd && wd->isInspect())
d->m_qmlEngine->watchDataSelected(iname);
}
void QmlCppEngine::watchPoint(const QPoint &point)
{
d->m_cppEngine->watchPoint(point);
......
......@@ -50,6 +50,7 @@ public:
TextEditor::ITextEditor * editor, const DebuggerToolTipContext &);
void updateWatchData(const WatchData &data,
const WatchUpdateFlags &flags);
void watchDataSelected(const QByteArray &iname);
void watchPoint(const QPoint &);
void fetchMemory(MemoryAgent *, QObject *, quint64 addr, quint64 length);
......
......@@ -1026,6 +1026,13 @@ void QmlEngine::updateWatchData(const WatchData &data,
watchHandler()->insertData(data);
}
void QmlEngine::watchDataSelected(const QByteArray &iname)
{
const WatchData *wd = watchHandler()->findData(iname);
if (wd && wd->isInspect())
m_inspectorAdapter.agent()->watchDataSelected(wd);
}
void QmlEngine::synchronizeWatchers()
{
QStringList watchedExpressions = watchHandler()->watchedExpressions();
......
......@@ -162,6 +162,7 @@ private:
bool supportsThreads() const { return false; }
void updateWatchData(const WatchData &data,
const WatchUpdateFlags &flags);
void watchDataSelected(const QByteArray &iname);
void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
bool evaluateScript(const QString &expression);
......
......@@ -81,6 +81,8 @@ QmlInspectorAdapter::QmlInspectorAdapter(QmlAdapter *debugAdapter,
{
connect(m_agent, SIGNAL(objectFetched(QmlDebug::ObjectReference)),
SLOT(onObjectFetched(QmlDebug::ObjectReference)));
connect(m_agent, SIGNAL(jumpToObjectDefinition(QmlDebug::FileReference)),
SLOT(jumpToObjectDefinitionInEditor(QmlDebug::FileReference)));
QmlDebugConnection *connection = m_debugAdapter->connection();
DeclarativeEngineDebugClient *engineClient1
......@@ -473,7 +475,7 @@ void QmlInspectorAdapter::showConnectionStatusMessage(const QString &message)
m_engine->showMessage(_("QML Inspector: ") + message, LogStatus);
}
void QmlInspectorAdapter::gotoObjectReferenceDefinition(
void QmlInspectorAdapter::jumpToObjectDefinitionInEditor(
const FileReference &objSource)
{
if (m_cursorPositionChangedExternally) {
......@@ -508,7 +510,7 @@ void QmlInspectorAdapter::selectObject(const ObjectReference &obj,
QList<ObjectReference>() << obj);
if (target == EditorTarget)
gotoObjectReferenceDefinition(obj.source());
jumpToObjectDefinitionInEditor(obj.source());
agent()->selectObjectInTree(obj.debugId());
}
......
......@@ -96,6 +96,7 @@ private slots:
void onReload();
void onReloaded();
void onDestroyedObject(int);
void jumpToObjectDefinitionInEditor(const QmlDebug::FileReference &objSource);
private:
void setActiveEngineClient(QmlDebug::BaseEngineDebugClient *client);
......@@ -103,8 +104,6 @@ private:
void initializePreviews();
void showConnectionStatusMessage(const QString &message);
void gotoObjectReferenceDefinition(const QmlDebug::FileReference &objSource);
enum SelectionTarget { NoTarget, ToolTarget, EditorTarget };
void selectObject(
const QmlDebug::ObjectReference &objectReference,
......
......@@ -121,6 +121,17 @@ void QmlInspectorAgent::updateWatchData(const WatchData &data)
}
}
void QmlInspectorAgent::watchDataSelected(const WatchData *data)
{
if (debug)
qDebug() << __FUNCTION__ << '(' << data->id << ')';
if (data->id) {
QTC_ASSERT(m_debugIdLocations.keys().contains(data->id), return);
emit jumpToObjectDefinition(m_debugIdLocations.value(data->id));
}
}
bool QmlInspectorAgent::selectObjectInTree(int debugId)
{
if (debug) {
......
......@@ -60,6 +60,7 @@ public:
void assignValue(const WatchData *data, const QString &expression, const QVariant &valueV);
void updateWatchData(const WatchData &data);
void watchDataSelected(const WatchData *data);
bool selectObjectInTree(int debugId);
quint32 setBindingForObject(int objectDebugId,
......@@ -101,6 +102,7 @@ signals:
void propertyChanged(int debugId, const QByteArray &propertyName,
const QVariant &propertyValue);
void automaticUpdateFailed();
void jumpToObjectDefinition(const QmlDebug::FileReference &objSource);
private slots:
void updateStatus();
......
......@@ -992,6 +992,11 @@ void WatchTreeView::setModel(QAbstractItemModel *model)
SLOT(handleItemIsExpanded(QModelIndex)));
}
void WatchTreeView::rowClicked(const QModelIndex &index)
{
currentEngine()->watchDataSelected(currentEngine()->watchHandler()->watchData(index)->iname);
}
void WatchTreeView::handleItemIsExpanded(const QModelIndex &idx)
{
bool on = idx.data(LocalsExpandedRole).toBool();
......
......@@ -51,6 +51,7 @@ public:
explicit WatchTreeView(Type type, QWidget *parent = 0);
Type type() const { return m_type; }
void setModel(QAbstractItemModel *model);
void rowClicked(const QModelIndex &index);
void reset();
public slots:
......
......@@ -341,14 +341,14 @@ bool MaemoMakeInstallToSysrootStep::init()
const Qt4BuildConfiguration * const bc
= qobject_cast<Qt4BuildConfiguration *>(target()->activeBuildConfiguration());
if (!bc) {