1
0
Fork 0
This commit is contained in:
Nukem 2015-10-17 21:12:27 -04:00
parent a5c85b7710
commit c0a6040ded
2 changed files with 11 additions and 9 deletions

View File

@ -44,14 +44,16 @@ void HistoryLineEdit::keyPressEvent(QKeyEvent* event)
mCmdIndex = mCmdIndex < -1 ? -1 : mCmdIndex;
mCmdIndex = mCmdIndex > mCmdHistory.size() - 1 ? mCmdHistory.size() - 1 : mCmdIndex;
if(mCmdIndex == -1)
{
setText("");
}
else
{
setText(mCmdHistory.at(mCmdIndex));
}
// Set the new text if an existing command was available
QString newText("");
if(mCmdIndex != -1)
newText = mCmdHistory.at(mCmdIndex);
// Quote from QT docs: "Unlike textChanged(), this signal is not emitted when
// the text is changed programmatically, for example, by calling setText()."
setText(newText);
emit textEdited(newText);
}
QLineEdit::keyPressEvent(event);

View File

@ -259,7 +259,7 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWi
mCpuWidget->mDisas->setFocus();
GuiAddLogMessage(QString().sprintf("thread id (GUI thread) %X\n", GetCurrentThreadId()).toUtf8().constData());
GuiAddLogMessage(QString().sprintf("Thread id (GUI thread) %X\n", GetCurrentThreadId()).toUtf8().constData());
}
void MainWindow::closeEvent(QCloseEvent* event)