1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
qTox/chattextedit.cpp
Tux3 / Mlkj / !Lev.uXFMLA 18cee41cfb Initial commit
2014-06-24 22:11:11 +02:00

20 lines
414 B
C++

#include "chattextedit.h"
#include <QKeyEvent>
ChatTextEdit::ChatTextEdit(QWidget *parent) :
QTextEdit(parent)
{
}
void ChatTextEdit::keyPressEvent(QKeyEvent * event)
{
int key = event->key();
if ((key == Qt::Key_Enter || key == Qt::Key_Return)
&& !(event->modifiers() && Qt::ShiftModifier))
{
emit enterPressed();
return;
}
QTextEdit::keyPressEvent(event);
}