Merge remote-tracking branch 'origin/2.5'

This commit is contained in:
Eike Ziller
2012-03-12 15:10:32 +01:00
37 changed files with 1074 additions and 232 deletions

View File

@@ -4,7 +4,7 @@
//! [0]
import QtQuick 1.0
import QtQuick 1.1
Rectangle {
id: page

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 349 B

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 562 B

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@@ -35,7 +35,7 @@
\note To complete this tutorial, you must have Qt 4.7 or later installed.
This tutorial uses basic elements and illustrates basic concepts of
This tutorial uses built-in QML elements and illustrates basic concepts of
\l {http://doc.qt.nokia.com/4.7/qtquick.html}{Qt Quick}.
This tutorial describes how to use the \QC to implement the
@@ -53,8 +53,8 @@
\list 1
\o Select \gui{File > New File or Project > Qt Quick Project > Qt Quick
Application > Choose}.
\o Select \gui{File > New File or Project > Applications >
Qt Quick Application (Built-in Elements) > Choose}.
\o In the \gui{Name} field, type \bold {Transitions}.
@@ -150,7 +150,7 @@
\o In the \gui Colors group, \gui Rectangle field, click the
\inlineimage qmldesigner-transparent-button.png
button to make the rectangle transparent.
(\gui Transparent) button to make the rectangle transparent.
\o In the \gui Border field, set the border color to #808080.
@@ -161,7 +161,7 @@
border color, try setting the border color to solid by clicking
the
\inlineimage qmldesigner-solid-color-button.png
button.
(\gui {Solid Color}) button.
\o In the \gui Radius field, select 6 to create rounded corners for
the rectangle.
@@ -187,7 +187,8 @@
\o Click \gui {Layout}, and then click the
\inlineimage qmldesigner-anchor-fill-screen.png
button to anchor the mouse area to the rectangle.
(\gui {Fill to Parent}) button to anchor the mouse area to the
rectangle.
\o In the code editor, edit the pointer to the clicked expression
in the mouse area element, as illustrated by the following code

File diff suppressed because it is too large Load Diff

View File

@@ -37,6 +37,12 @@ Item {
width: 480
height: 32
Rectangle {
anchors.fill: parent
color: "#f9f9f9"
opacity: projectNameText.hovered ? 1 : 0
}
property alias projectName: projectNameText.text
property alias projectPath: pathText.text

View File

@@ -49,7 +49,7 @@ ScrollArea {
Column {
id: column
spacing: 2
spacing: 6
Repeater {
id: repeater

View File

@@ -48,7 +48,7 @@ namespace Constants {
const char * const IDE_VERSION_LONG = IDE_VERSION_STR;
const char * const IDE_AUTHOR = \"Nokia Corporation\";
const char * const IDE_YEAR = \"2011\";
const char * const IDE_YEAR = \"2012\";
#ifdef IDE_VERSION_DESCRIPTION
const char * const IDE_VERSION_DESCRIPTION_STR = STRINGIFY(IDE_VERSION_DESCRIPTION);

View File

@@ -85,7 +85,8 @@ AnalyzerRunConfigWidget::AnalyzerRunConfigWidget()
globalSettingLayout->addStretch(2);
m_subConfigWidget = new QWidget(this);
new QVBoxLayout(m_subConfigWidget);
QVBoxLayout *subConfigLayout = new QVBoxLayout(m_subConfigWidget);
subConfigLayout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(m_subConfigWidget);
}

View File

@@ -74,15 +74,11 @@ Qt::DropActions ExternalToolModel::supportedDropActions() const
return Qt::MoveAction;
}
QString ExternalToolModel::uncategorizedDisplayName() const
{
static QString uncategorized = tr("Uncategorized");
return uncategorized;
}
int ExternalToolModel::columnCount(const QModelIndex &parent) const
{
if (!parent.isValid() || toolForIndex(parent) || !categoryForIndex(parent).isEmpty())
bool categoryFound;
categoryForIndex(parent, &categoryFound);
if (!parent.isValid() || toolForIndex(parent) || categoryFound)
return 1;
return 0;
}
@@ -91,9 +87,11 @@ QVariant ExternalToolModel::data(const QModelIndex &index, int role) const
{
if (ExternalTool *tool = toolForIndex(index))
return data(tool, role);
QString category = categoryForIndex(index);
QTC_ASSERT(!category.isEmpty(), return QVariant());
bool found;
QString category = categoryForIndex(index, &found);
if (found)
return data(category, role);
return QVariant();
}
QVariant ExternalToolModel::data(ExternalTool *tool, int role) const
@@ -113,10 +111,9 @@ QVariant ExternalToolModel::data(const QString &category, int role) const
switch (role) {
case Qt::DisplayRole:
case Qt::EditRole:
return category;
return category.isEmpty() ? tr("Uncategorized") : category;
case Qt::ToolTipRole:
return category == uncategorizedDisplayName()
? tr("Tools that will appear directly under the External Tools menu.") : QVariant();
return category.isEmpty() ? tr("Tools that will appear directly under the External Tools menu.") : QVariant();
default:
break;
}
@@ -130,8 +127,9 @@ QMimeData *ExternalToolModel::mimeData(const QModelIndexList &indexes) const
QModelIndex modelIndex = indexes.first();
ExternalTool *tool = toolForIndex(modelIndex);
QTC_ASSERT(tool, return 0);
QString category = categoryForIndex(modelIndex.parent());
QTC_ASSERT(!category.isEmpty(), return 0);
bool found;
QString category = categoryForIndex(modelIndex.parent(), &found);
QTC_ASSERT(found, return 0);
QMimeData *md = new QMimeData();
QByteArray ba;
QDataStream stream(&ba, QIODevice::WriteOnly);
@@ -149,8 +147,9 @@ bool ExternalToolModel::dropMimeData(const QMimeData *data,
Q_UNUSED(column)
if (action != Qt::MoveAction || !data)
return false;
QString toCategory = categoryForIndex(parent);
QTC_ASSERT(!toCategory.isEmpty(), return false);
bool found;
QString toCategory = categoryForIndex(parent, &found);
QTC_ASSERT(found, return false);
QByteArray ba = data->data(QLatin1String("application/qtcreator-externaltool-config"));
if (ba.isEmpty())
return false;
@@ -159,15 +158,14 @@ bool ExternalToolModel::dropMimeData(const QMimeData *data,
int pos = -1;
stream >> category;
stream >> pos;
QTC_ASSERT(!category.isEmpty(), return false);
QList<ExternalTool *> &items = m_tools[category];
QTC_ASSERT(pos >= 0 && pos < items.count(), return false);
beginRemoveRows(index(rowForCategory(category), 0), pos, pos);
beginRemoveRows(index(m_tools.keys().indexOf(category), 0), pos, pos);
ExternalTool *tool = items.takeAt(pos);
endRemoveRows();
if (row < 0)
row = m_tools.value(toCategory).count();
beginInsertRows(index(rowForCategory(toCategory), 0), row, row);
beginInsertRows(index(m_tools.keys().indexOf(toCategory), 0), row, row);
m_tools[toCategory].insert(row, tool);
endInsertRows();
return true;
@@ -181,8 +179,9 @@ QStringList ExternalToolModel::mimeTypes() const
QModelIndex ExternalToolModel::index(int row, int column, const QModelIndex &parent) const
{
if (column == 0 && parent.isValid()) {
QString category = categoryForIndex(parent);
if (!category.isEmpty()) {
bool found;
QString category = categoryForIndex(parent, &found);
if (found) {
QList<ExternalTool *> items = m_tools.value(category);
if (row < items.count()) {
return createIndex(row, 0, items.at(row));
@@ -197,11 +196,13 @@ QModelIndex ExternalToolModel::index(int row, int column, const QModelIndex &par
QModelIndex ExternalToolModel::parent(const QModelIndex &child) const
{
if (ExternalTool *tool = toolForIndex(child)) {
int categoryIndex = 0;
QMapIterator<QString, QList<ExternalTool *> > it(m_tools);
while (it.hasNext()) {
it.next();
if (it.value().contains(tool))
return index(rowForCategory(it.key()), 0);
return index(categoryIndex, 0);
++categoryIndex;
}
}
return QModelIndex();
@@ -214,8 +215,9 @@ int ExternalToolModel::rowCount(const QModelIndex &parent) const
if (toolForIndex(parent)) {
return 0;
}
QString category = categoryForIndex(parent);
if (!category.isEmpty()) {
bool found;
QString category = categoryForIndex(parent, &found);
if (found) {
return m_tools.value(category).count();
}
@@ -226,9 +228,10 @@ Qt::ItemFlags ExternalToolModel::flags(const QModelIndex &index) const
{
if (toolForIndex(index))
return TOOL_ITEM_FLAGS;
QString category = categoryForIndex(index);
if (!category.isEmpty()) {
if (category == uncategorizedDisplayName())
bool found;
QString category = categoryForIndex(index, &found);
if (found) {
if (category.isEmpty())
return TOOLSMENU_ITEM_FLAGS;
return CATEGORY_ITEM_FLAGS;
}
@@ -248,18 +251,17 @@ bool ExternalToolModel::setData(const QModelIndex &modelIndex, const QVariant &v
emit dataChanged(modelIndex, modelIndex);
return true;
} else {
QString category = categoryForIndex(modelIndex);
if (!category.isEmpty()) {
bool found;
QString category = categoryForIndex(modelIndex, &found);
if (found) {
if (string.isEmpty() || m_tools.contains(string))
return false;
// rename category
QList<QString> categories = m_tools.keys();
int previousIndex = rowForCategory(category);
categories.removeAll(uncategorizedDisplayName()); // prepended again after sorting new list
int previousIndex = categories.indexOf(category);
categories.removeAt(previousIndex);
categories.append(string);
qSort(categories);
categories.prepend(uncategorizedDisplayName()); // prepend, so order is like in view
int newIndex = categories.indexOf(string);
if (newIndex != previousIndex) {
// we have same parent so we have to do special stuff for beginMoveRows...
@@ -293,34 +295,19 @@ ExternalTool *ExternalToolModel::toolForIndex(const QModelIndex &index) const
return static_cast<ExternalTool *>(index.internalPointer());
}
QString ExternalToolModel::categoryForIndex(const QModelIndex &index) const
QString ExternalToolModel::categoryForIndex(const QModelIndex &index, bool *found) const
{
if (index.isValid() && !index.parent().isValid() && index.column() == 0 && index.row() >= 0) {
const QList<QString> &keys = m_tools.keys();
if (index.row() == 0)
return uncategorizedDisplayName();
if (index.row() < keys.count()) {
int uncategorizedIndex = keys.indexOf(uncategorizedDisplayName());
if (index.row() <= uncategorizedIndex)
return keys.at(index.row() - 1);
if (found) *found = true;
return keys.at(index.row());
}
}
if (found) *found = false;
return QString();
}
int ExternalToolModel::rowForCategory(const QString &category) const
{
if (category == uncategorizedDisplayName())
return 0;
const QList<QString> &keys = m_tools.keys();
int uncategorizedIndex = keys.indexOf(uncategorizedDisplayName());
int index = keys.indexOf(category);
if (index < uncategorizedIndex)
return index + 1;
return index;
}
void ExternalToolModel::revertTool(const QModelIndex &modelIndex)
{
ExternalTool *tool = toolForIndex(modelIndex);
@@ -343,10 +330,8 @@ QModelIndex ExternalToolModel::addCategory()
category = categoryBase + QString::number(count);
}
QList<QString> categories = m_tools.keys();
categories.removeAll(uncategorizedDisplayName()); // prepended again after sorting new list
categories.append(category);
qSort(categories);
categories.prepend(uncategorizedDisplayName()); // prepend, so order is like in view
int pos = categories.indexOf(category);
beginInsertRows(QModelIndex(), pos, pos);
@@ -357,9 +342,10 @@ QModelIndex ExternalToolModel::addCategory()
QModelIndex ExternalToolModel::addTool(const QModelIndex &atIndex)
{
QString category = categoryForIndex(atIndex);
if (category.isEmpty())
category = categoryForIndex(atIndex.parent());
bool found;
QString category = categoryForIndex(atIndex, &found);
if (!found)
category = categoryForIndex(atIndex.parent(), &found);
ExternalTool *tool = new ExternalTool;
tool->setDisplayCategory(category);
@@ -491,8 +477,8 @@ void ExternalToolConfig::setTools(const QMap<QString, QList<ExternalTool *> > &t
itemCopy.append(new ExternalTool(tool));
toolsCopy.insert(it.key(), itemCopy);
}
if (!toolsCopy.contains(m_model->uncategorizedDisplayName()))
toolsCopy.insert(m_model->uncategorizedDisplayName(), QList<ExternalTool *>());
if (!toolsCopy.contains(QString()))
toolsCopy.insert(QString(), QList<ExternalTool *>());
m_model->setTools(toolsCopy);
ui->toolTree->expandAll();
}

View File

@@ -73,14 +73,12 @@ public:
QMap<QString, QList<ExternalTool *> > tools() const;
ExternalTool *toolForIndex(const QModelIndex &modelIndex) const;
QString categoryForIndex(const QModelIndex &modelIndex) const;
int rowForCategory(const QString &category) const;
QString categoryForIndex(const QModelIndex &modelIndex, bool *found) const;
void revertTool(const QModelIndex &modelIndex);
QModelIndex addCategory();
QModelIndex addTool(const QModelIndex &atIndex);
void removeTool(const QModelIndex &modelIndex);
Qt::DropActions supportedDropActions() const;
QString uncategorizedDisplayName() const;
private:
QVariant data(ExternalTool *tool, int role = Qt::DisplayRole) const;
QVariant data(const QString &category, int role = Qt::DisplayRole) const;

View File

@@ -34,6 +34,7 @@
#include "mainwindow.h"
#include "vcsmanager.h"
#include <coreplugin/fileiconprovider.h>
#include <coreplugin/idocument.h>
#include <QDir>
@@ -42,6 +43,7 @@
#include <QTreeWidget>
#include <QHeaderView>
#include <QCheckBox>
#include <QtDebug>
Q_DECLARE_METATYPE(Core::IDocument*)
@@ -54,10 +56,15 @@ SaveItemsDialog::SaveItemsDialog(QWidget *parent,
{
m_ui.setupUi(this);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
QPushButton *discardButton = m_ui.buttonBox->addButton(tr("Do not Save"), QDialogButtonBox::DestructiveRole);
#ifdef Q_OS_MAC
// QDialogButtonBox's behavior for "destructive" is wrong, the "do not save" should be left-aligned
QDialogButtonBox::ButtonRole discardButtonRole = QDialogButtonBox::ResetRole;
#else
QDialogButtonBox::ButtonRole discardButtonRole = QDialogButtonBox::DestructiveRole;
#endif
QPushButton *discardButton = m_ui.buttonBox->addButton(tr("Do not Save"), discardButtonRole);
m_ui.buttonBox->button(QDialogButtonBox::Save)->setDefault(true);
m_ui.buttonBox->button(QDialogButtonBox::Save)->setFocus(Qt::TabFocusReason);
m_ui.buttonBox->button(QDialogButtonBox::Save)->setMinimumWidth(130); // bad magic number to avoid resizing of button
m_ui.treeWidget->setFocus();
m_ui.saveBeforeBuildCheckBox->setVisible(false);
@@ -74,11 +81,17 @@ SaveItemsDialog::SaveItemsDialog(QWidget *parent,
}
QTreeWidgetItem *item = new QTreeWidgetItem(m_ui.treeWidget, QStringList()
<< visibleName << QDir::toNativeSeparators(directory));
if (!fileName.isEmpty())
item->setIcon(0, FileIconProvider::instance()->icon(QFileInfo(fileName)));
item->setData(0, Qt::UserRole, qVariantFromValue(document));
}
m_ui.treeWidget->resizeColumnToContents(0);
m_ui.treeWidget->selectAll();
#ifdef Q_OS_MAC
m_ui.treeWidget->setAlternatingRowColors(true);
#endif
adjustButtonWidths();
updateSaveButton();
connect(m_ui.buttonBox->button(QDialogButtonBox::Save), SIGNAL(clicked()),
@@ -108,6 +121,32 @@ void SaveItemsDialog::updateSaveButton()
}
}
void SaveItemsDialog::adjustButtonWidths()
{
// give save button a size that all texts fit in, so it doesn't get resized
// Mac: make cancel + save button same size (work around dialog button box issue)
QStringList possibleTexts;
possibleTexts << tr("Save") << tr("Save All");
if (m_ui.treeWidget->topLevelItemCount() > 1)
possibleTexts << tr("Save Selected");
int maxTextWidth = 0;
QPushButton *saveButton = m_ui.buttonBox->button(QDialogButtonBox::Save);
foreach (const QString &text, possibleTexts) {
saveButton->setText(text);
int hint = saveButton->sizeHint().width();
if (hint > maxTextWidth)
maxTextWidth = hint;
}
#ifdef Q_OS_MAC
QPushButton *cancelButton = m_ui.buttonBox->button(QDialogButtonBox::Cancel);
int cancelButtonWidth = cancelButton->sizeHint().width();
if (cancelButtonWidth > maxTextWidth)
maxTextWidth = cancelButtonWidth;
cancelButton->setMinimumWidth(maxTextWidth);
#endif
saveButton->setMinimumWidth(maxTextWidth);
}
void SaveItemsDialog::collectItemsToSave()
{
m_itemsToSave.clear();

View File

@@ -70,6 +70,8 @@ private slots:
void updateSaveButton();
private:
void adjustButtonWidths();
Ui::SaveItemsDialog m_ui;
QList<Core::IDocument*> m_itemsToSave;
};

View File

@@ -744,8 +744,7 @@ void BreakHandler::setEnabled(BreakpointModelId id, bool on)
if (it->data.enabled == on)
return;
it->data.enabled = on;
it->destroyMarker();
it->updateMarker(id);
it->updateMarkerIcon();
if (it->engine) {
it->state = BreakpointChangeRequested;
scheduleSynchronization();
@@ -780,8 +779,7 @@ void BreakHandler::setTracepoint(BreakpointModelId id, bool on)
if (it->data.tracepoint == on)
return;
it->data.tracepoint = on;
it->destroyMarker();
it->updateMarker(id);
it->updateMarkerIcon();
if (it->engine) {
it->state = BreakpointChangeRequested;
@@ -1414,6 +1412,12 @@ bool BreakHandler::BreakpointItem::isLocatedAt
|| fileNameMatch(fileName, markerFileName()));
}
void BreakHandler::BreakpointItem::updateMarkerIcon()
{
marker->setIcon(icon());
marker->updateMarker();
}
void BreakHandler::BreakpointItem::updateMarker(BreakpointModelId id)
{
QString file = markerFileName();

View File

@@ -197,6 +197,7 @@ private:
bool isLocatedAt(const QString &fileName, int lineNumber,
bool useMarkerPosition) const;
void updateMarker(BreakpointModelId id);
void updateMarkerIcon();
QString toToolTip() const;
QString markerFileName() const;
int markerLineNumber() const;

View File

@@ -67,8 +67,8 @@ void BreakpointMarker::removedFromEditor()
void BreakpointMarker::updateLineNumber(int lineNumber)
{
breakHandler()->updateLineNumberFromMarker(m_id, lineNumber);
BaseTextMark::updateLineNumber(lineNumber);
breakHandler()->updateLineNumberFromMarker(m_id, lineNumber);
}
} // namespace Internal

View File

@@ -715,7 +715,7 @@ void GdbEngine::interruptInferior()
QTC_ASSERT(state() == InferiorStopRequested,
qDebug() << "INTERRUPT INFERIOR: " << state(); return);
if (0 && debuggerCore()->boolSetting(TargetAsync)) {
if (usesExecInterrupt()) {
postCommand("-exec-interrupt");
} else {
showStatusMessage(tr("Stop requested..."), 5000);
@@ -1634,7 +1634,7 @@ void GdbEngine::handleStop1(const GdbMi &data)
} else {
showMessage(_("HANDLING SIGNAL " + name));
if (debuggerCore()->boolSetting(UseMessageBoxForSignals)
&& !isStopperThread)
&& !isStopperThread && !isAutoTestRunning())
showStoppedBySignalMessageBox(_(meaning), _(name));
if (!name.isEmpty() && !meaning.isEmpty())
reasontr = msgStoppedBySignal(_(meaning), _(name));
@@ -1667,7 +1667,7 @@ void GdbEngine::handleStop2()
if (supportsThreads()) {
if (m_gdbAdapter->isCodaAdapter()) {
m_gdbAdapter->codaReloadThreads();
} else if (m_isMacGdb) {
} else if (m_isMacGdb || m_gdbVersion < 70100) {
postCommand("-thread-list-ids", Discardable, CB(handleThreadListIds));
} else {
// This is only available in gdb 7.1+.
@@ -1715,6 +1715,11 @@ void GdbEngine::handleShowVersion(const GdbResponse &response)
if (m_gdbVersion > 70300)
m_hasBreakpointNotifications = true;
if (usesExecInterrupt())
postCommand("set target-async on", ConsoleCommand);
else
postCommand("set target-async off", ConsoleCommand);
}
}
@@ -4707,11 +4712,7 @@ bool GdbEngine::startGdb(const QStringList &args, const QString &settingsIdHint)
postCommand("set trust-readonly-sections on", ConsoleCommand);
postCommand("set auto-solib-add on", ConsoleCommand);
postCommand("set remotecache on", ConsoleCommand);
if (0 && debuggerCore()->boolSetting(TargetAsync)) {
postCommand("set target-async on", ConsoleCommand);
postCommand("set non-stop on", ConsoleCommand);
}
//postCommand("set non-stop on", ConsoleCommand);
// Work around https://bugreports.qt-project.org/browse/QTCREATORBUG-2004
postCommand("maintenance set internal-warning quit no", ConsoleCommand);
@@ -5130,6 +5131,17 @@ bool GdbEngine::isHiddenBreakpoint(const BreakpointResponseId &id) const
return isQFatalBreakpoint(id) || isQmlStepBreakpoint(id);
}
bool GdbEngine::usesExecInterrupt() const
{
if (m_gdbVersion < 70000)
return false;
// debuggerCore()->boolSetting(TargetAsync)
DebuggerStartMode mode = startParameters().startMode;
return mode == AttachToRemoteServer
|| mode == AttachToRemoteProcess;
}
void GdbEngine::scheduleTestResponse(int testCase, const QByteArray &response)
{
if (!m_testCases.contains(testCase) && startParameters().testCase != testCase)

View File

@@ -732,6 +732,8 @@ private: ////////// View & Data Stuff //////////
BreakpointResponseId m_qFatalBreakpointResponseId;
bool m_actingOnExpectedStop;
bool usesExecInterrupt() const;
QHash<int, QByteArray> m_scheduledTestResponses;
QSet<int> m_testCases;
};

View File

@@ -154,6 +154,9 @@ public:
bool visit(UiScriptBinding *ast)
{
if (!ast->statement)
return true;
quint32 sourceStartLine = ast->firstSourceLocation().startLine;
quint32 statementStartLine;
quint32 statementColumn;
@@ -165,6 +168,8 @@ public:
} else if (ast->statement->kind == Node::Kind_Block) {
Block *block = static_cast<Block *>(ast->statement);
if (!block || !block->statements)
return true;
statementStartLine = block->statements->firstSourceLocation().
startLine;
statementColumn = block->statements->firstSourceLocation().

View File

@@ -91,6 +91,8 @@ public:
QmlAdapter *adapter() const;
void insertBreakpoint(BreakpointModelId id);
public slots:
void disconnected();
void documentUpdated(QmlJS::Document::Ptr doc);
@@ -130,7 +132,6 @@ private:
void selectThread(int index);
void attemptBreakpointSynchronization();
void insertBreakpoint(BreakpointModelId id);
void removeBreakpoint(BreakpointModelId id);
void changeBreakpoint(BreakpointModelId id);
bool acceptsBreakpoint(BreakpointModelId id) const;

View File

@@ -1131,23 +1131,21 @@ void QmlV8DebuggerClient::changeBreakpoint(const BreakpointModelId &id)
BreakHandler *handler = d->engine->breakHandler();
const BreakpointParameters &params = handler->breakpointData(id);
BreakpointResponse br = handler->response(id);
if (params.type == BreakpointAtJavaScriptThrow) {
d->setExceptionBreak(AllExceptions, params.enabled);
br.enabled = params.enabled;
handler->setResponse(id, br);
} else if (params.type == BreakpointOnQmlSignalHandler) {
d->setBreakpoint(QString(_(EVENT)), params.functionName, params.enabled);
} else {
int breakpoint = d->breakpoints.value(id);
d->changeBreakpoint(breakpoint, params.enabled, QLatin1String(params.condition),
params.ignoreCount);
}
BreakpointResponse br = handler->response(id);
br.enabled = params.enabled;
br.condition = params.condition;
br.ignoreCount = params.ignoreCount;
handler->setResponse(id, br);
} else {
//V8 supports only minimalistic changes in breakpoint
//Remove the breakpoint and add again
removeBreakpoint(id);
d->engine->insertBreakpoint(id);
}
}
void QmlV8DebuggerClient::synchronizeBreakpoints()

View File

@@ -418,7 +418,7 @@ public:
bool isReturn() const
{
return m_key == Key_Return;
return m_key == Key_Return || m_key == Key_Enter;
}
bool isEscape() const

View File

@@ -163,7 +163,6 @@ void TaskModel::updateTaskLineNumber(unsigned int id, int line)
if (m_tasks.at(i).taskId == id) {
m_tasks[i].movedLine = line;
emit dataChanged(index(i, 0), index(i, 0));
return;
}
}

View File

@@ -482,6 +482,7 @@ UnConfiguredSettings Qt4Manager::unconfiguredSettings() const
}
}
m_unConfiguredVersionId = version->uniqueId();
if (toolChain)
m_unconfiguredToolChainId = toolChain->id();
}
UnConfiguredSettings us;

View File

@@ -596,7 +596,9 @@ void QtOptionsPageWidget::addQtDir()
QFileDialog::getOpenFileName(this,
tr("Select a qmake executable"),
QString(),
filterForQmakeFileDialog()));
filterForQmakeFileDialog(),
0,
QFileDialog::DontResolveSymlinks));
if (qtVersion.isNull())
return;
if (QtVersionManager::instance()->qtVersionForQMakeBinary(qtVersion)) {
@@ -642,7 +644,10 @@ void QtOptionsPageWidget::editPath()
Utils::FileName qtVersion = Utils::FileName::fromString(
QFileDialog::getOpenFileName(this,
tr("Select a qmake executable"),
dir, filterForQmakeFileDialog()));
dir,
filterForQmakeFileDialog(),
0,
QFileDialog::DontResolveSymlinks));
if (qtVersion.isNull())
return;
BaseQtVersion *version = QtVersionFactory::createQtVersionFromQMakePath(qtVersion);

View File

@@ -69,7 +69,7 @@ public:
QString CodeStylePoolPrivate::generateUniqueId(const QString &id) const
{
if (!m_idToCodeStyle.contains(id))
if (!id.isEmpty() && !m_idToCodeStyle.contains(id))
return id;
int idx = id.size();
@@ -80,7 +80,7 @@ QString CodeStylePoolPrivate::generateUniqueId(const QString &id) const
}
const QString baseName = id.left(idx);
QString newName = baseName;
QString newName = baseName.isEmpty() ? QLatin1String("codestyle") : baseName;
int i = 2;
while (m_idToCodeStyle.contains(newName))
newName = baseName + QString::number(i++);

View File

@@ -117,6 +117,7 @@ CodeStyleDialog::CodeStyleDialog(ICodeStylePreferencesFactory *factory,
m_codeStyle = factory->createCodeStyle();
m_codeStyle->setTabSettings(codeStyle->tabSettings());
m_codeStyle->setValue(codeStyle->value());
m_codeStyle->setId(codeStyle->id());
m_codeStyle->setDisplayName(m_originalDisplayName);
QWidget *editor = factory->createEditor(m_codeStyle, this);