forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/3.5'
Change-Id: Iebaabfc2f724cd493b7cab025406531cea5cd2dc
This commit is contained in:
@@ -168,7 +168,7 @@ For detailed information on the supported compilers, see
|
||||
able to find all dependent Qt-libraries and plugins when being launched by the
|
||||
system. The easiest way to provide them for Qt 5 is to run the tool windeployqt:
|
||||
|
||||
windeployqt -qmldir share\qtcreator -qmldir src\plugins\qmlprofiler bin\qtcreator.exe lib\qtcreator lib\qtcreator\plugins
|
||||
windeployqt -quick -qmldir share\qtcreator\welcomescreen -qmldir src\plugins\qmlprofiler bin\qtcreator.exe lib\qtcreator lib\qtcreator\plugins
|
||||
|
||||
Note that unlike on Unix, you cannot overwrite executables that are running.
|
||||
Thus, if you want to work on Qt Creator using Qt Creator, you need a
|
||||
|
||||
11
dist/changes-3.5.0.md
vendored
11
dist/changes-3.5.0.md
vendored
@@ -49,6 +49,8 @@ Editing
|
||||
Project Management
|
||||
|
||||
* Fixed issues with restoring project tree state (QTCREATORBUG-14304)
|
||||
* Fixed crash when application output contains incomplete control
|
||||
sequence (QTCREATORBUG-14720)
|
||||
|
||||
CMake Projects
|
||||
|
||||
@@ -66,6 +68,13 @@ QML-Only Projects (.qmlproject)
|
||||
|
||||
* Re-enabled the plugin by default
|
||||
|
||||
Autotools Projects
|
||||
|
||||
* Improved parsing of `CPPFLAGS`
|
||||
* Added support for line continuations
|
||||
* Added support for `top_srcdir`, `abs_top_srcdir`, `top_builddir` and
|
||||
`abs_top_builddir`
|
||||
|
||||
Debugging
|
||||
|
||||
* Added dumper for `QJsonValue`, `QJsonObject`, `QJsonArray`, `QUuid`
|
||||
@@ -74,6 +83,8 @@ Debugging
|
||||
* Fixed display of `QHash` keys with value 0 (QTCREATORBUG-14451)
|
||||
* Fixed variable expansion state in QML debugger
|
||||
* Fixed display of members of returned values
|
||||
* Fixed that items in Locals and Expressions did not expand on first
|
||||
click for QML (QTCREATORBUG-14210)
|
||||
|
||||
QML Profiler
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
\section2 Specifying Run Settings for Embedded Devices
|
||||
|
||||
To run and debug an application on an embedded device (commercial only), you
|
||||
must create connections from the development host to the device and add the
|
||||
device configurations to \l{glossary-buildandrun-kit}{kits}. Select
|
||||
\uicontrol {Manage Kits} to add devices to kits. For more information, see
|
||||
the \l{http://doc.qt.io/QtForDeviceCreation/qtee-installation-guide.html}
|
||||
{Installation Guide} in the
|
||||
\l{http://doc.qt.io/QtForDeviceCreation/index.html}{Qt for Device Creation}
|
||||
documentation.
|
||||
|
||||
When you run the application, \QC copies the files to the connected device.
|
||||
|
||||
The run settings display the path to the executable file on the development
|
||||
host and on the device.
|
||||
|
||||
To execute custom commands, select \uicontrol {Add Deploy Step} >
|
||||
\uicontrol {Custom Remote Command (via adb shell)} and enter the command to
|
||||
execute.
|
||||
@@ -48,7 +48,8 @@
|
||||
\li \l{Supported Platforms}
|
||||
|
||||
You can install and run \QC on several operating systems to create
|
||||
applications for multiple desktop and mobile device platforms.
|
||||
applications for multiple desktop, embedded, and mobile device
|
||||
platforms.
|
||||
|
||||
\li \l{Using Other Build Systems}
|
||||
|
||||
|
||||
@@ -55,5 +55,7 @@
|
||||
\li \l{Using Qt Quick UI Forms}{Export button} for exporting
|
||||
items as alias properties
|
||||
\endlist
|
||||
\li \l{http://doc.qt.io/QtForDeviceCreation/index.html}{Developing for
|
||||
embedded devices}
|
||||
\endlist
|
||||
*/
|
||||
|
||||
@@ -74,8 +74,8 @@
|
||||
\target glossary-deploy-config
|
||||
\li Handles the packaging and copying of the necessary files to a
|
||||
location you want to run the executable at. The files can be
|
||||
copied to a location in the file system of the development PC or
|
||||
a mobile device.
|
||||
copied to a location in the file system of the development PC,
|
||||
an embedded device, or a mobile device.
|
||||
|
||||
\row
|
||||
\li Kit
|
||||
@@ -100,8 +100,8 @@
|
||||
\li Project
|
||||
\target glossary-project
|
||||
\li Groups together a set of source files, forms, and resource files
|
||||
that you can build, deploy, and run for different desktop and
|
||||
mobile device platforms, as
|
||||
that you can build, deploy, and run for different desktop,
|
||||
embedded, and mobile device platforms, as
|
||||
specified by a \e {build configuration}, \e {deploy
|
||||
configuration}, and \e {run configuration}.
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
\QC is an integrated development environment (IDE) that provides you with
|
||||
tools to design and develop applications with the Qt application framework.
|
||||
Qt is designed for developing applications and user interfaces once and
|
||||
deploying them to several desktop and mobile operating systems. \QC
|
||||
deploying them to several desktop, embedded, and mobile operating systems. \QC
|
||||
provides you with tools for accomplishing your tasks throughout the whole
|
||||
application development life-cycle, from creating a project to deploying the
|
||||
application to the target platforms.
|
||||
@@ -86,8 +86,8 @@
|
||||
and commands used to build the project.
|
||||
|
||||
\QC provides support for building, running, and deploying Qt
|
||||
applications for desktop environment and mobile devices.
|
||||
\l{glossary-buildandrun-kit}{Kits}, build,
|
||||
applications for desktop environment as well as embedded and
|
||||
mobile devices. \l{glossary-buildandrun-kit}{Kits}, build,
|
||||
run, and deployment settings allow you to quickly switch between
|
||||
different setups and target platforms.
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
\title Supported Platforms
|
||||
|
||||
You can install and run \QC on several operating systems to create
|
||||
applications for multiple desktop and mobile device platforms.
|
||||
applications for multiple desktop, embedded, and mobile device platforms.
|
||||
|
||||
\section1 Development Platforms
|
||||
|
||||
@@ -113,6 +113,16 @@
|
||||
|
||||
\endlist
|
||||
|
||||
\section2 Developing for Embedded Devices
|
||||
|
||||
The development environment supported by Qt for Device Creation is
|
||||
Ubuntu Linux 64-bit (12.04 LTS or later). For more information about
|
||||
the requirements for the development host, see the
|
||||
\l{http://doc.qt.io/QtForDeviceCreation/qtee-installation-guide.html}
|
||||
{Installation Guide} in the
|
||||
\l{http://doc.qt.io/QtForDeviceCreation/index.html}{Qt for Device Creation}
|
||||
documentation.
|
||||
|
||||
\section1 Compiling from Source
|
||||
|
||||
To build \QC from the source, see the requirements and instructions in the
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
\li Android
|
||||
|
||||
\li Embedded
|
||||
|
||||
\li Generic remote Linux
|
||||
|
||||
\li iOS
|
||||
@@ -18,6 +20,20 @@
|
||||
|
||||
\endlist
|
||||
|
||||
\section2 Embedded Devices
|
||||
|
||||
The Boot to Qt stack can be made to run on a variety of hardware. For
|
||||
Qt for Device Creation license holders, tooling is provided to customize the
|
||||
contents of the stack as well as to take it into desired production
|
||||
hardware.
|
||||
|
||||
For more information about the supported device groups and reference devices,
|
||||
see \l{http://doc.qt.io/QtForDeviceCreation/qtee-supported-platforms.html}
|
||||
{Supported Platforms} in the {http://doc.qt.io/QtForDeviceCreation/index.html}
|
||||
{Qt for Device Creation} documentation.
|
||||
|
||||
\section2 Mobile Devices
|
||||
|
||||
The following table summarizes operating system support for developing
|
||||
applications for mobile device platforms.
|
||||
|
||||
|
||||
@@ -47,7 +47,8 @@
|
||||
{List of Qt Quick Examples}
|
||||
|
||||
\row
|
||||
\li Develop Qt applications for desktop and mobile devices
|
||||
\li Develop Qt applications for desktop and embedded or mobile
|
||||
devices
|
||||
\li \l{https://www.qt.io/developers/}{Qt Developers}
|
||||
|
||||
\row
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
is installed automatically and you should be ready to start
|
||||
debugging after you create a new project. However, you can
|
||||
change the setup to use debugging tools for Windows, for
|
||||
example. You can connect mobile devices to your development PC
|
||||
and debug processes running on the devices.
|
||||
example. You can connect embedded or mobile devices to your
|
||||
development host and debug processes running on the devices.
|
||||
|
||||
\li \l{Analyzing Code}
|
||||
|
||||
|
||||
@@ -37,6 +37,14 @@
|
||||
the development environment for Android or iOS. For more information, see
|
||||
\l{Connecting Android Devices} and \l{Connecting iOS Devices}.
|
||||
|
||||
To run an example application on an embedded device, you must set up
|
||||
Qt for Device Creation on the development host and create connections
|
||||
between the host and devices. For more information, see the
|
||||
\l{http://doc.qt.io/QtForDeviceCreation/qtee-installation-guide.html}
|
||||
{Installation Guide} in the
|
||||
\l{http://doc.qt.io/QtForDeviceCreation/index.html}{Qt for Device Creation}
|
||||
documentation.
|
||||
|
||||
\list 1
|
||||
|
||||
\li In the \uicontrol Welcome mode, select \uicontrol Examples (1).
|
||||
@@ -47,7 +55,9 @@
|
||||
|
||||
You can also search for examples. Enter the \uicontrol android or
|
||||
\uicontrol iOS keyword in the search field (2) to list all the
|
||||
examples tested for Android or iOS.
|
||||
examples tested for Android or iOS. To list examples that you can
|
||||
run on embedded devices, enter the \uicontrol Boot2Qt keyword in the
|
||||
search field (commercial only).
|
||||
|
||||
\li To check that the application code can be compiled and linked for a
|
||||
device, click the \uicontrol {Kit Selector} and select a
|
||||
|
||||
@@ -107,8 +107,8 @@
|
||||
|
||||
Create a Qt Quick application that contains both QML and C++
|
||||
code. The project includes a QQuickView.
|
||||
You can build the application and deploy it to desktop and
|
||||
mobile target platforms.
|
||||
You can build the application and deploy it to desktop,
|
||||
embedded, and mobile target platforms.
|
||||
|
||||
\li Qt Quick Controls Application
|
||||
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
|
||||
By default, running an application also builds it and deploys it to a
|
||||
location from where it can be run on the desktop, on a device emulator or
|
||||
simulator, or on a mobile device that is connected to the development PC.
|
||||
simulator, or on an embedded device or a mobile device that is connected to
|
||||
the development PC.
|
||||
|
||||
To run executable files without deploying them first, select \uicontrol Build >
|
||||
\uicontrol {Run Without Deployment}. To make this the default option, deselect the
|
||||
|
||||
@@ -141,6 +141,12 @@
|
||||
|
||||
\image qtcreator-build-steps-custom.png "Custom Process Step"
|
||||
|
||||
\section2 Executing Custom Commands
|
||||
|
||||
To execute custom commands when building for embedded devices, select
|
||||
\uicontrol {Add Build Step} > \uicontrol {Custom Remote Command
|
||||
(via adb shell)} (commercial only) and enter the command to execute.
|
||||
|
||||
\section1 Clean Steps
|
||||
|
||||
You can use the cleaning process to remove intermediate files. This process
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
\include projects/creator-projects-settings-run-debug.qdocinc
|
||||
\include linux-mobile/creator-projects-settings-run-linux.qdocinc
|
||||
\include qnx/creator-projects-settings-run-qnx.qdocinc
|
||||
\include linux-mobile/creator-projects-settings-run-b2qt.qdocinc
|
||||
|
||||
\section1 Selecting the Run Environment
|
||||
|
||||
|
||||
@@ -31,7 +31,8 @@
|
||||
\title Qt Creator Manual
|
||||
|
||||
\QC provides a cross-platform, complete integrated development environment
|
||||
(IDE) for application developers to create applications for multiple desktop
|
||||
(IDE) for application developers to create applications for multiple
|
||||
desktop, \l {http://doc.qt.io/QtForDeviceCreation/index.html}{embedded},
|
||||
and mobile device platforms, such as \l{Connecting Android Devices}{Android}
|
||||
and \l{Connecting iOS Devices}{iOS}. It is available for Linux, OS X and
|
||||
Windows
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
|
||||
\li \uicontrol {Qt Quick Application} creates a Qt Quick 2 application
|
||||
project that can contain both QML and C++ code. The project includes
|
||||
a QQuickView. You can build the application and deploy it to desktop
|
||||
and mobile target platforms.
|
||||
a QQuickView. You can build the application and deploy it to desktop,
|
||||
embedded, and mobile target platforms.
|
||||
|
||||
\li \uicontrol {Qt Quick Controls Application} is like
|
||||
\uicontrol {Qt Quick Application}, but using Qt Quick Controls.
|
||||
|
||||
@@ -38,7 +38,7 @@ import shutil
|
||||
import inspect
|
||||
|
||||
def usage():
|
||||
print 'Usage: %s [-v|--version-string=versionstring] [-i|--installer-path=/path/to/installerfw] [-a|--archive=archive.7z] <outputname>' % os.path.basename(sys.argv[0])
|
||||
print('Usage: %s [-v|--version-string=versionstring] [-i|--installer-path=/path/to/installerfw] [-a|--archive=archive.7z] <outputname>' % os.path.basename(sys.argv[0]))
|
||||
|
||||
def substitute_file(infile, outfile, substitutions):
|
||||
with open(infile, 'r') as f:
|
||||
@@ -132,9 +132,9 @@ def main():
|
||||
ifw_call = [os.path.join(ifw_location, 'bin', 'binarycreator'), '-c', os.path.join(out_config_dir, config_name), '-p', out_packages_dir, installer_name, '--offline-only' ]
|
||||
subprocess.check_call(ifw_call, stderr=subprocess.STDOUT)
|
||||
finally:
|
||||
print 'Cleaning up...'
|
||||
print('Cleaning up...')
|
||||
shutil.rmtree(temp_dir)
|
||||
print 'Done.'
|
||||
print('Done.')
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -76,8 +76,10 @@ struct MetaPropertyData {
|
||||
|
||||
static bool constructedMetaData(const QQmlVMEMetaData* data)
|
||||
{
|
||||
return data->varPropertyCount == 0
|
||||
&& data->propertyCount == 0
|
||||
return data->propertyCount == 0
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
|
||||
&& data->varPropertyCount == 0
|
||||
#endif
|
||||
&& data->aliasCount == 0
|
||||
&& data->signalCount == 0
|
||||
&& data->methodCount == 0;
|
||||
@@ -86,7 +88,9 @@ static bool constructedMetaData(const QQmlVMEMetaData* data)
|
||||
static QQmlVMEMetaData* fakeMetaData()
|
||||
{
|
||||
QQmlVMEMetaData* data = new QQmlVMEMetaData;
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
|
||||
data->varPropertyCount = 0;
|
||||
#endif
|
||||
data->propertyCount = 0;
|
||||
data->aliasCount = 0;
|
||||
data->signalCount = 0;
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
%{CN} &operator=(const %{CN} &);
|
||||
~%{CN}();
|
||||
@endif
|
||||
@if '%{isQObject}'
|
||||
@if %{isQObject}
|
||||
|
||||
signals:
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ OutputPanes_DebugTextColor=text
|
||||
OutputPanes_ErrorMessageTextColor=ffff6c6c
|
||||
OutputPanes_MessageOutput=ff008787
|
||||
OutputPanes_NormalMessageTextColor=text
|
||||
OutputPanes_StdErrTextColor=error
|
||||
OutputPanes_StdErrTextColor=ffff6666
|
||||
OutputPanes_StdOutTextColor=text
|
||||
OutputPanes_WarningMessageTextColor=fff3c300
|
||||
OutputPaneButtonFlashColor=error
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -218,8 +218,10 @@ static inline QStringList getPluginPaths()
|
||||
// "%LOCALAPPDATA%\QtProject\qtcreator" on Windows Vista and later
|
||||
// "$XDG_DATA_HOME/data/QtProject/qtcreator" or "~/.local/share/data/QtProject/qtcreator" on Linux
|
||||
// "~/Library/Application Support/QtProject/Qt Creator" on Mac
|
||||
pluginPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)
|
||||
+ QLatin1String("/data");
|
||||
pluginPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|
||||
pluginPath += QLatin1String("/data");
|
||||
#endif
|
||||
pluginPath += QLatin1Char('/')
|
||||
+ QLatin1String(Core::Constants::IDE_SETTINGSVARIANT_STR)
|
||||
+ QLatin1Char('/');
|
||||
@@ -297,6 +299,8 @@ int main(int argc, char **argv)
|
||||
&& !qEnvironmentVariableIsSet("QT_DEVICE_PIXEL_RATIO")) {
|
||||
qputenv("QT_DEVICE_PIXEL_RATIO", "auto");
|
||||
}
|
||||
#else
|
||||
qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
|
||||
#endif // < Qt 5.6
|
||||
|
||||
QLoggingCategory::setFilterRules(QLatin1String("qtc.*.debug=false"));
|
||||
|
||||
4
src/libs/3rdparty/botan/botan.cpp
vendored
4
src/libs/3rdparty/botan/botan.cpp
vendored
@@ -46200,7 +46200,7 @@ bool caseless_cmp(char a, char b)
|
||||
#elif defined(BOTAN_BUILD_COMPILER_IS_INTEL)
|
||||
|
||||
#include <ia32intrin.h>
|
||||
#define CALL_CPUID(type, out) do { __cpuid(out, type); } while(0)
|
||||
#define CALL_CPUID(type, out) do { __cpuid((int*)out, type); } while(0)
|
||||
|
||||
#elif defined(BOTAN_BUILD_COMPILER_IS_GCC) && (BOTAN_GCC_VERSION >= 430)
|
||||
|
||||
@@ -46223,7 +46223,7 @@ namespace {
|
||||
}
|
||||
|
||||
#elif defined(BOTAN_TARGET_ARCH_IS_X86_64) && \
|
||||
(defined(BOTAN_BUILD_COMPILER_IS_CLANG) || defined(BOTAN_BUILD_COMPILER_IS_GCC) || defined(BOTAN_BUILD_COMPILER_IS_INTEL))
|
||||
(defined(BOTAN_BUILD_COMPILER_IS_CLANG) || defined(BOTAN_BUILD_COMPILER_IS_GCC))
|
||||
|
||||
/*
|
||||
* We can't safely use this on x86-32 as some 32-bit ABIs use ebx as
|
||||
|
||||
@@ -1001,13 +1001,11 @@ LookupScope *LookupScopePrivate::lookupType_helper(
|
||||
}
|
||||
|
||||
if (const QualifiedNameId *qName = name->asQualifiedNameId()) {
|
||||
|
||||
ProcessedSet innerProcessed;
|
||||
if (! qName->base())
|
||||
return globalNamespace()->d->lookupType_helper(qName->name(), &innerProcessed, true, origin);
|
||||
return globalNamespace()->d->lookupType_helper(qName->name(), processed, true, origin);
|
||||
|
||||
if (LookupScope *binding = lookupType_helper(qName->base(), processed, true, origin))
|
||||
return binding->d->lookupType_helper(qName->name(), &innerProcessed, false, origin);
|
||||
return binding->d->lookupType_helper(qName->name(), processed, false, origin);
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -71,6 +71,7 @@ public:
|
||||
{
|
||||
m_pixmap = QPixmap();
|
||||
m_label->setText(text);
|
||||
layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||
adjustSize();
|
||||
if (QWidget *parent = parentWidget())
|
||||
move(parent->rect().center() - rect().center());
|
||||
@@ -80,6 +81,7 @@ public:
|
||||
{
|
||||
m_label->hide();
|
||||
m_pixmap.load(Utils::StyleHelper::dpiSpecificImageFile(uri));
|
||||
layout()->setSizeConstraint(QLayout::SetNoConstraint);
|
||||
resize(m_pixmap.size() / m_pixmap.devicePixelRatio());
|
||||
if (QWidget *parent = parentWidget())
|
||||
move(parent->rect().center() - rect().center());
|
||||
|
||||
@@ -151,7 +151,7 @@ AndroidRunner::AndroidRunner(QObject *parent,
|
||||
qDebug() << tr("No free ports available on host for QML debugging."));
|
||||
m_qmlPort = server.serverPort();
|
||||
} else {
|
||||
m_qmlPort = -1;
|
||||
m_qmlPort = 0;
|
||||
}
|
||||
ProjectExplorer::Target *target = runConfig->target();
|
||||
m_useLocalQtLibs = AndroidManager::useLocalLibs(target);
|
||||
|
||||
@@ -79,13 +79,21 @@ void BareMetalDevice::fromMap(const QVariantMap &map)
|
||||
IDevice::fromMap(map);
|
||||
QString gdbServerProvider = map.value(QLatin1String(gdbServerProviderIdKeyC)).toString();
|
||||
if (gdbServerProvider.isEmpty()) {
|
||||
const QString name = displayName();
|
||||
if (GdbServerProvider *provider =
|
||||
GdbServerProviderManager::instance()->findByDisplayName(name)) {
|
||||
gdbServerProvider = provider->id();
|
||||
} else {
|
||||
const QSsh::SshConnectionParameters sshParams = sshParameters();
|
||||
DefaultGdbServerProvider *newProvider = new DefaultGdbServerProvider;
|
||||
newProvider->setDisplayName(displayName());
|
||||
newProvider->setDisplayName(name);
|
||||
newProvider->m_host = sshParams.host;
|
||||
newProvider->m_port = sshParams.port;
|
||||
GdbServerProviderManager::instance()->registerProvider(newProvider);
|
||||
if (GdbServerProviderManager::instance()->registerProvider(newProvider))
|
||||
gdbServerProvider = newProvider->id();
|
||||
else
|
||||
delete newProvider;
|
||||
}
|
||||
}
|
||||
setGdbServerProviderId(gdbServerProvider);
|
||||
}
|
||||
|
||||
@@ -172,6 +172,14 @@ GdbServerProvider *GdbServerProviderManager::findProvider(const QString &id) con
|
||||
return Utils::findOrDefault(m_providers, Utils::equal(&GdbServerProvider::id, id));
|
||||
}
|
||||
|
||||
GdbServerProvider *GdbServerProviderManager::findByDisplayName(const QString &displayName) const
|
||||
{
|
||||
if (displayName.isEmpty())
|
||||
return 0;
|
||||
|
||||
return Utils::findOrDefault(m_providers, Utils::equal(&GdbServerProvider::displayName, displayName));
|
||||
}
|
||||
|
||||
void GdbServerProviderManager::notifyAboutUpdate(GdbServerProvider *provider)
|
||||
{
|
||||
if (!provider || !m_providers.contains(provider))
|
||||
|
||||
@@ -56,6 +56,7 @@ public:
|
||||
QList<GdbServerProvider *> providers() const;
|
||||
QList<GdbServerProviderFactory *> factories() const;
|
||||
GdbServerProvider *findProvider(const QString &id) const;
|
||||
GdbServerProvider *findByDisplayName(const QString &displayName) const;
|
||||
bool registerProvider(GdbServerProvider *);
|
||||
void deregisterProvider(GdbServerProvider *);
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ void CMakeProject::changeBuildDirectory(CMakeBuildConfiguration *bc, const QStri
|
||||
parseCMakeLists();
|
||||
}
|
||||
|
||||
QStringList CMakeProject::getCXXFlagsFor(const CMakeBuildTarget &buildTarget)
|
||||
QStringList CMakeProject::getCXXFlagsFor(const CMakeBuildTarget &buildTarget, QByteArray *cachedBuildNinja)
|
||||
{
|
||||
QString makeCommand = QDir::fromNativeSeparators(buildTarget.makeCommand);
|
||||
int startIndex = makeCommand.indexOf(QLatin1Char('\"'));
|
||||
@@ -206,12 +206,23 @@ QStringList CMakeProject::getCXXFlagsFor(const CMakeBuildTarget &buildTarget)
|
||||
// found
|
||||
// Get "all" target's working directory
|
||||
if (!buildTargets().empty()) {
|
||||
if (cachedBuildNinja->isNull()) {
|
||||
QString buildNinjaFile = QDir::fromNativeSeparators(buildTargets().at(0).workingDirectory);
|
||||
buildNinjaFile += QLatin1String("/build.ninja");
|
||||
QFile buildNinja(buildNinjaFile);
|
||||
if (buildNinja.exists()) {
|
||||
buildNinja.open(QIODevice::ReadOnly | QIODevice::Text);
|
||||
QTextStream stream(&buildNinja);
|
||||
*cachedBuildNinja = buildNinja.readAll();
|
||||
buildNinja.close();
|
||||
} else {
|
||||
*cachedBuildNinja = QByteArray();
|
||||
}
|
||||
}
|
||||
|
||||
if (cachedBuildNinja->isEmpty())
|
||||
return QStringList();
|
||||
|
||||
QTextStream stream(cachedBuildNinja);
|
||||
bool targetFound = false;
|
||||
bool cxxFound = false;
|
||||
QString targetSearchPattern = QString::fromLatin1("target %1").arg(buildTarget.title);
|
||||
@@ -231,7 +242,7 @@ QStringList CMakeProject::getCXXFlagsFor(const CMakeBuildTarget &buildTarget)
|
||||
return line.mid(7).trimmed().split(QLatin1Char(' '), QString::SkipEmptyParts);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return QStringList();
|
||||
}
|
||||
@@ -338,13 +349,15 @@ bool CMakeProject::parseCMakeLists()
|
||||
|
||||
ppBuilder.setQtVersion(activeQtVersion);
|
||||
|
||||
QByteArray cachedBuildNinja;
|
||||
foreach (const CMakeBuildTarget &cbt, m_buildTargets) {
|
||||
// This explicitly adds -I. to the include paths
|
||||
QStringList includePaths = cbt.includeFiles;
|
||||
includePaths += projectDirectory().toString();
|
||||
ppBuilder.setIncludePaths(includePaths);
|
||||
ppBuilder.setCFlags(getCXXFlagsFor(cbt));
|
||||
ppBuilder.setCxxFlags(getCXXFlagsFor(cbt));
|
||||
QStringList cxxflags = getCXXFlagsFor(cbt, &cachedBuildNinja);
|
||||
ppBuilder.setCFlags(cxxflags);
|
||||
ppBuilder.setCxxFlags(cxxflags);
|
||||
ppBuilder.setDefines(cbt.defines);
|
||||
ppBuilder.setDisplayName(cbt.title);
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ private:
|
||||
QString uiHeaderFile(const QString &uiFile);
|
||||
void updateRunConfigurations(ProjectExplorer::Target *t);
|
||||
void updateApplicationAndDeploymentTargets();
|
||||
QStringList getCXXFlagsFor(const CMakeBuildTarget &buildTarget);
|
||||
QStringList getCXXFlagsFor(const CMakeBuildTarget &buildTarget, QByteArray *cachedBuildNinja);
|
||||
|
||||
Internal::CMakeManager *m_manager;
|
||||
ProjectExplorer::Target *m_activeTarget;
|
||||
|
||||
@@ -39,9 +39,11 @@
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/actionmanager/command.h>
|
||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||
#include <projectexplorer/buildmanager.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/projecttree.h>
|
||||
#include <projectexplorer/session.h>
|
||||
|
||||
#include <utils/synchronousprocess.h>
|
||||
|
||||
@@ -52,10 +54,6 @@ using namespace CMakeProjectManager::Internal;
|
||||
|
||||
CMakeManager::CMakeManager()
|
||||
{
|
||||
ProjectExplorer::ProjectTree *tree = ProjectExplorer::ProjectTree::instance();
|
||||
connect(tree, &ProjectExplorer::ProjectTree::aboutToShowContextMenu,
|
||||
this, &CMakeManager::updateContextMenu);
|
||||
|
||||
Core::ActionContainer *mbuild =
|
||||
Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_BUILDPROJECT);
|
||||
Core::ActionContainer *mproject =
|
||||
@@ -64,14 +62,15 @@ CMakeManager::CMakeManager()
|
||||
Core::ActionManager::actionContainer(ProjectExplorer::Constants::M_SUBPROJECTCONTEXT);
|
||||
|
||||
const Core::Context projectContext(CMakeProjectManager::Constants::PROJECTCONTEXT);
|
||||
const Core::Context globalcontext(Core::Constants::C_GLOBAL);
|
||||
|
||||
m_runCMakeAction = new QAction(QIcon(), tr("Run CMake"), this);
|
||||
Core::Command *command = Core::ActionManager::registerAction(m_runCMakeAction,
|
||||
Constants::RUNCMAKE, projectContext);
|
||||
Constants::RUNCMAKE, globalcontext);
|
||||
command->setAttribute(Core::Command::CA_Hide);
|
||||
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_DEPLOY);
|
||||
connect(m_runCMakeAction, &QAction::triggered, [this]() {
|
||||
runCMake(ProjectExplorer::ProjectTree::currentProject());
|
||||
runCMake(ProjectExplorer::SessionManager::startupProject());
|
||||
});
|
||||
|
||||
m_runCMakeActionContextMenu = new QAction(QIcon(), tr("Run CMake"), this);
|
||||
@@ -81,14 +80,20 @@ CMakeManager::CMakeManager()
|
||||
mproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD);
|
||||
msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD);
|
||||
connect(m_runCMakeActionContextMenu, &QAction::triggered, [this]() {
|
||||
runCMake(m_contextProject);
|
||||
runCMake(ProjectExplorer::ProjectTree::currentProject());
|
||||
});
|
||||
|
||||
connect(ProjectExplorer::SessionManager::instance(), &ProjectExplorer::SessionManager::startupProjectChanged,
|
||||
this, &CMakeManager::updateRunCmakeAction);
|
||||
connect(ProjectExplorer::BuildManager::instance(), &ProjectExplorer::BuildManager::buildStateChanged,
|
||||
this, &CMakeManager::updateRunCmakeAction);
|
||||
|
||||
}
|
||||
|
||||
void CMakeManager::updateContextMenu(ProjectExplorer::Project *project, ProjectExplorer::Node *)
|
||||
void CMakeManager::updateRunCmakeAction()
|
||||
{
|
||||
m_contextProject = project;
|
||||
auto project = qobject_cast<CMakeProject *>(ProjectExplorer::SessionManager::startupProject());
|
||||
m_runCMakeAction->setVisible(project && !ProjectExplorer::BuildManager::isBuilding(project));
|
||||
}
|
||||
|
||||
void CMakeManager::runCMake(ProjectExplorer::Project *project)
|
||||
|
||||
@@ -69,14 +69,13 @@ public:
|
||||
static QString findCbpFile(const QDir &);
|
||||
|
||||
private:
|
||||
void updateContextMenu(ProjectExplorer::Project *project, ProjectExplorer::Node *node);
|
||||
void updateRunCmakeAction();
|
||||
void runCMake(ProjectExplorer::Project *project);
|
||||
|
||||
private:
|
||||
CMakeSettingsPage *m_settingsPage;
|
||||
QAction *m_runCMakeAction;
|
||||
QAction *m_runCMakeActionContextMenu;
|
||||
ProjectExplorer::Project *m_contextProject;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -16,7 +16,6 @@ SOURCES += corejsextensions.cpp \
|
||||
shellcommand.cpp \
|
||||
editmode.cpp \
|
||||
iwizardfactory.cpp \
|
||||
tabpositionindicator.cpp \
|
||||
fancyactionbar.cpp \
|
||||
fancytabwidget.cpp \
|
||||
generalsettings.cpp \
|
||||
@@ -124,7 +123,6 @@ HEADERS += corejsextensions.h \
|
||||
shellcommand.h \
|
||||
editmode.h \
|
||||
iwizardfactory.h \
|
||||
tabpositionindicator.h \
|
||||
fancyactionbar.h \
|
||||
fancytabwidget.h \
|
||||
generalsettings.h \
|
||||
|
||||
@@ -97,7 +97,6 @@ QtcPlugin {
|
||||
"statusbarmanager.cpp", "statusbarmanager.h",
|
||||
"statusbarwidget.cpp", "statusbarwidget.h",
|
||||
"styleanimator.cpp", "styleanimator.h",
|
||||
"tabpositionindicator.cpp", "tabpositionindicator.h",
|
||||
"textdocument.cpp", "textdocument.h",
|
||||
"themesettings.cpp", "themesettings.h", "themesettings.ui",
|
||||
"themesettingswidget.cpp", "themesettingswidget.h",
|
||||
|
||||
@@ -95,6 +95,12 @@ bool PatchTool::runPatch(const QByteArray &input, const QString &workingDirector
|
||||
if (!workingDirectory.isEmpty())
|
||||
patchProcess.setWorkingDirectory(workingDirectory);
|
||||
QStringList args;
|
||||
// Add argument 'apply' when git is used as patch command since git 2.5/Windows
|
||||
// no longer ships patch.exe.
|
||||
if (patch.endsWith(QLatin1String("git"), Qt::CaseInsensitive)
|
||||
|| patch.endsWith(QLatin1String("git.exe"), Qt::CaseInsensitive)) {
|
||||
args << QLatin1String("apply");
|
||||
}
|
||||
if (strip >= 0)
|
||||
args << (QLatin1String("-p") + QString::number(strip));
|
||||
if (reverse)
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2015 The Qt Company Ltd.
|
||||
** Contact: http://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 http://www.qt.io/terms-conditions. For further information
|
||||
** use the contact form at http://www.qt.io/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 or version 3 as published by the Free
|
||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
||||
** following information to ensure the GNU Lesser General Public License
|
||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, The Qt Company gives you certain additional
|
||||
** rights. These rights are described in The Qt Company LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "tabpositionindicator.h"
|
||||
|
||||
#include <QPainter>
|
||||
#include <QPaintEvent>
|
||||
#include <QPalette>
|
||||
|
||||
using namespace Core::Internal;
|
||||
|
||||
TabPositionIndicator::TabPositionIndicator()
|
||||
: QWidget(0, Qt::ToolTip)
|
||||
{
|
||||
}
|
||||
|
||||
void TabPositionIndicator::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QPainter p(this);
|
||||
QPen pen = p.pen();
|
||||
pen.setWidth(2);
|
||||
pen.setColor(palette().color(QPalette::Active, QPalette::LinkVisited));
|
||||
pen.setStyle(Qt::DotLine);
|
||||
p.setPen(pen);
|
||||
p.drawLine(event->rect().topLeft(), event->rect().bottomLeft());
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2015 The Qt Company Ltd.
|
||||
** Contact: http://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 http://www.qt.io/terms-conditions. For further information
|
||||
** use the contact form at http://www.qt.io/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 or version 3 as published by the Free
|
||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
||||
** following information to ensure the GNU Lesser General Public License
|
||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, The Qt Company gives you certain additional
|
||||
** rights. These rights are described in The Qt Company LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef TABPOSITIONINDICATOR_H
|
||||
#define TABPOSITIONINDICATOR_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Core {
|
||||
namespace Internal {
|
||||
|
||||
class TabPositionIndicator : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum { TABPOSITIONINDICATOR_WIDTH = 2 };
|
||||
|
||||
TabPositionIndicator();
|
||||
int indicatorWidth() { return TABPOSITIONINDICATOR_WIDTH; }
|
||||
|
||||
private:
|
||||
void paintEvent(QPaintEvent *event);
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Core
|
||||
|
||||
#endif // TABPOSITIONINDICATOR_H
|
||||
@@ -241,6 +241,7 @@ QuickFixOperationTest::QuickFixOperationTest(const QList<QuickFixTestDocument::P
|
||||
QuickFixOperations operations;
|
||||
factory->match(quickFixInterface, operations);
|
||||
if (operations.isEmpty()) {
|
||||
QEXPECT_FAIL("onBaseOfQualifiedClassName", "QTCREATORBUG-14499", Continue);
|
||||
QVERIFY(testDocuments.first()->m_expectedSource.isEmpty());
|
||||
return;
|
||||
}
|
||||
@@ -2751,6 +2752,37 @@ void CppEditorPlugin::test_quickfix_AddIncludeForUndefinedIdentifier_data()
|
||||
|
||||
// -------------------------------------------------------------------------------------------
|
||||
|
||||
// Header File
|
||||
original = "class Foo { static void bar() {} };\n";
|
||||
expected = original;
|
||||
testDocuments << QuickFixTestDocument::create("afile.h", original, expected);
|
||||
|
||||
// Source File
|
||||
original =
|
||||
"#include \"header.h\"\n"
|
||||
"\n"
|
||||
"void f()\n"
|
||||
"{\n"
|
||||
" @Foo::bar();\n"
|
||||
"}\n"
|
||||
;
|
||||
expected =
|
||||
"#include \"afile.h\"\n"
|
||||
"#include \"header.h\"\n"
|
||||
"\n"
|
||||
"void f()\n"
|
||||
"{\n"
|
||||
" Foo::bar();\n"
|
||||
"}\n"
|
||||
;
|
||||
testDocuments << QuickFixTestDocument::create("afile.cpp", original, expected);
|
||||
QTest::newRow("onBaseOfQualifiedClassName")
|
||||
<< TestIncludePaths::globalIncludePath()
|
||||
<< testDocuments << firstRefactoringOperation << "";
|
||||
testDocuments.clear();
|
||||
|
||||
// -------------------------------------------------------------------------------------------
|
||||
|
||||
// Header File
|
||||
original = "namespace N { template <typename T> class Foo {}; }\n";
|
||||
expected = original;
|
||||
|
||||
@@ -369,6 +369,7 @@ F2TestCase::F2TestCase(CppEditorAction action,
|
||||
|
||||
QEXPECT_FAIL("globalVarFromEnum", "Contributor works on a fix.", Abort);
|
||||
QEXPECT_FAIL("matchFunctionSignature_Follow_5", "foo(int) resolved as CallAST", Abort);
|
||||
QEXPECT_FAIL("qualifiedNames", "Regression since e0594fc9b906a32f5c8ac70265490cf86044676f", Abort);
|
||||
QCOMPARE(currentTextEditor->currentLine(), expectedLine);
|
||||
QCOMPARE(currentTextEditor->currentColumn() - 1, expectedColumn);
|
||||
|
||||
@@ -972,6 +973,20 @@ void CppEditorPlugin::test_FollowSymbolUnderCursor_data()
|
||||
"template<class $T>\n"
|
||||
"using Foo = Bar<@T>;\n"
|
||||
);
|
||||
|
||||
QTest::newRow("qualifiedNames") << _(
|
||||
"struct C\n"
|
||||
"{\n"
|
||||
" struct Nested { int $member; };\n"
|
||||
" void f();\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"void C::f()\n"
|
||||
"{\n"
|
||||
" C::Nested object;\n"
|
||||
" object.@member;\n"
|
||||
"}\n"
|
||||
);
|
||||
}
|
||||
|
||||
void CppEditorPlugin::test_FollowSymbolUnderCursor()
|
||||
|
||||
@@ -3235,6 +3235,120 @@ void CppToolsPlugin::test_completion_data()
|
||||
<< QLatin1String("Foo")
|
||||
<< QLatin1String("bar"));
|
||||
|
||||
QTest::newRow("typedef for templates in namespace") << _(
|
||||
"namespace N {\n"
|
||||
"\n"
|
||||
"struct Data { int x; };\n"
|
||||
"template <typename T> struct Foo { T member; };\n"
|
||||
"typedef Foo<Data> Bar;\n"
|
||||
"\n"
|
||||
"} // N\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"void f()\n"
|
||||
"{\n"
|
||||
" N::Bar o;\n"
|
||||
" @\n"
|
||||
"}\n"
|
||||
) << _("o.member.") << (QStringList()
|
||||
<< QLatin1String("Data")
|
||||
<< QLatin1String("x"));
|
||||
|
||||
QTest::newRow("std vector") << _(
|
||||
"namespace std\n"
|
||||
"{\n"
|
||||
"template<typename _Tp>\n"
|
||||
"struct allocator\n"
|
||||
"{\n"
|
||||
" typedef _Tp value_type;\n"
|
||||
"\n"
|
||||
" template<typename _Tp1>\n"
|
||||
" struct rebind\n"
|
||||
" { typedef allocator<_Tp1> other; };\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"template<typename _Alloc, typename _Tp>\n"
|
||||
"struct __alloctr_rebind\n"
|
||||
"{\n"
|
||||
" typedef typename _Alloc::template rebind<_Tp>::other __type;\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"template<typename _Alloc>\n"
|
||||
"struct allocator_traits\n"
|
||||
"{\n"
|
||||
" typedef typename _Alloc::value_type value_type;\n"
|
||||
"\n"
|
||||
" template<typename _Tp>\n"
|
||||
" using rebind_alloc = typename __alloctr_rebind<_Alloc, _Tp>::__type;\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"template<typename _Iterator>\n"
|
||||
"struct iterator_traits { };\n"
|
||||
"\n"
|
||||
"template<typename _Tp>\n"
|
||||
"struct iterator_traits<_Tp*>\n"
|
||||
"{\n"
|
||||
" typedef _Tp* pointer;\n"
|
||||
"};\n"
|
||||
"} // namespace std\n"
|
||||
"\n"
|
||||
"namespace __gnu_cxx\n"
|
||||
"{\n"
|
||||
"template<typename _Alloc>\n"
|
||||
"struct __alloc_traits\n"
|
||||
"{\n"
|
||||
" typedef _Alloc allocator_type;\n"
|
||||
" typedef std::allocator_traits<_Alloc> _Base_type;\n"
|
||||
" typedef typename _Alloc::value_type value_type;\n"
|
||||
"\n"
|
||||
" static value_type *_S_pointer_helper(...);\n"
|
||||
" typedef decltype(_S_pointer_helper((_Alloc*)0)) __pointer;\n"
|
||||
" typedef __pointer pointer;\n"
|
||||
"\n"
|
||||
" template<typename _Tp>\n"
|
||||
" struct rebind\n"
|
||||
" { typedef typename _Base_type::template rebind_alloc<_Tp> other; };\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"template<typename _Iterator, typename _Container>\n"
|
||||
"struct __normal_iterator\n"
|
||||
"{\n"
|
||||
" typedef std::iterator_traits<_Iterator> __traits_type;\n"
|
||||
" typedef typename __traits_type::pointer pointer;\n"
|
||||
"\n"
|
||||
" pointer p;\n"
|
||||
"};\n"
|
||||
"} // namespace __gnu_cxx\n"
|
||||
"\n"
|
||||
"namespace std {\n"
|
||||
"template<typename _Tp, typename _Alloc>\n"
|
||||
"struct _Vector_Base\n"
|
||||
"{\n"
|
||||
" typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template\n"
|
||||
" rebind<_Tp>::other _Tp_alloc_type;\n"
|
||||
" typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>::pointer\n"
|
||||
" pointer;\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"template<typename _Tp, typename _Alloc = std::allocator<_Tp> >\n"
|
||||
"struct vector : protected _Vector_Base<_Tp, _Alloc>\n"
|
||||
"{\n"
|
||||
" typedef _Vector_Base<_Tp, _Alloc> _Base;\n"
|
||||
" typedef typename _Base::pointer pointer;\n"
|
||||
" typedef __gnu_cxx::__normal_iterator<pointer, vector> iterator;\n"
|
||||
"};\n"
|
||||
"} // namespace std\n"
|
||||
"\n"
|
||||
"struct Foo { int bar; };\n"
|
||||
"\n"
|
||||
"void func()\n"
|
||||
"{\n"
|
||||
" std::vector<Foo>::iterator it;\n"
|
||||
" @;\n"
|
||||
"}\n"
|
||||
) << _("it.p->") << (QStringList()
|
||||
<< QLatin1String("Foo")
|
||||
<< QLatin1String("bar"));
|
||||
}
|
||||
|
||||
void CppToolsPlugin::test_completion_member_access_operator()
|
||||
|
||||
@@ -1759,6 +1759,7 @@ void DebuggerPluginPrivate::connectEngine(DebuggerEngine *engine)
|
||||
m_inspectorView->setModel(engine->watchModel());
|
||||
|
||||
engine->watchHandler()->resetWatchers();
|
||||
m_localsView->hideProgressIndicator();
|
||||
|
||||
m_mainWindow->setEngineDebugLanguages(engine->runParameters().languages);
|
||||
}
|
||||
|
||||
@@ -597,6 +597,7 @@ void QmlInspectorAgent::addWatchData(const ObjectReference &obj,
|
||||
bool append)
|
||||
{
|
||||
qCDebug(qmlInspectorLog) << '(' << obj << parentIname << ')';
|
||||
QTC_ASSERT(m_qmlEngine, return);
|
||||
|
||||
int objDebugId = obj.debugId();
|
||||
QByteArray objIname = buildIName(parentIname, objDebugId);
|
||||
@@ -689,6 +690,7 @@ bool QmlInspectorAgent::isConnected() const
|
||||
|
||||
void QmlInspectorAgent::clearObjectTree()
|
||||
{
|
||||
if (m_qmlEngine)
|
||||
m_qmlEngine->watchHandler()->removeAllData(true);
|
||||
m_objectTreeQueryIds.clear();
|
||||
m_fetchDataIds.clear();
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#define QMLINSPECTORAGENT_H
|
||||
|
||||
#include <QStack>
|
||||
#include <QPointer>
|
||||
#include <QTimer>
|
||||
|
||||
#include <coreplugin/icontext.h>
|
||||
@@ -127,7 +128,7 @@ private:
|
||||
void enableTools(const bool enable);
|
||||
|
||||
private:
|
||||
QmlEngine *m_qmlEngine;
|
||||
QPointer<QmlEngine> m_qmlEngine;
|
||||
QmlDebug::BaseEngineDebugClient *m_engineClient;
|
||||
|
||||
quint32 m_engineQueryId;
|
||||
|
||||
@@ -541,6 +541,17 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch_data()
|
||||
"similarity index 99%\n"
|
||||
"rename from file a.txt\n"
|
||||
"rename to file b.txt\n"
|
||||
"diff --git a/file.txt b/file.txt\n"
|
||||
"old mode 100644\n"
|
||||
"new mode 100755\n"
|
||||
"index 1234567..9876543\n"
|
||||
"--- a/file.txt\n"
|
||||
"+++ b/file.txt\n"
|
||||
"@@ -20,3 +20,3 @@\n"
|
||||
" A\n"
|
||||
"-B\n"
|
||||
"+C\n"
|
||||
" D\n"
|
||||
);
|
||||
|
||||
FileData fileData1;
|
||||
@@ -641,8 +652,13 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch_data()
|
||||
fileData8.rightFileInfo = DiffFileInfo(_("file b.txt"));
|
||||
fileData8.fileOperation = FileData::RenameFile;
|
||||
|
||||
FileData fileData9;
|
||||
fileData9.leftFileInfo = DiffFileInfo(_("file.txt"), _("1234567"));
|
||||
fileData9.rightFileInfo = DiffFileInfo(_("file.txt"), _("9876543"));
|
||||
fileData9.chunks << chunkData7;
|
||||
QList<FileData> fileDataList1;
|
||||
fileDataList1 << fileData1 << fileData2 << fileData3 << fileData4 << fileData5 << fileData6 << fileData7 << fileData8;
|
||||
fileDataList1 << fileData1 << fileData2 << fileData3 << fileData4 << fileData5
|
||||
<< fileData6 << fileData7 << fileData8 << fileData9;
|
||||
|
||||
QTest::newRow("Git patch") << patch
|
||||
<< fileDataList1;
|
||||
|
||||
@@ -892,6 +892,8 @@ static FileData readGitHeaderAndChunks(const QString &headerAndChunks,
|
||||
// will be followed by: index shasha..0000000, file "b" replaced by "/dev/null", @@ -m,n +0,0 @@
|
||||
const QRegExp deletedFileMode(QLatin1String("^deleted file mode \\d+\\n")); // deleted file mode octal
|
||||
|
||||
const QRegExp modeChangeRegExp(QLatin1String("^old mode \\d+\\nnew mode \\d+\\n"));
|
||||
|
||||
const QRegExp indexRegExp(QLatin1String("^index (\\w+)\\.{2}(\\w+)(?: \\d+)?(\\n|$)")); // index cap1..cap2(optionally: octal)
|
||||
|
||||
QString leftFileName = QLatin1String("a/") + fileName;
|
||||
@@ -905,6 +907,8 @@ static FileData readGitHeaderAndChunks(const QString &headerAndChunks,
|
||||
fileData.fileOperation = FileData::DeleteFile;
|
||||
rightFileName = devNull;
|
||||
patch.remove(0, deletedFileMode.matchedLength());
|
||||
} else if (modeChangeRegExp.indexIn(patch) == 0) {
|
||||
patch.remove(0, modeChangeRegExp.matchedLength());
|
||||
}
|
||||
|
||||
if (indexRegExp.indexIn(patch) == 0) {
|
||||
|
||||
@@ -58,10 +58,6 @@ using namespace ProjectExplorer;
|
||||
namespace GenericProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
GenericProjectPlugin::GenericProjectPlugin()
|
||||
: m_contextMenuProject(0)
|
||||
{ }
|
||||
|
||||
bool GenericProjectPlugin::initialize(const QStringList &, QString *errorMessage)
|
||||
{
|
||||
Q_UNUSED(errorMessage)
|
||||
@@ -85,15 +81,14 @@ bool GenericProjectPlugin::initialize(const QStringList &, QString *errorMessage
|
||||
|
||||
connect(editFilesAction, &QAction::triggered, this, &GenericProjectPlugin::editFiles);
|
||||
|
||||
connect(ProjectTree::instance(), &ProjectTree::aboutToShowContextMenu,
|
||||
[this] (Project *project, Node *) { m_contextMenuProject = project; });
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void GenericProjectPlugin::editFiles()
|
||||
{
|
||||
GenericProject *genericProject = static_cast<GenericProject *>(m_contextMenuProject);
|
||||
auto genericProject = qobject_cast<GenericProject *>(ProjectTree::currentProject());
|
||||
if (!genericProject)
|
||||
return;
|
||||
SelectableFilesDialogEditFiles sfd(genericProject->projectFilePath().toFileInfo().path(), genericProject->files(),
|
||||
ICore::mainWindow());
|
||||
if (sfd.exec() == QDialog::Accepted)
|
||||
|
||||
@@ -50,8 +50,6 @@ class GenericProjectPlugin : public ExtensionSystem::IPlugin
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "GenericProjectManager.json")
|
||||
|
||||
public:
|
||||
GenericProjectPlugin();
|
||||
|
||||
bool initialize(const QStringList &arguments, QString *errorString);
|
||||
void extensionsInitialized() {}
|
||||
|
||||
@@ -64,9 +62,6 @@ private slots:
|
||||
void test_mixed1();
|
||||
void test_mixed2();
|
||||
#endif // WITH_TESTS
|
||||
|
||||
private:
|
||||
ProjectExplorer::Project *m_contextMenuProject;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -379,7 +379,8 @@ QByteArray GccToolChain::predefinedMacros(const QStringList &cxxflags) const
|
||||
if (a == QLatin1String("-arch")) {
|
||||
if (++iArg < allCxxflags.length() && !arguments.contains(a))
|
||||
arguments << a << allCxxflags.at(iArg);
|
||||
} else if (a == QLatin1String("--sysroot") || a == QLatin1String("-isysroot")) {
|
||||
} else if (a == QLatin1String("--sysroot") || a == QLatin1String("-isysroot")
|
||||
|| a == QLatin1String("-D") ||a == QLatin1String("-U")) {
|
||||
if (++iArg < allCxxflags.length())
|
||||
arguments << a << allCxxflags.at(iArg);
|
||||
} else if (a == QLatin1String("-m128bit-long-double") || a == QLatin1String("-m32")
|
||||
|
||||
@@ -444,7 +444,7 @@ void GenericListWidget::addProjectConfiguration(ProjectConfiguration *pc)
|
||||
int pos = count();
|
||||
for (int i = 0; i < count(); ++i) {
|
||||
ProjectConfiguration *p = item(i)->data(Qt::UserRole).value<ProjectConfiguration *>();
|
||||
if (pc->displayName() < p->displayName()) {
|
||||
if (caseFriendlyCompare(pc->displayName(), p->displayName()) < 0) {
|
||||
pos = i;
|
||||
break;
|
||||
}
|
||||
@@ -512,7 +512,7 @@ void GenericListWidget::displayNameChanged()
|
||||
int pos = count();
|
||||
for (int i = 0; i < count(); ++i) {
|
||||
ProjectConfiguration *p = item(i)->data(Qt::UserRole).value<ProjectConfiguration *>();
|
||||
if (pc->displayName() < p->displayName()) {
|
||||
if (caseFriendlyCompare(pc->displayName(), p->displayName()) < 0) {
|
||||
pos = i;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -384,11 +384,8 @@ Project::RestoreResult Project::fromMap(const QVariantMap &map, QString *errorMe
|
||||
|
||||
for (int i = 0; i < maxI; ++i) {
|
||||
const QString key(QString::fromLatin1(TARGET_KEY_PREFIX) + QString::number(i));
|
||||
if (!map.contains(key)) {
|
||||
if (errorMessage)
|
||||
*errorMessage = tr("Target key %1 was not found in project settings.").arg(key);
|
||||
return RestoreResult::Error;
|
||||
}
|
||||
if (!map.contains(key))
|
||||
continue;
|
||||
QVariantMap targetMap = map.value(key).toMap();
|
||||
|
||||
Target *t = restoreTarget(targetMap);
|
||||
|
||||
@@ -903,9 +903,8 @@ void QbsProject::updateDeploymentInfo()
|
||||
installOptions.setInstallRoot(QLatin1String("/"));
|
||||
foreach (const qbs::InstallableFile &f, m_qbsProject
|
||||
.installableFilesForProject(m_projectData, installOptions)) {
|
||||
deploymentData.addFile(f.sourceFilePath(), f.targetDirectory(), f.isExecutable()
|
||||
? DeployableFile::TypeExecutable
|
||||
: DeployableFile::TypeNormal);
|
||||
deploymentData.addFile(f.sourceFilePath(), QFileInfo(f.targetFilePath()).path(),
|
||||
f.isExecutable() ? DeployableFile::TypeExecutable : DeployableFile::TypeNormal);
|
||||
}
|
||||
}
|
||||
activeTarget()->setDeploymentData(deploymentData);
|
||||
|
||||
Submodule src/shared/qbs updated: 0abd1f7b72...a34e10961d
@@ -1212,6 +1212,8 @@ void tst_CheckSymbols::findField()
|
||||
source[position] = ' ';
|
||||
BaseTestCase tc(source);
|
||||
Use use = tc.findUse(line, column);
|
||||
|
||||
QEXPECT_FAIL("std vector", "Regression since e0594fc9b906a32f5c8ac70265490cf86044676f", Abort);
|
||||
QVERIFY(use.isValid());
|
||||
QVERIFY(use.kind == Highlighting::FieldUse);
|
||||
}
|
||||
@@ -1399,6 +1401,100 @@ void tst_CheckSymbols::findField_data()
|
||||
" p->@bar;\n"
|
||||
"}\n"
|
||||
);
|
||||
|
||||
QTest::newRow("std vector") << _(
|
||||
"namespace std\n"
|
||||
"{\n"
|
||||
"template<typename _Tp>\n"
|
||||
"struct allocator\n"
|
||||
"{\n"
|
||||
" typedef _Tp value_type;\n"
|
||||
"\n"
|
||||
" template<typename _Tp1>\n"
|
||||
" struct rebind\n"
|
||||
" { typedef allocator<_Tp1> other; };\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"template<typename _Alloc, typename _Tp>\n"
|
||||
"struct __alloctr_rebind\n"
|
||||
"{\n"
|
||||
" typedef typename _Alloc::template rebind<_Tp>::other __type;\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"template<typename _Alloc>\n"
|
||||
"struct allocator_traits\n"
|
||||
"{\n"
|
||||
" typedef typename _Alloc::value_type value_type;\n"
|
||||
"\n"
|
||||
" template<typename _Tp>\n"
|
||||
" using rebind_alloc = typename __alloctr_rebind<_Alloc, _Tp>::__type;\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"template<typename _Iterator>\n"
|
||||
"struct iterator_traits { };\n"
|
||||
"\n"
|
||||
"template<typename _Tp>\n"
|
||||
"struct iterator_traits<_Tp*>\n"
|
||||
"{\n"
|
||||
" typedef _Tp* pointer;\n"
|
||||
"};\n"
|
||||
"} // namespace std\n"
|
||||
"\n"
|
||||
"namespace __gnu_cxx\n"
|
||||
"{\n"
|
||||
"template<typename _Alloc>\n"
|
||||
"struct __alloc_traits\n"
|
||||
"{\n"
|
||||
" typedef _Alloc allocator_type;\n"
|
||||
" typedef std::allocator_traits<_Alloc> _Base_type;\n"
|
||||
" typedef typename _Alloc::value_type value_type;\n"
|
||||
"\n"
|
||||
" static value_type *_S_pointer_helper(...);\n"
|
||||
" typedef decltype(_S_pointer_helper((_Alloc*)0)) __pointer;\n"
|
||||
" typedef __pointer pointer;\n"
|
||||
"\n"
|
||||
" template<typename _Tp>\n"
|
||||
" struct rebind\n"
|
||||
" { typedef typename _Base_type::template rebind_alloc<_Tp> other; };\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"template<typename _Iterator, typename _Container>\n"
|
||||
"struct __normal_iterator\n"
|
||||
"{\n"
|
||||
" typedef std::iterator_traits<_Iterator> __traits_type;\n"
|
||||
" typedef typename __traits_type::pointer pointer;\n"
|
||||
"\n"
|
||||
" pointer p;\n"
|
||||
"};\n"
|
||||
"} // namespace __gnu_cxx\n"
|
||||
"\n"
|
||||
"namespace std {\n"
|
||||
"template<typename _Tp, typename _Alloc>\n"
|
||||
"struct _Vector_Base\n"
|
||||
"{\n"
|
||||
" typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template\n"
|
||||
" rebind<_Tp>::other _Tp_alloc_type;\n"
|
||||
" typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>::pointer\n"
|
||||
" pointer;\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"template<typename _Tp, typename _Alloc = std::allocator<_Tp> >\n"
|
||||
"struct vector : protected _Vector_Base<_Tp, _Alloc>\n"
|
||||
"{\n"
|
||||
" typedef _Vector_Base<_Tp, _Alloc> _Base;\n"
|
||||
" typedef typename _Base::pointer pointer;\n"
|
||||
" typedef __gnu_cxx::__normal_iterator<pointer, vector> iterator;\n"
|
||||
"};\n"
|
||||
"} // namespace std\n"
|
||||
"\n"
|
||||
"struct Foo { int bar; };\n"
|
||||
"\n"
|
||||
"void func()\n"
|
||||
"{\n"
|
||||
" std::vector<Foo>::iterator it;\n"
|
||||
" it.p->@bar;\n"
|
||||
"}\n"
|
||||
);
|
||||
}
|
||||
|
||||
QTEST_APPLESS_MAIN(tst_CheckSymbols)
|
||||
|
||||
@@ -127,6 +127,7 @@
|
||||
:QmlJSTools::Internal::QmlConsoleEdit {columnIndex='0' container=':DebugModeWidget_QmlJSTools::Internal::QmlConsoleView' rowIndex='0' type='QmlJSTools::Internal::QmlConsoleEdit' unnamed='1' visible='1'}
|
||||
:Qt Creator.Add Bookmark_QToolButton {text='Add Bookmark' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
||||
:Qt Creator.Analyzer Toolbar_QDockWidget {name='Analyzer Toolbar' type='QDockWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Analyzer Toolbar'}
|
||||
:Qt Creator.CloseDoc_QToolButton {toolTip?='Close Document *' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
||||
:Qt Creator.CloseFind_QToolButton {name='close' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
||||
:Qt Creator.Compile Output_Core::OutputWindow {type='Core::OutputWindow' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Compile Output'}
|
||||
:Qt Creator.DebugModeWidget_QSplitter {name='DebugModeWidget' type='QSplitter' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
||||
|
||||
@@ -174,8 +174,8 @@ def __selectQtVersionDesktop__(checks, available=None):
|
||||
clickButton(waitForObject(":Next_QPushButton"))
|
||||
return checkedTargets
|
||||
|
||||
def __createProjectHandleLastPage__(expectedFiles = None, addToVersionControl = "<None>", addToProject = None):
|
||||
if expectedFiles != None:
|
||||
def __createProjectHandleLastPage__(expectedFiles=[], addToVersionControl="<None>", addToProject=None):
|
||||
if len(expectedFiles):
|
||||
summary = waitForObject("{name='filesLabel' text?='<qt>Files to be added in<pre>*</pre>' "
|
||||
"type='QLabel' visible='1'}").text
|
||||
verifyItemOrder(expectedFiles, summary)
|
||||
@@ -241,7 +241,7 @@ def createProject_Qt_GUI(path, projectName, checks = True, addToVersionControl =
|
||||
|
||||
clickButton(waitForObject(":Next_QPushButton"))
|
||||
|
||||
expectedFiles = None
|
||||
expectedFiles = []
|
||||
if checks:
|
||||
if platform.system() in ('Windows', 'Microsoft'):
|
||||
path = os.path.abspath(path)
|
||||
@@ -264,7 +264,7 @@ def createProject_Qt_Console(path, projectName, checks = True):
|
||||
__createProjectSetNameAndPath__(path, projectName, checks)
|
||||
checkedTargets = __selectQtVersionDesktop__(checks, available)
|
||||
|
||||
expectedFiles = None
|
||||
expectedFiles = []
|
||||
if checks:
|
||||
if platform.system() in ('Windows', 'Microsoft'):
|
||||
path = os.path.abspath(path)
|
||||
@@ -734,20 +734,47 @@ def compareProjectTree(rootObject, dataset):
|
||||
return
|
||||
test.passes("No errors found in project tree")
|
||||
|
||||
def addCPlusPlusFileToCurrentProject(name, template, forceOverwrite=False, addToVCS = "<None>"):
|
||||
# creates C++ file(s) and adds them to the current project if one is open
|
||||
# name name of the created object: filename for files, classname for classes
|
||||
# template "C++ Class", "C++ Header File" or "C++ Source File"
|
||||
# forceOverwrite bool: force overwriting existing files?
|
||||
# addToVCS name of VCS to add the file(s) to
|
||||
# newBasePath path to create the file(s) at
|
||||
# expectedSourceName expected name of created source file
|
||||
# expectedHeaderName expected name of created header file
|
||||
def addCPlusPlusFileToCurrentProject(name, template, forceOverwrite=False, addToVCS="<None>",
|
||||
newBasePath=None, expectedSourceName=None, expectedHeaderName=None):
|
||||
if name == None:
|
||||
test.fatal("File must have a name - got None.")
|
||||
return
|
||||
__createProjectOrFileSelectType__(" C++", template, isProject=False)
|
||||
window = "{type='ProjectExplorer::JsonWizard' unnamed='1' visible='1'}"
|
||||
basePath = str(waitForObject("{type='Utils::FancyLineEdit' unnamed='1' visible='1' "
|
||||
"window=%s}" % window).text)
|
||||
basePathEdit = waitForObject("{type='Utils::FancyLineEdit' unnamed='1' visible='1' "
|
||||
"window=%s}" % window)
|
||||
if newBasePath:
|
||||
replaceEditorContent(basePathEdit, newBasePath)
|
||||
basePath = str(basePathEdit.text)
|
||||
lineEdit = None
|
||||
if template == "C++ Class":
|
||||
lineEdit = waitForObject("{name='Class' type='QLineEdit' visible='1'}")
|
||||
else:
|
||||
lineEdit = waitForObject("{name='nameLineEdit' type='Utils::FileNameValidatingLineEdit' "
|
||||
"visible='1' window=%s}" % window)
|
||||
replaceEditorContent(lineEdit, name)
|
||||
expectedFiles = []
|
||||
if expectedSourceName:
|
||||
expectedFiles += [expectedSourceName]
|
||||
if template == "C++ Class":
|
||||
test.compare(str(waitForObject("{name='SrcFileName' type='QLineEdit' visible='1'}").text),
|
||||
expectedSourceName)
|
||||
if expectedHeaderName:
|
||||
expectedFiles += [expectedHeaderName]
|
||||
if template == "C++ Class":
|
||||
test.compare(str(waitForObject("{name='HdrFileName' type='QLineEdit' visible='1'}").text),
|
||||
expectedHeaderName)
|
||||
clickButton(waitForObject(":Next_QPushButton"))
|
||||
fileExistedBefore = os.path.exists(os.path.join(basePath, name))
|
||||
__createProjectHandleLastPage__(addToVersionControl = addToVCS)
|
||||
__createProjectHandleLastPage__(expectedFiles, addToVersionControl=addToVCS)
|
||||
if (fileExistedBefore):
|
||||
overwriteDialog = "{type='Core::Internal::PromptOverwriteDialog' unnamed='1' visible='1'}"
|
||||
waitForObject(overwriteDialog)
|
||||
|
||||
@@ -46,7 +46,9 @@ def main():
|
||||
openQmakeProject(proFile)
|
||||
if not testRenameMacroAfterSourceModification():
|
||||
return
|
||||
addCPlusPlusFileToCurrentProject("anothertestfile.h", "C++ Header File")
|
||||
headerName = "anothertestfile.h"
|
||||
addCPlusPlusFileToCurrentProject(headerName, "C++ Header File",
|
||||
expectedHeaderName=headerName)
|
||||
if not testRenameMacroAfterSourceMoving():
|
||||
return
|
||||
invokeMenuItem("File", "Save All")
|
||||
|
||||
@@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false
|
||||
IMPLICITAUTSTART=0
|
||||
LANGUAGE=Python
|
||||
OBJECTMAP=../objects.map
|
||||
TEST_CASES=tst_build_speedcrunch tst_cmake_speedcrunch tst_create_proj_wizard tst_default_settings tst_installed_languages tst_opencreator_qbs tst_openqt_creator tst_rename_file tst_save_before_build tst_session_handling tst_tasks_handling
|
||||
TEST_CASES=tst_build_speedcrunch tst_cmake_speedcrunch tst_create_proj_wizard tst_default_settings tst_installed_languages tst_new_class tst_opencreator_qbs tst_openqt_creator tst_rename_file tst_save_before_build tst_session_handling tst_tasks_handling
|
||||
VERSION=2
|
||||
WRAPPERS=Qt
|
||||
|
||||
73
tests/system/suite_general/tst_new_class/test.py
Normal file
73
tests/system/suite_general/tst_new_class/test.py
Normal file
@@ -0,0 +1,73 @@
|
||||
#############################################################################
|
||||
##
|
||||
## Copyright (C) 2015 The Qt Company Ltd.
|
||||
## Contact: http://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 http://www.qt.io/terms-conditions. For further information
|
||||
## use the contact form at http://www.qt.io/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 or version 3 as published by the Free
|
||||
## Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
||||
## LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
||||
## following information to ensure the GNU Lesser General Public License
|
||||
## requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
||||
## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
##
|
||||
## In addition, as a special exception, The Qt Company gives you certain additional
|
||||
## rights. These rights are described in The Qt Company LGPL Exception
|
||||
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
##
|
||||
#############################################################################
|
||||
|
||||
source("../../shared/qtcreator.py")
|
||||
|
||||
def main():
|
||||
newClassName = "MyNewClass"
|
||||
headerFileName = newClassName.lower() + ".h"
|
||||
sourceFileName = newClassName.lower() + ".cpp"
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
addCPlusPlusFileToCurrentProject(newClassName, "C++ Class", newBasePath=tempDir(),
|
||||
expectedSourceName=sourceFileName,
|
||||
expectedHeaderName=headerFileName)
|
||||
|
||||
mainWindow = waitForObject(":Qt Creator_Core::Internal::MainWindow")
|
||||
if test.verify(waitFor("sourceFileName in str(mainWindow.windowTitle)", 1000),
|
||||
"Source file was opened on time?"):
|
||||
editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
|
||||
editorText = str(editor.plainText)
|
||||
mouseClick(editor) # enable menu items for file
|
||||
test.verify('#include "%s"' % headerFileName in editorText,
|
||||
"Header included in source file?")
|
||||
test.verify(newClassName + "::" + newClassName + "()" in editorText,
|
||||
"Ctor implementation in source file?")
|
||||
clickButton(waitForObject(":Qt Creator.CloseDoc_QToolButton"))
|
||||
if test.verify(waitFor("headerFileName in str(mainWindow.windowTitle)", 1000),
|
||||
"Header file was shown after closing source?"):
|
||||
editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
|
||||
editorText = str(editor.plainText)
|
||||
includeGuard = newClassName.upper().replace(".", "_")
|
||||
test.verify("#ifndef " + includeGuard in editorText,
|
||||
"Include guard check in header file?")
|
||||
test.verify("#define " + includeGuard in editorText,
|
||||
"Include guard definition in header file?")
|
||||
test.verify("class " + newClassName in editorText,
|
||||
"Class definition in header file?")
|
||||
test.verify(" " + newClassName + "();" in editorText,
|
||||
"Ctor declaration in header file?")
|
||||
test.verify("signals" not in editorText, # QTCREATORBUG-14949
|
||||
"No signals in non-Qt header file?")
|
||||
test.verify("slots" not in editorText, # QTCREATORBUG-14949
|
||||
"No slots in non-Qt header file?")
|
||||
invokeMenuItem("File", "Exit")
|
||||
return
|
||||
@@ -173,7 +173,9 @@ def main():
|
||||
createLocalGitConfig(os.path.join(srcPath, projectName, ".git"))
|
||||
commitMessages = [commit("Initial Commit", "Committed 5 file(s).")]
|
||||
clickButton(waitForObject(":*Qt Creator.Clear_QToolButton"))
|
||||
addCPlusPlusFileToCurrentProject("pointless_header.h", "C++ Header File", addToVCS = "Git")
|
||||
headerName = "pointless_header.h"
|
||||
addCPlusPlusFileToCurrentProject(headerName, "C++ Header File", addToVCS="Git",
|
||||
expectedHeaderName=headerName)
|
||||
commitMessages.insert(0, commit("Added pointless header file", "Committed 2 file(s)."))
|
||||
__createProjectOrFileSelectType__(" General", "Empty File", isProject=False)
|
||||
readmeName = "README.txt"
|
||||
|
||||
Reference in New Issue
Block a user