23#ifndef BOOKMARKMODEL_H
24#define BOOKMARKMODEL_H
26#include "../common/sharedStructures.h"
28#include <qabstractitemmodel.h>
51 bool isValid()
const {
return lineIdx != -1; }
61QDataStream &operator<<(QDataStream &out,
const BookmarkItem &obj);
62QDataStream &operator>>(QDataStream &in, BookmarkItem &obj);
71 RoleFilename = Qt::UserRole + 1,
72 RoleLineIdx = Qt::UserRole + 2,
73 RoleEnabled = Qt::UserRole + 3
82 QVariant
data(
const QModelIndex &
index,
int role)
const;
83 QModelIndex
index(
int row,
int column,
const QModelIndex &
parent = QModelIndex())
const;
88 QVariant
headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const;
94 RetVal changeBookmark(
const BookmarkItem &item,
const QString &newFilename,
int newLineNo);
96 QList<BookmarkItem> getBookmarks(
const QString &filenameFilter = QString())
const;
98 QAction *bookmarkNextAction()
const {
return m_pBookmarkNext; }
99 QAction *bookmarkPreviousAction()
const {
return m_pBookmarkPrevious; }
100 QAction *bookmarkClearAllAction()
const {
return m_pBookmarkClearAll; }
103 bool bookmarkExists(
const QString &filename,
int lineno)
const;
105 void gotoBookmark(
const QModelIndex &
index);
109 QModelIndex modelIndexFromItem(
const BookmarkItem &item)
const;
110 void updateActions();
116 Qt::CaseSensitivity m_filenameCaseSensitivity;
119 QAction *m_pBookmarkNext;
120 QAction *m_pBookmarkPrevious;
121 QAction *m_pBookmarkClearAll;
130 void clearAllBookmarks();
131 void gotoNextBookmark();
132 void gotoPreviousBookmark();
model for management of all bookmarks. This model will be displayed by a viewer-widget in the main wi...
Definition bookmarkModel.h:65
int rowCount(const QModelIndex &parent=QModelIndex()) const
counts number of bookmarks in this model
Definition bookmarkModel.cpp:296
RetVal restoreState()
Restores the breakpoint model from the settings.
Definition bookmarkModel.cpp:137
RetVal deleteBookmark(const BookmarkItem &item)
delete a given bookmark
Definition bookmarkModel.cpp:200
QList< QVariant > m_alignment
Definition bookmarkModel.h:115
const BookmarkItem & itemFromModelIndex(const QModelIndex &index) const
returns BookmarkItem for given QModelIndex
Definition bookmarkModel.cpp:424
int columnCount(const QModelIndex &parent=QModelIndex()) const
counts number of columns in this model (corresponds to number of header-elements)
Definition bookmarkModel.cpp:306
void bookmarkAdded(const BookmarkItem &item)
void gotoBookmark(const BookmarkItem &item)
RetVal deleteBookmarks(const QList< BookmarkItem > &items)
delete the given bookmarks
Definition bookmarkModel.cpp:225
RetVal saveState()
Saves the breakpoint model into the settings.
Definition bookmarkModel.cpp:107
QVariant data(const QModelIndex &index, int role) const
overwritten data method of QAbstractItemModel
Definition bookmarkModel.cpp:319
QModelIndex parent(const QModelIndex &index) const
returns parent of given QModelIndex
Definition bookmarkModel.cpp:392
RetVal addBookmark(const BookmarkItem &item)
adds given bookmark to model
Definition bookmarkModel.cpp:174
RetVal deleteAllBookmarks()
delete all bookmarks
Definition bookmarkModel.cpp:252
void bookmarkDeleted(const BookmarkItem &item)
QList< QString > m_headers
Definition bookmarkModel.h:114
~BookmarkModel()
destructor
Definition bookmarkModel.cpp:94
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
returns QModelIndex for given row and column
Definition bookmarkModel.cpp:370
QList< BookmarkItem > m_bookmarks
Definition bookmarkModel.h:113
BookmarkModel()
constructor
Definition bookmarkModel.cpp:62
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
returns header element at given position
Definition bookmarkModel.cpp:405
Class for managing status values (like errors or warning)
Definition retVal.h:54
Definition apiFunctionsGraph.cpp:40
item of BookmarkModel
Definition bookmarkModel.h:43
QString filename
Definition bookmarkModel.h:47
BookmarkItem()
Definition bookmarkModel.h:45
bool enabled
Definition bookmarkModel.h:49
int lineIdx
Definition bookmarkModel.h:48