Commit 9b054e66 authored by Emmanuel Promayon's avatar Emmanuel Promayon

FIXED code cleanup

parent 805e952c
......@@ -499,22 +499,13 @@ void ImpMainWindow::updateViewMenu() {
// change the central viewer if there is more than one viewer in the central area
if (qobject_cast<QStackedWidget*>(centralWidget())->count() > 1) {
viewMenu->addSeparator()->setText(tr("Toggle Central Viewers"));
// for(Viewer *v : viewers) {
// int i = 0;
// // beware that getWidget(..) requires a parent and as the widget was setup inside centralWidget()
// // it was reparented to centralWidget() → use getWidget(centralWidget()) and not getWidget(this)
// // in order not to modify the central widget parenting
// while (i<qobject_cast<QStackedWidget*>(centralWidget())->count() && qobject_cast<QStackedWidget*>(centralWidget())->widget(i)!=v->getWidget(centralWidget()))
// i++;
// if (i<qobject_cast<QStackedWidget*>(centralWidget())->count()) {
// viewMenu->addAction(v->objectName());
// }
// }
// add a toggle action
// add a toggle action for each widget stacked inside the central widget
for (int i = 0; i < qobject_cast<QStackedWidget*>(centralWidget())->count(); i++) {
QWidget* cWidget = qobject_cast<QStackedWidget*>(centralWidget())->widget(i);
// get the viewer associated with the widget in the central area
// Get the viewer associated with the widget in the central area
// As there is no map from widget to viewer, we need to find the viewer that
// has the given corresponding widget.
// Beware that getWidget(..) requires a parent and as the widget was setup inside centralWidget()
// it was reparented to centralWidget() → use getWidget(centralWidget()) and not getWidget(this)
// in order not to modify the central widget parenting
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment