change: change code style to Linux style except indent.
This commit is contained in:
@@ -22,34 +22,34 @@
|
||||
|
||||
#include <QKeyEvent>
|
||||
|
||||
namespace olive {
|
||||
|
||||
FocusableLineEdit::FocusableLineEdit(QWidget *parent) :
|
||||
QLineEdit(parent)
|
||||
namespace olive
|
||||
{
|
||||
|
||||
FocusableLineEdit::FocusableLineEdit(QWidget *parent)
|
||||
: QLineEdit(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void FocusableLineEdit::keyPressEvent(QKeyEvent *e)
|
||||
{
|
||||
switch (e->key()) {
|
||||
case Qt::Key_Return:
|
||||
case Qt::Key_Enter:
|
||||
emit Confirmed();
|
||||
break;
|
||||
case Qt::Key_Escape:
|
||||
emit Cancelled();
|
||||
break;
|
||||
default:
|
||||
QLineEdit::keyPressEvent(e);
|
||||
}
|
||||
switch (e->key()) {
|
||||
case Qt::Key_Return:
|
||||
case Qt::Key_Enter:
|
||||
emit Confirmed();
|
||||
break;
|
||||
case Qt::Key_Escape:
|
||||
emit Cancelled();
|
||||
break;
|
||||
default:
|
||||
QLineEdit::keyPressEvent(e);
|
||||
}
|
||||
}
|
||||
|
||||
void FocusableLineEdit::focusOutEvent(QFocusEvent *e)
|
||||
{
|
||||
QLineEdit::focusOutEvent(e);
|
||||
QLineEdit::focusOutEvent(e);
|
||||
|
||||
emit Confirmed();
|
||||
emit Confirmed();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,25 +25,23 @@
|
||||
|
||||
#include "common/define.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
class FocusableLineEdit : public QLineEdit
|
||||
namespace olive
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
class FocusableLineEdit : public QLineEdit {
|
||||
Q_OBJECT
|
||||
public:
|
||||
FocusableLineEdit(QWidget* parent = nullptr);
|
||||
FocusableLineEdit(QWidget *parent = nullptr);
|
||||
|
||||
signals:
|
||||
void Confirmed();
|
||||
void Confirmed();
|
||||
|
||||
void Cancelled();
|
||||
void Cancelled();
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *) override;
|
||||
|
||||
void focusOutEvent(QFocusEvent *) override;
|
||||
|
||||
void keyPressEvent(QKeyEvent *) override;
|
||||
|
||||
void focusOutEvent(QFocusEvent *) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user