Merge remote-tracking branch 'origin/4.1'

Change-Id: I5cdc704c827a6f5abf4dc39e2a131d53df328bd2
This commit is contained in:
Eike Ziller
2016-06-22 11:29:07 +02:00
34 changed files with 272 additions and 96 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -120,7 +120,7 @@
\li Qt Quick Controls Application \li Qt Quick Controls Application
Create a Qt Quick application using Create a Qt Quick application using
\l{http://doc-snapshots.qt.io/qt5-5.7/qtquickcontrols2-index.html} \l{http://doc.qt.io/qt-5/qtquickcontrols2-index.html}
{Qt Quick Controls 2} (requires Qt 5.7 or later), {Qt Quick Controls 2} (requires Qt 5.7 or later),
\l{http://doc.qt.io/qt-5/qtquickcontrols-index.html} \l{http://doc.qt.io/qt-5/qtquickcontrols-index.html}
{Qt Quick Controls}, or {Qt Quick Controls}, or

View File

@@ -37,27 +37,72 @@
\title Adding JSON-Based Wizards \title Adding JSON-Based Wizards
\image qtcreator-new-qt-gui-application.png \QC searches for wizards in the shared directory and in the local user's
settings directory, as described in \l{Locating Wizards}.
The JSON-based wizards are displayed in the \uicontrol New dialog. To
customize them, copy a directory that contains a \c {wizard.json} file in
\c {share/qtcreator/templates/wizards/} and modify it to fit your needs.
After you run qmake and restart \QC, the wizard name appears in the
selected or added category. For each wizard, an icon, a display name, and
a description are displayed.
JSON-based wizard template directories contain a JSON configuration file JSON-based wizard template directories contain a JSON configuration file
called \c {wizard.json} and any template files needed. The configuration called \c {wizard.json} and any template files needed. The configuration
file contains sections that specify information about the wizard, variables file contains sections that specify information about the wizard, variables
that you can use, wizard pages, and generators for creating files. that you can use, wizard pages, and generators for creating files.
To create a customized wizard, copy a template directory to the shared
directory or the settings directory under a new name. If you want to use
qmake to build the wizard and integrate it into \QC, use the shared
directory. Otherwise, you can create a subdirectory in the settings
directory. The standard wizards are organized into subdirectories by type,
but you can add your wizard directory to any directory you like. The folder
hierarchy does not affect the order in which the wizards are displayed.
To share the wizard with other users, you can create an archive of the
wizard directory and instruct the recipients to extract it into one of the
directories \QC searches wizards from.
For wizard development, we recommend that you start \QC with the
\c {-customwizard-verbose} argument to receive confirmation that \QC was
able to find and parse the \c {wizard.json} file. The verbose mode displays
information about syntax errors, which are the most typical errors you might
run into while editing wizards. For more information, see
\l {Verbose Output}.
In addition, set keyboard shortcuts for the \uicontrol Inspect and
\uicontrol {Factory.Reset} functions to be able to inspect the fields and
variables in the wizard and to have the wizard listed in \uicontrol File >
\uicontrol {New File or Project} without restarting \QC. For more
information, see \l {Tips for Wizard Development}.
\QC displays the wizards that it finds in the
\uicontrol {New File or Project} dialog. For each wizard, an icon (1), a
display name (2), and a description (3) are displayed.
\image qtcreator-custom-wizard.png
\section1 Integrating Wizards into Qt Creator Builds
To integrate the wizard into \QC and to deliver it as part of the \QC build,
place the wizard files in the \QC sources. Then select \uicontrol Build >
\uicontrol {Run qmake}, so that the new files you added for your wizard are
actually copied from the \QC source directory into the \QC build directory
as part of the next \QC build.
If you do not run qmake, your new wizard will not show up, because it does
not exist in the build directory you run your newly built \QC from. It never
got copied there, because make did not know that the files exist in the
source tree, because qmake did not inform make that the files were added
recently.
Basically, qmake generates a fixed list of files to copy from the source
directory to the sudirectory of the build directory that is checked for
wizards at runtime. Therefore, you need to run qmake or execute the
\uicontrol {Factory.Reset} function each time the names or locations of the
files change.
\section1 Using Variables in Wizards \section1 Using Variables in Wizards
You can use variables (\c {%\{<variableName>\}}) in the configuration and You can use variables (\c {%\{<variableName>\}}) in the configuration and
template source files. A set of variables is predefined by the wizards and template source files. A set of variables is predefined by the wizards and
their pages. You can introduce new variables as shortcuts to be used later. their pages. You can introduce new variables as shortcuts to be used later.
Define the variable key names and values in the \c options section in the Define the variable key names and values in the \c options section in the
\c {.json} file. \c {wizard.json} file.
The variables always return strings. In places where a boolean value is The variables always return strings. In places where a boolean value is
expected and a string is given, an empty string as well as the string expected and a string is given, an empty string as well as the string
@@ -87,34 +132,45 @@
use them as basis for adding your own wizards. We use the C++ wizard use them as basis for adding your own wizards. We use the C++ wizard
to explain the process and the sections and settings in the .json file. to explain the process and the sections and settings in the .json file.
In this example, we create the wizard directory in the shared directory
and integrate it in the \QC build system, so that it can deployed along with
the \QC binaries as part of the build.
\image qtcreator-cpp-class-wizard.png \image qtcreator-cpp-class-wizard.png
For more information about the pages and widgets that you can add, see For more information about the pages and widgets that you can add and their
\l {Available Pages} and \l{Available Widgets}. supported properties, see \l {Available Pages} and \l{Available Widgets}.
To create a JSON-based C++ class wizard: To create a JSON-based C++ class wizard:
\list 1 \list 1
\li Make a copy of \c {share/qtcreator/templates/wizards/classes/cpp} \li Start \QC with the \c {-customwizard-verbose} argument to receive
and rename it. feedback during wizard development. For more information, see
\l {Verbose Output}.
\li Right-click the project name in \uicontrol Projects view and \li Set keyboard shortcuts for the \uicontrol Inspect and
select \uicontrol {Run qmake} from the context menu to register the \uicontrol {Factory.Reset} actions, as described in
new wizard. Basically, qmake generates a fixed list of files to \l {Tips for Wizard Development}.
copy. Therefore, you need to run qmake each time the names or
locations of the files change. \li Make a copy of \c {share/qtcreator/templates/wizards/classes/cpp}
and rename it. For example,
\c {share/qtcreator/templates/wizards/classes/mycpp}
\li Use the \uicontrol {Factory.Reset} action to make the wizard appear
in \uicontrol File > \uicontrol {New File or Project} without
restarting \QC.
\li Open the wizard configuration file, \c {wizard.json} for editing: \li Open the wizard configuration file, \c {wizard.json} for editing:
\list \list
\li The following settings determine the type of the wizard and \li The following settings determine the type of the wizard and
its place in the \uicontrol New dialog: its place in the \uicontrol {New File or Project} dialog:
\code \code
"version": 1, "version": 1,
"kind": "file", "supportedProjectTypes": [ ],
"id": "A.Class", "id": "A.Class",
"category": "O.C++", "category": "O.C++",
\endcode \endcode
@@ -124,15 +180,26 @@
\li \c version is the version of the file contents. Do not \li \c version is the version of the file contents. Do not
modify this value. modify this value.
\li \c kind specifies the type of the wizard: \c file or \li \c supportedProjectTypes is an optional setting that
\c project. can be used to filter wizards when adding a new build
target to an existing project. For example, only wizards
that produce qmake projects should be provided when
adding a new target to an existing qmake project.
This information is available in the wizard as Possible values are the build systems supported by \QC
\c {%\{kind\}} with values \c file or \c project. or \c UNKNOWN_PROJECT if the build system is not
specified: \c AutotoolsProjectManager.AutotoolsProject,
\c CMakeProjectManager.CMakeProject,
\c GenericProjectManager.GenericProject,
\c PythonProject, \c Qbs.QbsProject,
\c Qt4ProjectManager.Qt4Project (qmake project),
\c QmlProjectManager.QmlProject
\li \c id is the unique identifier for your wizard. You can \li \c id is the unique identifier for your wizard. Wizards
use a leading letter to specify the position of the are sorted by the ID in alphabetic order within the
wizard within the \c category. \c category. You can use a leading letter to specify the
position of the wizard. You must always change
this value. For example, \c B.MyClass.
This information is available in the wizard as This information is available in the wizard as
\c {%\{id\}}. \c {%\{id\}}.
@@ -140,20 +207,21 @@
\li \c category is the category in which to place the wizard \li \c category is the category in which to place the wizard
in the list. You can use a leading letter to specify the in the list. You can use a leading letter to specify the
position of the category in the list in the position of the category in the list in the
\uicontrol New dialog. \uicontrol {New File or Project} dialog.
This information is available in the wizard as This information is available in the wizard as
\c {%\{category\}}. \c {%\{category\}}.
\endlist \endlist
\li The following settings specify the icon and text that appear in \li The following settings specify the icon and text that appear in
the \uicontrol New dialog: the \uicontrol {New File or Project} dialog:
\code \code
"trDescription": "Creates a C++ header and a source file for a new class that you can add to a C++ project.", "trDescription": "Creates a C++ header and a source file for a new class that you can add to a C++ project.",
"trDisplayName": "C++ Class", "trDisplayName": "C++ Class",
"trDisplayCategory": "C++", "trDisplayCategory": "C++",
"icon": "../../global/genericfilewizard.png", "icon": "../../global/genericfilewizard.png",
"enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}",
\endcode \endcode
\list \list
@@ -170,8 +238,9 @@
This information is available in the wizard as This information is available in the wizard as
\c {%\{trDisplayName\}}. \c {%\{trDisplayName\}}.
\li \c trDisplayCategory appears in the \uicontrol New dialog, \li \c trDisplayCategory appears in the
under \uicontrol Projects. \uicontrol {New File or Project} dialog, under
\uicontrol Projects.
This information is available in the wizard as This information is available in the wizard as
\c {%\{trDisplayCategory\}}. \c {%\{trDisplayCategory\}}.
@@ -250,16 +319,16 @@
"trDisplayName": "Define Class", "trDisplayName": "Define Class",
"trShortTitle": "Details", "trShortTitle": "Details",
"typeId": "Fields", "typeId": "Fields",
"data" : "data" :
[ [
{ {
"name": "Class", "name": "Class",
"trDisplayName": "Class name:", "trDisplayName": "Class name:",
"mandatory": true, "mandatory": true,
"type": "LineEdit", "type": "LineEdit",
"data": { "validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)+[a-zA-Z_][a-zA-Z_0-9]*|)" } "data": { "validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)+[a-zA-Z_][a-zA-Z_0-9]*|)" }
}, },
... ...
] ]
\endcode \endcode
@@ -580,6 +649,9 @@
\li Text Edit \li Text Edit
\endlist \endlist
\note Only the the settings documented in the following sections are
supported in wizards.
Specify the following settings for each widget: Specify the following settings for each widget:
\list \list

View File

@@ -78,7 +78,7 @@
\li the local user's configuration folder, \li the local user's configuration folder,
\c {$HOME/.config/QtProject/qtcreator/templates/wizards} on Linux \c {$HOME/.config/QtProject/qtcreator/templates/wizards} on Linux
and OS X or \c {%APPDATA%\QtProject\qtcreator\templates\wizards} on and OS X or \c {%APPDATA%\QtProject\qtcreator\templates\wizards} on
windows Windows
\endlist \endlist
@@ -114,9 +114,34 @@
a wizard definition to become visible. a wizard definition to become visible.
\endtable \endtable
\note When developing custom wizards (both JSON as well as XML based), it is \section2 Verbose Output
recommended to start \QC with the \c {-customwizard-verbose} argument. See
\l{Using Command Line Options} for more information about command line
arguments.
When developing custom wizards (both JSON as well as XML based), it is
recommended to start \QC with the \c {-customwizard-verbose} argument. It
causes each correctly set up wizard to produce output along the following
lines:
\code
Checking "/home/jsmith/.config/QtProject/qtcreator/templates/wizards/mywizard"
for wizard.json.
* Configuration found and parsed.
\endcode
The output includes the name of the directory that was checked for a
\c wizard.json file. If the file is not found, the message is not displayed.
If the file contains errors, such as an invalid icon path, the following
types of messages are displayed:
\code
Checking "/home/jsmith/.config/QtProject/qtcreator/templates/wizards/mywizard"
for wizard.json.
* Configuration found and parsed.
* Failed to create: Icon file
"/home/jsmith/.config/QtProject/qtcreator/templates/wizards/mywizard/../..
/global/genericfilewizard.png" not found.
\endcode
See \l{Using Command Line Options} for more information about command line
arguments.
*/ */

View File

@@ -54,7 +54,7 @@
\uicontrol {Qt Quick Controls 2 Application}, and \uicontrol {Qt Quick Controls 2 Application}, and
\uicontrol {Qt Labs Controls Application} are like \uicontrol {Qt Labs Controls Application} are like
\uicontrol {Qt Quick Application}, but using \uicontrol {Qt Quick Application}, but using
\l{http://doc-snapshots.qt.io/qt5-5.7/qtquickcontrols2-index.html} \l{http://doc.qt.io/qt-5/qtquickcontrols2-index.html}
{Qt Quick Controls 2} (requires Qt 5.7 or later), {Qt Quick Controls 2} (requires Qt 5.7 or later),
\l{http://doc.qt.io/qt-5/qtquickcontrols-index.html} \l{http://doc.qt.io/qt-5/qtquickcontrols-index.html}
{Qt Quick Controls}, or {Qt Quick Controls}, or

View File

@@ -92,7 +92,7 @@ void ReadMessageBlock::resetCounter()
bool ReadMessageBlock::isTheWholeMessageReadable(QDataStream &in) bool ReadMessageBlock::isTheWholeMessageReadable(QDataStream &in)
{ {
if (ioDevice->bytesAvailable() == 0) if (ioDevice->bytesAvailable() < sizeof(blockSize))
return false; return false;
if (blockSize == 0) if (blockSize == 0)

View File

@@ -266,10 +266,9 @@ public:
bool setData(int column, const QVariant &data, int role) bool setData(int column, const QVariant &data, int role)
{ {
if (column == LoadedColumn && role == Qt::CheckStateRole) { if (column == LoadedColumn && role == Qt::CheckStateRole) {
QSet<PluginSpec *> affectedPlugins; const QList<PluginSpec *> affectedPlugins =
foreach (TreeItem *item, children()) Utils::filtered(m_plugins, [](PluginSpec *spec) { return !spec->isRequired(); });
affectedPlugins.insert(static_cast<PluginItem *>(item)->m_spec); if (m_view->setPluginsEnabled(affectedPlugins.toSet(), data.toBool())) {
if (m_view->setPluginsEnabled(affectedPlugins, data.toBool())) {
update(); update();
return true; return true;
} }

View File

@@ -407,8 +407,6 @@ void QrcParserPrivate::collectResourceFilesForSourceFile(const QString &sourceFi
const QLocale *locale) const const QLocale *locale) const
{ {
// TODO: use FileName from fileutils for file pathes // TODO: use FileName from fileutils for file pathes
QTC_CHECK(QFileInfo(sourceFile).isFile());
QTC_CHECK(QFileInfo(sourceFile).isAbsolute());
QStringList langs = allUiLanguages(locale); QStringList langs = allUiLanguages(locale);
SMap::const_iterator file = m_files.find(sourceFile); SMap::const_iterator file = m_files.find(sourceFile);

View File

@@ -207,9 +207,8 @@ bool FileUtils::isFileNewerThan(const FileName &filePath, const QDateTime &timeS
} }
/*! /*!
Recursively resolves possibly present symlinks in \a filePath. Recursively resolves symlinks if \a filePath is a symlink.
Unlike QFileInfo::canonicalFilePath(), this function will still return the expected target file To resolve symlinks anywhere in the path, see canonicalPath
even if the symlink is dangling.
\note Maximum recursion depth == 16. \note Maximum recursion depth == 16.
@@ -226,6 +225,21 @@ FileName FileUtils::resolveSymlinks(const FileName &path)
return FileName::fromString(f.filePath()); return FileName::fromString(f.filePath());
} }
/*!
Recursively resolves possibly present symlinks in \a filePath.
Unlike QFileInfo::canonicalFilePath(), this function will not return an empty
string if path doesn't exist.
Returns the canonical path.
*/
FileName FileUtils::canonicalPath(const FileName &path)
{
const QString result = QFileInfo(path.toString()).canonicalFilePath();
if (result.isEmpty())
return path;
return FileName::fromString(result);
}
/*! /*!
Like QDir::toNativeSeparators(), but use prefix '~' instead of $HOME on unix systems when an Like QDir::toNativeSeparators(), but use prefix '~' instead of $HOME on unix systems when an
absolute path is given. absolute path is given.

View File

@@ -108,6 +108,7 @@ public:
QString *error = 0, const std::function<bool (QFileInfo, QFileInfo, QString *)> &copyHelper = std::function<bool (QFileInfo, QFileInfo, QString *)>()); QString *error = 0, const std::function<bool (QFileInfo, QFileInfo, QString *)> &copyHelper = std::function<bool (QFileInfo, QFileInfo, QString *)>());
static bool isFileNewerThan(const FileName &filePath, const QDateTime &timeStamp); static bool isFileNewerThan(const FileName &filePath, const QDateTime &timeStamp);
static FileName resolveSymlinks(const FileName &path); static FileName resolveSymlinks(const FileName &path);
static FileName canonicalPath(const FileName &path);
static QString shortNativePath(const FileName &path); static QString shortNativePath(const FileName &path);
static QString fileSystemFriendlyName(const QString &name); static QString fileSystemFriendlyName(const QString &name);
static int indexOfQmakeUnfriendly(const QString &name, int startpos = 0); static int indexOfQmakeUnfriendly(const QString &name, int startpos = 0);

View File

@@ -87,7 +87,8 @@ SOURCES += \
avddialog.cpp \ avddialog.cpp \
androidbuildapkstep.cpp \ androidbuildapkstep.cpp \
androidbuildapkwidget.cpp \ androidbuildapkwidget.cpp \
androidqtsupport.cpp androidqtsupport.cpp \
androidrunnable.cpp
FORMS += \ FORMS += \
androidsettingswidget.ui \ androidsettingswidget.ui \

View File

@@ -80,6 +80,7 @@ Project {
"androidruncontrol.h", "androidruncontrol.h",
"androidrunfactories.cpp", "androidrunfactories.cpp",
"androidrunfactories.h", "androidrunfactories.h",
"androidrunnable.cpp",
"androidrunnable.h", "androidrunnable.h",
"androidrunner.cpp", "androidrunner.cpp",
"androidrunner.h", "androidrunner.h",

View File

@@ -28,6 +28,7 @@
#include "androidsignaloperation.h" #include "androidsignaloperation.h"
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
#include <projectexplorer/runnables.h>
#include <QCoreApplication> #include <QCoreApplication>

View File

@@ -0,0 +1,32 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** 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 The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "androidrunnable.h"
namespace Android {
void *AndroidRunnable::staticTypeId = &AndroidRunnable::staticTypeId;
} // namespace Android

View File

@@ -39,6 +39,8 @@ struct ANDROID_EXPORT AndroidRunnable
QVector<QStringList> beforeStartADBCommands; QVector<QStringList> beforeStartADBCommands;
QVector<QStringList> afterFinishADBCommands; QVector<QStringList> afterFinishADBCommands;
QString deviceSerialNumber; QString deviceSerialNumber;
static void *staticTypeId;
}; };
inline bool operator==(const AndroidRunnable &r1, const AndroidRunnable &r2) inline bool operator==(const AndroidRunnable &r1, const AndroidRunnable &r2)

View File

@@ -401,6 +401,7 @@ void BinEditorWidget::setSizes(quint64 startAddr, qint64 range, int blockSize)
m_blockSize = blockSize; m_blockSize = blockSize;
m_emptyBlock = QByteArray(blockSize, '\0'); m_emptyBlock = QByteArray(blockSize, '\0');
m_data.clear();
m_modifiedData.clear(); m_modifiedData.clear();
m_requests.clear(); m_requests.clear();
@@ -1567,9 +1568,7 @@ void BinEditorWidget::setNewWindowRequestAllowed(bool c)
void BinEditorWidget::updateContents() void BinEditorWidget::updateContents()
{ {
m_oldData = m_data; m_oldData = m_data;
m_data.clear();
setSizes(baseAddress() + cursorPosition(), m_size, m_blockSize); setSizes(baseAddress() + cursorPosition(), m_size, m_blockSize);
viewport()->update();
} }
QPoint BinEditorWidget::offsetToPos(qint64 offset) const QPoint BinEditorWidget::offsetToPos(qint64 offset) const

View File

@@ -289,8 +289,12 @@ CMakeConfig BuildDirManager::parsedConfiguration() const
emit errorOccured(errorMessage); emit errorOccured(errorMessage);
const Utils::FileName sourceOfBuildDir const Utils::FileName sourceOfBuildDir
= Utils::FileName::fromUtf8(CMakeConfigItem::valueOf("CMAKE_HOME_DIRECTORY", m_cmakeCache)); = Utils::FileName::fromUtf8(CMakeConfigItem::valueOf("CMAKE_HOME_DIRECTORY", m_cmakeCache));
if (sourceOfBuildDir != sourceDirectory()) // Use case-insensitive compare where appropriate const Utils::FileName canonicalSourceOfBuildDir = Utils::FileUtils::canonicalPath(sourceOfBuildDir);
emit errorOccured(tr("The build directory is not for %1").arg(sourceDirectory().toUserOutput())); const Utils::FileName canonicalSourceDirectory = Utils::FileUtils::canonicalPath(sourceDirectory());
if (canonicalSourceOfBuildDir != canonicalSourceDirectory) // Uses case-insensitive compare where appropriate
emit errorOccured(tr("The build directory is not for %1 but for %2")
.arg(canonicalSourceOfBuildDir.toUserOutput(),
canonicalSourceDirectory.toUserOutput()));
} }
return m_cmakeCache; return m_cmakeCache;
} }

View File

@@ -307,7 +307,7 @@ void CMakeBuildConfiguration::setCMakeConfiguration(const CMakeConfig &config)
} }
if (hasKitOverride) if (hasKitOverride)
setWarning(tr("CMake Configuration set by the Kit was overridden in the project.")); setWarning(tr("CMake configuration set by the kit was overridden in the project."));
else else
setWarning(QString()); setWarning(QString());
} }

View File

@@ -39,6 +39,8 @@ public:
QString analyzerHost; QString analyzerHost;
QString analyzerSocket; QString analyzerSocket;
Utils::Port analyzerPort; Utils::Port analyzerPort;
static void *staticTypeId;
}; };
} // namespace Debugger } // namespace Debugger

View File

@@ -3849,6 +3849,9 @@ QList<QObject *> DebuggerPlugin::createTestObjects() const
#endif // if WITH_TESTS #endif // if WITH_TESTS
} // namespace Internal } // namespace Internal
void *AnalyzerConnection::staticTypeId = &AnalyzerConnection::staticTypeId;
} // namespace Debugger } // namespace Debugger
#include "debuggerplugin.moc" #include "debuggerplugin.moc"

View File

@@ -187,7 +187,7 @@ void LldbEngine::setupEngine()
// FIXME: We can't handle terminals yet. // FIXME: We can't handle terminals yet.
if (runParameters().useTerminal) { if (runParameters().useTerminal) {
qWarning("Run in Terminal is not supported yet with the LLDB backend"); qWarning("Run in Terminal is not supported yet with the LLDB backend");
showMessage(tr("Run in Terminal is not supported yet with the LLDB backend"), AppError); showMessage(tr("Run in Terminal is not supported with the LLDB backend."), AppError);
runParameters().useTerminal = false; runParameters().useTerminal = false;
} }

View File

@@ -157,7 +157,6 @@ bool MemoryAgent::doCreateBinEditor(const MemoryViewSetupData &data)
topLevel->setWindowTitle(title); topLevel->setWindowTitle(title);
} }
m_views << topLevel; m_views << topLevel;
topLevel->move(data.pos);
topLevel->show(); topLevel->show();
return true; return true;
} }

View File

@@ -56,6 +56,7 @@ MemoryView::MemoryView(QWidget *binEditor, QWidget *parent) :
layout->addWidget(binEditor); layout->addWidget(binEditor);
layout->setContentsMargins(0, 0, 0, 0); layout->setContentsMargins(0, 0, 0, 0);
setMinimumWidth(400); setMinimumWidth(400);
resize(800, 200);
} }
void MemoryView::setBinEditorRange(QWidget *w, quint64 address, qint64 range, int blockSize) void MemoryView::setBinEditorRange(QWidget *w, quint64 address, qint64 range, int blockSize)

View File

@@ -28,8 +28,9 @@
#include "customwizardpage.h" #include "customwizardpage.h"
#include "customwizardscriptgenerator.h" #include "customwizardscriptgenerator.h"
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/baseprojectwizarddialog.h> #include <projectexplorer/baseprojectwizarddialog.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/runconfiguration.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/messagemanager.h> #include <coreplugin/messagemanager.h>

View File

@@ -32,6 +32,7 @@
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
#include <projectexplorer/runnables.h>
#include <ssh/sshconnection.h> #include <ssh/sshconnection.h>

View File

@@ -31,6 +31,7 @@
#include "../kit.h" #include "../kit.h"
#include "../kitinformation.h" #include "../kitinformation.h"
#include "../runconfiguration.h" #include "../runconfiguration.h"
#include "../runnables.h"
#include <ssh/sshconnection.h> #include <ssh/sshconnection.h>
#include <utils/portlist.h> #include <utils/portlist.h>
@@ -467,4 +468,6 @@ DeviceEnvironmentFetcher::DeviceEnvironmentFetcher()
{ {
} }
void *HostName::staticTypeId = &HostName::staticTypeId;
} // namespace ProjectExplorer } // namespace ProjectExplorer

View File

@@ -108,16 +108,6 @@ public:
virtual QList<Utils::Port> usedPorts(const QByteArray &commandOutput) const = 0; virtual QList<Utils::Port> usedPorts(const QByteArray &commandOutput) const = 0;
}; };
class PROJECTEXPLORER_EXPORT HostName
{
public:
explicit HostName(const QString &host) : m_host(host) {}
QString host() const { return m_host; }
private:
QString m_host;
};
// See cpp file for documentation. // See cpp file for documentation.
class PROJECTEXPLORER_EXPORT IDevice class PROJECTEXPLORER_EXPORT IDevice
{ {

View File

@@ -161,6 +161,7 @@ class PROJECTEXPLORER_EXPORT Runnable
virtual ~Concept() {} virtual ~Concept() {}
virtual Concept *clone() const = 0; virtual Concept *clone() const = 0;
virtual bool canReUseOutputPane(const std::unique_ptr<Concept> &other) const = 0; virtual bool canReUseOutputPane(const std::unique_ptr<Concept> &other) const = 0;
virtual void *typeId() const = 0;
}; };
template <class T> template <class T>
@@ -172,10 +173,14 @@ class PROJECTEXPLORER_EXPORT Runnable
bool canReUseOutputPane(const std::unique_ptr<Concept> &other) const override bool canReUseOutputPane(const std::unique_ptr<Concept> &other) const override
{ {
auto that = dynamic_cast<const Model<T> *>(other.get()); if (other->typeId() != typeId())
return that && m_data == that->m_data; return false;
auto that = static_cast<const Model<T> *>(other.get());
return m_data == that->m_data;
} }
void *typeId() const { return T::staticTypeId; }
T m_data; T m_data;
}; };
@@ -187,8 +192,13 @@ public:
void operator=(Runnable other) { d = std::move(other.d); } void operator=(Runnable other) { d = std::move(other.d); }
template <class T> bool is() const { return dynamic_cast<Model<T> *>(d.get()) != 0; } template <class T> bool is() const {
template <class T> const T &as() const { return static_cast<Model<T> *>(d.get())->m_data; } return d.get()->typeId() == T::staticTypeId;
}
template <class T> const T &as() const {
return static_cast<Model<T> *>(d.get())->m_data;
}
bool canReUseOutputPane(const Runnable &other) const; bool canReUseOutputPane(const Runnable &other) const;
@@ -202,6 +212,7 @@ class PROJECTEXPLORER_EXPORT Connection
{ {
virtual ~Concept() {} virtual ~Concept() {}
virtual Concept *clone() const = 0; virtual Concept *clone() const = 0;
virtual void *typeId() const = 0;
}; };
template <class T> template <class T>
@@ -209,6 +220,7 @@ class PROJECTEXPLORER_EXPORT Connection
{ {
Model(const T &data) : m_data(data) { } Model(const T &data) : m_data(data) { }
Concept *clone() const override { return new Model(*this); } Concept *clone() const override { return new Model(*this); }
void *typeId() const { return T::staticTypeId; }
T m_data; T m_data;
}; };
@@ -220,8 +232,13 @@ public:
void operator=(Connection other) { d = std::move(other.d); } void operator=(Connection other) { d = std::move(other.d); }
template <class T> bool is() const { return dynamic_cast<Model<T> *>(d.get()) != 0; } template <class T> bool is() const {
template <class T> const T &as() const { return static_cast<Model<T> *>(d.get())->m_data; } return d.get()->typeId() == T::staticTypeId;
}
template <class T> const T &as() const {
return static_cast<Model<T> *>(d.get())->m_data;
}
private: private:
std::unique_ptr<Concept> d; std::unique_ptr<Concept> d;

View File

@@ -35,4 +35,6 @@ bool operator==(const StandardRunnable &r1, const StandardRunnable &r2)
&& r1.environment == r2.environment; && r1.environment == r2.environment;
} }
void *StandardRunnable::staticTypeId = &StandardRunnable::staticTypeId;
} // namespace ProjectExplorer } // namespace ProjectExplorer

View File

@@ -43,8 +43,22 @@ public:
Utils::Environment environment; Utils::Environment environment;
ApplicationLauncher::Mode runMode = ApplicationLauncher::Gui; ApplicationLauncher::Mode runMode = ApplicationLauncher::Gui;
IDevice::ConstPtr device; // Override the kit's device. Keep unset by default. IDevice::ConstPtr device; // Override the kit's device. Keep unset by default.
static void *staticTypeId;
}; };
PROJECTEXPLORER_EXPORT bool operator==(const StandardRunnable &r1, const StandardRunnable &r2); PROJECTEXPLORER_EXPORT bool operator==(const StandardRunnable &r1, const StandardRunnable &r2);
class PROJECTEXPLORER_EXPORT HostName
{
public:
explicit HostName(const QString &host) : m_host(host) {}
QString host() const { return m_host; }
static void *staticTypeId;
private:
QString m_host;
};
} // namespace ProjectExplorer } // namespace ProjectExplorer

View File

@@ -89,7 +89,7 @@ static QStringList targetOSList(const ProjectExplorer::Abi &abi, const ProjectEx
break; break;
case ProjectExplorer::Abi::MacOS: case ProjectExplorer::Abi::MacOS:
if (device == DESKTOP_DEVICE_TYPE) if (device == DESKTOP_DEVICE_TYPE)
os << QLatin1String("osx"); os << QLatin1String("macos") << QLatin1String("osx");
else if (device == IOS_DEVICE_TYPE) else if (device == IOS_DEVICE_TYPE)
os << QLatin1String("ios"); os << QLatin1String("ios");
else if (device == IOS_SIMULATOR_TYPE) else if (device == IOS_SIMULATOR_TYPE)

View File

@@ -3,7 +3,7 @@
\"Version\" : \"$$QTCREATOR_VERSION\", \"Version\" : \"$$QTCREATOR_VERSION\",
\"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\",
\"Experimental\" : true, \"Experimental\" : true,
\"Platform\" : \"Windows 8\", \"Platform\" : \"Windows (8.1|10)\",
\"Vendor\" : \"The Qt Company Ltd\", \"Vendor\" : \"The Qt Company Ltd\",
\"Copyright\" : \"(C) 2016 The Qt Company Ltd\", \"Copyright\" : \"(C) 2016 The Qt Company Ltd\",
\"License\" : [ \"Commercial Usage\", \"License\" : [ \"Commercial Usage\",

View File

@@ -34,10 +34,8 @@ public:
unsigned line; unsigned line;
unsigned column; unsigned column;
unsigned length; unsigned length;
union { TextStyles textStyles;
TextStyles textStyles; int kind;
int kind;
};
bool useTextSyles; bool useTextSyles;
bool isValid() const bool isValid() const

View File

@@ -47,6 +47,8 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "gtest-qt-printing.h" #include "gtest-qt-printing.h"
#include <utils/hostosinfo.h>
#include <QBuffer> #include <QBuffer>
#include <QProcess> #include <QProcess>
#include <QSignalSpy> #include <QSignalSpy>
@@ -55,12 +57,6 @@
#include <vector> #include <vector>
#ifdef Q_OS_WIN
#define QTC_HOST_EXE_SUFFIX L".exe"
#else
#define QTC_HOST_EXE_SUFFIX ""
#endif
using namespace ClangBackEnd; using namespace ClangBackEnd;
using ::testing::Eq; using ::testing::Eq;
@@ -175,7 +171,7 @@ TEST_F(ClientServerOutsideProcess, SendUnregisterProjectPartsForEditorMessage)
void ClientServerOutsideProcess::SetUpTestCase() void ClientServerOutsideProcess::SetUpTestCase()
{ {
client.setProcessPath(QStringLiteral(ECHOSERVER QTC_HOST_EXE_SUFFIX)); client.setProcessPath(Utils::HostOsInfo::withExecutableSuffix(QStringLiteral(ECHOSERVER)));
ASSERT_TRUE(client.connectToServer()); ASSERT_TRUE(client.connectToServer());
} }