itom 1.1.0
|
model for management of all breakpoints. This model will be displayed by a viewer-widget in the main window More...
Signals | |
void | breakPointAdded (BreakPointItem bp, int row) |
void | breakPointDeleted (QString filename, int lineNo, int pyBpNumber) |
void | breakPointChanged (BreakPointItem oldBp, BreakPointItem newBp) |
Public Member Functions | |
BreakPointModel () | |
constructor | |
~BreakPointModel () | |
destructor | |
QVariant | data (const QModelIndex &index, int role) const |
overwritten data method of QAbstractItemModel | |
QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const |
returns QModelIndex for given row and column | |
QModelIndex | parent (const QModelIndex &index) const |
returns parent of given QModelIndex | |
int | rowCount (const QModelIndex &parent=QModelIndex()) const |
counts number of breakpoints in this model | |
int | columnCount (const QModelIndex &parent=QModelIndex()) const |
counts number of columns in this model (corresponds to number of header-elements) | |
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
returns header element at given position | |
RetVal | addBreakPoint (BreakPointItem bp) |
adds given breakpoint to model | |
RetVal | deleteBreakPoint (QModelIndex index) |
delete breakpoint given by its QModelIndex | |
RetVal | deleteBreakPoints (QModelIndexList indizes) |
delete multiple breakpoints given by a list of QModelIndex | |
QModelIndex | getFirstBreakPointIndex (const QString filename, int lineNo) const |
returns QModelIndex for first breakpoint which is found in given filename and at given line number. | |
QModelIndexList | getBreakPointIndizes (const QString filename, int lineNo) const |
returns a list of QModelIndex for all breakpoints, which are registered in given file and at given line number. | |
QModelIndexList | getBreakPointIndizes (const QString filename) const |
returns QModelIndexList with all breakpoints being in one given file | |
BreakPointItem | getBreakPoint (const QString filename, int lineNo) const |
returns BreakPointItem for breakpoint being in given file and at given line number | |
BreakPointItem | getBreakPoint (const QModelIndex index) const |
returns BreakPointItem for given QModelIndex | |
QList< BreakPointItem > | getBreakPoints (const QModelIndexList indizes) const |
returns list of BreakPointItem corresponding to given list of model indices | |
RetVal | changeBreakPoint (const QModelIndex index, BreakPointItem bp, bool emitBreakPointChanged=true) |
changes breakpoint, given by its QModelIndex to values, determined by BreakPointItem | |
RetVal | changeBreakPoints (const QModelIndexList indizes, QList< BreakPointItem > bps, bool emitBreakPointChanged=true) |
change multiple breakpoints to data, given by list of BreakPointItem | |
QList< BreakPointItem > const | getBreakpoints () |
RetVal | resetAllPyBpNumbers () |
resets all python breakpoint numbers to -1. | |
RetVal | setPyBpNumber (int row, int pyBpNumber) |
set python breakpoint number of breakpoint at given row in the model | |
Static Private Member Functions | |
static bool | compareRow (QModelIndex a, QModelIndex b) |
helper-method for sorting different breakpoints with respect to row-index of both given QModelIndex | |
Private Attributes | |
QList< BreakPointItem > | m_breakpoints |
QList< QString > | m_headers |
QList< QVariant > | m_alignment |
model for management of all breakpoints. This model will be displayed by a viewer-widget in the main window
BreakPointModel::BreakPointModel | ( | ) |
constructor
initializes headers and its alignment
RetVal BreakPointModel::addBreakPoint | ( | BreakPointItem | bp | ) |
adds given breakpoint to model
if added, the signal breakPointAdded is emitted.
[in] | bp | Breakpoint of type BreakPointItem |
void BreakPointModel::breakPointAdded | ( | BreakPointItem | bp, |
int | row | ||
) | [signal] |
emitted if breakpoint has been added to model at position row
void BreakPointModel::breakPointChanged | ( | BreakPointItem | oldBp, |
BreakPointItem | newBp | ||
) | [signal] |
emitted if breakpoint oldBp has been changed to newBp
void BreakPointModel::breakPointDeleted | ( | QString | filename, |
int | lineNo, | ||
int | pyBpNumber | ||
) | [signal] |
emitted if breakpoint in file filename at line lineNo with python internal debugger number has been deleted from model
RetVal BreakPointModel::changeBreakPoint | ( | const QModelIndex | index, |
BreakPointItem | bp, | ||
bool | emitBreakPointChanged = true |
||
) |
changes breakpoint, given by its QModelIndex to values, determined by BreakPointItem
if indicated, emits signal emitBreakPointChanged with old and new BreakPointItem
index | QModelIndex of item, which should be changed |
bp | BreakPointItem with new values for this breakpoint |
emitBreakPointChanged | if signal should be emitted, this value must be true, else false |
< should be false, if filename or line-nr of editor has changed.
RetVal BreakPointModel::changeBreakPoints | ( | const QModelIndexList | indizes, |
QList< BreakPointItem > | bps, | ||
bool | emitBreakPointChanged = true |
||
) |
change multiple breakpoints to data, given by list of BreakPointItem
indizes | list of model indices |
bps | list of BreakPointItem |
emitBreakPointChanged | true if the breakPointChanged signal should be emitted after having changed the property of one single breakpoint |
int BreakPointModel::columnCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const |
counts number of columns in this model (corresponds to number of header-elements)
QVariant BreakPointModel::data | ( | const QModelIndex & | index, |
int | role | ||
) | const |
overwritten data method of QAbstractItemModel
data method will be called by View-Widget in order to fill the table.
index | QModelIndex of item, whose content should be returned |
RetVal BreakPointModel::deleteBreakPoint | ( | QModelIndex | index | ) |
delete breakpoint given by its QModelIndex
emits breakPointDeleted if deletion has been successfull.
index | QModelIndex of breakpoint which should be deleted |
RetVal BreakPointModel::deleteBreakPoints | ( | QModelIndexList | indizes | ) |
delete multiple breakpoints given by a list of QModelIndex
calls deleteBreakPoint method for each element of QModelIndexList
indizes | list of QModelIndex |
BreakPointItem BreakPointModel::getBreakPoint | ( | const QString | filename, |
int | lineNo | ||
) | const |
returns BreakPointItem for breakpoint being in given file and at given line number
filename | Filename of python macro file |
lineNo | line number in given filename |
BreakPointItem BreakPointModel::getBreakPoint | ( | const QModelIndex | index | ) | const |
returns BreakPointItem for given QModelIndex
index | given QModelIndex |
QModelIndexList BreakPointModel::getBreakPointIndizes | ( | const QString | filename, |
int | lineNo | ||
) | const |
returns a list of QModelIndex for all breakpoints, which are registered in given file and at given line number.
filename | Filename of python macro |
lineNo | line, where breakpoint is expected |
QModelIndexList BreakPointModel::getBreakPointIndizes | ( | const QString | filename | ) | const |
returns QModelIndexList with all breakpoints being in one given file
filename | Filename of python macro file |
QList< BreakPointItem > BreakPointModel::getBreakPoints | ( | const QModelIndexList | indizes | ) | const |
returns list of BreakPointItem corresponding to given list of model indices
indizes | list of model indices |
QModelIndex BreakPointModel::getFirstBreakPointIndex | ( | const QString | filename, |
int | lineNo | ||
) | const |
returns QModelIndex for first breakpoint which is found in given filename and at given line number.
filename | Filename of Python macro file |
lineNo | line, where breakpoint is expected |
QVariant BreakPointModel::headerData | ( | int | section, |
Qt::Orientation | orientation, | ||
int | role = Qt::DisplayRole |
||
) | const |
returns header element at given position
section | position in m_headers list |
orientation | the model's orientation should be horizontal, no other orientation is supported |
role | model is only prepared for DisplayRole |
QModelIndex BreakPointModel::index | ( | int | row, |
int | column, | ||
const QModelIndex & | parent = QModelIndex() |
||
) | const |
returns QModelIndex for given row and column
row | row of desired entry, corresponds to index in m_breakpoints list |
column | column of desired entry |
parent | since this model is no tree model, parent always points to a "virtual" root element |
QModelIndex BreakPointModel::parent | ( | const QModelIndex & | index | ) | const |
returns parent of given QModelIndex
since this model is not a tree model, returns always an empty QModelIndex
RetVal BreakPointModel::resetAllPyBpNumbers | ( | ) |
resets all python breakpoint numbers to -1.
every breakpoint only gets a valid python breakpoint number, if python is in debugging mode. This method is called, if python leaves the debugging mode.
int BreakPointModel::rowCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const |
counts number of breakpoints in this model
RetVal BreakPointModel::setPyBpNumber | ( | int | row, |
int | pyBpNumber | ||
) |
set python breakpoint number of breakpoint at given row in the model
If starting debugging a python macro, the whole breakpoint list is submitted to the python debugger, which assigns a python debugging number for each breakpoint. This method calls the changeBreakPoint method.
row | row of breakpoint in model |
pyBpNumber | python breakpoint number for this breakpoint |
QList<QVariant> BreakPointModel::m_alignment [private] |
list of alignments for the corresponding headers
QList<BreakPointItem> BreakPointModel::m_breakpoints [private] |
list of breakpoints (BreakPointItem) which are currently available in this application
QList<QString> BreakPointModel::m_headers [private] |
string list of names of column headers