本文整理汇总了C++中ViewContainer::addView方法的典型用法代码示例。如果您正苦于以下问题:C++ ViewContainer::addView方法的具体用法?C++ ViewContainer::addView怎么用?C++ ViewContainer::addView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewContainer
的用法示例。
在下文中一共展示了ViewContainer::addView方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: splitView
void ViewManager::splitView(Qt::Orientation orientation)
{
// iterate over each session which has a view in the current active
// container and create a new view for that session in a new container
QListIterator<QWidget*> existingViewIter(_viewSplitter->activeContainer()->views());
ViewContainer* container = 0;
while (existingViewIter.hasNext()) {
Session* session = _sessionMap[(TerminalDisplay*)existingViewIter.next()];
TerminalDisplay* display = createTerminalDisplay(session);
const Profile::Ptr profile = SessionManager::instance()->sessionProfile(session);
applyProfileToView(display, profile);
ViewProperties* properties = createController(session, display);
_sessionMap[display] = session;
// create a container using settings from the first
// session in the previous container
if (!container) {
container = createContainer(profile);
applyProfileToContainer(container, profile);
}
container->addView(display, properties);
session->addView(display);
}
_viewSplitter->addContainer(container, orientation);
emit splitViewToggle(_viewSplitter->containers().count() > 0);
// focus the new container
container->containerWidget()->setFocus();
// ensure that the active view is focused after the split / unsplit
ViewContainer* activeContainer = _viewSplitter->activeContainer();
QWidget* activeView = activeContainer ? activeContainer->activeView() : 0;
if (activeView)
activeView->setFocus(Qt::OtherFocusReason);
}