本文整理汇总了C++中KDockWidget::manualDock方法的典型用法代码示例。如果您正苦于以下问题:C++ KDockWidget::manualDock方法的具体用法?C++ KDockWidget::manualDock怎么用?C++ KDockWidget::manualDock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KDockWidget
的用法示例。
在下文中一共展示了KDockWidget::manualDock方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dockToolViewsIntoContainers
void MainWindow::dockToolViewsIntoContainers(QPtrList<KDockWidget>& widgetsToReparent,KDockWidget *container) {
for ( KDockWidget *dw = widgetsToReparent.first(); dw;
dw=widgetsToReparent.next()){
dw->manualDock(container,KDockWidget::DockCenter,20);
dw->loseFormerBrotherDockWidget();
}
}
示例2: place
void ToolViewAccessor::place(KDockWidget::DockPosition pos, QWidget* pTargetWnd ,int percent)
{
Q_ASSERT(d->widgetContainer);
if (!d->widgetContainer) return;
if (pos == KDockWidget::DockNone) {
d->widgetContainer->setEnableDocking(KDockWidget::DockNone);
d->widgetContainer->reparent(mdiMainFrm, Qt::WType_TopLevel | Qt::WType_Dialog, QPoint(0,0), mdiMainFrm->isVisible());
}
else { // add (and dock) the toolview as DockWidget view
KDockWidget* pCover = d->widgetContainer;
KDockWidget* pTargetDock = 0L;
if (pTargetWnd->inherits("KDockWidget") || pTargetWnd->inherits("KDockWidget_Compat::KDockWidget")) {
pTargetDock = (KDockWidget*) pTargetWnd;
}
// Should we dock to ourself?
bool DockToOurself = false;
if (mdiMainFrm->getMainDockWidget()) {
if (pTargetWnd == mdiMainFrm->getMainDockWidget()->getWidget()) {
DockToOurself = true;
pTargetDock = mdiMainFrm->getMainDockWidget();
}
else if (pTargetWnd == mdiMainFrm->getMainDockWidget()) {
DockToOurself = true;
pTargetDock = mdiMainFrm->getMainDockWidget();
}
}
// this is not inheriting QWidget*, its plain impossible that this condition is true
//if (pTargetWnd == this) DockToOurself = true;
if (!DockToOurself) if(pTargetWnd != 0L) {
pTargetDock = mdiMainFrm->dockManager->findWidgetParentDock( pTargetWnd);
if (!pTargetDock) {
if (pTargetWnd->parentWidget()) {
pTargetDock = mdiMainFrm->dockManager->findWidgetParentDock( pTargetWnd->parentWidget());
}
}
}
/* if (!pTargetDock || pTargetWnd == mdiMainFrm->getMainDockWidget()) {
if (mdiMainFrm->m_managedDockPositionMode && (mdiMainFrm->m_pMdi || mdiMainFrm->m_documentTabWidget)) {
KDockWidget *dw1=pTargetDock->findNearestDockWidget(pos);
if (dw1)
pCover->manualDock(dw1,KDockWidget::DockCenter,percent);
else
pCover->manualDock ( pTargetDock, pos, 20 );
return;
}
}*/ //TODO
pCover->manualDock( pTargetDock, pos, percent);
//check pCover->show();
}
}
示例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 );
}