Merge remote-tracking branch 'origin/3.3'

Conflicts:
	src/plugins/debugger/watchhandler.cpp
	src/plugins/projectexplorer/kitmodel.cpp
	src/plugins/qbsprojectmanager/qbsprojectmanager.cpp
	src/shared/qbs

Change-Id: I6a68090993a264e93ac7850858cc24ba6bdb5602
This commit is contained in:
Eike Ziller
2015-02-12 17:36:29 +01:00
44 changed files with 302 additions and 214 deletions

View File

@@ -258,7 +258,7 @@
changed over time, so they differ between Qt and \QC versions. Since \QC
version 3.3, only Qt 5 is supported for building documentation. The
templates to use are defined by the
\c qt5\qtbase\doc\global\qt-html-templates-offline.qdocconf} and
\c {qt5\qtbase\doc\global\qt-html-templates-offline.qdocconf} and
\c {qt5\qtbase\doc\global\qt-html-templates-online.qdocconf} configuration
file. They are fetched from Qt sources by adding the following lines to the
qdocconf file:
@@ -266,11 +266,14 @@
\list
\li \c {include ($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf)}
for publishing on the web
\li \c {include ($QT_INSTALL_DOCS/global/qt-html-templates-online.qdocconf)}
for help files
\li \c {include ($QT_INSTALL_DOCS/global/qt-html-templates-online.qdocconf)}
for publishing on the web
\endlist
\note To have the correct fonts loaded for the online version, you must be
running it on a web server.
\note If the styles look wrong to you when reading help files in \QC or \QA,
you might be looking at them in the QTextBrowser instead of the WebKit
browser. This happens if you build \QC and \QA with a self-built Qt and did

View File

@@ -34,6 +34,9 @@
You can use \QC wizards to create UI forms that have the filename extension
\e .ui.qml. The UI forms contain a purely declarative subset of the QML
language. It is recommended that you edit the forms in the \uicontrol Design mode.
However, exporting items as alias properties is a commercial only feature,
and therefore you must use the \uicontrol Edit mode to do it if you are
using the open source version of \QC.
\QC enforces the use of the supported QML features by displaying error
messages.

View File

@@ -67,7 +67,7 @@ SpinBoxStyle {
}
background: Rectangle {
implicitWidth: Math.max(60, styleData.contentWidth)
implicitWidth: Math.max(64, styleData.contentWidth)
implicitHeight: 23
border.color: borderColor
radius: 3

View File

@@ -39,79 +39,6 @@ SpinBox {
property color highlightColor: "orange"
property color textColor: "#eee"
function showSlider() {
timer.stop()
timer2.start()
slider.opacity = 1;
}
onHoveredChanged: {
if (hovered)
showSlider();
}
Slider {
id: slider
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.bottom
height: 10;
//opacity: 0
maximumValue: spinBox.maximumValue
minimumValue: spinBox.minimumValue
value: spinBox.value
visible: false
onValueChanged: {
spinBox.value = value
}
Behavior on opacity {
PropertyAnimation {
duration: 100
}
}
onHoveredChanged: {
if (!hovered) {
timer.startTimer();
} else {
timer2.stop()
timer.stop()
}
}
}
Timer {
id: timer
repeat: false
function startTimer() {
if (!timer.running)
timer.start()
}
interval: 600
onTriggered: {
return
if (!slider.hovered)
slider.opacity = 0;
}
}
Timer {
id: timer2
repeat: false
interval: 1000
onTriggered: {
return
if (!slider.hovered)
slider.opacity = 0;
}
}
style: CustomSpinBoxStyle {
}

View File

@@ -63,25 +63,6 @@ Controls.SpinBox {
backendValue.value = value;
}
Controls.Slider {
id: slider
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.bottom
height: 10
visible: false
maximumValue: spinBox.maximumValue
minimumValue: spinBox.minimumValue
value: spinBox.value
onValueChanged: {
spinBox.value = value
}
}
style: CustomSpinBoxStyle {
}
}

View File

@@ -51,7 +51,7 @@ Column {
SecondColumnLayout {
SpinBox {
backendValue: backendValues.dragMargin
minimumValue: 100;
minimumValue: 0;
maximumValue: 100;
decimals: 0
}

View File

@@ -631,10 +631,15 @@ QList<LookupItem> ClassOrNamespace::lookup_helper(const Name *name, bool searchI
// a qualified name. For instance, a nested class which is forward declared
// in the class but defined outside it - we should capture both.
Symbol *match = 0;
QSet<ClassOrNamespace *> processed;
for (ClassOrNamespace *parentBinding = binding->parent();
parentBinding && !match;
parentBinding = parentBinding->parent())
parentBinding = parentBinding->parent()) {
if (processed.contains(parentBinding))
break;
processed.insert(parentBinding);
match = parentBinding->lookupInScope(fullName);
}
if (match) {
LookupItem item;
@@ -648,8 +653,12 @@ QList<LookupItem> ClassOrNamespace::lookup_helper(const Name *name, bool searchI
}
QSet<ClassOrNamespace *> processed;
QSet<ClassOrNamespace *> processedOwnParents;
ClassOrNamespace *binding = this;
do {
if (processedOwnParents.contains(binding))
break;
processedOwnParents.insert(binding);
lookup_helper(name, binding, &result, &processed, /*templateId = */ 0);
binding = binding->_parent;
} while (searchInEnclosingScope && binding);

View File

@@ -140,6 +140,12 @@ static bool isQtReservedWord(const char *name, int size)
return false;
}
static void nestingTooDeep()
{
#ifndef NO_DEBUG
std::cerr << "*** WARNING #if / #ifdef nesting exceeded the max level " << MAX_LEVEL << std::endl;
#endif
}
} // anonymous namespace
@@ -1824,6 +1830,12 @@ void Preprocessor::handleIfDirective(PPToken *tk)
lex(tk); // consume "if" token
Value result;
const PPToken lastExpressionToken = evalExpression(tk, result);
if (m_state.m_ifLevel >= MAX_LEVEL - 1) {
nestingTooDeep();
return;
}
const bool value = !result.is_zero();
const bool wasSkipping = m_state.m_skipping[m_state.m_ifLevel];
@@ -1950,12 +1962,17 @@ void Preprocessor::handleIfDefDirective(bool checkUndefined, PPToken *tk)
value = !value;
const bool wasSkipping = m_state.m_skipping[m_state.m_ifLevel];
if (m_state.m_ifLevel < MAX_LEVEL - 1) {
++m_state.m_ifLevel;
m_state.m_trueTest[m_state.m_ifLevel] = value;
m_state.m_skipping[m_state.m_ifLevel] = wasSkipping ? wasSkipping : !value;
if (m_client && !wasSkipping && !value)
startSkippingBlocks(*tk);
} else {
nestingTooDeep();
}
lex(tk); // consume the identifier
#ifndef NO_DEBUG

View File

@@ -1006,7 +1006,8 @@ void ModelManagerInterface::importScan(QFutureInterface<void> &future,
int totalWork(progressRange), workDone(0);
future.setProgressRange(0, progressRange); // update max length while iterating?
const Snapshot snapshot = modelManager->snapshot();
while (!pathsToScan.isEmpty() && !future.isCanceled()) {
bool isCanceled = future.isCanceled();
while (!pathsToScan.isEmpty() && !isCanceled) {
ScanItem toScan = pathsToScan.last();
pathsToScan.pop_back();
int pathBudget = (1 << (maxScanDepth + 2 - toScan.depth));
@@ -1043,9 +1044,10 @@ void ModelManagerInterface::importScan(QFutureInterface<void> &future,
workDone += pathBudget * 3 / 4;
}
future.setProgressValue(progressRange * workDone / totalWork);
isCanceled = future.isCanceled();
}
future.setProgressValue(progressRange);
if (future.isCanceled()) {
if (isCanceled) {
// assume no work has been done
QMutexLocker l(&modelManager->m_mutex);
for (int i = 0; i < paths.size(); ++i)

View File

@@ -354,6 +354,7 @@ QPalette Theme::palette() const
pal.setBrush(QPalette::ButtonText, color(Theme::TextColorNormal));
pal.setBrush(QPalette::ToolTipBase, color(Theme::BackgroundColorSelected));
pal.setColor(QPalette::Highlight, color(Theme::BackgroundColorSelected));
pal.setColor(QPalette::Dark, color(Theme::BackgroundColorDark));
pal.setColor(QPalette::HighlightedText, Qt::white);
pal.setColor(QPalette::ToolTipText, color(Theme::TextColorNormal));
return pal;

View File

@@ -8,11 +8,6 @@ QT += script network
CONFIG += exceptions # used by portlist.cpp, textfileformat.cpp, and ssh/*
win32-msvc* {
# disable warnings caused by botan headers
QMAKE_CXXFLAGS += -wd4250 -wd4290
}
SOURCES += $$PWD/environment.cpp \
$$PWD/environmentmodel.cpp \
$$PWD/qtcprocess.cpp \

View File

@@ -390,14 +390,6 @@ void AndroidRunner::asyncStart()
args << _("-e") << _("qml_debug") << _("true");
args << _("-e") << _("qmljsdebugger") << QString::fromLatin1("port:%1,block").arg(m_qmlPort);
}
if (m_useLocalQtLibs) {
args << _("-e") << _("use_local_qt_libs") << _("true");
args << _("-e") << _("libs_prefix") << _("/data/local/tmp/qt/");
args << _("-e") << _("load_local_libs") << m_localLibs;
args << _("-e") << _("load_local_jars") << m_localJars;
if (!m_localJarsInitClasses.isEmpty())
args << _("-e") << _("static_init_classes") << m_localJarsInitClasses;
}
QProcess adb;
adb.start(m_adb, args);

View File

@@ -518,7 +518,7 @@ void QmlEngine::serviceConnectionError(const QString &serviceName)
bool QmlEngine::canDisplayTooltip() const
{
return state() == InferiorRunOk || state() == InferiorStopOk;
return false;
}
void QmlEngine::filterApplicationMessage(const QString &output, int /*channel*/)

View File

@@ -127,7 +127,6 @@ public:
QScriptValue parser;
QScriptValue stringifier;
QStringList scriptSourceRequests;
QHash<int, QString> evaluatingExpression;
QHash<int, QByteArray> localsAndWatchers;
@@ -952,6 +951,9 @@ void QmlV8DebuggerClient::executeDebuggerCommand(const QString &command)
void QmlV8DebuggerClient::synchronizeWatchers(const QStringList &watchers)
{
SDEBUG(watchers);
if (d->engine->state() != InferiorStopOk)
return;
foreach (const QString &exp, watchers) {
StackHandler *stackHandler = d->engine->stackHandler();
if (stackHandler->isContentsValid() && stackHandler->currentFrame().isUsable()) {

View File

@@ -1629,7 +1629,7 @@ int WatchHandler::format(const QByteArray &iname) const
{
int result = AutomaticFormat;
if (const WatchItem *item = m_model->findItem(iname)) {
int result = theIndividualFormats.value(item->d.iname, AutomaticFormat);
result = theIndividualFormats.value(item->d.iname, AutomaticFormat);
if (result == AutomaticFormat)
result = theTypeFormats.value(stripForFormat(item->d.type), AutomaticFormat);
}

View File

@@ -402,6 +402,7 @@ QtWebKitHelpViewer::QtWebKitHelpViewer(QWidget *parent)
QPalette p = palette();
p.setColor(QPalette::Base, Qt::white);
p.setColor(QPalette::Text, Qt::black);
setPalette(p);
connect(m_webView, SIGNAL(urlChanged(QUrl)), this, SIGNAL(sourceChanged(QUrl)));

View File

@@ -65,6 +65,7 @@ TextBrowserHelpViewer::TextBrowserHelpViewer(QWidget *parent)
p.setColor(QPalette::Inactive, QPalette::HighlightedText,
p.color(QPalette::Active, QPalette::HighlightedText));
p.setColor(QPalette::Base, Qt::white);
p.setColor(QPalette::Text, Qt::black);
setPalette(p);
connect(m_textBrowser, SIGNAL(sourceChanged(QUrl)), this, SIGNAL(titleChanged()));

View File

@@ -582,16 +582,19 @@ QString Kit::toHtml(const QList<Task> &additional) const
void Kit::setAutoDetected(bool detected)
{
d->m_autodetected = detected;
kitUpdated();
}
void Kit::setAutoDetectionSource(const QString &autoDetectionSource)
{
d->m_autoDetectionSource = autoDetectionSource;
kitUpdated();
}
void Kit::setSdkProvided(bool sdkProvided)
{
d->m_sdkProvided = sdkProvided;
kitUpdated();
}
void Kit::makeSticky()
@@ -608,11 +611,13 @@ void Kit::setSticky(Id id, bool b)
d->m_sticky.insert(id);
else
d->m_sticky.remove(id);
kitUpdated();
}
void Kit::makeUnSticky()
{
d->m_sticky.clear();
kitUpdated();
}
void Kit::setMutable(Id id, bool b)
@@ -621,6 +626,7 @@ void Kit::setMutable(Id id, bool b)
d->m_mutable.insert(id);
else
d->m_mutable.remove(id);
kitUpdated();
}
bool Kit::isMutable(Id id) const

View File

@@ -354,8 +354,12 @@ void KitManagerConfigWidget::workingCopyWasUpdated(Kit *k)
void KitManagerConfigWidget::kitWasUpdated(Kit *k)
{
if (m_kit == k)
if (m_kit == k) {
bool emitSignal = m_kit->isAutoDetected() != m_modifiedKit->isAutoDetected();
discard();
if (emitSignal)
emit isAutoDetectedChanged();
}
updateVisibility();
}

View File

@@ -77,6 +77,7 @@ public:
signals:
void dirty();
void isAutoDetectedChanged();
private slots:
void setIcon();

View File

@@ -170,6 +170,31 @@ KitManagerConfigWidget *KitModel::widget(const QModelIndex &index)
return n ? n->widget : 0;
}
void KitModel::isAutoDetectedChanged()
{
KitManagerConfigWidget *w = qobject_cast<KitManagerConfigWidget *>(sender());
int idx = -1;
idx = Utils::indexOf(m_manualRoot->childNodes, [w](KitNode *node) { return node->widget == w; });
KitNode *oldParent = 0;
KitNode *newParent = w->workingCopy()->isAutoDetected() ? m_autoRoot : m_manualRoot;
if (idx != -1) {
oldParent = m_manualRoot;
} else {
idx = Utils::indexOf(m_autoRoot->childNodes, [w](KitNode *node) { return node->widget == w; });
if (idx != -1) {
oldParent = m_autoRoot;
}
}
if (oldParent && oldParent != newParent) {
beginMoveRows(index(oldParent), idx, idx, index(newParent), newParent->childNodes.size());
KitNode *n = oldParent->childNodes.takeAt(idx);
n->parent = newParent;
newParent->childNodes.append(n);
endMoveRows();
}
}
void KitModel::validateKitNames()
{
QHash<QString, int> nameHash;
@@ -263,6 +288,9 @@ KitNode *KitModel::createNode(Kit *k)
|| m_manualRoot->children().contains(node))
node->update();
});
connect(node->widget, SIGNAL(isAutoDetectedChanged()),
this, SLOT(isAutoDetectedChanged()));
return node;
}

View File

@@ -84,6 +84,7 @@ private:
void removeKit(ProjectExplorer::Kit *k);
void changeDefaultKit();
void validateKitNames();
void isAutoDetectedChanged();
KitNode *findWorkingCopy(Kit *k) const;
KitNode *createNode(Kit *k);

View File

@@ -135,12 +135,12 @@ void TargetSelectorDelegate::paint(QPainter *painter,
selectionGradient.load(QLatin1String(":/projectexplorer/images/targetpanel_gradient.png"));
if (option.state & QStyle::State_Selected) {
if (creatorTheme()->widgetStyle() == Theme::StyleFlat) {
painter->fillRect(option.rect, creatorTheme()->color(Theme::BackgroundColorSelected));
} else {
QColor color =(option.state & QStyle::State_HasFocus) ?
const QColor color = (option.state & QStyle::State_HasFocus) ?
option.palette.highlight().color() :
option.palette.dark().color();
if (creatorTheme()->widgetStyle() == Theme::StyleFlat) {
painter->fillRect(option.rect, color);
} else {
painter->fillRect(option.rect, color.darker(140));
StyleHelper::drawCornerImage(selectionGradient, painter, option.rect.adjusted(0, 0, 0, -1), 5, 5, 5, 5);
painter->setPen(QColor(255, 255, 255, 60));

View File

@@ -194,6 +194,7 @@ void QbsManager::addProfileFromKit(const ProjectExplorer::Kit *k)
{
const QString name = QString::fromLatin1("qtc_%1_%2").arg(k->fileSystemFriendlyName().left(8),
QString::number(k->id().uniqueIdentifier(), 16));
qbs::Profile(name, settings()).removeProfile();
setProfileForKit(name, k);
addQtProfileFromKit(name, k);

View File

@@ -32,6 +32,7 @@
#include "importswidget.h"
#include <rewritingexception.h>
#include <qmldesignerplugin.h>
namespace QmlDesigner {
@@ -264,6 +265,8 @@ void ImportManagerView::addImport(const Import &import)
catch (const RewritingException &e) {
e.showException();
}
QmlDesignerPlugin::instance()->currentDesignDocument()->updateSubcomponentManager();
}
} // namespace QmlDesigner

View File

@@ -64,33 +64,6 @@ static bool isImportAlreadyUsed(const Import &import, QList<ImportLabel*> import
return false;
}
void ImportsWidget::setPossibleImports(const QList<Import> &possibleImports)
{
m_addImportComboBox->clear();
foreach (const Import &possibleImport, possibleImports) {
if (!isImportAlreadyUsed(possibleImport, m_importLabels))
m_addImportComboBox->addItem(possibleImport.toString(true), QVariant::fromValue(possibleImport));
}
}
void ImportsWidget::removePossibleImports()
{
m_addImportComboBox->clear();
}
void ImportsWidget::setUsedImports(const QList<Import> &usedImports)
{
foreach (ImportLabel *importLabel, m_importLabels)
importLabel->setReadOnly(usedImports.contains(importLabel->import()));
}
void ImportsWidget::removeUsedImports()
{
foreach (ImportLabel *importLabel, m_importLabels)
importLabel->setEnabled(true);
}
static bool importLess(const Import &firstImport, const Import &secondImport)
{
if (firstImport.url() == secondImport.url())
@@ -117,6 +90,34 @@ static bool importLess(const Import &firstImport, const Import &secondImport)
return false;
}
void ImportsWidget::setPossibleImports(QList<Import> possibleImports)
{
Utils::sort(possibleImports, importLess);
m_addImportComboBox->clear();
foreach (const Import &possibleImport, possibleImports) {
if (!isImportAlreadyUsed(possibleImport, m_importLabels))
m_addImportComboBox->addItem(possibleImport.toString(true), QVariant::fromValue(possibleImport));
}
}
void ImportsWidget::removePossibleImports()
{
m_addImportComboBox->clear();
}
void ImportsWidget::setUsedImports(const QList<Import> &usedImports)
{
foreach (ImportLabel *importLabel, m_importLabels)
importLabel->setReadOnly(usedImports.contains(importLabel->import()));
}
void ImportsWidget::removeUsedImports()
{
foreach (ImportLabel *importLabel, m_importLabels)
importLabel->setEnabled(true);
}
void ImportsWidget::setImports(const QList<Import> &imports)
{
qDeleteAll(m_importLabels);

View File

@@ -52,7 +52,7 @@ public:
void setImports(const QList<Import> &imports);
void removeImports();
void setPossibleImports(const QList<Import> &possibleImports);
void setPossibleImports(QList<Import> possibleImports);
void removePossibleImports();
void setUsedImports(const QList<Import> &possibleImports);

View File

@@ -123,32 +123,29 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV
m_runModus(runModus),
m_synchronizeId(-1)
{
PuppetCreator puppetCreator(kit, QString());
QString socketToken(QUuid::createUuid().toString());
m_localServer->listen(socketToken);
m_localServer->setMaxPendingConnections(3);
PuppetCreator::QmlPuppetVersion puppetVersion = hasQtQuick1(nodeInstanceView) ? PuppetCreator::Qml1Puppet : PuppetCreator::Qml2Puppet;
PuppetCreator puppetCreator(kit, QString(), nodeInstanceView->model(), puppetVersion);
puppetCreator.createPuppetExecutableIfMissing(puppetVersion);
m_qmlPuppetEditorProcess = puppetCreator.createPuppetProcess(puppetVersion,
"editormode",
puppetCreator.createPuppetExecutableIfMissing();
m_qmlPuppetEditorProcess = puppetCreator.createPuppetProcess("editormode",
socketToken,
this,
SLOT(printEditorProcessOutput()),
SLOT(processFinished(int,QProcess::ExitStatus)));
if (runModus == NormalModus) {
m_qmlPuppetRenderProcess = puppetCreator.createPuppetProcess(puppetVersion,
"rendermode",
m_qmlPuppetRenderProcess = puppetCreator.createPuppetProcess("rendermode",
socketToken,
this,
SLOT(printRenderProcessOutput()),
SLOT(processFinished(int,QProcess::ExitStatus)));
m_qmlPuppetPreviewProcess = puppetCreator.createPuppetProcess(puppetVersion,
"previewmode",
m_qmlPuppetPreviewProcess = puppetCreator.createPuppetProcess("previewmode",
socketToken,
this,
SLOT(printPreviewProcessOutput()),

View File

@@ -115,10 +115,12 @@ bool PuppetCreator::useOnlyFallbackPuppet() const
|| !qgetenv("USE_ONLY_FALLBACK_PUPPET").isEmpty() || m_kit == 0 || !m_kit->isValid();
}
PuppetCreator::PuppetCreator(ProjectExplorer::Kit *kit, const QString &qtCreatorVersion)
PuppetCreator::PuppetCreator(ProjectExplorer::Kit *kit, const QString &qtCreatorVersion, const Model *model, QmlPuppetVersion puppetVersion)
: m_qtCreatorVersion(qtCreatorVersion),
m_kit(kit),
m_availablePuppetType(FallbackPuppet)
m_availablePuppetType(FallbackPuppet),
m_model(model),
m_puppetVersion(puppetVersion)
{
}
@@ -126,18 +128,18 @@ PuppetCreator::~PuppetCreator()
{
}
void PuppetCreator::createPuppetExecutableIfMissing(PuppetCreator::QmlPuppetVersion puppetVersion)
void PuppetCreator::createPuppetExecutableIfMissing()
{
if (puppetVersion == Qml1Puppet)
if (m_puppetVersion == Qml1Puppet)
createQml1PuppetExecutableIfMissing();
else
createQml2PuppetExecutableIfMissing();
}
QProcess *PuppetCreator::createPuppetProcess(PuppetCreator::QmlPuppetVersion puppetVersion, const QString &puppetMode, const QString &socketToken, QObject *handlerObject, const char *outputSlot, const char *finishSlot) const
QProcess *PuppetCreator::createPuppetProcess(const QString &puppetMode, const QString &socketToken, QObject *handlerObject, const char *outputSlot, const char *finishSlot) const
{
QString puppetPath;
if (puppetVersion == Qml1Puppet)
if (m_puppetVersion == Qml1Puppet)
puppetPath = qmlPuppetPath(m_availablePuppetType);
else
puppetPath = qml2PuppetPath(m_availablePuppetType);
@@ -333,13 +335,21 @@ QString PuppetCreator::qmlPuppetPath(PuppetType puppetType) const
QProcessEnvironment PuppetCreator::processEnvironment() const
{
#if defined(Q_OS_WIN)
static QLatin1String pathSep(";");
#else
static QLatin1String pathSep(":");
#endif
Utils::Environment environment = Utils::Environment::systemEnvironment();
if (!useOnlyFallbackPuppet())
m_kit->addToEnvironment(environment);
environment.set("QML_BAD_GUI_RENDER_LOOP", "true");
environment.set("QML_USE_MOCKUPS", "true");
environment.set("QML_PUPPET_MODE", "true");
if (m_puppetVersion == Qml1Puppet)
environment.appendOrSet("QML_IMPORT_PATH", m_model->importPaths().join(pathSep), pathSep);
else
environment.appendOrSet("QML2_IMPORT_PATH", m_model->importPaths().join(pathSep), pathSep);
return environment.toProcessEnvironment();
}

View File

@@ -41,6 +41,7 @@ class Kit;
namespace QmlDesigner {
class Model;
class PuppetBuildProgressDialog;
class PuppetCreator
@@ -56,13 +57,12 @@ public:
Qml2Puppet
};
PuppetCreator(ProjectExplorer::Kit *kit, const QString &qtCreatorVersion);
PuppetCreator(ProjectExplorer::Kit *kit, const QString &qtCreatorVersion, const Model *model, QmlPuppetVersion puppetVersion);
~PuppetCreator();
void createPuppetExecutableIfMissing(QmlPuppetVersion puppetVersion);
void createPuppetExecutableIfMissing();
QProcess *createPuppetProcess(QmlPuppetVersion puppetVersion,
const QString &puppetMode,
QProcess *createPuppetProcess(const QString &puppetMode,
const QString &socketToken,
QObject *handlerObject,
const char *outputSlot,
@@ -120,6 +120,8 @@ private:
PuppetType m_availablePuppetType;
static QHash<Core::Id, PuppetType> m_qml1PuppetForKitPuppetHash;
static QHash<Core::Id, PuppetType> m_qml2PuppetForKitPuppetHash;
const Model *m_model;
QmlPuppetVersion m_puppetVersion;
};
} // namespace QmlDesigner

View File

@@ -175,16 +175,17 @@ void Highlighter::highlightBlock(const QString &text)
handleContextChange(m_currentContext->lineBeginContext(),
m_currentContext->definition());
ProgressData progress;
ProgressData *progress = new ProgressData;
const int length = text.length();
while (progress.offset() < length)
iterateThroughRules(text, length, &progress, false, m_currentContext->rules());
while (progress->offset() < length)
iterateThroughRules(text, length, progress, false, m_currentContext->rules());
if (extractObservableState(currentBlockState()) != WillContinue) {
handleContextChange(m_currentContext->lineEndContext(),
m_currentContext->definition(),
false);
}
delete progress;
m_contexts.clear();
if (m_indentationBasedFolding) {

View File

@@ -57,6 +57,11 @@ WinRtDebugSupport::WinRtDebugSupport(RunControl *runControl, WinRtRunnerHelper *
connect(m_debugRunControl, SIGNAL(finished()), this, SLOT(finish()));
}
WinRtDebugSupport::~WinRtDebugSupport()
{
delete m_runner;
}
void WinRtDebugSupport::finish()
{
m_runner->stop();

View File

@@ -49,6 +49,7 @@ public:
static ProjectExplorer::RunControl *createDebugRunControl(WinRtRunConfiguration *runConfig,
ProjectExplorer::RunMode mode,
QString *errorMessage);
~WinRtDebugSupport();
private:
WinRtDebugSupport(ProjectExplorer::RunControl *runControl, WinRtRunnerHelper *runner);

View File

@@ -52,7 +52,7 @@ using namespace WinRt;
using namespace WinRt::Internal;
WinRtRunnerHelper::WinRtRunnerHelper(WinRtRunConfiguration *runConfiguration, QString *errormessage)
: QObject(runConfiguration)
: QObject()
, m_messenger(0)
, m_runConfiguration(runConfiguration)
, m_process(0)

View File

@@ -192,6 +192,7 @@ private slots:
void test_checksymbols_macroUses();
void test_checksymbols_macroUses_data();
void test_checksymbols_infiniteLoop_data();
void test_checksymbols_infiniteLoop();
};
@@ -1755,36 +1756,12 @@ void tst_CheckSymbols::test_checksymbols_macroUses_data()
void tst_CheckSymbols::test_checksymbols_infiniteLoop()
{
const QByteArray source1 =
"#include \"file2.h\"\n"
"\n"
"template<class _Elem, class _Traits>\n"
"class basic_ios {\n"
" typedef basic_ostream<_Elem, _Traits> _Myos;\n"
"};\n"
"\n"
"template<class _Elem, class _Traits>\n"
"class basic_ostream {\n"
" typedef basic_ostream<_Elem, _Traits> _Myt;\n"
" typedef ostreambuf_iterator<_Elem, _Traits> _Iter;\n"
"};\n"
;
QFETCH(QByteArray, source1);
QFETCH(QByteArray, source2);
const QString filePath1 = QDir::tempPath() + QLatin1String("/file1.h");
Tests::TestCase::writeFile(filePath1, source1);
const QByteArray source2 =
"template<class _Elem, class _Traits>\n"
"class basic_streambuf {\n"
" typedef basic_streambuf<_Elem, _Traits> _Myt;\n"
"};\n"
"\n"
"template<class _Elem, class _Traits>\n"
"class ostreambuf_iterator {\n"
" typedef _Traits traits_type;\n"
" typedef basic_streambuf<_Elem, _Traits> streambuf_type;\n"
" typedef basic_ostream<_Elem, _Traits> ostream_type;\n"
"};\n"
;
const QString filePath2 = QDir::tempPath() + QLatin1String("/file2.h");
Tests::TestCase::writeFile(filePath2, source2);
@@ -1797,5 +1774,77 @@ void tst_CheckSymbols::test_checksymbols_infiniteLoop()
TestCase::runCheckSymbols(document1, snapshot);
}
void tst_CheckSymbols::test_checksymbols_infiniteLoop_data()
{
QTest::addColumn<QByteArray>("source1");
QTest::addColumn<QByteArray>("source2");
QTest::newRow("1")
<<
_("#include \"file2.h\"\n"
"\n"
"template<class _Elem, class _Traits>\n"
"class basic_ios {\n"
" typedef basic_ostream<_Elem, _Traits> _Myos;\n"
"};\n"
"\n"
"template<class _Elem, class _Traits>\n"
"class basic_ostream {\n"
" typedef basic_ostream<_Elem, _Traits> _Myt;\n"
" typedef ostreambuf_iterator<_Elem, _Traits> _Iter;\n"
"};\n")
<<
_("template<class _Elem, class _Traits>\n"
"class basic_streambuf {\n"
" typedef basic_streambuf<_Elem, _Traits> _Myt;\n"
"};\n"
"\n"
"template<class _Elem, class _Traits>\n"
"class ostreambuf_iterator {\n"
" typedef _Traits traits_type;\n"
" typedef basic_streambuf<_Elem, _Traits> streambuf_type;\n"
" typedef basic_ostream<_Elem, _Traits> ostream_type;\n"
"};\n")
;
QTest::newRow("2")
<<
_("#include \"file2.h\"\n"
"\n"
"template<class _Ty >\n"
"struct _List_base_types\n"
"{\n"
" typedef typename _Wrap_alloc<_Alloc>::template rebind<_Ty>::other _Alty;\n"
" typedef typename _Alty::template rebind<_Node>::other _Alnod_type;\n"
"};\n"
"\n"
"template<class _Alloc_types>\n"
"struct _List_alloc \n"
"{\n"
" const _Alloc_types::_Alnod_type& _Getal() const {}\n"
"};\n"
"\n"
"template<class _Ty, class _Alloc>\n"
"struct _List_buy : public _List_alloc< _List_base_types<_Ty> >\n"
"{\n"
" void foo()\n"
" {\n"
" this->_Getal().construct(1, 2);\n"
" this->_Getal().deallocate(0, 1);\n"
" }\n"
"};\n")
<<
_("template<class _Alloc>\n"
"struct _Wrap_alloc : public _Alloc\n"
"{\n"
" typedef _Alloc _Mybase;\n"
" template<class _Other> struct rebind { typedef _Wrap_alloc<_Other_alloc> other; };\n"
"\n"
" void deallocate(pointer _Ptr, size_type _Count) {}\n"
" void construct(value_type *_Ptr) {}\n"
"};\n")
;
}
QTEST_APPLESS_MAIN(tst_CheckSymbols)
#include "tst_checksymbols.moc"

View File

@@ -390,6 +390,7 @@ private slots:
void empty_trailing_lines_data();
void undef();
void concat();
void excessive_nesting();
};
// Remove all #... lines, and 'simplify' string, to allow easily comparing the result
@@ -1901,6 +1902,23 @@ void tst_Preprocessor::concat()
QCOMPARE(prep.constData(), output.constData());
}
void tst_Preprocessor::excessive_nesting()
{
Environment env;
Preprocessor preprocess(0, &env);
QByteArray input;
const QByteArray output =
"# 1 \"<stdin>\"\n"
"# 2001 \"<stdin>\"\n";
for (int i = 0; i < 1000; ++i)
input += "#if FOO\n";
for (int i = 0; i < 1000; ++i)
input += "#endif\n";
QByteArray prep = preprocess.run(QLatin1String("<stdin>"), input);
// Output cannot be precisely determined, but it shouldn't crash.
QCOMPARE(prep, output);
}
void tst_Preprocessor::compare_input_output(bool keepComments)
{
QFETCH(QByteArray, input);

View File

@@ -83,7 +83,17 @@ void tst_offsets::offsets_data()
QFilePrivate *p = 0;
QTestData &data = QTest::newRow("QFilePrivate::fileName")
<< int((char *)&p->fileName - (char *)p);
if (qtVersion > 0x50200)
if (qtVersion >= 0x50400)
#ifdef Q_OS_WIN
# ifdef Q_CC_MSVC
data << 196 << 272;
# else // MinGW
data << 188 << 272;
# endif
#else
data << 180 << 272;
#endif
else if (qtVersion > 0x50200)
#ifdef Q_OS_WIN
# ifdef Q_CC_MSVC
data << 184 << 272;

View File

@@ -153,9 +153,12 @@ def verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, e
for ty in additionalKeyPresses:
type(editor, ty)
rect = editor.cursorRect(editor.textCursor())
expectedToolTip = "{type='%s' visible='1'}" % expectedType
# wait for similar tooltips to disappear
checkIfObjectExists(expectedToolTip, False, 1000, True)
sendEvent("QMouseEvent", editor, QEvent.MouseMove, rect.x+rect.width/2, rect.y+rect.height/2, Qt.NoButton, 0)
try:
tip = waitForObject("{type='%s' visible='1'}" % expectedType)
tip = waitForObject(expectedToolTip)
except:
tip = None
if tip == None:

View File

@@ -39,6 +39,8 @@ import sys
import errno;
from datetime import datetime,timedelta;
isQt53Build = os.getenv("SYSTEST_ISQT53BUILD") != "0"
srcPath = ''
SettingsPath = ''
tmpSettingsDir = ''

View File

@@ -578,9 +578,6 @@ def dumpChildren(item):
return [item.child(index) for index in range(item.childCount())]
def writeTestResults(folder):
if squishinfo.version < 0x040200FF:
print "Skipping writing test results (Squish < 4.2)"
return
if not os.path.exists(folder):
print "Skipping writing test results (folder '%s' does not exist)." % folder
return

View File

@@ -45,7 +45,13 @@ def invokeContextMenuItemOnBookmarkFolder(view, item, menuItem):
"window=':Add Bookmark_BookmarkDialog'}" % aboveWidget), menuItem)
def textForQtVersion(text):
if isQt53Build:
return text + " | QtCreator"
else:
suffix = "Qt Creator Manual"
if text != suffix:
text += " | " + suffix
return text
def main():
startApplication("qtcreator" + SettingsPath)

View File

@@ -83,7 +83,10 @@ def main():
test.verify(checkIfObjectExists(gettingStartedText),
"Verifying: Qt Creator displays Welcome Page with 'Get Started Now' button.")
if isQt53Build:
expectedText = "(QtCreator : Qt Creator Manual)|(Qt Creator Manual [|] QtCreator)"
else:
expectedText = "Qt Creator Manual"
testDetails = "Verifying: Help with Creator Documentation is being opened."
clickItemVerifyHelpCombo(gettingStartedText, expectedText, testDetails)

View File

@@ -39,7 +39,12 @@ def main():
if not startedWithoutPluginError():
return
openQbsProject(pathCreator)
progressBarWait(200000)
test.log("Start parsing project")
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='qtcreator( \[\S+\])?' type='QModelIndex'}"
ntwObject = waitForObject(naviTreeView)
if waitFor("ntwObject.model().rowCount(ntwObject) > 2", 200000): # No need to wait for C++-parsing
test.log("Parsing project done") # we only need the project
else:
test.warning("Parsing project timed out")
compareProjectTree(naviTreeView, "projecttree_creator.tsv")
invokeMenuItem("File", "Exit")

View File

@@ -41,7 +41,7 @@ def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
protocolsToTest = ["Paste.KDE.Org", "Pastebin.Ca"]
protocolsToTest = ["Paste.KDE.Org"] # , "Pastebin.Ca"]
# Be careful with Pastebin.Com, there are only 10 pastes per 24h
# for all machines using the same IP-address like you.
# protocolsToTest += ["Pastebin.Com"]