Skip to content

Commit

Permalink
fix hidden window property browser crash issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Arun authored and Arun committed Apr 17, 2024
1 parent 78859ad commit 4ae519e
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 3 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file added 3rdparty/.DS_Store
Binary file not shown.
Binary file modified alphaplot/.DS_Store
Binary file not shown.
Binary file added alphaplot/src/.DS_Store
Binary file not shown.
8 changes: 6 additions & 2 deletions alphaplot/src/ApplicationWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5557,6 +5557,9 @@ void ApplicationWindow::hideActiveWindow() {
void ApplicationWindow::hideWindow(MyWidget *w) {
hiddenWindows.append(w);
w->setHidden();
propertybrowser->populateObjectBrowser(nullptr);
customMenu(nullptr);
customToolBars(nullptr);
emit modified();
}

Expand All @@ -5573,7 +5576,7 @@ void ApplicationWindow::activateWindow() {
raise();
show();
WindowTableWidgetItem *it =
static_cast<WindowTableWidgetItem *>(ui_->listView->currentItem());
dynamic_cast<WindowTableWidgetItem *>(ui_->listView->currentItem());
if (it) activateWindow(it->window());
}

Expand Down Expand Up @@ -5638,6 +5641,7 @@ void ApplicationWindow::removeWindowFromLists(MyWidget *widgrt) {
QString caption = widgrt->name();
if (isActiveSubwindow(SubWindowType::TableSubWindow)) {
Table *table = qobject_cast<Table *>(widgrt);
if(!table) return;
for (int i = 0; i < table->numCols(); i++) {
QString name = table->colName(i);
removeCurves(table, name);
Expand Down Expand Up @@ -5681,9 +5685,9 @@ void ApplicationWindow::closeWindow(MyWidget *window) {
if (subwindowlist.isEmpty()) {
customMenu(nullptr);
customToolBars(nullptr);
propertybrowser->populateObjectBrowser(nullptr);
}

propertybrowser->populateObjectBrowser(nullptr);
emit modified();
}

Expand Down
2 changes: 1 addition & 1 deletion alphaplot/src/core/propertybrowser/propertybrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void PropertyBrowser::populateObjectBrowser(MyWidget *widget) {
} else if (qobject_cast<Layout2D *>(widget)) {
Layout2D *gd = qobject_cast<Layout2D *>(widget);
objectItemModel_->buildUpGraph2D(gd);
connect(gd, &Layout2D::addedOrRemoved, this, [=]() {
connect(gd, &Layout2D::addedOrRemoved, this, [&]() {
MyWidget *active =
qobject_cast<MyWidget *>(app_->d_workspace->activeSubWindow());
if (active == widget) {
Expand Down
Binary file added build/.DS_Store
Binary file not shown.
Binary file added data/.DS_Store
Binary file not shown.
Binary file added fitPlugins/.DS_Store
Binary file not shown.

0 comments on commit 4ae519e

Please sign in to comment.