MdTab: fix bug which will open two tabs for the same file

This commit is contained in:
Le Tan 2019-06-06 20:00:11 +08:00
parent 357604a38d
commit e0ba7210f3

View File

@ -94,11 +94,13 @@ VMdTab::VMdTab(VFile *p_file, VEditArea *p_editArea,
}
});
if (p_mode == OpenFileMode::Edit) {
showFileEditMode();
} else {
showFileReadMode();
}
QTimer::singleShot(50, this, [this, p_mode]() {
if (p_mode == OpenFileMode::Edit) {
showFileEditMode();
} else {
showFileReadMode();
}
});
}
void VMdTab::setupUI()
@ -940,7 +942,7 @@ void VMdTab::focusChild()
break;
default:
Q_ASSERT(false);
this->setFocus();
break;
}
}