FastTrack 6.1.0
Tracks multiples objects dealing with occlusion and identities.
Loading...
Searching...
No Matches
annotation.h
1#ifndef ANNOTATION_H
2#define ANNOTATION_H
3
4#include <QDebug>
5#include <QDir>
6#include <QFile>
7#include <QHash>
8#include <QHashIterator>
9#include <QMessageBox>
10#include <QString>
11#include <QTextStream>
12#include <QUndoCommand>
13#include <QWidget>
14
15class Annotation : public QWidget {
16 Q_OBJECT
17
18 private:
19 QFile *annotationFile;
20 QHash<int, QString> *annotations;
21 void writeToFile();
22 QList<int> findIndexes;
23 qsizetype findIndex;
24
25 public slots:
26 void clear();
27 void write(int index, const QString &text);
28 void read(int index);
29 void find(const QString &expression);
30 int next();
31 int prev();
32
33 signals:
38 void annotationText(const QString &text);
39
40 public:
41 explicit Annotation(QWidget *parent = nullptr);
42 Annotation(const QString &annotationFile);
43 Annotation(const Annotation &T) = delete;
44 Annotation &operator=(const Annotation &T) = delete;
45 Annotation &operator=(Annotation &&T) = delete;
46 Annotation(Annotation &&T) = delete;
48 bool setPath(const QString &annotationFile);
49 bool isActive;
50};
51
52#endif
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