1
0
Fork 0
mirror of https://github.com/LongSoft/UEFITool.git synced 2025-05-25 12:34:54 -04:00

UEFITool 0.19.3

- new program icon made by Alexander Zhidkov
- spaces instead of tabs in source files
This commit is contained in:
Nikolaj Schlej 2014-11-18 16:01:20 +01:00
parent 39e53719d4
commit 93973d0042
11 changed files with 163 additions and 163 deletions

View file

@ -14,12 +14,12 @@
#include "guidlineedit.h"
GuidLineEdit::GuidLineEdit(QWidget * parent)
:QLineEdit(parent)
:QLineEdit(parent)
{
}
GuidLineEdit::GuidLineEdit(const QString & contents, QWidget * parent)
:QLineEdit(contents, parent)
:QLineEdit(contents, parent)
{
}
@ -29,33 +29,33 @@ GuidLineEdit::~GuidLineEdit()
void GuidLineEdit::keyPressEvent(QKeyEvent * event)
{
if (event == QKeySequence::Delete || event->key() == Qt::Key_Backspace)
{
int pos = cursorPosition();
if (event->key() == Qt::Key_Backspace && pos > 0) {
cursorBackward(false);
pos = cursorPosition();
}
QString txt = text();
QString selected = selectedText();
if (event == QKeySequence::Delete || event->key() == Qt::Key_Backspace)
{
int pos = cursorPosition();
if (event->key() == Qt::Key_Backspace && pos > 0) {
cursorBackward(false);
pos = cursorPosition();
}
QString txt = text();
QString selected = selectedText();
if (!selected.isEmpty()) {
pos = QLineEdit::selectionStart();
for (int i = pos; i < pos + selected.count(); i++)
if (txt[i] != QChar('-'))
txt[i] = QChar('.');
}
else
txt[pos] = QChar('.');
if (!selected.isEmpty()) {
pos = QLineEdit::selectionStart();
for (int i = pos; i < pos + selected.count(); i++)
if (txt[i] != QChar('-'))
txt[i] = QChar('.');
}
else
txt[pos] = QChar('.');
setCursorPosition(0);
insert(txt);
setCursorPosition(pos);
setCursorPosition(0);
insert(txt);
setCursorPosition(pos);
return;
}
return;
}
// Call original event handler
QLineEdit::keyPressEvent(event);
// Call original event handler
QLineEdit::keyPressEvent(event);
}