| 427 | } |
| 428 | |
| 429 | void Controller::insertWidget(const QString &name, Position pos, Qt::Orientation orientation) |
| 430 | { |
| 431 | if (!d->allWidgets.contains(name)) { |
| 432 | qWarning() << "no widget named:" << name; |
| 433 | return; |
| 434 | } |
| 435 | |
| 436 | auto &info = d->allWidgets[name]; |
| 437 | if (!info.created) { |
| 438 | auto dock = d->mainWindow->addWidget(name, info.getDWidget(), pos, orientation); |
| 439 | info.dockWidget = dock; |
| 440 | info.created = true; |
| 441 | info.replace = false; |
| 442 | } else { |
| 443 | d->mainWindow->showWidget(name); |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | void Controller::hideWidget(const QString &name) |
| 448 | { |
no test coverage detected