GUI: fixed a very annoying bug on some systems with the '^' character being inserted after the '6' without shift pressed
This commit is contained in:
parent
4a8a44764e
commit
2cb45f1d7a
|
|
@ -1,4 +1,5 @@
|
|||
#include "HistoryLineEdit.h"
|
||||
#include "Bridge.h"
|
||||
|
||||
HistoryLineEdit::HistoryLineEdit(QWidget *parent) : QLineEdit(parent)
|
||||
{
|
||||
|
|
@ -20,6 +21,19 @@ void HistoryLineEdit::keyPressEvent(QKeyEvent* event)
|
|||
{
|
||||
int wKey = event->key();
|
||||
|
||||
//This fixes a very annoying bug on some systems
|
||||
if(bSixPressed)
|
||||
{
|
||||
bSixPressed=false;
|
||||
if(event->text()=="^")
|
||||
{
|
||||
event->ignore();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(wKey == Qt::Key_6)
|
||||
bSixPressed=true;
|
||||
|
||||
if(wKey == Qt::Key_Up || wKey == Qt::Key_Down)
|
||||
{
|
||||
if(wKey == Qt::Key_Up)
|
||||
|
|
|
|||
|
|
@ -17,12 +17,10 @@ public:
|
|||
signals:
|
||||
void keyPressed(int parKey);
|
||||
|
||||
public slots:
|
||||
|
||||
|
||||
private:
|
||||
QList<QString> mCmdHistory;
|
||||
int mCmdIndex;
|
||||
bool bSixPressed;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue