model for management of all bookmarks. This model will be displayed by a viewer-widget in the main window
More...
|
enum | BookmarkRole { RoleFilename = Qt::UserRole + 1
, RoleLineIdx = Qt::UserRole + 2
, RoleEnabled = Qt::UserRole + 3
} |
|
|
void | clearAllBookmarks () |
|
void | gotoNextBookmark () |
|
void | gotoPreviousBookmark () |
|
|
| BookmarkModel () |
| constructor
|
|
| ~BookmarkModel () |
| 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 bookmarks 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 | addBookmark (const BookmarkItem &item) |
| adds given bookmark to model
|
|
RetVal | deleteBookmark (const BookmarkItem &item) |
| delete a given bookmark
|
|
RetVal | deleteBookmarks (const QList< BookmarkItem > &items) |
| delete the given bookmarks
|
|
RetVal | deleteAllBookmarks () |
| delete all bookmarks
|
|
RetVal | changeBookmark (const BookmarkItem &item, const QString &newFilename, int newLineNo) |
|
QList< BookmarkItem > | getBookmarks (const QString &filenameFilter=QString()) const |
|
QAction * | bookmarkNextAction () const |
|
QAction * | bookmarkPreviousAction () const |
|
QAction * | bookmarkClearAllAction () const |
|
bool | bookmarkExists (const BookmarkItem &item) const |
|
bool | bookmarkExists (const QString &filename, int lineno) const |
|
void | gotoBookmark (const QModelIndex &index) |
|
|
QList< BookmarkItem > | m_bookmarks |
|
QList< QString > | m_headers |
|
QList< QVariant > | m_alignment |
|
Qt::CaseSensitivity | m_filenameCaseSensitivity |
|
int | m_currentIndex |
|
QAction * | m_pBookmarkNext |
|
QAction * | m_pBookmarkPrevious |
|
QAction * | m_pBookmarkClearAll |
|
BookmarkItem | m_invalidBookmarkItem |
|
model for management of all bookmarks. This model will be displayed by a viewer-widget in the main window
◆ BookmarkModel()
ito::BookmarkModel::BookmarkModel |
( |
| ) |
|
constructor
initializes headers and its alignment
◆ addBookmark()
adds given bookmark to model
if added, the signal bookmarkAdded is emitted.
- Parameters
-
- Returns
- retOk if this item could be appended, retError if it already exists.
◆ bookmarkAdded
void ito::BookmarkModel::bookmarkAdded |
( |
const BookmarkItem & | item | ) |
|
|
signal |
emitted if bookmark has been added to model at position row
◆ bookmarkDeleted
void ito::BookmarkModel::bookmarkDeleted |
( |
const BookmarkItem & | item | ) |
|
|
signal |
emitted if bookmark has been deleted
◆ columnCount()
int ito::BookmarkModel::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::BookmarkModel::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
-
index | QModelIndex of item, whose content should be returned |
- Returns
- content of desired item and column
◆ deleteAllBookmarks()
RetVal ito::BookmarkModel::deleteAllBookmarks |
( |
| ) |
|
delete all bookmarks
- Parameters
-
indizes | list of QModelIndex |
- Returns
- retOk
- See also
- deleteBookmark
◆ deleteBookmark()
delete a given bookmark
emits bookmarkDeleted if deletion has been successful.
- Parameters
-
index | QModelIndex of bookmark which should be deleted |
- Returns
- retOk in case of success, if QModelIndex not valid retError
◆ deleteBookmarks()
delete the given bookmarks
emits bookmarkDeleted if deletion has been successful.
- Parameters
-
index | QModelIndex of bookmark which should be deleted |
- Returns
- retOk in case of success, if QModelIndex not valid retError
◆ gotoBookmark
void ito::BookmarkModel::gotoBookmark |
( |
const BookmarkItem & | item | ) |
|
|
signal |
emitted if the cursor should jump to a certain bookmark
◆ headerData()
QVariant ito::BookmarkModel::headerData |
( |
int | section, |
|
|
Qt::Orientation | orientation, |
|
|
int | role = Qt::DisplayRole ) const |
returns header element at given position
- Parameters
-
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 |
- Returns
- name of header or empty QVariant value (if no header element available)
◆ index()
QModelIndex ito::BookmarkModel::index |
( |
int | row, |
|
|
int | column, |
|
|
const QModelIndex & | parent = QModelIndex() ) const |
returns QModelIndex for given row and column
- Parameters
-
row | row of desired entry, corresponds to index in m_bookmarks list |
column | column of desired entry |
parent | since 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
◆ itemFromModelIndex()
const BookmarkItem & ito::BookmarkModel::itemFromModelIndex |
( |
const QModelIndex & | index | ) |
const |
|
protected |
◆ parent()
QModelIndex ito::BookmarkModel::parent |
( |
const QModelIndex & | index | ) |
const |
returns parent of given QModelIndex
since this model is not a tree model, returns always an empty QModelIndex
◆ rowCount()
int ito::BookmarkModel::rowCount |
( |
const QModelIndex & | parent = QModelIndex() | ) |
const |
counts number of bookmarks in this model
- Returns
- number of elements
◆ m_alignment
QList<QVariant> ito::BookmarkModel::m_alignment |
|
private |
list of alignments for the corresponding headers
◆ m_bookmarks
list of bookmarks (BookmarkItem) which are currently available in this application
◆ m_headers
QList<QString> ito::BookmarkModel::m_headers |
|
private |
string list of names of column headers
The documentation for this class was generated from the following files:
- C:/Workspace/itom_development_VS2019_Qt5.15.2_x64/itomProject/itom/Qitom/models/bookmarkModel.h
- C:/Workspace/itom_development_VS2019_Qt5.15.2_x64/itomProject/itom/Qitom/models/bookmarkModel.cpp