Commit 1dc8d0f0 authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/3.6'

Change-Id: Ibee24c1c80984cdc45e7bcf3e4fbb5f1e6b81454
parents 4ff20dfa 7fb4315d
......@@ -114,6 +114,30 @@
data, select \uicontrol {Load QML Trace}. You can also deliver the saved data to
other developers for examination or load data saved by them.
\section1 Specifying Flushing Settings
You can specify flushing settings for the QML Profiler either globally for
all projects or separately for each project. To specify global settings,
select \uicontrol Tools > \uicontrol Options > \uicontrol Analyzer.
To specify custom QML Profiler settings for a particular project, select
\uicontrol Projects and then select \uicontrol Custom in \uicontrol
{QML Profiler Settings}. To restore the global settings for the project,
select \uicontrol {Restore Global}.
\image qml-profiler-settings.png "QML Profiler Settings"
Select the \uicontrol {Flush data while profiling} check box to flush the
data periodically instead of flushing all data when profiling stops. This
saves memory on the target device and shortens the wait between the
profiling being stopped and the data being displayed.
In the \uicontrol {Flush interval} field, set the flush interval in
milliseconds. The shorter the interval, the more often the data is flushed.
The longer the interval, the more data has to be buffered in the target
application, potentially wasting memory. However, the flushing itself takes
time, which can distort the profiling results.
\section1 Attaching to Running Qt Quick Applications
To profile Qt Quick applications that are not launched by \QC, select
......@@ -509,11 +533,6 @@
Click on an event to move to it in the source code
in the code editor.
JavaScript events often duplicate bindings or signals, so you can show and
hide them by selecting \uicontrol {Show JavaScript Events} in the context
menu. To show and hide QML events (\uicontrol Create, \uicontrol Compile,
and \uicontrol Signal), select \uicontrol {Show QML Events}.
\image qtcreator-analyzer-bindings.png "Events view"
The \uicontrol Callers and \uicontrol Callees panes show dependencies between events.
......
......@@ -2346,7 +2346,7 @@
\li Activation
\row
\li Move Component into \c filename.qml
\li Move Component into Separate File
\li Moves a QML type into a separate file
\li QML type name
\row
......@@ -2370,7 +2370,7 @@
\li QML type property
\row
\li Wrap in Loader
\li Wrap Component in Loader
\li Wraps the type in a Component type and loads it dynamically in a
Loader type. This is usually done to improve startup time.
\li QML type name
......
......@@ -39,7 +39,7 @@
\table
\header
\li {1,3} Target Platform
\li {1,2} Target Platform
\li {3,1} Development Platform
\header
\li Linux
......
......@@ -99,8 +99,8 @@
\list 1
\li Choose \uicontrol {File > New File or Project > Libraries >
C++ Library} to create the library.
\li Choose \uicontrol File > \uicontrol {New File or Project} >
\uicontrol Library > \uicontrol {C++ Library} to create the library.
The \uicontrol {Introduction and Product Location} dialog opens.
......
......@@ -47,6 +47,7 @@
\li \inlineimage creator_gettingstarted.png
\li \inlineimage creator_managingprojects.png
\li \inlineimage creator_designinguserinterface.png
\li \inlineimage creator_coding.png
\row
\li \b {\l{Getting Started}}
\list
......@@ -69,11 +70,6 @@
\li \l{Developing Widget Based Applications}
\li \l{Optimizing Applications for Mobile Devices}
\endlist
\row
\li \inlineimage creator_coding.png
\li \inlineimage creator_buildingrunning.png
\li \inlineimage creator_testing.png
\row
\li \b {\l{Coding}}
\list
\li \l{Modeling}
......@@ -81,25 +77,26 @@
\li \l{Finding}
\li \l{Refactoring}
\li \l{Configuring the Editor}
\endlist
\endlist
\row
\li \inlineimage creator_buildingrunning.png
\li \inlineimage creator_testing.png
\li \inlineimage creator_advanceduse.png
\li \inlineimage creator_gettinghelp.png
\row
\li \b {\l{Building and Running}}
\list
\li \l{Building for Multiple Platforms}
\li \l{Running on Multiple Platforms}
\li \l{Deploying to Mobile Devices}
\li \l{Connecting Mobile Devices}
\endlist
\endlist
\li \b {\l{Testing}}
\list
\li \l{Debugging}
\li \l{Analyzing Code}
\li \l{Running Autotests}
\endlist
\row
\li \inlineimage creator_advanceduse.png
\li \inlineimage creator_gettinghelp.png
\li
\row
\li \b {\l{Advanced Use}}
\list
\li \l{Supported Platforms}
......@@ -118,7 +115,7 @@
\endlist
\li
\row
\li {3,1} \note To report bugs and suggestions to the Qt Bug
\li {4,1} \note To report bugs and suggestions to the Qt Bug
Tracker, select \uicontrol {Help > Report Bug}.
You can also join the \QC mailing list at:
......
......@@ -59,7 +59,7 @@
\li \uicontrol {Qt Quick Controls UI} is like \uicontrol {Qt Quick UI},
but using Qt Quick Controls.
\li \uicontrol {Qt Quick Extension Plugins} (in the \uicontrol Libraries category)
\li \uicontrol {Qt Quick Extension Plugins} (in the \uicontrol Library category)
create C++ plugins that make it possible to offer extensions that
can be loaded dynamically into Qt Quick applications. Select
\uicontrol {Qt Quick 1 Extension Plugin} to create extensions for
......
......@@ -82,7 +82,13 @@ QDataStream &operator>>(QDataStream &in, SourceLocationContainer &container)
bool operator==(const SourceLocationContainer &first, const SourceLocationContainer &second)
{
return first.offset_ == second.offset_ && first.filePath_ == second.filePath_;
return !(first != second);
}
bool operator!=(const SourceLocationContainer &first, const SourceLocationContainer &second)
{
return first.offset_ != second.offset_
|| first.filePath_ != second.filePath_;
}
bool operator<(const SourceLocationContainer &first, const SourceLocationContainer &second)
......
......@@ -44,6 +44,7 @@ class CMBIPC_EXPORT SourceLocationContainer
friend CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const SourceLocationContainer &container);
friend CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, SourceLocationContainer &container);
friend CMBIPC_EXPORT bool operator==(const SourceLocationContainer &first, const SourceLocationContainer &second);
friend CMBIPC_EXPORT bool operator!=(const SourceLocationContainer &first, const SourceLocationContainer &second);
friend CMBIPC_EXPORT bool operator<(const SourceLocationContainer &first, const SourceLocationContainer &second);
public:
......@@ -65,6 +66,7 @@ private:
CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const SourceLocationContainer &container);
CMBIPC_EXPORT QDataStream &operator>>(QDataStream &in, SourceLocationContainer &container);
CMBIPC_EXPORT bool operator==(const SourceLocationContainer &first, const SourceLocationContainer &second);
CMBIPC_EXPORT bool operator!=(const SourceLocationContainer &first, const SourceLocationContainer &second);
CMBIPC_EXPORT bool operator<(const SourceLocationContainer &first, const SourceLocationContainer &second);
CMBIPC_EXPORT QDebug operator<<(QDebug debug, const SourceLocationContainer &container);
......
......@@ -94,7 +94,7 @@ bool ClangCodeModelPlugin::initialize(const QStringList &arguments, QString *err
pchManager, &PchManager::onProjectPartsUpdated);
// Register ModelManagerSupportProvider
cppModelManager->addModelManagerSupportProvider(&m_modelManagerSupportProvider);
cppModelManager->setClangModelManagerSupportProvider(&m_modelManagerSupportProvider);
initializeTextMarks();
......
......@@ -174,13 +174,8 @@ void ModelManagerSupportClang::onEditorOpened(Core::IEditor *editor)
TextEditor::TextDocument *textDocument = qobject_cast<TextEditor::TextDocument *>(document);
if (textDocument && cppModelManager()->isCppEditor(editor)) {
const QString clangSupportId = QLatin1String(Constants::CLANG_MODELMANAGERSUPPORT_ID);
if (cppModelManager()->isManagedByModelManagerSupport(textDocument, clangSupportId)) {
connectTextDocumentToTranslationUnit(textDocument);
connectToWidgetsMarkContextMenuRequested(editor->widget());
} else {
connectTextDocumentToUnsavedFiles(textDocument);
}
connectTextDocumentToTranslationUnit(textDocument);
connectToWidgetsMarkContextMenuRequested(editor->widget());
// TODO: Ensure that not fully loaded documents are updated?
}
......
......@@ -55,7 +55,7 @@ static const QLatin1Char kDoubleQuote('"');
static const QLatin1Char kNewLine('\n');
static const QLatin1Char kHorizontalTab('\t');
const char CLANG_MODELMANAGERSUPPORT_ID[] = "ClangCodeMode.ClangCodeMode";
const char CLANG_MODELMANAGERSUPPORT_ID[] = "ClangCodeModel.ClangCodeModel";
const char CLANG_ERROR[] = "Clang.Error";
const char CLANG_WARNING[] = "Clang.Warning";
......
......@@ -35,13 +35,11 @@
#include "../clangmodelmanagersupport.h"
#include <clangcodemodel/clangeditordocumentprocessor.h>
#include <clangcodemodel/constants.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/icore.h>
#include <cpptools/cppcodemodelsettings.h>
#include <cpptools/cpptoolsconstants.h>
#include <cpptools/cpptoolsreuse.h>
#include <cpptools/cpptoolstestcase.h>
#include <cpptools/modelmanagertesthelper.h>
......@@ -857,7 +855,7 @@ private:
ActivateClangModelManagerSupport();
CppCodeModelSettingsPtr m_codeModelSettings;
QHash<QString, QString> m_previousValues;
bool m_clangCodeModelWasUsedPreviously;
};
ActivateClangModelManagerSupport::ActivateClangModelManagerSupport(
......@@ -865,22 +863,16 @@ ActivateClangModelManagerSupport::ActivateClangModelManagerSupport(
: m_codeModelSettings(codeModelSettings)
{
QTC_CHECK(m_codeModelSettings);
const QString clangModelManagerSupportId
= QLatin1String(Constants::CLANG_MODELMANAGERSUPPORT_ID);
foreach (const QString &mimeType, CppTools::CppCodeModelSettings::supportedMimeTypes()) {
m_previousValues.insert(mimeType,
m_codeModelSettings->modelManagerSupportIdForMimeType(mimeType));
m_codeModelSettings->setModelManagerSupportIdForMimeType(mimeType,
clangModelManagerSupportId);
}
m_clangCodeModelWasUsedPreviously = m_codeModelSettings->useClangCodeModel();
m_codeModelSettings->setUseClangCodeModel(true);
m_codeModelSettings->emitChanged();
}
ActivateClangModelManagerSupport::~ActivateClangModelManagerSupport()
{
QHash<QString, QString>::const_iterator i = m_previousValues.constBegin();
for (; i != m_previousValues.end(); ++i)
m_codeModelSettings->setModelManagerSupportIdForMimeType(i.key(), i.value());
m_codeModelSettings->setUseClangCodeModel(m_clangCodeModelWasUsedPreviously);
m_codeModelSettings->emitChanged();
}
......
......@@ -51,6 +51,8 @@ Q_DECLARE_METATYPE(Core::IWizardFactory*)
namespace {
const int ICON_SIZE = 22;
const char LAST_CATEGORY_KEY[] = "Core/NewDialog/LastCategory";
const char LAST_PLATFORM_KEY[] = "Core/NewDialog/LastPlatform";
class WizardFactoryContainer
{
......@@ -188,8 +190,6 @@ using namespace Core;
using namespace Core::Internal;
bool NewDialog::m_isRunning = false;
QString NewDialog::m_lastCategory = QString();
QString NewDialog::m_lastPlatform = QString();
NewDialog::NewDialog(QWidget *parent) :
QDialog(parent),
......@@ -302,12 +302,18 @@ void NewDialog::showDialog()
{
QModelIndex idx;
if (!m_lastPlatform.isEmpty())
m_ui->comboBox->setCurrentIndex(m_ui->comboBox->findData(m_lastPlatform));
QString lastPlatform = ICore::settings()->value(QLatin1String(LAST_PLATFORM_KEY)).toString();
QString lastCategory = ICore::settings()->value(QLatin1String(LAST_CATEGORY_KEY)).toString();
if (!m_lastCategory.isEmpty())
if (!lastPlatform.isEmpty()) {
int index = m_ui->comboBox->findData(lastPlatform);
if (index != -1)
m_ui->comboBox->setCurrentIndex(index);
}
if (!lastCategory.isEmpty())
foreach (QStandardItem* item, m_categoryItems) {
if (item->data(Qt::UserRole) == m_lastCategory)
if (item->data(Qt::UserRole) == lastCategory)
idx = m_twoLevelProxyModel->mapToSource(m_model->indexFromItem(item));
}
if (!idx.isValid())
......@@ -449,8 +455,9 @@ void NewDialog::saveState()
QModelIndex idx = m_ui->templateCategoryView->currentIndex();
QStandardItem *currentItem = m_model->itemFromIndex(m_twoLevelProxyModel->mapToSource(idx));
if (currentItem)
m_lastCategory = currentItem->data(Qt::UserRole).toString();
m_lastPlatform = m_ui->comboBox->currentData().toString();
ICore::settings()->setValue(QLatin1String(LAST_CATEGORY_KEY),
currentItem->data(Qt::UserRole));
ICore::settings()->setValue(QLatin1String(LAST_PLATFORM_KEY), m_ui->comboBox->currentData());
}
void NewDialog::accept()
......
......@@ -85,8 +85,6 @@ private:
void addItem(QStandardItem *topLevelCategoryItem, IWizardFactory *factory);
void saveState();
static QString m_lastCategory;
static QString m_lastPlatform;
static bool m_isRunning;
Ui::NewDialog *m_ui;
......
......@@ -2517,8 +2517,6 @@ static void mimeTypeFactoryLookup(const Utils::MimeType &mimeType,
seen.insert(parent.name());
if (seen.size() != seenSize) // not seen before, so add
queue.append(parent);
else
qWarning("MimeTypes: Parent hierarchy loop detected for '%s'!", qPrintable(parent.name()));
}
}
}
......
......@@ -61,8 +61,6 @@ const char CPP_SNIPPETS_GROUP_ID[] = "C++";
const char CPP_PREPROCESSOR_PROJECT_PREFIX[] = "CppPreprocessorProject-";
const char CLANG_MODELMANAGERSUPPORT_ID[] = "ClangCodeMode.ClangCodeMode";
} // namespace Constants
} // namespace CppEditor
......
......@@ -181,7 +181,7 @@ void CppEditorDocument::onMimeTypeChanged()
const QString &mt = mimeType();
m_isObjCEnabled = (mt == QLatin1String(CppTools::Constants::OBJECTIVE_C_SOURCE_MIMETYPE)
|| mt == QLatin1String(CppTools::Constants::OBJECTIVE_CPP_SOURCE_MIMETYPE));
m_completionAssistProvider = mm()->completionAssistProvider(mt);
m_completionAssistProvider = mm()->completionAssistProvider();
initializeTimer();
}
......@@ -292,7 +292,7 @@ void CppEditorDocument::releaseResources()
void CppEditorDocument::initializeTimer()
{
m_processorTimer.setSingleShot(true);
if (mm()->isManagedByModelManagerSupport(this, QLatin1String(Constants::CLANG_MODELMANAGERSUPPORT_ID)))
if (mm()->isClangCodeModelActive())
m_processorTimer.setInterval(clangProcessDocumentIntervalInMs);
else
m_processorTimer.setInterval(processDocumentIntervalInMs);
......
......@@ -1298,7 +1298,7 @@ bool CheckSymbols::maybeAddFunction(const QList<LookupItem> &candidates, NameAST
Function *funTy = c->type()->asFunctionType();
if (!funTy) // Template function has an overridden type
funTy = r.type()->asFunctionType();
if (!funTy)
if (!funTy || funTy->isAmbiguous())
continue; // TODO: add diagnostic messages and color call-operators calls too?
if (argumentCount < funTy->minimumArgumentCount()) {
......
......@@ -29,23 +29,22 @@
****************************************************************************/
#include "cppcodemodelsettings.h"
#include "cppmodelmanagersupport.h"
#include "cpptoolsconstants.h"
#include <QSettings>
using namespace CppTools;
static QLatin1String cppHeaderMimeType(Constants::CPP_HEADER_MIMETYPE);
static QLatin1String cHeaderMimeType(Constants::C_HEADER_MIMETYPE);
static QLatin1String clangExtraOptionsKey(Constants::CPPTOOLS_EXTRA_CLANG_OPTIONS);
static QLatin1String useClangCodeModelKey(Constants::CPPTOOLS_USE_CLANG_CODE_MODEL);
void CppCodeModelSettings::fromSettings(QSettings *s)
{
s->beginGroup(QLatin1String(Constants::CPPTOOLS_SETTINGSGROUP));
QVariant supporters = s->value(QLatin1String(Constants::CPPTOOLS_MODEL_MANAGER_SUPPORTERS_KEY));
foreach (const QString &mimeType, supportedMimeTypes())
setIdForMimeType(supporters, mimeType);
setUseClangCodeModel(s->value(useClangCodeModelKey, false).toBool());
setExtraClangOptions(s->value(clangExtraOptionsKey, defaultExtraClangOptions()).toStringList());
QVariant v = s->value(QLatin1String(Constants::CPPTOOLS_MODEL_MANAGER_PCH_USAGE), PchUse_None);
......@@ -58,66 +57,24 @@ void CppCodeModelSettings::fromSettings(QSettings *s)
void CppCodeModelSettings::toSettings(QSettings *s)
{
s->beginGroup(QLatin1String(Constants::CPPTOOLS_SETTINGSGROUP));
QHash<QString, QVariant> var;
foreach (const QString &mimeType, m_modelManagerSupportByMimeType.keys())
var[mimeType] = m_modelManagerSupportByMimeType[mimeType];
s->setValue(QLatin1String(Constants::CPPTOOLS_MODEL_MANAGER_SUPPORTERS_KEY), QVariant(var));
s->setValue(useClangCodeModelKey, useClangCodeModel());
s->setValue(clangExtraOptionsKey, extraClangOptions());
s->setValue(QLatin1String(Constants::CPPTOOLS_MODEL_MANAGER_PCH_USAGE), pchUsage());
s->endGroup();
emit changed();
}
QStringList CppCodeModelSettings::supportedMimeTypes()
{
return QStringList({
QLatin1String(Constants::C_SOURCE_MIMETYPE),
QLatin1String(Constants::CPP_SOURCE_MIMETYPE),
QLatin1String(Constants::OBJECTIVE_C_SOURCE_MIMETYPE),
QLatin1String(Constants::OBJECTIVE_CPP_SOURCE_MIMETYPE),
QLatin1String(Constants::CPP_HEADER_MIMETYPE)
});
}
s->endGroup();
void CppCodeModelSettings::emitChanged()
{
emit changed();
}
void CppCodeModelSettings::setModelManagerSupportProviders(
const QList<ModelManagerSupportProvider *> &providers)
bool CppCodeModelSettings::useClangCodeModel() const
{
m_modelManagerSupportsByName.clear();
foreach (ModelManagerSupportProvider *provider, providers)
m_modelManagerSupportsByName[provider->displayName()] = provider->id();
return m_useClangCodeModel;
}
QString CppCodeModelSettings::modelManagerSupportIdForMimeType(const QString &mimeType) const
void CppCodeModelSettings::setUseClangCodeModel(bool useClangCodeModel)
{
if (mimeType == cHeaderMimeType)
return m_modelManagerSupportByMimeType.value(cppHeaderMimeType);
else
return m_modelManagerSupportByMimeType.value(mimeType);
}
void CppCodeModelSettings::setModelManagerSupportIdForMimeType(const QString &mimeType,
const QString &id)
{
QString theMimeType = mimeType;
if (theMimeType == cHeaderMimeType)
theMimeType = cppHeaderMimeType;
m_modelManagerSupportByMimeType.insert(theMimeType, id);
}
bool CppCodeModelSettings::hasModelManagerSupportIdForMimeType(const QString &mimeType,
const QString &id) const
{
if (mimeType == cHeaderMimeType)
return m_modelManagerSupportByMimeType.value(cppHeaderMimeType) == id;
else
return m_modelManagerSupportByMimeType.value(mimeType) == id;
m_useClangCodeModel = useClangCodeModel;
}
QStringList CppCodeModelSettings::defaultExtraClangOptions()
......@@ -147,8 +104,17 @@ void CppCodeModelSettings::setExtraClangOptions(const QStringList &extraClangOpt
m_extraClangOptions = extraClangOptions;
}
void CppCodeModelSettings::setIdForMimeType(const QVariant &var, const QString &mimeType)
CppCodeModelSettings::PCHUsage CppCodeModelSettings::pchUsage() const
{
QHash<QString, QVariant> mimeToId = var.toHash();
m_modelManagerSupportByMimeType[mimeType] = mimeToId.value(mimeType, defaultId()).toString();
return m_pchUsage;
}
void CppCodeModelSettings::setPCHUsage(CppCodeModelSettings::PCHUsage pchUsage)
{
m_pchUsage = pchUsage;
}
void CppCodeModelSettings::emitChanged()
{
emit changed();
}
......@@ -33,14 +33,14 @@
#include "cpptools_global.h"
#include <QHash>
#include <QList>
#include <QSettings>
#include <QString>
#include <QObject>
#include <QStringList>
namespace CppTools {
QT_BEGIN_NAMESPACE
class QSettings;
QT_END_NAMESPACE
class ModelManagerSupportProvider;
namespace CppTools {
class CPPTOOLS_EXPORT CppCodeModelSettings : public QObject
{
......@@ -53,34 +53,19 @@ public:
};
public:
CppCodeModelSettings(): m_pchUsage(PchUse_None) {}
void fromSettings(QSettings *s);
void toSettings(QSettings *s);
void setModelManagerSupportProviders(const QList<ModelManagerSupportProvider *> &supporters);
QString modelManagerSupportIdForMimeType(const QString &mimeType) const;
void setModelManagerSupportIdForMimeType(const QString &mimeType, const QString &id);
bool hasModelManagerSupportIdForMimeType(const QString &mimeType, const QString &id) const;
const QHash<QString, QString> &availableModelManagerSupportProvidersByName() const
{ return m_modelManagerSupportsByName; }
QString defaultId() const
{ return m_defaultId; }
void setDefaultId(const QString &defaultId)
{ m_defaultId = defaultId; }
public:
bool useClangCodeModel() const;
void setUseClangCodeModel(bool useClangCodeModel);
static QStringList defaultExtraClangOptions();
QStringList extraClangOptions() const;
void setExtraClangOptions(const QStringList &extraClangOptions);
PCHUsage pchUsage() const { return m_pchUsage; }
void setPCHUsage(PCHUsage pchUsage) { m_pchUsage = pchUsage; }
static QStringList supportedMimeTypes();
PCHUsage pchUsage() const;
void setPCHUsage(PCHUsage pchUsage);
public: // for tests
void emitChanged();
......@@ -89,14 +74,10 @@ signals:
void changed();
private:
void setIdForMimeType(const QVariant &var, const QString &mimeType);
private:
QHash<QString, QString> m_modelManagerSupportByMimeType;
QHash<QString, QString> m_modelManagerSupportsByName;
bool m_isClangCodeModelAvailable = false;
bool m_useClangCodeModel = false;
QStringList m_extraClangOptions;
QString m_defaultId;
PCHUsage m_pchUsage;