Commit e5e3f91e authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/2.5'

Conflicts:
	src/libs/qmljsdebugclient/qmlprofilereventlist.cpp

Change-Id: Ic6251d47ecd032ea1db4fc58dc80e19b6e6cf23d
parents c0e50601 10cdeb87
......@@ -31,7 +31,7 @@ Editing
* Fix position of code-assist popup when cursor is outside viewport
(QTCREATORBUG-6843)
* Add experimental plugin for showing "TODO"s in files
[by Dmitry Savchenko]
[by Dmitry Savchenko, initial version by Vasiliy Sorokin]
* Add "Open with" context menu in resource editor (QTCREATORBUG-4224)
* Add task indicators in the left margin of a line
......
doc/images/qtcreator-add-resource.png

30.5 KB | W: | H:

doc/images/qtcreator-add-resource.png

12.7 KB | W: | H:

doc/images/qtcreator-add-resource.png
doc/images/qtcreator-add-resource.png
doc/images/qtcreator-add-resource.png
doc/images/qtcreator-add-resource.png
  • 2-up
  • Swipe
  • Onion skin
doc/images/qtcreator-qt4-addbutton.png

839 Bytes | W: | H:

doc/images/qtcreator-qt4-addbutton.png

762 Bytes | W: | H:

doc/images/qtcreator-qt4-addbutton.png
doc/images/qtcreator-qt4-addbutton.png
doc/images/qtcreator-qt4-addbutton.png
doc/images/qtcreator-qt4-addbutton.png
  • 2-up
  • Swipe
  • Onion skin
doc/images/qtcreator-target-remove.png

826 Bytes | W: | H:

doc/images/qtcreator-target-remove.png

740 Bytes | W: | H:

doc/images/qtcreator-target-remove.png
doc/images/qtcreator-target-remove.png
doc/images/qtcreator-target-remove.png
doc/images/qtcreator-target-remove.png
  • 2-up
  • Swipe
  • Onion skin
doc/images/qtcreator-textfinder-ui.png

2.48 KB | W: | H:

doc/images/qtcreator-textfinder-ui.png

2.21 KB | W: | H:

doc/images/qtcreator-textfinder-ui.png
doc/images/qtcreator-textfinder-ui.png
doc/images/qtcreator-textfinder-ui.png
doc/images/qtcreator-textfinder-ui.png
  • 2-up
  • Swipe
  • Onion skin
doc/images/qtcreator-vcs-diff.png

142 KB | W: | H:

doc/images/qtcreator-vcs-diff.png

23.6 KB | W: | H:

doc/images/qtcreator-vcs-diff.png
doc/images/qtcreator-vcs-diff.png
doc/images/qtcreator-vcs-diff.png
doc/images/qtcreator-vcs-diff.png
  • 2-up
  • Swipe
  • Onion skin
doc/images/qtcreator-vcs-gitbranch.png

24.3 KB | W: | H:

doc/images/qtcreator-vcs-gitbranch.png

6.73 KB | W: | H:

doc/images/qtcreator-vcs-gitbranch.png
doc/images/qtcreator-vcs-gitbranch.png
doc/images/qtcreator-vcs-gitbranch.png
doc/images/qtcreator-vcs-gitbranch.png
  • 2-up
  • Swipe
  • Onion skin
doc/images/qtcreator-vcs-log.png

76.3 KB | W: | H:

doc/images/qtcreator-vcs-log.png

23.7 KB | W: | H:

doc/images/qtcreator-vcs-log.png
doc/images/qtcreator-vcs-log.png
doc/images/qtcreator-vcs-log.png
doc/images/qtcreator-vcs-log.png
  • 2-up
  • Swipe
  • Onion skin
doc/images/qtcreator-vcs-pane.png

11.9 KB | W: | H:

doc/images/qtcreator-vcs-pane.png

14.1 KB | W: | H:

doc/images/qtcreator-vcs-pane.png
doc/images/qtcreator-vcs-pane.png
doc/images/qtcreator-vcs-pane.png
doc/images/qtcreator-vcs-pane.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -44,7 +44,7 @@
\o \l{Creating a Qt Quick Application}
Learn about the basic Qt Quick concepts and QML elements.
\o \l{Creating a Qt Quick Application Using Qt Quick Components}
\o \l{Using Qt Quick Components}
Learn how to develop a Qt Quick application for mobile devices.
......
......@@ -82,9 +82,8 @@
\list 1
\o In the \gui Projects pane, open the project file (.pro).
\o Right-click in the code editor to open the context menu and select
\o In the \gui Projects pane, right-click the project name to open the
context menu and select
\gui {Add Library}.
\o Follow the instructions of the wizard.
......@@ -102,7 +101,7 @@
\list 1
\o Choose \gui {File > New File or Project > Other Projects >
\o Choose \gui {File > New File or Project > Libraries >
C++ Library} to create the library.
The \gui {Introduction and Product Location} dialog opens.
......@@ -118,10 +117,8 @@
\gui {Project Management} dialog. In the \gui {Add to project}
list, select a project. For example, \bold myapp.
\o In the \gui Projects pane, open the project file (.pro).
For example, \bold myapp.pro.
\o Right-click in the code editor to open the context menu and select
\o In the \gui Projects pane, right-click the project name to open the
context menu and select
\gui {Add Library > Internal Library > Next}.
\o In the \gui Library field, select \bold mylib and click \gui Next.
......
......@@ -39,7 +39,7 @@
To view and modify the settings for currently open projects, switch to the
\gui Projects mode by pressing \key Ctrl+5.
\image qtcreator-projectpane.png
\image qtcreator-project-targets.png
You can add a target if the development environment for the target platform
is installed on the development PC and the Qt version is configured. Click
......@@ -60,18 +60,18 @@
\list
\o If you have installed the development environment for only
\o \l{Specifying Build Settings}{Build Settings}
\o \l{Specifying Run Settings}{Run Settings}
\endlist
\note If you have installed the development environment for only
one target, the \gui Targets tab is replaced by a \gui Build
tab and a \gui Run tab.
\o If you have not configured the project for building, the
If you have not configured the project for building, the
\gui Targets tab is replaced by the \l{Opening Projects}
{Configure Projects} tab.
\endlist
\o \l{Specifying Build Settings}{Build Settings}
\o \l{Specifying Run Settings}{Run Settings}
\o \l{Specifying Editor Settings}{Editor Settings}
......
......@@ -136,7 +136,7 @@
\o \l{Tutorials}
\list
\o \l{Creating a Qt Quick Application}
\o \l{Creating a Qt Quick Application Using Qt Quick Components}
\o \l{Using Qt Quick Components}
\o \l{Creating a Qt Widget Based Application}
\endlist
\endlist
......
......@@ -31,7 +31,7 @@
\page creator-qml-components-example.html
\nextpage creator-writing-program.html
\title Creating a Qt Quick Application Using Qt Quick Components
\title Using Qt Quick Components
\note To complete this tutorial, you must install the Qt Quick Components
for Symbian and the Symbian Anna target as part of the \QSDK. In addition,
......@@ -50,17 +50,14 @@
\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 for Symbian > Choose}.
\o In the \gui{Name} field, type \bold {BatteryStatus}.
\o In the \gui {Create in} field, enter the path for the project files.
For example, \c {C:\Qt\examples}, and then click \gui{Next}.
\o In the \gui {Application Type} dialog, select \gui {Qt Quick
Components for Symbian}, and then click \gui{Next}.
\o Select \gui {Symbian Device} and \gui {\QS} targets, and
then click \gui{Next}.
......
......@@ -45,7 +45,7 @@
\list 1
\o Select \gui{File > New File or Project > Qt Widget Project > Qt Gui
\o Select \gui{File > New File or Project > Applications > Qt Gui
Application > Choose}.
\image qtcreator-new-qt-gui-application.png "New File or Project dialog"
......
......@@ -245,6 +245,7 @@ def main():
sys.exit(2)
QT_INSTALL_LIBS = readQmakeVar(qmake_bin, 'QT_INSTALL_LIBS')
QT_INSTALL_BINS = readQmakeVar(qmake_bin, 'QT_INSTALL_BINS')
QT_INSTALL_PLUGINS = readQmakeVar(qmake_bin, 'QT_INSTALL_PLUGINS')
QT_INSTALL_IMPORTS = readQmakeVar(qmake_bin, 'QT_INSTALL_IMPORTS')
QT_INSTALL_TRANSLATIONS = readQmakeVar(qmake_bin, 'QT_INSTALL_TRANSLATIONS')
......@@ -257,7 +258,10 @@ def main():
global debug_build
debug_build = is_debug_build(install_dir)
copy_qt_libs(install_dir, QT_INSTALL_LIBS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, plugins, imports)
if sys.platform.startswith('win'):
copy_qt_libs(install_dir, QT_INSTALL_BINS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, plugins, imports)
else:
copy_qt_libs(install_dir, QT_INSTALL_LIBS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, plugins, imports)
copy_translations(install_dir, QT_INSTALL_TRANSLATIONS, tr_catalogs)
if not sys.platform.startswith('win'):
......
......@@ -99,7 +99,7 @@ QString Html5ApplicationViewerPrivate::adjustPath(const QString &path)
}
#endif
#endif
return path;
return QFileInfo(path).absoluteFilePath();
}
void Html5ApplicationViewerPrivate::quit()
......@@ -130,7 +130,7 @@ Html5ApplicationViewer::~Html5ApplicationViewer()
void Html5ApplicationViewer::loadFile(const QString &fileName)
{
m_d->m_webView->setUrl(QUrl(Html5ApplicationViewerPrivate::adjustPath(fileName)));
m_d->m_webView->setUrl(QUrl::fromLocalFile(Html5ApplicationViewerPrivate::adjustPath(fileName)));
}
void Html5ApplicationViewer::loadUrl(const QUrl &url)
......
......@@ -21220,7 +21220,7 @@ Fehler: %2</translation>
</message>
<message>
<source>Import build from %1.</source>
<translation>Build aus %1. importieren.</translation>
<translation>Build aus %1 importieren.</translation>
</message>
<message>
<source>Already imported build</source>
......@@ -115,6 +115,7 @@ Item {
}
Column {
y: -4
x: parent.margin + 8
//y: parent.margin
id: innerColumn
......@@ -149,7 +150,7 @@ Item {
wrapMode: Text.WrapAnywhere
maximumLineCount: 2
elide: Text.ElideRight
height: font.pixelSize * 2 + 4
height: lineCount == 2 ? font.pixelSize * 2 + 4 : font.pixelSize + 2
color: "#6b6b6b"
width: delegate.ListView.view.width - 48
MouseArea {
......@@ -220,7 +221,6 @@ Item {
}
Item {
x: delegate.ListView.view.width - 65
width: 38
height: 20
......
......@@ -76,8 +76,7 @@ Item {
anchors.fill: parent
verticalMinimumValue: vscrollbar.minimumValue
verticalMaximumValue: vscrollbar.maximumValue
onVerticalValueChanged: root.contentY = Math.round(verticalValue / root.delegateHeight) * root.delegateHeight
onVerticalValueChanged: root.contentY = verticalValue
}
ScrollBar {
......@@ -92,7 +91,7 @@ Item {
anchors.bottom: parent.bottom
singleStep: root.delegateHeight
anchors.topMargin: styleitem.style === "mac" ? 1 : 0
onValueChanged: root.contentY = Math.round(value / root.delegateHeight) * root.delegateHeight
onValueChanged: root.contentY = value
anchors.rightMargin: styleitem.frameoffset
anchors.bottomMargin: styleitem.frameoffset
value: root.contentY
......
......@@ -64,6 +64,7 @@ public:
ProjectInfo(QPointer<ProjectExplorer::Project> project)
: project(project)
, tryQmlDump(false)
{ }
operator bool() const
......
......@@ -333,7 +333,9 @@ Core::IWizard *NewDialog::showDialog()
const int retVal = exec();
idx = m_ui->templateCategoryView->currentIndex();
lastCategory = m_model->itemFromIndex(m_twoLevelProxyModel->mapToSource(idx))->data(Qt::UserRole).toString();
QStandardItem *currentItem = m_model->itemFromIndex(m_twoLevelProxyModel->mapToSource(idx));
if (currentItem)
lastCategory = currentItem->data(Qt::UserRole).toString();
if (retVal != Accepted)
return 0;
......
......@@ -2381,7 +2381,10 @@ bool CPPEditorWidget::handleDocumentationComment(QKeyEvent *e)
if (followinPos == text.length()
|| text.at(followinPos) != QLatin1Char('*')) {
QString newLine(QLatin1Char('\n'));
newLine.append(QString(offset, QLatin1Char(' ')));
QTextCursor c(cursor);
c.movePosition(QTextCursor::StartOfBlock);
c.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, offset);
newLine.append(c.selectedText());
if (text.at(offset) == QLatin1Char('/')) {
newLine.append(QLatin1String(" *"));
} else {
......
......@@ -56,7 +56,6 @@ DoxygenGenerator::DoxygenGenerator()
, m_generateBrief(true)
, m_startComment(true)
, m_style(QtStyle)
, m_commentOffset(0)
{}
void DoxygenGenerator::setStyle(DocumentationStyle style)
......@@ -308,16 +307,11 @@ void DoxygenGenerator::assignCommentOffset(QTextCursor cursor)
cursor.setPosition(cursor.anchor());
}
m_commentOffset = cursor.positionInBlock();
cursor.movePosition(QTextCursor::StartOfBlock, QTextCursor::KeepAnchor);
m_commentOffset = cursor.selectedText();
}
QString DoxygenGenerator::offsetString() const
{
// Note: Currently we don't indent comments, but simply preserve them in the original
// relative positions. What we do here is just to make sure that such positions are correct,
// although they might still be wrong from an indentation point of view (for instance,
// using spaces instead of tabs). Therefore, the content generated should still have
// the indentation strings fixed.
return QString(m_commentOffset, QLatin1Char(' '));
return m_commentOffset;
}
......@@ -95,7 +95,7 @@ private:
bool m_startComment;
DocumentationStyle m_style;
CPlusPlus::Overview m_printer;
int m_commentOffset;
QString m_commentOffset;
};
} // CppTools
......
......@@ -75,8 +75,9 @@ public:
virtual void changeBreakpoint(const BreakpointModelId &id) = 0;
virtual void synchronizeBreakpoints() = 0;
virtual void assignValueInDebugger(const QByteArray expr, const quint64 &id,
const QString &property, const QString &value) = 0;
virtual void assignValueInDebugger(const WatchData *data,
const QString &expression,
const QVariant &valueV) = 0;
virtual void updateWatchData(const WatchData &data) = 0;
virtual void executeDebuggerCommand(const QString &command) = 0;
......
......@@ -119,11 +119,13 @@ private:
InteractiveInterpreter m_interpreter;
bool m_validContext;
QHash<QString,BreakpointModelId> pendingBreakpoints;
bool m_retryOnConnectFail;
};
QmlEnginePrivate::QmlEnginePrivate(QmlEngine *q)
: m_adapter(q),
m_validContext(false)
m_validContext(false),
m_retryOnConnectFail(false)
{}
class ASTWalker: public Visitor
......@@ -344,15 +346,15 @@ QmlEngine::QmlEngine(const DebuggerStartParameters &startParameters,
connect(&d->m_outputParser, SIGNAL(waitingForConnectionViaOst()),
this, SLOT(beginConnection()));
connect(&d->m_outputParser, SIGNAL(noOutputMessage()),
this, SLOT(beginConnection()));
this, SLOT(tryToConnect()));
connect(&d->m_outputParser, SIGNAL(errorMessage(QString)),
this, SLOT(connectionStartupFailed(QString)));
this, SLOT(appStartupFailed(QString)));
// Only wait 8 seconds for the 'Waiting for connection' on application ouput, then just try to connect
// (application output might be redirected / blocked)
d->m_noDebugOutputTimer.setSingleShot(true);
d->m_noDebugOutputTimer.setInterval(8000);
connect(&d->m_noDebugOutputTimer, SIGNAL(timeout()), this, SLOT(beginConnection()));
connect(&d->m_noDebugOutputTimer, SIGNAL(timeout()), this, SLOT(tryToConnect()));
qtMessageLogHandler()->setHasEditableRow(true);
......@@ -360,6 +362,9 @@ QmlEngine::QmlEngine(const DebuggerStartParameters &startParameters,
SIGNAL(documentUpdated(QmlJS::Document::Ptr)),
this,
SLOT(documentUpdated(QmlJS::Document::Ptr)));
// we won't get any debug output
d->m_retryOnConnectFail = startParameters.useTerminal;
}
QmlEngine::~QmlEngine()
......@@ -409,6 +414,12 @@ void QmlEngine::connectionEstablished()
notifyEngineRunAndInferiorRunOk();
}
void QmlEngine::tryToConnect(quint16 port)
{
d->m_retryOnConnectFail = true;
beginConnection(port);
}
void QmlEngine::beginConnection(quint16 port)
{
d->m_noDebugOutputTimer.stop();
......@@ -434,7 +445,7 @@ void QmlEngine::beginConnection(quint16 port)
}
}
void QmlEngine::connectionStartupFailed(const QString &errorMessage)
void QmlEngine::connectionStartupFailed()
{
if (isSlaveEngine()) {
if (masterEngine()->state() != InferiorRunOk) {
......@@ -443,23 +454,19 @@ void QmlEngine::connectionStartupFailed(const QString &errorMessage)
return;
}
}
if (d->m_retryOnConnectFail) {
beginConnection();
return;
}
QMessageBox *infoBox = new QMessageBox(Core::ICore::mainWindow());
infoBox->setIcon(QMessageBox::Critical);
infoBox->setWindowTitle(tr("Qt Creator"));
if (qobject_cast<QmlAdapter *>(sender())) {
infoBox->setText(tr("Could not connect to the in-process QML debugger."
"\nDo you want to retry?"));
infoBox->setStandardButtons(QMessageBox::Retry | QMessageBox::Cancel |
QMessageBox::Help);
infoBox->setDefaultButton(QMessageBox::Retry);
}
if (qobject_cast<QmlJsDebugClient::QDeclarativeOutputParser *>(sender())) {
infoBox->setText(tr("Could not connect to the in-process QML debugger."
"\n%1").arg(errorMessage));
infoBox->setStandardButtons(QMessageBox::Ok | QMessageBox::Help);
infoBox->setDefaultButton(QMessageBox::Ok);
}
infoBox->setText(tr("Could not connect to the in-process QML debugger."
"\nDo you want to retry?"));
infoBox->setStandardButtons(QMessageBox::Retry | QMessageBox::Cancel |
QMessageBox::Help);
infoBox->setDefaultButton(QMessageBox::Retry);
infoBox->setModal(true);
connect(infoBox, SIGNAL(finished(int)),
......@@ -468,6 +475,22 @@ void QmlEngine::connectionStartupFailed(const QString &errorMessage)
infoBox->show();
}
void QmlEngine::appStartupFailed(const QString &errorMessage)
{
QMessageBox *infoBox = new QMessageBox(Core::ICore::mainWindow());
infoBox->setIcon(QMessageBox::Critical);
infoBox->setWindowTitle(tr("Qt Creator"));
infoBox->setText(tr("Could not connect to the in-process QML debugger."
"\n%1").arg(errorMessage));
infoBox->setStandardButtons(QMessageBox::Ok | QMessageBox::Help);
infoBox->setDefaultButton(QMessageBox::Ok);
connect(infoBox, SIGNAL(finished(int)),
this, SLOT(errorMessageBoxFinished(int)));
infoBox->show();
notifyEngineRunFailed();
}
void QmlEngine::errorMessageBoxFinished(int result)
{
switch (result) {
......@@ -484,7 +507,7 @@ void QmlEngine::errorMessageBoxFinished(int result)
if (state() == InferiorRunOk) {
notifyInferiorSpontaneousStop();
notifyInferiorIll();
} else {
} else if (state() == EngineRunRequested) {
notifyEngineRunFailed();
}
break;
......@@ -576,6 +599,8 @@ void QmlEngine::runEngine()
beginConnection();
else
startApplicationLauncher();
} else {
d->m_noDebugOutputTimer.start();
}
}
......@@ -973,9 +998,10 @@ bool QmlEngine::setToolTipExpression(const QPoint &mousePos,
void QmlEngine::assignValueInDebugger(const WatchData *data,
const QString &expression, const QVariant &valueV)
{
quint64 objectId = data->id;
if (objectId > 0 && !expression.isEmpty() && d->m_adapter.activeDebuggerClient()) {
d->m_adapter.activeDebuggerClient()->assignValueInDebugger(expression.toUtf8(), objectId, expression, valueV.toString());
if (!expression.isEmpty() && d->m_adapter.activeDebuggerClient()) {
d->m_adapter.activeDebuggerClient()->assignValueInDebugger(data,
expression,
valueV);
}
}
......
......@@ -161,9 +161,11 @@ signals:
TextEditor::ITextEditor *editor, int cursorPos);
private slots:
void tryToConnect(quint16 port = 0);
void beginConnection(quint16 port = 0);
void connectionEstablished();
void connectionStartupFailed(const QString &errorMessage = QString());
void connectionStartupFailed();
void appStartupFailed(const QString &errorMessage);
void connectionError(QAbstractSocket::SocketError error);
void serviceConnectionError(const QString &service);
void appendMessage(const QString &msg, Utils::OutputFormat);
......
......@@ -1153,11 +1153,12 @@ void QmlV8DebuggerClient::synchronizeBreakpoints()
//NOT USED
}
void QmlV8DebuggerClient::assignValueInDebugger(const QByteArray /*expr*/, const quint64 &/*id*/,
const QString &property, const QString &value)
void QmlV8DebuggerClient::assignValueInDebugger(const WatchData * /*data*/,
const QString &expr,
const QVariant &valueV)
{
StackHandler *stackHandler = d->engine->stackHandler();
QString expression = QString(_("%1 = %2;")).arg(property).arg(value);
QString expression = QString(_("%1 = %2;")).arg(expr).arg(valueV.toString());
if (stackHandler->isContentsValid() && stackHandler->currentFrame().isUsable()) {
d->evaluate(expression, false, false, stackHandler->currentIndex());
} else {
......@@ -1309,13 +1310,22 @@ void QmlV8DebuggerClient::messageReceived(const QByteArray &data)
BreakpointModelId id = d->breakpointsSync.take(seq);
d->breakpoints.insert(id, index);
BreakHandler *handler = d->engine->breakHandler();
if (handler->state(id) != BreakpointInserted) {
BreakpointResponse br = handler->response(id);
br.lineNumber = breakpointData.value(_("line")
).toInt() + 1;
handler->setResponse(id, br);
handler->notifyBreakpointInsertOk(id);
//Is actual position info present? Then breakpoint was
//accepted
const QVariantList actualLocations =
breakpointData.value(
_("actual_locations")).toList();
if (actualLocations.count()) {
//The breakpoint requested line should be same as
//actual line
BreakHandler *handler = d->engine->breakHandler();
if (handler->state(id) != BreakpointInserted) {
BreakpointResponse br = handler->response(id);
br.lineNumber = breakpointData.value(_("line")
).toInt() + 1;
handler->setResponse(id, br);
handler->notifyBreakpointInsertOk(id);
}
}
......@@ -1480,6 +1490,12 @@ void QmlV8DebuggerClient::messageReceived(const QByteArray &data)
br.functionName = invocationText;
handler->setResponse(id, br);
}
if (handler->state(id) != BreakpointInserted) {
br.lineNumber = breakData.value(
_("sourceLine")).toInt() + 1;
handler->setResponse(id, br);
handler->notifyBreakpointInsertOk(id);
}
}
}
}
......
......@@ -87,8 +87,9 @@ public:
void changeBreakpoint(const BreakpointModelId &id);
void synchronizeBreakpoints();
void assignValueInDebugger(const QByteArray expr, const quint64 &id,
const QString &property, const QString &value);
void assignValueInDebugger(const WatchData *data,
const QString &expression,
const QVariant &valueV);
void updateWatchData(const WatchData &);