diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index 4dd7a5fb53c..0db515fe434 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -69,7 +69,7 @@ \image qtcreator-breakdown.png - \seection1 The Mode Selectors + \section1 The Mode Selectors When working in Qt Creator, you can be in one of five modes: \bold Project, \bold Edit, \bold Debug, \bold Help, and \bold Output. @@ -613,7 +613,7 @@ \page creator-debugging.html \nextpage creator-tips.html - \title Debugging With Qt Creator + \title Debugging with Qt Creator \table \row @@ -677,9 +677,9 @@ \list \o At a particular line you want the program to stop -- click on the - left margin or press \key F9 (\key F8 for Mac Os X). - \o At the name of a function that you want the program to stop -- enter - the function's name in \gui{Set Breakpoint at Function...} under the + left margin or press \key F9 (\key F8 for Mac OS X). + \o At a function that you want the program to stop -- enter the + function's name in \gui{Set Breakpoint at Function...} under the \gui Debug menu. \endlist @@ -744,7 +744,7 @@ When the program being debugged is stopped, Qt Creator displays the nested function calls leading to the current position as a \e call stack trace. - This stack trace is built up from \e call stack frames, each representing a + This stack trace is built up from \e{call stack frames}, each representing a particular function. For each function, Qt Creator will try to retrieve the file name and line number of the corresponding source files. This data is shown in the \gui Stack view. @@ -765,11 +765,10 @@ \section2 Threads - The \gui Thread view displays the state of the program being debugged one - thread at a time. If a multi-threaded program is stopped, the \gui Thread - view or the combobox named \gui Thread in the debugger's status bar can - be used to switch from one thread to another. The \gui Stack view will - adjust itself accordingly. + If a multi-threaded program is stopped, the \gui Thread view or the + combobox named \gui Thread in the debugger's status bar can be used to + switch from one thread to another. The \gui Stack view will adjust itself + accordingly. \section2 Locals and Watchers @@ -851,8 +850,8 @@ function, the latter the current state of the CPU registers. Both views are mainly useful in connection with the low-level \gui{Step single instruction} and \gui{Step over single instruction} - commands - + commands. + \section1 A Walkthrough for the Debugger Frontend @@ -947,8 +946,9 @@ \bold{Running Qt Creator from the Command Line} - You can start Qt Creator from a command prompt with an existing session or - \c{.pro} file by giving the name as argument on the command line. + You can start Qt Creator from a command prompt with the name of an existing + session or \c{.pro} file by giving the name as argument on the command + line. \bold{Show and Hide the Sidebar} diff --git a/src/libs/cplusplus/OverviewModel.cpp b/src/libs/cplusplus/OverviewModel.cpp index 38456d8fa7d..20658778905 100644 --- a/src/libs/cplusplus/OverviewModel.cpp +++ b/src/libs/cplusplus/OverviewModel.cpp @@ -74,10 +74,10 @@ Symbol *OverviewModel::globalSymbolAt(unsigned index) const QModelIndex OverviewModel::index(int row, int column, const QModelIndex &parent) const { - if (! hasDocument()) { - return QModelIndex(); - } else if (! parent.isValid()) { - Symbol *symbol = globalSymbolAt(row); + if (!parent.isValid()) { + if (row == 0) // account for no symbol item + return createIndex(row, column); + Symbol *symbol = globalSymbolAt(row-1); // account for no symbol item return createIndex(row, column, symbol); } else { Symbol *parentSymbol = static_cast(parent.internalPointer()); @@ -96,12 +96,20 @@ QModelIndex OverviewModel::index(int row, int column, const QModelIndex &parent) QModelIndex OverviewModel::parent(const QModelIndex &child) const { Symbol *symbol = static_cast(child.internalPointer()); - Q_ASSERT(symbol != 0); + if (!symbol) // account for no symbol item + return QModelIndex(); if (Scope *scope = symbol->scope()) { Symbol *parentSymbol = scope->owner(); - if (parentSymbol && parentSymbol->scope()) - return createIndex(parentSymbol->index(), 0, parentSymbol); + if (parentSymbol && parentSymbol->scope()) { + QModelIndex index; + if (parentSymbol->scope() && parentSymbol->scope()->owner() + && parentSymbol->scope()->owner()->scope()) // the parent doesn't have a parent + index = createIndex(parentSymbol->index(), 0, parentSymbol); + else //+1 to account for no symbol item + index = createIndex(parentSymbol->index() + 1, 0, parentSymbol); + return index; + } } return QModelIndex(); @@ -110,22 +118,27 @@ QModelIndex OverviewModel::parent(const QModelIndex &child) const int OverviewModel::rowCount(const QModelIndex &parent) const { if (hasDocument()) { - if (! parent.isValid()) { - return globalSymbolCount(); + if (!parent.isValid()) { + return globalSymbolCount()+1; // account for no symbol item } else { + if (!parent.parent().isValid() && parent.row() == 0) // account for no symbol item + return 0; Symbol *parentSymbol = static_cast(parent.internalPointer()); Q_ASSERT(parentSymbol != 0); if (ScopedSymbol *scopedSymbol = parentSymbol->asScopedSymbol()) { - if (! scopedSymbol->isFunction()) { + if (!scopedSymbol->isFunction()) { Scope *parentScope = scopedSymbol->members(); Q_ASSERT(parentScope != 0); return parentScope->symbolCount(); } } + return 0; } } + if (!parent.isValid()) + return 1; // account for no symbol item return 0; } @@ -136,6 +149,19 @@ int OverviewModel::columnCount(const QModelIndex &) const QVariant OverviewModel::data(const QModelIndex &index, int role) const { + // account for no symbol item + if (!index.parent().isValid() && index.row() == 0) { + switch (role) { + case Qt::DisplayRole: + if (rowCount() > 1) + return tr("