Merge branch '0.9.1-beta' of git@scm.dev.nokia.troll.no:creator/mainline into 0.9.1-beta

This commit is contained in:
hjk
2008-12-05 12:04:06 +01:00
4 changed files with 47 additions and 46 deletions

View File

@@ -814,21 +814,26 @@
a pointer to some private data structure, you will see a list of children, a pointer to some private data structure, you will see a list of children,
signals and slots. signals and slots.
Similarily, instead of showing a bunch of pointers and ints, Similarly, instead of displaying many pointers and integers, Qt Creator's
a QHash or QMap will display its contents in an orderly fashion, debugger will display the contents of a QHash or QMap in an orderly manner.
a QFileInfo will expose e.g. access data, and the otherwise Also, the debugger will display access data for QFileInfo and provide
"opaque" QVariant gives access to the "real" contents. access to the "real" contents of QVariant.
The \gui{Locals and Watchers View} can be used to change the
contents of variables of simple data types like int or float
while the program is stopped. To do so, click into the 'Value'
column, modify the value there, and hit \key{Return}.
The \gui{Locals and Watchers} view can be used to change the contents of
variables of simple data types such as \c int or \c float when the program
is stopped. To do so, click on the \gui Value column, modify the value
with the inplace editor, and hit \key Enter (or \key Return).
\section2 Modules \section2 Modules
The \gui{Modules View} is hidden by default and only useful in By default, the \gui Modules view is hidden as it is only useful with the
experimental delayed debug information loading feature. You can turn this
feature on by selecting \gui{Fast Debugger Start}
The \gui Modules view is hidden by default and only useful in
connection with the experimental feature of delayed debug connection with the experimental feature of delayed debug
information loading. This feature is accessible by selecting information loading. This feature is accessible by selecting
\gui{Debug} and \gui{Fast Debugger Start}. When using the \gui{Debug} and \gui{Fast Debugger Start}. When using the
@@ -849,29 +854,28 @@
commands commands
\section1 A Walkthrough for the Debugger Frontend
\section1 A short walk through the debugger frontend In our \l{Writing a Simple Program with Qt Creator}{TextFinder} example, we
read a text file into a QString and then display it with a QTextEdit.
In our \l{Writing a Simple Program with Qt Creator}{TextFinder} Suppose, you would like to look at this QString, \c{line}, and see what
example, we read a text file into a QString and then display it with a data it actually stores. Follow the steps described below to place a
QTextEdit. Suppose, you would like to look at this QString, \c{line}, breakpoint and view the QString object's data.
and see what data it actually stores. Follow the steps described below
to place a break point and view the QString object's data.
\table \table
\row \row
\i \inlineimage qtcreator-setting-breakpoint1.png \i \inlineimage qtcreator-setting-breakpoint1.png
\i \bold{Setting a Breakpoint} \i \bold{Setting a Breakpoint}
First, we set a breakpoint on the line where we invoke First, we set a breakpoint on the line where we invoke
\l{QTextEdit::}{setPlainText()} by clicking between the line number and \l{QTextEdit::}{setPlainText()} by clicking between the line number and the
the window border. Then, select \gui{Start Debugging} from the window border. Then, select \gui{Start Debugging} from the \gui{Debug} menu
\gui{Debug} menu or press \key{F5}. or press \key{F5}.
\endtable \endtable
Breakpoints are visible in the \gui{Breakpoints} view, shown below, in Breakpoints are visible in the \gui{Breakpoints} view, shown below, in
\gui{Debug} mode. If you wish to remove a breakpoint, simply right \gui{Debug} mode. If you wish to remove a breakpoint, simply right-click on
click on it and select \gui{Delete breakpoint} from the context menu. it and select \gui{Delete breakpoint} from the context menu.
\image qtcreator-setting-breakpoint2.png \image qtcreator-setting-breakpoint2.png
@@ -880,10 +884,10 @@
\image qtcreator-watcher.png \image qtcreator-watcher.png
Suppose we modify our \c{on_findButton_clicked()} function to move back Suppose we modify our \c{on_findButton_clicked()} function to move back to
to the start of the document and continue searching once the cursor the start of the document and continue searching once the cursor hits the
hits the end of the document. Adding this functionality can be done end of the document. Adding this functionality can be done with the code
with the code snippet below: snippet below:
\code \code
void TextFinder::on_findButton_clicked() void TextFinder::on_findButton_clicked()
@@ -915,9 +919,9 @@
} }
\endcode \endcode
However, if you compile and run this code, the application will not However, if you compile and run this code, the application will not work
work correctly due to a logic error. To locate this logic error, you correctly due to a logic error. To locate this logic error, you can step
can step through the code using the following buttons: through the code using the following buttons:
\image qtcreator-debugging-buttons.png \image qtcreator-debugging-buttons.png
*/ */
@@ -931,20 +935,20 @@
\title Tips and Tricks \title Tips and Tricks
\bold{Quick mode switch} \bold{Quickly Switching between Modes}
You can quickly switch between modes by pressing \key{Ctrl+1}, You can quickly switch between modes by pressing \key{Ctrl+1},
\key{Ctrl+2}, etc. \key{Ctrl+2}, and so on.
\bold{Other keyboard shortcuts} \bold{Keyboard Shortcuts}
There are a lot of other \l{keyboard-shortcuts}{keyboard shortcuts}. Qt Creator provides a lot of useful keyboard shortcuts. A complete list can
be found \l{Keyboard Shortcuts}{here}.
\bold{Command line} \bold{Running Qt Creator from the Command Line}
You can start Qt Creator from a command prompt with an already You can start Qt Creator from a command prompt with an existing session or
existing session or \c{.pro} file by giving the name as argument on the \c{.pro} file by giving the name as argument on the command line.
command line.
\bold{Sidebar} \bold{Sidebar}

View File

@@ -488,10 +488,6 @@ ITextEditable *BaseTextEditor::editableInterface() const
d->m_editable, SIGNAL(contentsChanged())); d->m_editable, SIGNAL(contentsChanged()));
connect(this, SIGNAL(changed()), connect(this, SIGNAL(changed()),
d->m_editable, SIGNAL(changed())); d->m_editable, SIGNAL(changed()));
connect(this,
SIGNAL(markRequested(TextEditor::ITextEditor *, int)),
d->m_editable,
SIGNAL(markRequested(TextEditor::ITextEditor *, int)));
} }
return d->m_editable; return d->m_editable;
} }
@@ -2434,9 +2430,10 @@ void BaseTextEditor::extraAreaMouseEvent(QMouseEvent *e)
} }
} else if (e->button() == Qt::RightButton) { } else if (e->button() == Qt::RightButton) {
QMenu * contextMenu = new QMenu(this); QMenu * contextMenu = new QMenu(this);
emit lineContextMenuRequested(editableInterface(), cursor.blockNumber(), contextMenu); emit d->m_editable->markContextMenuRequested(editableInterface(), cursor.blockNumber(), contextMenu);
if (!contextMenu->isEmpty()) if (!contextMenu->isEmpty())
contextMenu->exec(e->globalPos()); contextMenu->exec(e->globalPos());
delete contextMenu;
} }
} else if (d->extraAreaSelectionAnchorBlockNumber >= 0) { } else if (d->extraAreaSelectionAnchorBlockNumber >= 0) {
QTextCursor selection = cursor; QTextCursor selection = cursor;
@@ -2471,7 +2468,7 @@ void BaseTextEditor::extraAreaMouseEvent(QMouseEvent *e)
d->extraAreaToggleMarkBlockNumber = -1; d->extraAreaToggleMarkBlockNumber = -1;
if (cursor.blockNumber() == n) { if (cursor.blockNumber() == n) {
int line = n + 1; int line = n + 1;
emit markRequested(editableInterface(), line); emit d->m_editable->markRequested(editableInterface(), line);
} }
} }
} }

View File

@@ -431,8 +431,6 @@ protected slots:
signals: signals:
void markRequested(TextEditor::ITextEditor *editor, int line);
void lineContextMenuRequested(TextEditor::ITextEditor *editor, int line, QMenu *menu);
void requestBlockUpdate(const QTextBlock &); void requestBlockUpdate(const QTextBlock &);
void requestAutoCompletion(ITextEditable *editor, bool forced); void requestAutoCompletion(ITextEditable *editor, bool forced);

View File

@@ -44,6 +44,7 @@
#include <QtGui/QIcon> #include <QtGui/QIcon>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QMenu;
class QTextBlock; class QTextBlock;
QT_END_NAMESPACE QT_END_NAMESPACE
@@ -124,6 +125,7 @@ public:
signals: signals:
void contentsChanged(); void contentsChanged();
void markRequested(TextEditor::ITextEditor *editor, int line); void markRequested(TextEditor::ITextEditor *editor, int line);
void markContextMenuRequested(TextEditor::ITextEditor *editor, int line, QMenu *menu);
void tooltipRequested(TextEditor::ITextEditor *editor, const QPoint &globalPos, int position); void tooltipRequested(TextEditor::ITextEditor *editor, const QPoint &globalPos, int position);
void contextHelpIdRequested(TextEditor::ITextEditor *editor, int position); void contextHelpIdRequested(TextEditor::ITextEditor *editor, int position);
}; };