-
Notifications
You must be signed in to change notification settings - Fork 0
/
qpageviewer.h
38 lines (32 loc) · 898 Bytes
/
qpageviewer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef QPAGEVIEWER_H
#define QPAGEVIEWER_H
#include <QObject>
#include <QListWidget>
#include <QTextBrowser>
#include <QTextCursor>
#include <QStringList>
#include <QPoint>
#include <QVector>
class QPageViewer : public QObject
{
Q_OBJECT
public:
explicit QPageViewer(QObject *parent = 0);
void connectWithUI(QListWidget * list_widget, QTextBrowser * text_browser);
void disconnectUI();
signals:
public slots:
void viewPage(int index);
void clear();
void addPage(QString header, QString page, QVector<QPoint> highlighted = QVector<QPoint>());
void refreshHeaders(bool show_all);
private:
void highlightText(const int start_pos, const int length);
bool _show_all;
QListWidget * _list_widget;
QTextBrowser * _text_browser;
QStringList _pages;
QStringList _headers;
QVector < QVector<QPoint> > _highlighted;
};
#endif // QPAGEVIEWER_H