Add ability to set user defined toggle view action (#562)

Co-authored-by: Harbinder Saggu <harbinder.saggu@safe.com>
This commit is contained in:
uggas
2023-10-18 23:07:55 -07:00
committed by GitHub
parent 55ef6ef863
commit 9ec97a8867
2 changed files with 20 additions and 0 deletions

View File

@@ -364,6 +364,20 @@ CDockWidget::~CDockWidget()
delete d;
}
//============================================================================
void CDockWidget::setToggleViewAction(QAction* action)
{
if (!action)
{
return;
}
d->ToggleViewAction->setParent(nullptr);
delete d->ToggleViewAction;
d->ToggleViewAction = action;
d->ToggleViewAction->setParent(this);
connect(d->ToggleViewAction, &QAction::triggered, this, &CDockWidget::toggleView);
}
//============================================================================
void CDockWidget::setToggleViewActionChecked(bool Checked)