goldendict-ng/src/ui/dictheadwords.hh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

66 lines
1.5 KiB
C++
Raw Normal View History

#ifndef __DICTHEADWORDS_H_INCLUDED__
#define __DICTHEADWORDS_H_INCLUDED__
#include <QDialog>
#include <QSet>
#include <QString>
#include <QStringList>
#include <QStringListModel>
#include <QSortFilterProxyModel>
2014-06-24 13:55:06 +00:00
#include <QAction>
#include <qprogressdialog.h>
#include "config.hh"
#include "ui_dictheadwords.h"
#include "dict/dictionary.hh"
#include "delegate.hh"
#include "headwordsmodel.hh"
class DictHeadwords: public QDialog
{
Q_OBJECT
public:
explicit DictHeadwords( QWidget * parent, Config::Class & cfg_, Dictionary::Class * dict_ );
virtual ~DictHeadwords();
2014-03-03 13:46:41 +00:00
void setup( Dictionary::Class * dict_ );
protected:
Config::Class & cfg;
Dictionary::Class * dict;
std::shared_ptr< HeadwordListModel > model;
QSortFilterProxyModel * proxy;
WordListItemDelegate * delegate;
QString dictId;
2014-06-24 13:55:06 +00:00
QAction helpAction;
void saveHeadersToFile();
bool eventFilter( QObject * obj, QEvent * ev );
private:
Ui::DictHeadwords ui;
QStringList sortedWords;
QMutex mutex;
private slots:
2014-03-03 13:46:41 +00:00
void savePos();
void filterChangedInternal();
2023-04-22 05:32:10 +00:00
QRegularExpression getFilterRegex() const;
void filterChanged();
void exportButtonClicked();
void okButtonClicked();
void itemClicked( const QModelIndex & index );
void autoApplyStateChanged( int state );
void showHeadwordsNumber();
void loadAllSortedWords( QProgressDialog & progress );
2014-03-03 13:46:41 +00:00
virtual void reject();
signals:
void headwordSelected( QString const &, QString const & );
2014-03-03 13:46:41 +00:00
void closeDialog();
};
#endif // __DICTHEADWORDS_H_INCLUDED__