mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 21:20:19 +00:00
927bc5d601
This is almost a rewrite of the Search function on the WebView the old code had a few uneeded things, mostly being a subclass of QMainWindow instead of the QWebView - this makes the code use a tiny bit less ram. The SearchBox was also moved to an own class ( we can use it later to filter the contents of the DiveList for instance ) and a forced use of the pixmaps for the Mac and Windows platform was added. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
42 lines
766 B
C++
42 lines
766 B
C++
#ifndef USERMANUAL_H
|
|
#define USERMANUAL_H
|
|
|
|
#include <QWebView>
|
|
|
|
#include "ui_searchbar.h"
|
|
|
|
class SearchBar : public QWidget{
|
|
Q_OBJECT
|
|
public:
|
|
SearchBar(QWidget *parent = 0);
|
|
signals:
|
|
void searchTextChanged(const QString& s);
|
|
void searchNext();
|
|
void searchPrev();
|
|
protected:
|
|
void setVisible(bool visible);
|
|
private slots:
|
|
void enableButtons(const QString& s);
|
|
private:
|
|
Ui::SearchBar ui;
|
|
};
|
|
|
|
class UserManual : public QWebView {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit UserManual(QWidget *parent = 0);
|
|
~UserManual();
|
|
private
|
|
slots:
|
|
void searchTextChanged(const QString& s);
|
|
void searchNext();
|
|
void searchPrev();
|
|
void linkClickedSlot(QUrl url);
|
|
|
|
private:
|
|
SearchBar *searchBar;
|
|
QString mLastText;
|
|
void search(QString, QWebPage::FindFlags);
|
|
};
|
|
#endif // USERMANUAL_H
|