当前位置: 首页>>代码示例>>C++>>正文


C++ KDockWidget::getWidget方法代码示例

本文整理汇总了C++中KDockWidget::getWidget方法的典型用法代码示例。如果您正苦于以下问题:C++ KDockWidget::getWidget方法的具体用法?C++ KDockWidget::getWidget怎么用?C++ KDockWidget::getWidget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KDockWidget的用法示例。


在下文中一共展示了KDockWidget::getWidget方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: tabClicked

void KMdiDockContainer::tabClicked( int t )
{
	bool call_makeVisible = !m_tabSwitching;
	m_tabSwitching = true;
	if ( m_tb->isTabRaised( t ) )
	{
		kdDebug( 760 ) << k_funcinfo << "Tab " << t << " was just activated" << endl;
		if ( m_ws->isHidden() )
		{
			kdDebug( 760 ) << k_funcinfo << "Showing widgetstack for tab just clicked" << endl;
			m_ws->show();
			parentDockWidget()->restoreFromForcedFixedSize();
		}

		if ( !m_ws->widget( t ) )
		{
			kdDebug( 760 ) << k_funcinfo << "Widget tab was clicked for is not in our stack" << endl;
			kdDebug( 760 ) << k_funcinfo << "Docking it back in" << endl;
			m_revMap[t]->manualDock( parentDockWidget(), KDockWidget::DockCenter, 20 );
			if ( call_makeVisible )
				m_revMap[t]->makeDockVisible();
			m_tabSwitching = false;
			emit activated( this );
			return ;
		}

		if ( m_ws->widget( t ) )
		{
			m_ws->raiseWidget( t );
			KDockWidget * tmpDw = ::tqqt_cast<KDockWidget*>( m_ws->widget( t ) );
			if ( tmpDw )
			{
				if ( tmpDw->getWidget() )
					tmpDw->getWidget()->setFocus();
			}
			else
				kdDebug( 760 ) << k_funcinfo << "Something really weird is going on" << endl;
		}
		else
			kdDebug( 760 ) << k_funcinfo << "We have no widget to handle in our stack." << endl;

		if ( oldtab != t )
			m_tb->setTab( oldtab, false );

		m_tabSwitching = true;
		oldtab = t;
		emit activated( this );
	}
	else
	{
		kdDebug( 760 ) << k_funcinfo << "Tab " << t << " was just deactiviated" << endl;
		// try save splitter position
		if ( parentDockWidget() && parentDockWidget()->parent() )
		{
			KDockSplitter * sp = ::tqqt_cast<KDockSplitter*>( parentDockWidget()->parent() );
			if ( sp )
				m_separatorPos = sp->separatorPos();
		}
		m_previousTab = t;
		//    oldtab=-1;
		if ( m_block )
			return ;
		emit deactivated( this );
		m_block = true;
		if ( m_ws->widget( t ) )
		{
			//    ((KDockWidget*)m_ws->widget(t))->undock();
		}
		m_block = false;
		m_ws->hide ();


		kdDebug( 760 ) << k_funcinfo << "Fixed Width:" << m_tb->width() << endl;
		if ( !m_horizontal )
			parentDockWidget()->setForcedFixedWidth( m_tb->width() ); // strange why it worked before at all
		else
			parentDockWidget()->setForcedFixedHeight( m_tb->height() ); // strange why it worked before at all
	}
	m_tabSwitching = false;
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:80,代码来源:tdemdidockcontainer.cpp

示例2: tabClicked

void DockContainer::tabClicked(int t)
{
    kdDebug(760) << "DockContainer::tabClicked()" << endl;
    bool call_makeVisible = !m_tabSwitching;
    m_tabSwitching = true;
    if((t != -1) && m_tb->isTabRaised(t))
    {
        if(m_ws->isHidden())
        {
            m_ws->show();
            parentDockWidget()->restoreFromForcedFixedSize();
        }
        if(!m_ws->widget(t))
        {
            m_revMap[t]->manualDock(parentDockWidget(), KDockWidget::DockCenter, 20);
            if(call_makeVisible)
                m_revMap[t]->makeDockVisible(); // manualDock(parentDockWidget(),KDockWidget::DockCenter,20);
            m_tabSwitching = false;
            emit activated(this);
            return;
        }
        m_ws->raiseWidget(t);
        if(m_ws->widget(t))
        {
            KDockWidget *tmpDw = static_cast< KDockWidget * >(m_ws->widget(t)->qt_cast("KDockWidget"));
            if(tmpDw)
            {
                if(tmpDw->getWidget())
                    tmpDw->getWidget()->setFocus();
            }
            else
                kdDebug(760) << "Something really weird is going on" << endl;
        }
        else
            kdDebug(760) << "DockContainer::tabClicked(int): m_ws->widget(t)==0 " << endl;

        if(oldtab != t)
            m_tb->setTab(oldtab, false);
        m_tabSwitching = true;
        oldtab = t;
        emit activated(this);
    }
    else
    {
        // try save splitter position
        if(parentDockWidget() && parentDockWidget()->parent())
        {
            KDockSplitter *sp = static_cast< KDockSplitter * >(parentDockWidget()->parent()->qt_cast("KDockSplitter"));
            if(sp)
                m_separatorPos = sp->separatorPos();
        }
        m_previousTab = t;
        //    oldtab=-1;
        if(m_block)
            return;
        emit deactivated(this);
        m_block = true;
        if(m_ws->widget(t))
        {
            //    ((KDockWidget*)m_ws->widget(t))->undock();
        }
        m_block = false;
        m_ws->hide();


        kdDebug(760) << "Fixed Width:" << m_tb->width() << endl;
        if(m_vertical)
            parentDockWidget()->setForcedFixedWidth(m_tb->width()); // strange why it worked before at all
        else
            parentDockWidget()->setForcedFixedHeight(m_tb->height()); // strange why it worked before at all
    }
    m_tabSwitching = false;
}
开发者ID:,项目名称:,代码行数:73,代码来源:


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