itom  1.0.13
BreakPointModel Class Reference

model for management of all breakpoints. This model will be displayed by a viewer-widget in the main window More...

List of all members.

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< BreakPointItemgetBreakPoints (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< BreakPointItemm_breakpoints
QList< QString > m_headers
QList< QVariant > m_alignment

Detailed Description

model for management of all breakpoints. This model will be displayed by a viewer-widget in the main window


Constructor & Destructor Documentation

BreakPointModel::BreakPointModel ( )

constructor

initializes headers and its alignment


Member Function Documentation

RetVal BreakPointModel::addBreakPoint ( BreakPointItem  bp)

adds given breakpoint to model

if added, the signal breakPointAdded is emitted.

Parameters:
[in]bpBreakpoint of type BreakPointItem
Returns:
retOk
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

Parameters:
indexQModelIndex of item, which should be changed
bpBreakPointItem with new values for this breakpoint
emitBreakPointChangedif signal should be emitted, this value must be true, else false
Returns:
retOk, if index has been valid, retError, else.

< 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

Parameters:
indizeslist of model indices
bpslist of BreakPointItem
emitBreakPointChangedtrue if the breakPointChanged signal should be emitted after having changed the property of one single breakpoint
Returns:
retOk, if everything was ok, else retError
See also:
changeBreakPoint
int BreakPointModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const

counts number of columns in this model (corresponds to number of header-elements)

Returns:
number of columns
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.

Parameters:
indexQModelIndex of item, whose content should be returned
Returns:
content of desired item and column
RetVal BreakPointModel::deleteBreakPoint ( QModelIndex  index)

delete breakpoint given by its QModelIndex

emits breakPointDeleted if deletion has been successfull.

Parameters:
indexQModelIndex of breakpoint which should be deleted
Returns:
retOk in case of success, if QModelIndex not valid retError
RetVal BreakPointModel::deleteBreakPoints ( QModelIndexList  indizes)

delete multiple breakpoints given by a list of QModelIndex

calls deleteBreakPoint method for each element of QModelIndexList

Parameters:
indizeslist of QModelIndex
Returns:
retOk in case of total success, if any deletion returned with retError, the total return value will be retError, too.
See also:
deleteBreakPoint
BreakPointItem BreakPointModel::getBreakPoint ( const QString  filename,
int  lineNo 
) const

returns BreakPointItem for breakpoint being in given file and at given line number

Parameters:
filenameFilename of python macro file
lineNoline number in given filename
Returns:
breakpoint element represented by a BreakPointItem-struct
BreakPointItem BreakPointModel::getBreakPoint ( const QModelIndex  index) const

returns BreakPointItem for given QModelIndex

Parameters:
indexgiven QModelIndex
Returns:
element of breakpoint list or empty BreakPointItem, if index is invalid
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.

Parameters:
filenameFilename of python macro
lineNoline, where breakpoint is expected
Returns:
list of detected QModelIndex, corresponding to each found breakpoint
See also:
getFirstBreakPointIndex
QModelIndexList BreakPointModel::getBreakPointIndizes ( const QString  filename) const

returns QModelIndexList with all breakpoints being in one given file

Parameters:
filenameFilename of python macro file
Returns:
list of model indices
QList< BreakPointItem > BreakPointModel::getBreakPoints ( const QModelIndexList  indizes) const

returns list of BreakPointItem corresponding to given list of model indices

Parameters:
indizeslist of model indices
Returns:
list of BreakPointItem
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.

Parameters:
filenameFilename of Python macro file
lineNoline, where breakpoint is expected
Returns:
valid QModelIndex, if breakpoint could be found, else returns empty QModelIndex
QVariant BreakPointModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const

returns header element at given position

Parameters:
sectionposition in m_headers list
orientationthe model's orientation should be horizontal, no other orientation is supported
rolemodel is only prepared for DisplayRole
Returns:
name of header or empty QVariant value (if no header element available)
QModelIndex BreakPointModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const

returns QModelIndex for given row and column

Parameters:
rowrow of desired entry, corresponds to index in m_breakpoints list
columncolumn of desired entry
parentsince this model is no tree model, parent always points to a "virtual" root element
Returns:
empty QModelIndex if row or column are out of bound, else returns new valid QModelIndex for that combination of row and column
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.

Returns:
retOk
int BreakPointModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const

counts number of breakpoints in this model

Returns:
number of elements
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.

Parameters:
rowrow of breakpoint in model
pyBpNumberpython breakpoint number for this breakpoint
Returns:
result of changeBreakPoint method
See also:
changeBreakPoint

Member Data Documentation

QList<QVariant> BreakPointModel::m_alignment [private]

list of alignments for the corresponding headers

list of breakpoints (BreakPointItem) which are currently available in this application

QList<QString> BreakPointModel::m_headers [private]

string list of names of column headers


The documentation for this class was generated from the following files: