mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-24 00:31:32 -04:00
added completer to MimeTextEdit and ChatWidget (Patch from Phenom)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6475 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
33f4e5b779
commit
90e7a3cd54
4 changed files with 218 additions and 2 deletions
|
@ -23,6 +23,7 @@
|
|||
#define MIMETEXTEDIT_H
|
||||
|
||||
#include <QTextEdit>
|
||||
#include <QCompleter>
|
||||
|
||||
class MimeTextEdit : public QTextEdit
|
||||
{
|
||||
|
@ -31,9 +32,33 @@ class MimeTextEdit : public QTextEdit
|
|||
public:
|
||||
MimeTextEdit(QWidget *parent = 0);
|
||||
|
||||
//Form here: http://qt-project.org/doc/qt-4.8/tools-customcompleter.html
|
||||
void setCompleter(QCompleter *completer);
|
||||
QCompleter *completer() const;
|
||||
void setCompleterKeyModifiers(Qt::KeyboardModifier modifiers);
|
||||
Qt::KeyboardModifier getCompleterKeyModifiers() const;
|
||||
void setCompleterKey(Qt::Key key);
|
||||
Qt::Key getCompleterKey() const;
|
||||
void forceCompleterShowNextKeyEvent(QString startString);
|
||||
|
||||
protected:
|
||||
virtual bool canInsertFromMimeData(const QMimeData* source) const;
|
||||
virtual void insertFromMimeData(const QMimeData* source);
|
||||
void keyPressEvent(QKeyEvent *e);
|
||||
void focusInEvent(QFocusEvent *e);
|
||||
|
||||
private slots:
|
||||
void insertCompletion(const QString &completion);
|
||||
|
||||
private:
|
||||
QString textUnderCursor() const;
|
||||
|
||||
private:
|
||||
QCompleter *mCompleter;
|
||||
Qt::KeyboardModifier mCompleterKeyModifiers;
|
||||
Qt::Key mCompleterKey;
|
||||
bool mForceCompleterShowNextKeyEvent;
|
||||
QString mCompleterStartString;
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue