| 517 | } |
| 518 | |
| 519 | void Controller::showWidgetAtPosition(const QString &name, Position pos, bool replace) |
| 520 | { |
| 521 | if (replace) |
| 522 | d->mainWindow->hideWidget(pos); |
| 523 | |
| 524 | if (!d->allWidgets.contains(name)) { |
| 525 | qWarning() << "no widget named: " << name; |
| 526 | return; |
| 527 | } |
| 528 | |
| 529 | auto &info = d->allWidgets[name]; |
| 530 | if (!info.created) { |
| 531 | info.defaultPos = pos; |
| 532 | info.replace = replace; |
| 533 | createDockWidget(info); |
| 534 | } else if (!info.hiddenByManual || d->widgetBindToNavigation.contains(name)) { |
| 535 | d->mainWindow->showWidget(name); |
| 536 | info.hiddenByManual = false; |
| 537 | } |
| 538 | |
| 539 | if (pos != Position::Central && pos != Position::FullWindow) { |
| 540 | if (replace) { |
| 541 | for (auto name : d->currentDocks) { |
| 542 | if (d->mainWindow->positionOfDock(name) == pos) |
| 543 | d->currentDocks.removeOne(name); |
| 544 | } |
| 545 | } |
| 546 | d->currentDocks.append(name); |
| 547 | } |
| 548 | |
| 549 | checkDocksManager(); |
| 550 | } |
| 551 | |
| 552 | void Controller::resizeDocks(const QList<QString> &docks, const QList<int> &sizes, Qt::Orientation orientation) |
| 553 | { |
no test coverage detected