Skip to content

Commit

Permalink
fix crash because pdf dockwidget interfere
Browse files Browse the repository at this point in the history
  • Loading branch information
sunderme committed May 19, 2024
1 parent cca84fd commit 6cd1dc8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/texstudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1364,9 +1364,13 @@ void Texstudio::setupMenus()
int i=0;
foreach (QDockWidget* dockWidget, dockWidgets) {
if (dockWidget->toggleViewAction()) {
QLabel *lbl=qobject_cast<QLabel*>(dockWidget->titleBarWidget());
if(lbl == nullptr){
// dockwidget is not from sidepanel but pdf viewer
continue;
}
auto *act=newManagedAction(submenu, QString("dockview_%1").arg(i),dockWidget->objectName(),SLOT(toggleDockVisibility()));
act->setData(dockWidget->objectName());
QLabel *lbl=qobject_cast<QLabel*>(dockWidget->titleBarWidget());
act->setText(lbl->text());
act->setCheckable(true);
bool hide=hiddenDocks.contains(dockWidget->objectName());
Expand Down

0 comments on commit 6cd1dc8

Please sign in to comment.