本文整理汇总了C++中KDockWidget::dockManager方法的典型用法代码示例。如果您正苦于以下问题:C++ KDockWidget::dockManager方法的具体用法?C++ KDockWidget::dockManager怎么用?C++ KDockWidget::dockManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KDockWidget
的用法示例。
在下文中一共展示了KDockWidget::dockManager方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: eventFilter
bool KMdiDockContainer::eventFilter( TQObject *obj, TQEvent *event )
{
switch ( event->type() )
{
case TQEvent::MouseButtonPress:
{
KMultiTabBarTab* kmtbTab = tqt_dynamic_cast<KMultiTabBarTab*>( obj );
if ( !kmtbTab )
{
kdDebug(760) << k_funcinfo << "Got a mouse button press but we have no tab" << endl;
break;
}
KDockWidget* w = m_revMap[ kmtbTab->id() ];
if ( !w )
{
kdDebug(760) << k_funcinfo << "Got a mouse button press but we have no widget" << endl;
break;
}
if ( !w->getHeader() )
{
kdDebug(760) << k_funcinfo << "Got a mouse button press but we have no header" << endl;
break;
}
KDockWidgetHeader *hdr = ::tqqt_cast<KDockWidgetHeader*>( w->getHeader() );
if ( !hdr )
{
kdDebug(760) << "Wrong header type in KMdiDockContainer::eventFilter" << endl;
break;
}
m_dockManager = w->dockManager();
m_dragPanel = TQT_TQOBJECT(hdr->dragPanel());
if ( m_dragPanel )
m_movingState = WaitingForMoveStart;
delete m_startEvent;
m_startEvent = new TQMouseEvent( * ( ( TQMouseEvent* ) event ) );
}
break;
case TQEvent::MouseButtonRelease:
if ( m_movingState == Moving )
{
m_movingState = NotMoving;
TQApplication::postEvent( m_dragPanel, new TQMouseEvent( * ( ( TQMouseEvent* ) event ) ) );
delete m_startEvent;
m_startEvent = 0;
}
case TQEvent::MouseMove:
if ( m_movingState == WaitingForMoveStart )
{
TQPoint p( ( ( TQMouseEvent* ) event )->pos() - m_startEvent->pos() );
if ( p.manhattanLength() > TDEGlobalSettings::dndEventDelay() )
{
m_dockManager->eventFilter( m_dragPanel, TQT_TQEVENT(m_startEvent) );
m_dockManager->eventFilter( m_dragPanel, event );
m_movingState = Moving;
}
}
else if ( m_movingState == Moving )
m_dockManager->eventFilter( m_dragPanel, event );
break;
default:
break;
}
return false;
}
示例2: eventFilter
bool DockContainer::eventFilter(QObject *obj, QEvent *event)
{
if(obj == m_tb)
{
if((event->type() == QEvent::Resize) && (m_ws->isHidden()))
{
QSize size = ((QResizeEvent *)event)->size();
if(m_vertical)
parentDockWidget()->setForcedFixedWidth(size.width());
else
parentDockWidget()->setForcedFixedHeight(size.height());
}
}
else
switch(event->type())
{
case QEvent::MouseButtonPress:
{
KDockWidget *w = m_revMap[dynamic_cast< KMultiTabBarTab * >(obj)->id()];
if(!w)
{
kdDebug() << "NoWidget" << endl;
break;
}
if(!w->getHeader())
{
kdDebug() << "NO HEADER" << endl;
break;
}
KDockWidgetHeader *hdr = static_cast< KDockWidgetHeader * >(w->getHeader()->qt_cast("KDockWidgetHeader"));
if(!hdr)
{
kdDebug() << "Wrong header type in DockContainer::eventFilter" << endl;
break;
}
m_dockManager = w->dockManager();
m_dragPanel = hdr->dragPanel();
if(m_dragPanel)
m_movingState = WaitingForMoveStart;
delete m_startEvent;
m_startEvent = new QMouseEvent(*((QMouseEvent *)event));
}
break;
case QEvent::MouseButtonRelease:
if(m_movingState == Moving)
{
m_movingState = NotMoving;
QApplication::postEvent(m_dragPanel, new QMouseEvent(*((QMouseEvent *)event)));
delete m_startEvent;
m_startEvent = 0;
}
break;
case QEvent::MouseMove:
if(m_movingState == WaitingForMoveStart)
{
QPoint p(((QMouseEvent *)event)->pos() - m_startEvent->pos());
if(p.manhattanLength() > KGlobalSettings::dndEventDelay())
{
m_dockManager->eventFilter(m_dragPanel, m_startEvent);
m_dockManager->eventFilter(m_dragPanel, event);
m_movingState = Moving;
}
}
else if(m_movingState == Moving)
{
m_dockManager->eventFilter(m_dragPanel, event);
}
break;
default:
break;
}
return false;
}