Merge remote-tracking branch 'origin/4.1'

Conflicts:
	share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ExtendedFunctionButton.qml
	src/plugins/android/androidrunner.cpp
	src/plugins/debugger/debuggerruncontrol.cpp
	src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
	src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.h
	tests/system/suite_WELP/tst_WELP03/test.py

Change-Id: Ibac4d71d4f4dbe1e4f05052d2f8a2dcfd82edd4c
This commit is contained in:
Eike Ziller
2016-09-13 12:15:09 +02:00
30 changed files with 5125 additions and 2620 deletions

View File

@@ -51,7 +51,7 @@
\li \l{Setting Up a Qbs Project}
Qt Build Suite (Qbs) is an all-in-one build
\l{Qbs Manual}{Qbs} is an all-in-one build
tool that generates a build graph from a high-level project
description (like qmake or CMake do) and executes the commands in
the low-level build graph (like make does).

View File

@@ -178,7 +178,6 @@ Item {
expressionDialog.visible = false
}
}
}
}

View File

@@ -160,7 +160,7 @@ Welcome_BackgroundColor=normalBackground
Welcome_ButtonBackgroundColor=normalBackground
Welcome_DividerColor=ff555555
Welcome_HoverColor=ff444444
Welcome_LinkColor=ff5caa15
Welcome_LinkColor=ff78bb39
Timeline_TextColor=text
Timeline_BackgroundColor1=normalBackground

View File

@@ -165,7 +165,7 @@ Welcome_BackgroundColor=normalBackground
Welcome_ButtonBackgroundColor=normalBackground
Welcome_DividerColor=ff555555
Welcome_HoverColor=ff444444
Welcome_LinkColor=ff5caa15
Welcome_LinkColor=ff7fc63c
Timeline_TextColor=text
Timeline_BackgroundColor1=normalBackground

File diff suppressed because it is too large Load Diff

View File

@@ -301,7 +301,8 @@ int main(int argc, char **argv)
{
const char *highDpiEnvironmentVariable = setHighDpiEnvironmentVariable();
QLoggingCategory::setFilterRules(QLatin1String("qtc.*.debug=false"));
QLoggingCategory::setFilterRules(QLatin1String("qtc.*.debug=false\nqtc.*.info=false"));
#ifdef Q_OS_MAC
// increase the number of file that can be opened in Qt Creator.
struct rlimit rl;

View File

@@ -758,14 +758,8 @@ static inline AbstractSymbolGroupNodePtrVector
AddressSequence(arrayAddress, pointerSize),
v.module(), innerType, count);
// Check condition for large||static.
bool isLargeOrStatic = innerTypeSize > pointerSize;
if (!isLargeOrStatic && !SymbolGroupValue::isPointerType(innerType)) {
const KnownType kt = knownType(innerType, false); // inner type, no 'class ' prefix.
if (kt != KT_Unknown && !(kt & (KT_POD_Type|KT_Qt_PrimitiveType|KT_Qt_MovableType))
&& !(kt == KT_QStringList && QtInfo::get(v.context()).version >= 5)) {
isLargeOrStatic = true;
}
}
const bool isLargeOrStatic = innerTypeSize > pointerSize
|| !SymbolGroupValue::isMovable(innerType, v);
if (SymbolGroupValue::verbose)
DebugPrint() << "isLargeOrStatic " << isLargeOrStatic;
if (isLargeOrStatic) {
@@ -776,7 +770,8 @@ static inline AbstractSymbolGroupNodePtrVector
arrayChildList(v.node()->symbolGroup(),
AddressArraySequence<ULONG64>(reinterpret_cast<const ULONG64 *>(data)),
v.module(), innerType, count) :
arrayChildList(v.node()->symbolGroup(), AddressArraySequence<ULONG32>(reinterpret_cast<const ULONG32 *>(data)),
arrayChildList(v.node()->symbolGroup(),
AddressArraySequence<ULONG32>(reinterpret_cast<const ULONG32 *>(data)),
v.module(), innerType, count);
delete [] data;
return rc;

View File

@@ -163,7 +163,8 @@ bool AbstractSymbolGroupNode::accept(SymbolGroupNodeVisitor &visitor,
break;
case SymbolGroupNodeVisitor::VisitContinue: {
AbstractSymbolGroupNodePtrVector c = children();
if (visitor.sortChildrenAlphabetically() && !testFlags(SymbolGroupNode::PreSortedChildren)) {
if (visitor.sortChildrenAlphabetically()
&& !resolveReference()->testFlags(SymbolGroupNode::PreSortedChildren)) {
std::sort(c.begin(), c.end(), [](AbstractSymbolGroupNode *a, AbstractSymbolGroupNode *b) {
return a->name() < b->name();
});

View File

@@ -1505,6 +1505,14 @@ void formatKnownTypeFlags(std::ostream &os, KnownType kt)
os << " simple_dumper";
}
unsigned SymbolGroupValue::isMovable(const std::string &t, const SymbolGroupValue &v)
{
KnownType kt = knownType(t, false);
if (kt & (KT_POD_Type | KT_Qt_MovableType | KT_Qt_PrimitiveType))
return true;
return kt == KT_QStringList && QtInfo::get(v.context()).version >= 5;
}
static inline DumpParameterRecodeResult
checkCharArrayRecode(const SymbolGroupValue &v)
{

View File

@@ -112,6 +112,7 @@ public:
static std::string moduleOfType(const std::string &type);
// pointer type, return number of characters to strip
static unsigned isPointerType(const std::string &);
static unsigned isMovable(const std::string &, const SymbolGroupValue &v);
static bool isArrayType(const std::string &);
static bool isVTableType(const std::string &t);
// add pointer type 'Foo' -> 'Foo *', 'Foo *' -> 'Foo **'

View File

@@ -86,6 +86,15 @@ static QStringList uniquePaths(const QStringList &files)
return paths.toList();
}
static QString toNdkArch(const QString &arch)
{
if (arch == QLatin1String("armeabi-v7a") || arch == QLatin1String("armeabi"))
return QLatin1String("arch-arm");
if (arch == QLatin1String("arm64-v8a"))
return QLatin1String("arch-arm64");
return QLatin1String("arch-") + arch;
}
RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *runConfig, QString *errorMessage)
{
Target *target = runConfig->target();
@@ -109,6 +118,9 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
params.solibSearchPath.append(qtSoPaths(version));
params.solibSearchPath.append(uniquePaths(AndroidManager::androidQtSupport(target)->androidExtraLibs(target)));
params.sysRoot = AndroidConfigurations::currentConfig().ndkLocation().appendPath(QLatin1String("platforms"))
.appendPath(QLatin1String("android-") + QString::number(AndroidManager::minimumSDK(target)))
.appendPath(toNdkArch(AndroidManager::targetArch(target))).toString();
}
if (aspect->useQmlDebugger()) {
QTcpServer server;

View File

@@ -283,6 +283,8 @@ QString AndroidManager::androidNameForApiLevel(int x)
return QLatin1String("Android 5.1");
case 23:
return QLatin1String("Android 6.0");
case 24:
return QLatin1String("Android 7.0");
default:
return tr("Unknown Android version. API Level: %1").arg(QString::number(x));
}

View File

@@ -275,7 +275,8 @@ void AbstractSettings::createDocumentationFile() const
void AbstractSettings::read()
{
// Set default values
setSupportedMimeTypes("text/x-c++src;text/x-c++hdr");
setSupportedMimeTypes("text/x-c++src;text/x-c++hdr;text/x-csrc;text/x-chdr;text/x-objcsrc;"
"text/x-objc++src");
// Read settings, except styles
QSettings *s = Core::ICore::settings();

View File

@@ -183,6 +183,8 @@ void OutputPanePlaceHolder::ensureSizeHintAsMinimum()
int OutputPanePlaceHolder::nonMaximizedSize() const
{
if (!d->m_initialized)
return Internal::OutputPaneManager::outputPaneHeightSetting();
return d->m_nonMaximizedSize;
}

View File

@@ -88,6 +88,8 @@ void BuiltinEditorDocumentParser::updateHelper(const QFutureInterface<void> &fut
configFile += part->toolchainDefines;
configFile += overwrittenToolchainDefines(*part.data());
configFile += part->projectDefines;
if (!part->projectConfigFile.isEmpty())
configFile += ProjectPart::readProjectConfigFile(part);
headerPaths = part->headerPaths;
projectConfigFile = part->projectConfigFile;
if (baseConfig.usePrecompiledHeaders)
@@ -193,8 +195,6 @@ void BuiltinEditorDocumentParser::updateHelper(const QFutureInterface<void> &fut
sourceProcessor.setHeaderPaths(state.headerPaths);
sourceProcessor.setLanguageFeatures(features);
sourceProcessor.run(configurationFileName);
if (!state.projectConfigFile.isEmpty())
sourceProcessor.run(state.projectConfigFile);
if (baseConfig.usePrecompiledHeaders) {
foreach (const QString &precompiledHeader, state.precompiledHeaders)
sourceProcessor.run(precompiledHeader);

View File

@@ -99,7 +99,6 @@ public:
QStringList debugSourceLocation; // Gdb "directory"
QString serverStartScript;
ProjectExplorer::IDevice::ConstPtr device;
QString sysRoot;
bool isSnapshot = false; // Set if created internally.
ProjectExplorer::Abi toolChainAbi;

View File

@@ -428,6 +428,7 @@ static DebuggerRunControl *doCreate(DebuggerRunParameters rp, RunConfiguration *
rp.nativeMixedEnabled = bool(nativeMixedOverride);
rp.cppEngineType = DebuggerKitInformation::engineType(kit);
if (rp.sysRoot.isEmpty())
rp.sysRoot = SysRootKitInformation::sysRoot(kit).toString();
rp.device = DeviceKitInformation::device(kit);

View File

@@ -109,6 +109,7 @@ public:
QString platform;
QString deviceSymbolsRoot;
bool continueAfterAttach = false;
QString sysRoot;
};
} // namespace Debugger

View File

@@ -633,7 +633,7 @@ void HelpPlugin::handleHelpRequest(const QUrl &url, HelpManager::HelpViewerLocat
if (url.authority() == "org.qt-project.qtcreator")
urlPrefix.append(QString::fromLatin1("qtcreator"));
else
urlPrefix.append("latest");
urlPrefix.append("qt-5");
address = urlPrefix + address.mid(address.lastIndexOf(QLatin1Char('/')));
}
}

View File

@@ -617,10 +617,7 @@ IOutputParser *GccToolChain::outputParser() const
void GccToolChain::resetToolChain(const FileName &path)
{
if (path == m_compilerCommand)
return;
bool resetDisplayName = displayName() == defaultDisplayName();
bool resetDisplayName = (displayName() == defaultDisplayName());
setCompilerCommand(path);
@@ -710,14 +707,18 @@ bool GccToolChain::fromMap(const QVariantMap &data)
m_platformLinkerFlags = data.value(QLatin1String(compilerPlatformLinkerFlagsKeyC)).toStringList();
m_targetAbi = Abi(data.value(QLatin1String(targetAbiKeyC)).toString());
m_originalTargetTriple = data.value(QLatin1String(originalTargetTripleKeyC)).toString();
QStringList abiList = data.value(QLatin1String(supportedAbisKeyC)).toStringList();
const QStringList abiList = data.value(QLatin1String(supportedAbisKeyC)).toStringList();
m_supportedAbis.clear();
foreach (const QString &a, abiList) {
for (const QString &a : abiList) {
Abi abi(a);
if (!abi.isValid())
continue;
m_supportedAbis.append(abi);
}
if (!m_targetAbi.isValid())
resetToolChain(m_compilerCommand);
return true;
}

View File

@@ -42,7 +42,7 @@
#include <QPen>
#include <qdebug.h>
static Q_LOGGING_CATEGORY(itemlibraryPopulate, "itemlibrary.populate")
static Q_LOGGING_CATEGORY(itemlibraryPopulate, "qtc.itemlibrary.populate")
static bool inline registerItemLibrarySortedModel() {
qmlRegisterType<QmlDesigner::ItemLibrarySectionModel>();

View File

@@ -405,7 +405,6 @@ void NodeInstanceServerProxy::processFinished(int exitCode, QProcess::ExitStatus
if (m_captureFileForTest.isOpen()) {
m_captureFileForTest.close();
m_captureFileForTest.remove();
Core::AsynchronousMessageBox::warning(tr("QML Emulation Layer (QML Puppet) Crashed"),
tr("You are recording a puppet stream and the emulations layer crashed. "
"It is recommended to reopen the Qt Quick Designer and start again."));

View File

@@ -55,8 +55,8 @@
#include <QMessageBox>
#include <QThread>
static Q_LOGGING_CATEGORY(puppetStart, "puppet.start")
static Q_LOGGING_CATEGORY(puppetBuild, "puppet.build")
static Q_LOGGING_CATEGORY(puppetStart, "qtc.puppet.start")
static Q_LOGGING_CATEGORY(puppetBuild, "qtc.puppet.build")
namespace QmlDesigner {

View File

@@ -59,7 +59,7 @@
using namespace LanguageUtils;
using namespace QmlJS;
static Q_LOGGING_CATEGORY(rewriterBenchmark, "rewriter.load")
static Q_LOGGING_CATEGORY(rewriterBenchmark, "qtc.rewriter.load")
namespace {

View File

@@ -30,11 +30,9 @@
#include <utils/algorithm.h>
#include <utils/qtcassert.h>
#include <QVector>
#include <QHash>
#include <QString>
#include <QStack>
#include <QSet>
#include <QString>
#include <QPointer>
#include <functional>
@@ -60,6 +58,7 @@ public:
QHash<int, QString> notes;
QStack<QmlEvent> callStack;
QStack<QmlEvent> compileStack;
qint64 qmlTime = 0;
qint64 lastEndTime = 0;
QHash <int, QVector<qint64> > durations;
@@ -71,6 +70,7 @@ QmlProfilerStatisticsModel::QmlProfilerStatisticsModel(QmlProfilerModelManager *
{
d->modelManager = modelManager;
d->callStack.push(QmlEvent());
d->compileStack.push(QmlEvent());
connect(modelManager, &QmlProfilerModelManager::stateChanged,
this, &QmlProfilerStatisticsModel::dataChanged);
connect(modelManager->notesModel(), &Timeline::TimelineNotesModel::changed,
@@ -143,7 +143,9 @@ void QmlProfilerStatisticsModel::clear()
d->eventsInBindingLoop.clear();
d->notes.clear();
d->callStack.clear();
d->compileStack.clear();
d->callStack.push(QmlEvent());
d->compileStack.push(QmlEvent());
d->qmlTime = 0;
d->lastEndTime = 0;
d->durations.clear();
@@ -210,22 +212,25 @@ void QmlProfilerStatisticsModel::loadEvent(const QmlEvent &event, const QmlEvent
if (!d->acceptedTypes.contains(type.rangeType()))
return;
QStack<QmlEvent> &stack = type.rangeType() == Compiling ? d->compileStack : d->callStack;
switch (event.rangeStage()) {
case RangeStart:
// binding loop detection: check whether event is already in stack
for (int ii = 1; ii < d->callStack.size(); ++ii) {
if (d->callStack.at(ii).typeIndex() == event.typeIndex()
&& type.rangeType() != Javascript) {
if (type.rangeType() == Binding || type.rangeType() == HandlingSignal) {
for (int ii = 1; ii < stack.size(); ++ii) {
if (stack.at(ii).typeIndex() == event.typeIndex()) {
d->eventsInBindingLoop.insert(event.typeIndex());
break;
}
}
d->callStack.push(event);
}
stack.push(event);
break;
case RangeEnd: {
// update stats
QmlEventStats *stats = &d->data[event.typeIndex()];
qint64 duration = event.timestamp() - d->callStack.top().timestamp();
qint64 duration = event.timestamp() - stack.top().timestamp();
stats->duration += duration;
stats->durationSelf += duration;
if (duration < stats->minTime)
@@ -241,21 +246,20 @@ void QmlProfilerStatisticsModel::loadEvent(const QmlEvent &event, const QmlEvent
d->lastEndTime = event.timestamp();
}
d->callStack.pop();
if (d->callStack.count() > 1)
d->data[d->callStack.top().typeIndex()].durationSelf -= duration;
stack.pop();
if (stack.count() > 1)
d->data[stack.top().typeIndex()].durationSelf -= duration;
break;
}
default:
break;
return;
}
if (!d->childrenModel.isNull())
d->childrenModel->loadEvent(event);
d->childrenModel->loadEvent(type.rangeType(), event);
if (!d->parentsModel.isNull())
d->parentsModel->loadEvent(event);
d->parentsModel->loadEvent(type.rangeType(), event);
}
@@ -310,8 +314,6 @@ QmlProfilerStatisticsRelativesModel::QmlProfilerStatisticsRelativesModel(
QmlProfilerStatisticsRelation relation, QObject *parent) :
QObject(parent), m_relation(relation)
{
m_startTimesPerLevel[0] = 0;
QTC_CHECK(modelManager);
m_modelManager = modelManager;
@@ -341,21 +343,16 @@ const QVector<QmlEventType> &QmlProfilerStatisticsRelativesModel::getTypes() con
return m_modelManager->qmlModel()->eventTypes();
}
void QmlProfilerStatisticsRelativesModel::loadEvent(const QmlEvent &event)
void QmlProfilerStatisticsRelativesModel::loadEvent(RangeType type, const QmlEvent &event)
{
// level computation
QStack<Frame> &stack = (type == Compiling) ? m_compileStack : m_callStack;
switch (event.rangeStage()) {
case RangeStart:
// now lastparent is the new type
++m_level;
m_typesPerLevel[m_level] = event.typeIndex();
m_startTimesPerLevel[m_level] = event.timestamp();
stack.push({event.timestamp(), event.typeIndex()});
break;
case RangeEnd: {
int parentTypeIndex = -1;
if (m_level > 0 && m_typesPerLevel.contains(m_level-1))
parentTypeIndex = m_typesPerLevel[m_level-1];
int parentTypeIndex = stack.count() > 1 ? stack[stack.count() - 2].typeId : -1;
int relativeTypeIndex = (m_relation == QmlProfilerStatisticsParents) ? parentTypeIndex :
event.typeIndex();
int selfTypeIndex = (m_relation == QmlProfilerStatisticsParents) ? event.typeIndex() :
@@ -365,16 +362,16 @@ void QmlProfilerStatisticsRelativesModel::loadEvent(const QmlEvent &event)
QmlStatisticsRelativesMap::Iterator it = relativesMap.find(relativeTypeIndex);
if (it != relativesMap.end()) {
it.value().calls++;
it.value().duration += event.timestamp() - m_startTimesPerLevel[m_level];
it.value().duration += event.timestamp() - stack.top().startTime;
} else {
QmlStatisticsRelativesData relative = {
event.timestamp() - m_startTimesPerLevel[m_level],
event.timestamp() - stack.top().startTime,
1,
false
};
relativesMap.insert(relativeTypeIndex, relative);
}
--m_level;
stack.pop();
break;
}
default:
@@ -407,9 +404,8 @@ int QmlProfilerStatisticsRelativesModel::count() const
void QmlProfilerStatisticsRelativesModel::clear()
{
m_data.clear();
m_startTimesPerLevel.clear();
m_level = 0;
m_typesPerLevel.clear();
m_callStack.clear();
m_compileStack.clear();
}
} // namespace QmlProfiler

View File

@@ -32,6 +32,7 @@
#include "qmlprofilerconstants.h"
#include <QHash>
#include <QStack>
#include <QVector>
#include <QObject>
@@ -121,7 +122,7 @@ public:
const QmlStatisticsRelativesMap &getData(int typeId) const;
const QVector<QmlEventType> &getTypes() const;
void loadEvent(const QmlEvent &event);
void loadEvent(RangeType type, const QmlEvent &event);
void finalize(const QSet<int> &eventsInBindingLoop);
QmlProfilerStatisticsRelation relation() const;
@@ -133,12 +134,12 @@ protected:
QHash <int, QmlStatisticsRelativesMap> m_data;
QmlProfilerModelManager *m_modelManager;
// for level computation
QHash<int, qint64> m_startTimesPerLevel;
int m_level = 0;
// compute parent-child relationship and call count
QHash<int, int> m_typesPerLevel;
struct Frame {
qint64 startTime;
int typeId;
};
QStack<Frame> m_callStack;
QStack<Frame> m_compileStack;
const QmlProfilerStatisticsRelation m_relation;
};

View File

@@ -96,7 +96,8 @@ QString RemoteLinuxSignalOperation::interruptProcessByNameCommandLine(const QStr
void RemoteLinuxSignalOperation::killProcess(qint64 pid)
{
run(signalProcessByPidCommandLine(pid, 9));
run(QString::fromLatin1("%1; %2").arg(signalProcessByPidCommandLine(pid, 15),
signalProcessByPidCommandLine(pid, 9)));
}
void RemoteLinuxSignalOperation::killProcess(const QString &filePath)

View File

@@ -35,8 +35,8 @@ def checkTypeAndProperties(typePropertiesDetails):
def main():
# prepare example project
sourceExample = os.path.join(sdkPath, "Examples", "4.7", "declarative", "animation", "basics",
"property-animation")
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_561_DEFAULT),
"quick", "animation")
if not neededFilePresent(sourceExample):
return
# open Qt Creator
@@ -69,16 +69,16 @@ def main():
checkTypeAndProperties(typePropDet)
# select "Open project" and select a project
examplePath = os.path.join(prepareTemplate(sourceExample), "propertyanimation.pro")
examplePath = os.path.join(prepareTemplate(sourceExample), "animation.pro")
openQmakeProject(examplePath, fromWelcome = True)
progressBarWait(30000)
test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
" text~='propertyanimation( \(.*\))?' type='QModelIndex'}"),
" text~='animation( \(.*\))?' type='QModelIndex'}"),
"Verifying: The project is opened in 'Edit' mode after configuring.")
# go to "Welcome page" again and check if there is an information about recent projects
switchViewTo(ViewConstants.WELCOME)
test.verify(checkIfObjectExists(getQmlItem("Text", welcomePage, False,
"text='propertyanimation'")) and
"text='animation'")) and
checkIfObjectExists(getQmlItem("Text", welcomePage, False,
"text='SampleApp'")),
"Verifying: 'Welcome page' displays information about recently created and "

View File

@@ -41,13 +41,12 @@ def handlePackagingMessageBoxes():
break
def main():
global sdkPath
welcomePage = ":Qt Creator.WelcomePage_QQuickWidget"
# open Qt Creator
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
qchs = [os.path.join(sdkPath, "Documentation", "qt.qch")]
qchs = []
for p in Qt5Path.getPaths(Qt5Path.DOCS):
qchs.extend([os.path.join(p, "qtopengl.qch"), os.path.join(p, "qtwidgets.qch")])
addHelpDocumentation(qchs)
@@ -64,13 +63,8 @@ def main():
5, 5, 0, Qt.LeftButton)
test.verify(checkIfObjectExists(getQmlItem("Text", welcomePage, False, "text='Examples'")),
"Verifying: 'Examples' topic is opened and the examples are shown.")
basePath = "opengl/2dpainting/2dpainting.pro"
qt4Exmpl = os.path.join(sdkPath, "Examples", "4.7", basePath)
qt5Exmpls = []
for p in Qt5Path.getPaths(Qt5Path.EXAMPLES):
qt5Exmpls.append(os.path.join(p, basePath))
proFiles = [qt4Exmpl]
proFiles.extend(qt5Exmpls)
proFiles = map(lambda p: os.path.join(p, "opengl", "2dpainting", "2dpainting.pro"),
Qt5Path.getPaths(Qt5Path.EXAMPLES))
cleanUpUserFiles(proFiles)
for p in proFiles:
removePackagingDirectory(os.path.dirname(p))
@@ -112,13 +106,8 @@ def main():
# go to "Welcome" page and choose another example
switchViewTo(ViewConstants.WELCOME)
basePath = "itemviews/addressbook/addressbook.pro"
qt4Exmpl = os.path.join(sdkPath, "Examples", "4.7", basePath)
qt5Exmpls = []
for p in Qt5Path.getPaths(Qt5Path.EXAMPLES):
qt5Exmpls.append(os.path.join(p, "widgets", basePath))
proFiles = [qt4Exmpl]
proFiles.extend(qt5Exmpls)
proFiles = map(lambda p: os.path.join(p, "widgets", "itemviews", "addressbook", "addressbook.pro"),
Qt5Path.getPaths(Qt5Path.EXAMPLES))
cleanUpUserFiles(proFiles)
for p in proFiles:
removePackagingDirectory(os.path.dirname(p))

View File

@@ -27,8 +27,9 @@ source("../../shared/qtcreator.py")
def main():
# prepare example project
projectName = "declarative-music-browser"
sourceExample = os.path.join(sdkPath, "Examples", "QtMobility", projectName)
projectName = "adding"
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_561_DEFAULT),
"qml", "referenceexamples", "adding")
proFile = projectName + ".pro"
if not neededFilePresent(os.path.join(sourceExample, proFile)):
return
@@ -40,25 +41,33 @@ def main():
return
usedProFile = os.path.join(templateDir, proFile)
openQmakeProject(usedProFile)
openDocument(projectName + "." + projectName + "\\.pro")
typeLines(waitForObject(":Qt Creator_TextEditor::TextEditorWidget"),
"OTHER_FILES += example.qml")
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Close All")
progressBarWait()
for filetype, filename in [["Headers", "utility.h"],
for filetype, filename in [["Headers", "person.h"],
["Sources", "main.cpp"],
["Sources", "utility.cpp"],
["Resources", "musicbrowser.qrc"],
["QML", "musicbrowser.qml"]]:
["Sources", "person.cpp"],
["Resources", "adding.qrc"],
["QML", "example.qml"]]:
filenames = ["ABCD" + filename.upper(), "abcd" + filename.lower(), "test", "TEST", filename]
previous = filenames[-1]
for filename in filenames:
tempFiletype = filetype
if previous in ("test", "TEST") or filetype == "QML" and previous[-4:] != ".qml":
if (filetype == "Resources" and previous in ("test", "TEST")
or filetype == "QML" and not previous.endswith(".qml")):
tempFiletype = "Other files"
elif filetype == "Sources" and previous in ("test", "TEST"):
tempFiletype = "Headers"
renameFile(templateDir, usedProFile, projectName + "." + tempFiletype,
previous, filename)
# QTCREATORBUG-13176 does update the navigator async
progressBarWait()
if tempFiletype == "Headers": # QTCREATORBUG-13204
if filetype == "Headers":
verifyRenamedIncludes(templateDir, "main.cpp", previous, filename)
verifyRenamedIncludes(templateDir, "utility.cpp", previous, filename)
verifyRenamedIncludes(templateDir, "person.cpp", previous, filename)
previous = filename
invokeMenuItem("File", "Exit")