-
Notifications
You must be signed in to change notification settings - Fork 2
/
wordlist.h
44 lines (37 loc) · 968 Bytes
/
wordlist.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
39
40
41
42
43
44
/*
* Author: Huayin Zhou
* Description: WordList is a customized QListWidget to keep track of the text
* changes in QLineEdit and print strings to the changes accordingly by
* calling pa3 function:
* vector<std::string> autocomplete(unsigned int num_words, std::string prefix).
* Date: 01/28/2015
*/
#ifndef WORDLIST_H
#define WORDLIST_H
#include <QListWidget>
#include <QString>
#include <QLineEdit>
#include <string>
#include "mainwindow.h"
#include "../DictionaryTrie.hpp"
#include "../util.hpp"
#define MAX_DISPLAY 10
#define MAX_POSTFIX_TO_SEARCH 5
class MainWindow;
class WordList : public QListWidget
{
Q_OBJECT
public:
WordList(QWidget *parent = 0);
void selectNext();
void selectPrev();
~WordList();
public slots:
void setItems(const QString &newString);
void clearItems();
void mouseClickClearItems(QListWidgetItem * item);
private:
MainWindow *mainWindow;
DictionaryTrie * trie;
};
#endif // WORDLIST_H