mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-02 19:43:55 -07:00
Add LineEditCompleter to Tab_Game
This commit is contained in:
parent
8c0722953f
commit
a64ea17357
7 changed files with 222 additions and 153 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#define TAB_ROOM_H
|
||||
|
||||
#include "tab.h"
|
||||
#include "lineeditcompleter.h"
|
||||
#include <QGroupBox>
|
||||
#include <QMap>
|
||||
#include <QLineEdit>
|
||||
|
|
@ -28,7 +29,7 @@ class GameSelector;
|
|||
class Response;
|
||||
class PendingCommand;
|
||||
class ServerInfo_User;
|
||||
class CustomLineEdit;
|
||||
class LineEditCompleter;
|
||||
|
||||
class TabRoom : public Tab {
|
||||
Q_OBJECT
|
||||
|
|
@ -43,7 +44,7 @@ private:
|
|||
UserList *userList;
|
||||
ChatView *chatView;
|
||||
QLabel *sayLabel;
|
||||
CustomLineEdit *sayEdit;
|
||||
LineEditCompleter *sayEdit;
|
||||
QGroupBox *chatGroupBox;
|
||||
|
||||
QMenu *roomMenu;
|
||||
|
|
@ -90,21 +91,4 @@ public:
|
|||
void sendRoomCommand(PendingCommand *pend);
|
||||
};
|
||||
|
||||
class CustomLineEdit : public QLineEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
QString cursorWord(const QString& line) const;
|
||||
QCompleter* c;
|
||||
private slots:
|
||||
void insertCompletion(QString);
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent * event);
|
||||
void focusOutEvent(QFocusEvent * e);
|
||||
public:
|
||||
explicit CustomLineEdit(QWidget *parent = 0);
|
||||
void setCompleter(QCompleter*);
|
||||
void updateCompleterModel(QStringList);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue