8#include <QHashIterator>
12#include <QUndoCommand>
19 QFile *annotationFile;
20 QHash<int, QString> *annotations;
22 QList<int> findIndexes;
27 void write(
int index,
const QString &text);
29 void find(
const QString &expression);
41 explicit Annotation(QWidget *parent =
nullptr);
48 bool setPath(
const QString &annotationFile);
void clear()
Clear the object.
Definition annotation.cpp:36
void writeToFile()
Writes all the annotation to a file.
Definition annotation.cpp:91
void write(int index, const QString &text)
Adds an annotation to the annotation QHash.
Definition annotation.cpp:110
int next()
Returns the next element of the findIndexes list of annotations that contains the expression to find.
Definition annotation.cpp:147
void find(const QString &expression)
Finds the index of all the annotation with expression inside their text.
Definition annotation.cpp:132
void read(int index)
Reads an annotation from the annotation QHash.
Definition annotation.cpp:121
void annotationText(const QString &text)
Emitted when a new annotation is read.
bool setPath(const QString &annotationFile)
Set the path for the annotation.
Definition annotation.cpp:52
int prev()
Returns the previous element of the findIndexes list of annotations that contains the expression to f...
Definition annotation.cpp:163
Annotation(QWidget *parent=nullptr)
Constructs the annotation object from a file path.
Definition annotation.cpp:85