itom
Loading...
Searching...
No Matches
ito::BreakPointModel Class Reference

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

Inheritance diagram for ito::BreakPointModel:

Signals

void breakPointAdded (BreakPointItem bp, int row)
 
void breakPointDeleted (QString filename, int lineIdx, int pyBpNumber)
 
void breakPointChanged (BreakPointItem oldBp, BreakPointItem newBp)
 

Public Member Functions

 BreakPointModel ()
 constructor
 
 ~BreakPointModel ()
 destructor
 
RetVal saveState ()
 Saves the breakpoint model into the settings.
 
RetVal restoreState ()
 Restores the breakpoint model from the settings.
 
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 (const QModelIndex &index)
 delete breakpoint given by its QModelIndex
 
RetVal deleteBreakPoints (const QModelIndexList &indizes)
 delete multiple breakpoints given by a list of QModelIndex
 
RetVal deleteAllBreakPoints ()
 delete all breakpoints
 
QModelIndex getFirstBreakPointIndex (const QString &filename, int lineIdx) const
 returns QModelIndex for first breakpoint which is found in given filename and at given line number.
 
QModelIndexList getBreakPointIndizes (const QString &filename, int lineIdx) 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
 
QModelIndexList getAllBreakPointIndizes ()
 returns a List of all Breakpoints, doesn't matter in which file they are.
 
BreakPointItem getBreakPoint (const QString &filename, int lineIdx) 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 ()
 
QModelIndexList getAllFileIndexes ()
 This function returns a list of all files that contain breakpoints.
 
RetVal resetAllPyBpNumbers ()
 resets all python breakpoint numbers to -1.
 
RetVal setPyBpNumber (const BreakPointItem &item, int pyBpNumber)
 set python breakpoint number of breakpoint at given row in the model
 
QSize span (const QModelIndex &index) const
 

Private Member Functions

int nrOfBreakpointsInFile (const int fileIdx) const
 This function returns the number of breakpoints in the given File.
 
QModelIndex getFilenameModelIndex (const QString &filename) const
 This function returns the QModelindex of the given File.
 
int getBreakPointIndex (const QModelIndex &index) const
 returns the index for given QModelIndex
 
int getFileIndexFromInternalPtr (const void *ptr) const
 

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
 
QStringList m_scriptFiles
 
Qt::CaseSensitivity m_filenameCaseSensitivity
 

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()

ito::BreakPointModel::BreakPointModel ( )

constructor

initializes headers and its alignment

Member Function Documentation

◆ addBreakPoint()

RetVal ito::BreakPointModel::addBreakPoint ( BreakPointItem bp)

adds given breakpoint to model

if added, the signal breakPointAdded is emitted.

Parameters
[in]bpBreakpoint of type BreakPointItem
Returns
retOk

◆ breakPointAdded

void ito::BreakPointModel::breakPointAdded ( BreakPointItem bp,
int row )
signal

< emitted if breakpoint has been added to model at position row emitted if breakpoint in file filename at line lineIdx with python internal debugger number has been deleted from model

◆ breakPointDeleted

void ito::BreakPointModel::breakPointDeleted ( QString filename,
int lineIdx,
int pyBpNumber )
signal

emitted if breakpoint oldBp has been changed to newBp

◆ changeBreakPoint()

RetVal ito::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.

◆ changeBreakPoints()

RetVal ito::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

◆ columnCount()

int ito::BreakPointModel::columnCount ( const QModelIndex & parent = QModelIndex()) const

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

Returns
number of columns

◆ data()

QVariant ito::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

◆ deleteAllBreakPoints()

RetVal ito::BreakPointModel::deleteAllBreakPoints ( )

delete all breakpoints

Parameters
indizeslist of QModelIndex
Returns
retOk
See also
deleteBreakPoint, deleteBreakPoints

◆ deleteBreakPoint()

RetVal ito::BreakPointModel::deleteBreakPoint ( const QModelIndex & index)

delete breakpoint given by its QModelIndex

emits breakPointDeleted if deletion has been successful.

Parameters
indexQModelIndex of breakpoint which should be deleted
Returns
retOk in case of success, if QModelIndex not valid retError

◆ deleteBreakPoints()

RetVal ito::BreakPointModel::deleteBreakPoints ( const 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

◆ getAllFileIndexes()

QModelIndexList ito::BreakPointModel::getAllFileIndexes ( )

This function returns a list of all files that contain breakpoints.

Returns
QModelIndexList of all files that contain breakpoints.

◆ getBreakPoint() [1/2]

BreakPointItem ito::BreakPointModel::getBreakPoint ( const QModelIndex & index) const

returns BreakPointItem for given QModelIndex

Parameters
indexgiven QModelIndex
Returns
BreakPointItem to the QModelIndex that was given

◆ getBreakPoint() [2/2]

BreakPointItem ito::BreakPointModel::getBreakPoint ( const QString & filename,
int lineIdx ) const

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

Parameters
filenameFilename of python macro file
lineIdxline number in given filename
Returns
breakpoint element represented by a BreakPointItem-struct

◆ getBreakPointIndex()

int ito::BreakPointModel::getBreakPointIndex ( const QModelIndex & index) const
private

returns the index for given QModelIndex

Parameters
indexgiven QModelIndex
Returns
index as an integer

◆ getBreakPointIndizes() [1/2]

QModelIndexList ito::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

◆ getBreakPointIndizes() [2/2]

QModelIndexList ito::BreakPointModel::getBreakPointIndizes ( const QString & filename,
int lineIdx ) 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
lineIdxline, where breakpoint is expected
Returns
list of detected QModelIndex, corresponding to each found breakpoint
See also
getFirstBreakPointIndex

◆ getBreakPoints()

QList< BreakPointItem > ito::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

◆ getFilenameModelIndex()

QModelIndex ito::BreakPointModel::getFilenameModelIndex ( const QString & filename) const
private

This function returns the QModelindex of the given File.

Returns
QModelIndex of the given file

◆ getFirstBreakPointIndex()

QModelIndex ito::BreakPointModel::getFirstBreakPointIndex ( const QString & filename,
int lineIdx ) const

returns QModelIndex for first breakpoint which is found in given filename and at given line number.

Parameters
filenameFilename of Python macro file
lineIdxline, where breakpoint is expected
Returns
valid QModelIndex, if breakpoint could be found, else returns empty QModelIndex

◆ headerData()

QVariant ito::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)

◆ index()

QModelIndex ito::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

◆ nrOfBreakpointsInFile()

int ito::BreakPointModel::nrOfBreakpointsInFile ( const int fileIdx) const
private

This function returns the number of breakpoints in the given File.

Returns
the number is returned as an integer

◆ parent()

QModelIndex ito::BreakPointModel::parent ( const QModelIndex & index) const

returns parent of given QModelIndex

since this model is not a tree model, returns always an empty QModelIndex

◆ resetAllPyBpNumbers()

RetVal ito::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

◆ rowCount()

int ito::BreakPointModel::rowCount ( const QModelIndex & parent = QModelIndex()) const

counts number of breakpoints in this model

Returns
number of elements

◆ setPyBpNumber()

RetVal ito::BreakPointModel::setPyBpNumber ( const BreakPointItem & item,
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

◆ m_alignment

QList<QVariant> ito::BreakPointModel::m_alignment
private

list of alignments for the corresponding headers

◆ m_breakpoints

QList<BreakPointItem> ito::BreakPointModel::m_breakpoints
private

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

◆ m_headers

QList<QString> ito::BreakPointModel::m_headers
private

string list of names of column headers


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