- fix: The Enter key in the numpad doesn't work

- fix: The compiled executable not fully write to the disk before run it
 - fix: settings object not correctly released when exit
This commit is contained in:
royqh1979@gmail.com 2021-10-09 09:09:05 +08:00
parent 785f4769cd
commit c58ddf7073
7 changed files with 14 additions and 1 deletions

View File

@ -1,5 +1,8 @@
Version 0.6.1 Version 0.6.1
- fix: editor deadlock - fix: editor deadlock
- fix: The Enter key in the numpad doesn't work
- fix: The compiled executable not fully write to the disk before run it
- fix: settings object not correctly released when exit
Version 0.6.0 Version 0.6.0
- fix: old data not displayed when editing code snippets - fix: old data not displayed when editing code snippets

View File

@ -497,6 +497,7 @@ void Editor::keyPressEvent(QKeyEvent *event)
switch (event->key()) { switch (event->key()) {
case Qt::Key_Return: case Qt::Key_Return:
case Qt::Key_Enter:
mLastIdCharPressed = 0; mLastIdCharPressed = 0;
if (mTabStopBegin>=0) { // editing user code template if (mTabStopBegin>=0) { // editing user code template
handled = true; handled = true;
@ -2352,6 +2353,7 @@ bool Editor::onCompletionKeyPressed(QKeyEvent *event)
mCompletionPopup->hide(); mCompletionPopup->hide();
return true; return true;
case Qt::Key_Return: case Qt::Key_Return:
case Qt::Key_Enter:
case Qt::Key_Tab: case Qt::Key_Tab:
completionInsert(pSettings->codeCompletion().appendFunc()); completionInsert(pSettings->codeCompletion().appendFunc());
return true; return true;
@ -2403,6 +2405,7 @@ bool Editor::onHeaderCompletionKeyPressed(QKeyEvent *event)
mHeaderCompletionPopup->hide(); mHeaderCompletionPopup->hide();
return true; return true;
case Qt::Key_Return: case Qt::Key_Return:
case Qt::Key_Enter:
case Qt::Key_Tab: case Qt::Key_Tab:
headerCompletionInsert(); headerCompletionInsert();
mHeaderCompletionPopup->hide(); mHeaderCompletionPopup->hide();

View File

@ -139,10 +139,11 @@ int main(int argc, char *argv[])
app.installNativeEventFilter(&filter); app.installNativeEventFilter(&filter);
int retCode = app.exec(); int retCode = app.exec();
QString configDir = pSettings->dirs().config(); QString configDir = pSettings->dirs().config();
delete pSettings;
// save settings // save settings
// settings->compilerSets().saveSets(); // settings->compilerSets().saveSets();
if (mainWindow.shouldRemoveAllSettings()) { if (mainWindow.shouldRemoveAllSettings()) {
settings.release();
delete pSettings;
QDir dir(configDir); QDir dir(configDir);
dir.removeRecursively(); dir.removeRecursively();
} }

View File

@ -2767,6 +2767,7 @@ void MainWindow::onCompileFinished()
//run succession task if there aren't any errors //run succession task if there aren't any errors
if (mCompileSuccessionTask && mCompilerManager->compileErrorCount()==0) { if (mCompileSuccessionTask && mCompilerManager->compileErrorCount()==0) {
QThread::msleep(500); // wait for exec file writed to disk;
switch (mCompileSuccessionTask->type) { switch (mCompileSuccessionTask->type) {
case MainWindow::CompileSuccessionTaskType::Run: case MainWindow::CompileSuccessionTaskType::Run:
runExecutable(mCompileSuccessionTask->filename); runExecutable(mCompileSuccessionTask->filename);

View File

@ -203,6 +203,8 @@ void SynEditKeyStrokes::resetDefaults()
add(SynEditorCommand::ecRedo, Qt::Key_Backspace, Qt::AltModifier|Qt::ShiftModifier); add(SynEditorCommand::ecRedo, Qt::Key_Backspace, Qt::AltModifier|Qt::ShiftModifier);
add(SynEditorCommand::ecLineBreak, Qt::Key_Return, Qt::NoModifier); add(SynEditorCommand::ecLineBreak, Qt::Key_Return, Qt::NoModifier);
add(SynEditorCommand::ecLineBreak, Qt::Key_Return, Qt::ShiftModifier); add(SynEditorCommand::ecLineBreak, Qt::Key_Return, Qt::ShiftModifier);
add(SynEditorCommand::ecLineBreak, Qt::Key_Enter, Qt::KeypadModifier);
add(SynEditorCommand::ecLineBreak, Qt::Key_Enter, Qt::KeypadModifier|Qt::ShiftModifier);
add(SynEditorCommand::ecTab, Qt::Key_Tab, Qt::NoModifier); add(SynEditorCommand::ecTab, Qt::Key_Tab, Qt::NoModifier);
add(SynEditorCommand::ecShiftTab, Qt::Key_Backtab, Qt::ShiftModifier); add(SynEditorCommand::ecShiftTab, Qt::Key_Backtab, Qt::ShiftModifier);
add(SynEditorCommand::ecShiftTab, Qt::Key_Tab, Qt::ShiftModifier); add(SynEditorCommand::ecShiftTab, Qt::Key_Tab, Qt::ShiftModifier);

View File

@ -21,6 +21,8 @@
SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent) SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent)
{ {
mLastKey = 0;
mLastKeyModifiers = Qt::NoModifier;
mModified = false; mModified = false;
mPaintLock = 0; mPaintLock = 0;
mPainterLock = 0; mPainterLock = 0;

View File

@ -554,6 +554,7 @@ void QConsole::keyPressEvent(QKeyEvent *event)
{ {
switch(event->key()) { switch(event->key()) {
case Qt::Key_Return: case Qt::Key_Return:
case Qt::Key_Enter:
event->accept(); event->accept();
if (mReadonly) if (mReadonly)
return; return;