Commit f5601d7b authored by hjk's avatar hjk
Browse files

debugger: derive breakpoint model from QAbstract*, not QTable*

Preparation for proper mulptiple breakpoint display
parent 6bcb4dbd
......@@ -453,7 +453,7 @@ Qt::ItemFlags BreakHandler::flags(const QModelIndex &index) const
// //case 0:
// // return Qt::ItemIsUserCheckable | Qt::ItemIsEnabled;
// default:
return QAbstractTableModel::flags(index);
return QAbstractItemModel::flags(index);
// }
}
......@@ -469,6 +469,18 @@ int BreakHandler::threadSpecFromDisplay(const QString &str)
return ok ? result : -1;
}
QModelIndex BreakHandler::index(int row, int col, const QModelIndex &parent) const
{
Q_UNUSED(parent);
return createIndex(row, col, 0);
}
QModelIndex BreakHandler::parent(const QModelIndex &parent) const
{
Q_UNUSED(parent);
return QModelIndex();
}
QVariant BreakHandler::data(const QModelIndex &mi, int role) const
{
static const QString empty = QString(QLatin1Char('-'));
......@@ -742,9 +754,9 @@ DebuggerEngine *BreakHandler::engine(BreakpointId id) const
void BreakHandler::setEngine(BreakpointId id, DebuggerEngine *value)
{
Iterator it = m_storage.find(id);
BREAK_ASSERT(it != m_storage.end(), qDebug() << id; return);
QTC_ASSERT(it->state == BreakpointNew, qDebug() << id);
QTC_ASSERT(!it->engine, qDebug() << id; return);
BREAK_ASSERT(it != m_storage.end(), qDebug() << "SET ENGINE" << id; return);
QTC_ASSERT(it->state == BreakpointNew, qDebug() << "STATE: " << it->state <<id);
QTC_ASSERT(!it->engine, qDebug() << "NO ENGINE" << id; return);
it->engine = value;
it->state = BreakpointInsertRequested;
it->response = BreakpointResponse();
......
......@@ -54,7 +54,7 @@ namespace Internal {
class BreakpointMarker;
class BreakHandler : public QAbstractTableModel
class BreakHandler : public QAbstractItemModel
{
Q_OBJECT
......@@ -167,6 +167,8 @@ private:
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
Qt::ItemFlags flags(const QModelIndex &index) const;
QModelIndex index(int row, int col, const QModelIndex &parent) const;
QModelIndex parent(const QModelIndex &parent) const;
bool isEngineRunning(BreakpointId id) const;
void setState(BreakpointId id, BreakpointState state);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment