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


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

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


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

示例1: setToolViewStyle

void MainWindow::setToolViewStyle(int flag)
{
  d->m_styleIDEAlMode = flag; // see KMultiTabBar for the first 3 bits

  DockContainer *tmpL=(DockContainer*) (m_leftContainer->getWidget()->qt_cast("KMDI::DockContainer"));
  if (tmpL) tmpL->setStyle(flag);

  DockContainer *tmpR=(DockContainer*) (m_rightContainer->getWidget()->qt_cast("KMDI::DockContainer"));
  if (tmpR) tmpR->setStyle(flag);

  DockContainer *tmpT=(DockContainer*) (m_topContainer->getWidget()->qt_cast("KMDI::DockContainer"));
  if (tmpT) tmpT->setStyle(flag);

  DockContainer *tmpB=(DockContainer*) (m_bottomContainer->getWidget()->qt_cast("KMDI::DockContainer"));
  if (tmpB) tmpB->setStyle(flag);

  d->m_toolviewStyle = flag;
  bool toolviewExists = false;
  QMap<QWidget*,KMDI::ToolViewAccessor*>::Iterator it;
  for (it = m_toolViews->begin(); it != m_toolViews->end(); ++it) {
    KDockWidget *dockWidget = dynamic_cast<KDockWidget*>(it.data()->wrapperWidget());
    if (dockWidget) {
      if (flag == KMDI::IconOnly)
      {
        dockWidget->setTabPageLabel(" ");
        dockWidget->setPixmap(*(it.data()->wrappedWidget()->icon()));
      } else
      if (flag == KMDI::TextOnly)
      {
        dockWidget->setPixmap(); //FIXME: Does not hide the icon in the IDEAl mode.
        dockWidget->setTabPageLabel(it.data()->wrappedWidget()->caption());
      } else
      if (flag == KMDI::TextAndIcon)
      {
        dockWidget->setPixmap(*(it.data()->wrappedWidget()->icon()));
        dockWidget->setTabPageLabel(it.data()->wrappedWidget()->caption());
      }
      toolviewExists = true;
    }
  }
  if (toolviewExists)
  {
    //workaround for the above FIXME to make switching to TextOnly mode work in IDEAl as well. Be sure that this version of switch* is called.
    if (flag == KMDI::TextOnly)
    {
   /*   MainWindow::switchToTabPageMode();
      MainWindow::switchToIDEAlMode();*/ //TODO
    } else
    {
      writeDockConfig();
      readDockConfig();
    }
  }
}
开发者ID:,项目名称:,代码行数:54,代码来源:

示例2: isVisible

KMDI::ToolViewAccessor *MainWindow::addToolWindow( QWidget* pWnd, KDockWidget::DockPosition pos, QWidget* pTargetWnd, int percent, const QString& tabToolTip, const QString& tabCaption)
{
  QWidget *tvta=pWnd;
  KDockWidget* pDW = dockManager->getDockWidgetFromName(pWnd->name());
  if (pDW) {
    // probably readDockConfig already created the widgetContainer, use that
    pDW->setWidget(pWnd);

    if (pWnd->icon()) {
      pDW->setPixmap(*pWnd->icon());
    }
    pDW->setTabPageLabel((tabCaption==0)?pWnd->caption():tabCaption);
    pDW->setToolTipString(tabToolTip);
    dockManager->removeFromAutoCreateList(pDW);
    pWnd=pDW;
  }

  QRect r=pWnd->geometry();

  KMDI::ToolViewAccessor *mtva=new KMDI::ToolViewAccessor(this,pWnd,tabToolTip,(tabCaption==0)?pWnd->caption():tabCaption);
  m_toolViews->insert(tvta,mtva);

  if (pos == KDockWidget::DockNone) {
    mtva->d->widgetContainer->setEnableDocking(KDockWidget::DockNone);
    mtva->d->widgetContainer->reparent(this, Qt::WType_TopLevel | Qt::WType_Dialog, r.topLeft(), isVisible());
  } else {   // add (and dock) the toolview as DockWidget view
    //const QPixmap& wndIcon = pWnd->icon() ? *(pWnd->icon()) : QPixmap();

    //KDockWidget *pCover=mtva->d->widgetContainer;

    mtva->place(pos, pTargetWnd,percent);
  }

  return mtva;
}
开发者ID:,项目名称:,代码行数:35,代码来源:

示例3: load

void KMdiDockContainer::load( TDEConfig* cfg, const TQString& group_or_prefix )
{
	TQString grp = cfg->group();
	cfg->setGroup( group_or_prefix + TQString( "::%1" ).arg( parent() ->name() ) );

	if ( cfg->readEntry( "overlapMode" ) != "false" )
		activateOverlapMode( m_horizontal?m_tb->height():m_tb->width() );
	else
		deactivateOverlapMode();

	m_separatorPos = cfg->readNumEntry( "separatorPosition", 18000 );

	int i = 0;
	TQString raise;
	while ( true )
	{
		TQString dwn = cfg->readEntry( TQString( "widget%1" ).arg( i ) );
		if ( dwn.isEmpty() )
			break;
		kdDebug( 760 ) << k_funcinfo << "configuring dockwidget :" << dwn << endl;
		KDockWidget *dw = ( ( KDockWidget* ) parent() ) ->dockManager() ->getDockWidgetFromName( dwn );
		if ( dw )
		{
			TQString s = cfg->readEntry( TQString( "widget%1-tabCaption" ).arg( i ) );
			if ( !s.isEmpty() )
			{
				dw->setTabPageLabel( s );
			}
			s = cfg->readEntry( TQString( "widget%1-tabTooltip" ).arg( i ) );
			if ( !s.isEmpty() )
			{
				dw->setToolTipString( s );
			}
			dw->manualDock( ( KDockWidget* ) parent(), KDockWidget::DockCenter );
		}
		if ( cfg->readBoolEntry( dwn, false ) )
			raise = dwn;
		i++;

	}

	TQPtrList<KMultiTabBarTab>* tl = m_tb->tabs();
	TQPtrListIterator<KMultiTabBarTab> it1( *tl );
	m_ws->hide();
	if ( !m_horizontal )
		parentDockWidget() ->setForcedFixedWidth( m_tb->width() );
	else
		parentDockWidget() ->setForcedFixedHeight( m_tb->height() );
	for ( ;it1.current() != 0;++it1 )
	{
		m_tb->setTab( it1.current() ->id(), false );
	}
	kapp->syncX();
	m_delayedRaise = -1;

	for ( TQMap<KDockWidget*, KDockButton_Private*>::iterator it = m_overlapButtons.begin();
	        it != m_overlapButtons.end();++it )
		it.data() ->setOn( !isOverlapMode() );

	if ( !raise.isEmpty() )
	{
		for ( TQMap<KDockWidget*, int>::iterator it = m_map.begin();it != m_map.end();++it )
		{
			if ( it.key() ->name() == raise )
			{
				/*        tabClicked(it.data());
				        m_tb->setTab(it.data(),true);
				        tabClicked(it.data());
				        m_ws->raiseWidget(it.key());
				        kapp->sendPostedEvents();
				        kapp->syncX();*/

				m_delayedRaise = it.data();
				TQTimer::singleShot( 0, this, TQT_SLOT( delayedRaise() ) );
				kdDebug( 760 ) << k_funcinfo << "raising" << it.key() ->name() << endl;
				break;
			}
		}

	}
	if ( m_delayedRaise == -1 )
		TQTimer::singleShot( 0, this, TQT_SLOT( init() ) );
	cfg->setGroup( grp );

}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:85,代码来源:tdemdidockcontainer.cpp


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