• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ViewContainer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ViewContainer的典型用法代码示例。如果您正苦于以下问题:C++ ViewContainer类的具体用法?C++ ViewContainer怎么用?C++ ViewContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ViewContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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());
}
开发者ID:spytheman,项目名称:konsole,代码行数:7,代码来源:ViewManager.cpp


示例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);
    }

}
开发者ID:robertknight,项目名称:konsole,代码行数:27,代码来源:ViewManager.cpp


示例3: kDebug

void ViewManager::moveActiveViewRight()
{
    kDebug() << "Moving active view to the right";
    ViewContainer* container = _viewSplitter->activeContainer();
    Q_ASSERT( container );
    container->moveActiveView( ViewContainer::MoveViewRight );
}
开发者ID:robertknight,项目名称:konsole,代码行数:7,代码来源:ViewManager.cpp


示例4: IdentityDialog

    void ServerGroupDialog::editIdentity()
    {
        QPointer<IdentityDialog> dlg = new IdentityDialog(this);
        dlg->setCurrentIdentity(m_mainWidget->m_identityCBox->currentIndex());

        if(dlg->exec() == KDialog::Accepted)
        {
            IdentityList identities = Preferences::identityList();
            m_mainWidget->m_identityCBox->clear();

            for(IdentityList::ConstIterator it = identities.constBegin(); it != identities.constEnd(); ++it)
            {
                m_mainWidget->m_identityCBox->addItem((*it)->getName());
            }

            const int i = m_mainWidget->m_identityCBox->findText(dlg->currentIdentity()->getName());
            if (i != -1)
            {
                m_mainWidget->m_identityCBox->setCurrentIndex(i);
            }
            else
            {
                m_mainWidget->m_identityCBox->setItemText(m_mainWidget->m_identityCBox->currentIndex(), dlg->currentIdentity()->getName());
            }

            m_identitiesNeedsUpdate = true; // and what's this for?
            ViewContainer* vc = Application::instance()->getMainWindow()->getViewContainer();
            vc->updateViewEncoding(vc->getFrontView());
        }
        delete dlg;
    }
开发者ID:wordlet,项目名称:mykonvi,代码行数:31,代码来源:servergroupdialog.cpp


示例5: Parameter

void
StatisticsFilter::DependSources( const Context& ioContext ) const
{
  const ParamRef& VisualizeViews = Parameter( "VisualizeViews" );
  ViewContainer visViews;
  string OutputView = Parameter( "OutputView" );
  for( size_t i = 0; i < ioContext.views->size(); ++i )
  {
    ViewSource* pView = ( *ioContext.views )[i];
    if( pView->Name() == OutputView )
      *ioContext.outputView = pView;
    for( int i = 0; i < VisualizeViews->NumValues(); ++i )
      if( WildcardMatch( VisualizeViews( i ), pView->Name() ) )
        visViews.push_back( pView );
  }
  if( *ioContext.outputView == NULL && !OutputView.empty() )
    bcierr << "No view name matches the OutputView parameter: " << OutputView << endl;
  if( visViews.empty() && VisualizeViews->NumValues() > 0 )
    bciout << "No view name matches any of the pattern(s) specified in the VisualizeViews parameter" << endl;
  *ioContext.views = visViews;
  if( *ioContext.outputView )
    ( *ioContext.outputView )->Depends( ioContext, *ioContext.dependencies );
  for( size_t i = 0; i < ioContext.views->size(); ++i )
    ( *ioContext.views )[i]->Depends( ioContext, *ioContext.dependencies );
}
开发者ID:ACrazyer,项目名称:NeuralSystemsBCI2000,代码行数:25,代码来源:StatisticsFilter.cpp


示例6: while

ViewContainer* ViewSplitter::activeContainer() const
{
    if (QWidget* focusW = focusWidget()) {
        ViewContainer* focusContainer = 0;

        while (focusW != 0) {
            QListIterator<ViewContainer*> containerIter(_containers);
            while (containerIter.hasNext()) {
                ViewContainer* nextContainer = containerIter.next();

                if (nextContainer->containerWidget() == focusW) {
                    focusContainer = nextContainer;
                    break;
                }
            }
            focusW = focusW->parentWidget();
        }

        if (focusContainer)
            return focusContainer;
    }

    QList<ViewSplitter*> splitters = findChildren<ViewSplitter*>();

    if (splitters.count() > 0) {
        return splitters.last()->activeContainer();
    } else {
        if (_containers.count() > 0)
            return _containers.last();
        else
            return 0;
    }
}
开发者ID:spytheman,项目名称:konsole,代码行数:33,代码来源:ViewSplitter.cpp


示例7: lastView

void ViewManager::lastView()
{
    ViewContainer* container = _viewSplitter->activeContainer();

    Q_ASSERT(container);

    container->activateLastView();
}
开发者ID:spytheman,项目名称:konsole,代码行数:8,代码来源:ViewManager.cpp


示例8: previousView

void ViewManager::previousView()
{
    ViewContainer* container = _viewSplitter->activeContainer();

    Q_ASSERT(container);

    container->activatePreviousView();
}
开发者ID:spytheman,项目名称:konsole,代码行数:8,代码来源:ViewManager.cpp


示例9: activeView

QWidget* ViewManager::activeView() const
{
    ViewContainer* container = _viewSplitter->activeContainer();
    if (container) {
        return container->activeView();
    } else {
        return 0;
    }
}
开发者ID:spytheman,项目名称:konsole,代码行数:9,代码来源:ViewManager.cpp


示例10: Q_ASSERT

void ViewManager::switchToView(int index)
{
    Q_ASSERT(index >= 0);
    ViewContainer* container = _viewSplitter->activeContainer();
    Q_ASSERT(container);
    QList<QWidget*> containerViews = container->views();
    if (index >= containerViews.count())
        return;
    container->setActiveView(containerViews.at(index));
}
开发者ID:spytheman,项目名称:konsole,代码行数:10,代码来源:ViewManager.cpp


示例11: file

Document* DocManager::openURL( const KURL &url, ViewArea *viewArea )
{
	if ( url.isEmpty() ) return 0;
	
	if ( url.isLocalFile() )
	{
		QFile file(url.path());
		if ( file.open(IO_ReadOnly) == false )
		{
			KMessageBox::sorry( 0l, i18n("Could not open '%1'").arg( url.prettyURL() ) );
			return 0l;
		}
		file.close();
	}
	
	// If the currently active view area is empty, and we were not given a view area
	// to open into, then use the empty view area
	if ( !viewArea )
	{
		ViewContainer * currentVC = static_cast<ViewContainer*>( KTechlab::self()->tabWidget()->currentPage() );
		if ( currentVC )
		{
			ViewArea * va = currentVC->viewArea( currentVC->activeViewArea() );
			if ( !va->view() )
				viewArea = va;
		}
	}
	
	// If the document is already open, and a specific view area hasn't been
	// specified, then just return that document - otherwise, create a new
	// view in the viewarea
	Document *document = findDocument(url);
	if ( document ) {
		if ( viewArea )
			createNewView( document, viewArea );
		else	giveDocumentFocus( document, viewArea );
		return document;
	}
	
	QString fileName = url.fileName();
	QString extension = fileName.right( fileName.length() - fileName.findRev('.') );
	
	if ( extension == ".circuit" )
		return openCircuitFile( url, viewArea );
	else if ( extension == ".flowcode" )
		return openFlowCodeFile( url, viewArea );
	else if ( extension == ".mechanics" )
		return openMechanicsFile( url, viewArea );
	else	return openTextFile( url, viewArea );
}
开发者ID:zoltanp,项目名称:ktechlab-0.3,代码行数:50,代码来源:docmanager.cpp


示例12: 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);
        }
    }
}
开发者ID:spytheman,项目名称:konsole,代码行数:16,代码来源:ViewManager.cpp


示例13: 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();
}
开发者ID:ktechlab,项目名称:ktechlab,代码行数:45,代码来源:docmanager.cpp


示例14: existingViewIter

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);
}
开发者ID:spytheman,项目名称:konsole,代码行数:41,代码来源:ViewManager.cpp


示例15: activeSplitter

void ViewSplitter::addContainer( ViewContainer* container , 
                                 Qt::Orientation containerOrientation )
{
   ViewSplitter* splitter = activeSplitter();   

    if ( splitter->count() < 2 || 
         containerOrientation == splitter->orientation() ||
         !_recursiveSplitting )
    {
        splitter->registerContainer(container); 
        splitter->addWidget(container->containerWidget());

        if ( splitter->orientation() != containerOrientation )
            splitter->setOrientation( containerOrientation );

        splitter->updateSizes();
    }
    else
    {
        ViewSplitter* newSplitter = new ViewSplitter(this);
        connect( newSplitter , SIGNAL(empty(ViewSplitter*)) , splitter , SLOT(childEmpty(ViewSplitter*)) );

        ViewContainer* oldContainer = splitter->activeContainer();
        int oldContainerIndex = splitter->indexOf(oldContainer->containerWidget());

        splitter->unregisterContainer(oldContainer);   

        newSplitter->registerContainer(oldContainer);
        newSplitter->registerContainer(container);

        newSplitter->addWidget(oldContainer->containerWidget());
        newSplitter->addWidget(container->containerWidget());
        newSplitter->setOrientation(containerOrientation); 
        newSplitter->updateSizes();
        newSplitter->show();

        splitter->insertWidget(oldContainerIndex,newSplitter);
    }

}
开发者ID:ktuan89,项目名称:konsole-4.8.5,代码行数:40,代码来源:ViewSplitter.cpp



注:本文中的ViewContainer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ViewDefinition类代码示例发布时间:2022-05-31
下一篇:
C++ ViewArray类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap