本文整理汇总了C++中ViewContainer::activeView方法的典型用法代码示例。如果您正苦于以下问题:C++ ViewContainer::activeView方法的具体用法?C++ ViewContainer::activeView怎么用?C++ ViewContainer::activeView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewContainer
的用法示例。
在下文中一共展示了ViewContainer::activeView方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: detachActiveView
void ViewManager::detachActiveView()
{
// find the currently active view and remove it from its container
ViewContainer* container = _viewSplitter->activeContainer();
detachView(container, container->activeView());
}
示例2: detachActiveView
void ViewManager::detachActiveView()
{
// find the currently active view and remove it from its container
ViewContainer* container = _viewSplitter->activeContainer();
TerminalDisplay* activeView = dynamic_cast<TerminalDisplay*>(container->activeView());
if (!activeView)
return;
emit viewDetached(_sessionMap[activeView]);
_sessionMap.remove(activeView);
// remove the view from this window
container->removeView(activeView);
activeView->deleteLater();
// if the container from which the view was removed is now empty then it can be deleted,
// unless it is the only container in the window, in which case it is left empty
// so that there is always an active container
if ( _viewSplitter->containers().count() > 1 &&
container->views().count() == 0 )
{
removeContainer(container);
}
}
示例3: activeView
QWidget* ViewManager::activeView() const
{
ViewContainer* container = _viewSplitter->activeContainer();
if (container) {
return container->activeView();
} else {
return 0;
}
}
示例4: focusActiveView
void ViewManager::focusActiveView()
{
// give the active view in a container the focus. this ensures
// that controller associated with that view is activated and the session-specific
// menu items are replaced with the ones for the newly focused view
// see the viewFocused() method
ViewContainer* container = _viewSplitter->activeContainer();
if (container) {
QWidget* activeView = container->activeView();
if (activeView) {
activeView->setFocus(Qt::MouseFocusReason);
}
}
}
示例5: slotViewFocused
void DocManager::slotViewFocused( View *view )
{
ViewContainer * vc = static_cast<ViewContainer*>(KTechlab::self()->tabWidget()->currentWidget());
if (!vc)
view = 0l;
if (!view)
return;
// This function can get called with a view that is not in the current view
// container (such as when the user right clicks and then the popup is
// destroyed - not too sure why, but this is the easiest way to fix it).
if ( view->viewContainer() != vc )
view = vc->activeView();
if ( !view || (View*)p_focusedView == view )
return;
if (p_focusedView)
slotViewUnfocused();
p_focusedView = view;
if ( TextView * textView = dynamic_cast<TextView*>((View*)p_focusedView) )
KTechlab::self()->factory()->addClient( textView->kateView() );
else
KTechlab::self()->factory()->addClient( p_focusedView );
Document *document = view->document();
connect( document, SIGNAL(undoRedoStateChanged()), KTechlab::self(), SLOT(slotDocUndoRedoChanged()) );
p_connectedDocument = document;
if ( document->type() == Document::dt_circuit ||
document->type() == Document::dt_flowcode ||
document->type() == Document::dt_mechanics )
{
ItemDocument *cvb = static_cast<ItemDocument*>(view->document());
ItemInterface::self()->slotItemDocumentChanged(cvb);
}
KTechlab::self()->slotDocUndoRedoChanged();
KTechlab::self()->slotDocModifiedChanged();
KTechlab::self()->requestUpdateCaptions();
}
示例6: 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);
}