- fix: When debugging project, the executing source file is not auto switched to. (#476)

This commit is contained in:
Roy Qu 2024-09-29 20:39:57 +08:00
parent b9f36558ba
commit 785614607c
4 changed files with 7 additions and 3 deletions

View File

@ -9,6 +9,8 @@ Red Panda C++ Version 3.2
- fix: Crash in windows 7. (by CyanoHao) - fix: Crash in windows 7. (by CyanoHao)
- fix: While Control is pressed, can't start Drag&Drop by mouse. - fix: While Control is pressed, can't start Drag&Drop by mouse.
- enhancement: Auto detect gdb ACP (by CyanoHao) - enhancement: Auto detect gdb ACP (by CyanoHao)
- fix: When debugging project, the executing source file is not auto switched to. #476
Red Panda C++ Version 3.1 Red Panda C++ Version 3.1

View File

@ -608,10 +608,11 @@ void Editor::setFilename(const QString &newName)
return; return;
} }
void Editor::activate() void Editor::activate(bool focus)
{ {
if (mParentPageControl) if (mParentPageControl)
mParentPageControl->setCurrentWidget(this); mParentPageControl->setCurrentWidget(this);
if (focus)
setFocus(); setFocus();
} }

View File

@ -150,7 +150,7 @@ public:
bool save(bool force=false, bool reparse=true); bool save(bool force=false, bool reparse=true);
bool saveAs(const QString& name="", bool fromProject = false); bool saveAs(const QString& name="", bool fromProject = false);
void setFilename(const QString& newName); void setFilename(const QString& newName);
void activate(); void activate(bool focus=true);
QTabWidget* pageControl() noexcept; QTabWidget* pageControl() noexcept;
void setPageControl(QTabWidget* newPageControl); void setPageControl(QTabWidget* newPageControl);

View File

@ -1163,6 +1163,7 @@ void MainWindow::setActiveBreakpoint(QString fileName, int Line, bool setFocus)
Editor *e = openFile(fileName, false); Editor *e = openFile(fileName, false);
if (e!=nullptr) { if (e!=nullptr) {
e->setActiveBreakpointFocus(Line,setFocus); e->setActiveBreakpointFocus(Line,setFocus);
e->activate(false);
if (setFocus) { if (setFocus) {
activateWindow(); activateWindow();
} }