本文整理汇总了C++中KHTMLView::updateContents方法的典型用法代码示例。如果您正苦于以下问题:C++ KHTMLView::updateContents方法的具体用法?C++ KHTMLView::updateContents怎么用?C++ KHTMLView::updateContents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KHTMLView
的用法示例。
在下文中一共展示了KHTMLView::updateContents方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: userResize
//.........这里部分代码省略.........
// ### check the resize is not going out of bounds.
if(m_resizing && evt->id() == EventImpl::MOUSEUP_EVENT)
{
setResizing(false);
KApplication::restoreOverrideCursor();
if(m_vSplit != -1 )
{
#ifdef DEBUG_LAYOUT
kdDebug( 6031 ) << "split xpos=" << _x << endl;
#endif
int delta = m_vSplitPos - _x;
m_gridDelta[1][m_vSplit] -= delta;
m_gridDelta[1][m_vSplit+1] += delta;
}
if(m_hSplit != -1 )
{
#ifdef DEBUG_LAYOUT
kdDebug( 6031 ) << "split ypos=" << _y << endl;
#endif
int delta = m_hSplitPos - _y;
m_gridDelta[0][m_hSplit] -= delta;
m_gridDelta[0][m_hSplit+1] += delta;
}
// this just schedules the relayout
// important, otherwise the moving indicator is not correctly erased
setNeedsLayout(true);
}
else if (m_resizing || evt->id() == EventImpl::MOUSEUP_EVENT) {
#if APPLE_CHANGES
KHTMLView *v = canvas()->view();
QPainter paint;
v->disableFlushDrawing();
v->lockDrawingFocus();
#else
QPainter paint( canvas()->view() );
#endif
paint.setPen( Qt::gray );
paint.setBrush( Qt::gray );
#if !APPLE_CHANGES
paint.setRasterOp( Qt::XorROP );
#endif
QRect r(xPos(), yPos(), width(), height());
const int rBord = 3;
int sw = element()->border();
int p = m_resizing ? (m_vSplit > -1 ? _x : _y) : -1;
if (m_vSplit > -1) {
if ( m_oldpos >= 0 )
#if APPLE_CHANGES
v->updateContents( m_oldpos + sw/2 - rBord , r.y(), 2*rBord, r.height(), true );
#else
paint.drawRect( m_oldpos + sw/2 - rBord , r.y(),
2*rBord, r.height() );
#endif
if ( p >= 0 ){
#if APPLE_CHANGES
paint.setPen( Qt::NoPen );
paint.setBrush( Qt::gray );
v->setDrawingAlpha((float)0.25);
paint.drawRect( p + sw/2 - rBord, r.y(), 2*rBord, r.height() );
v->setDrawingAlpha((float)1.0);
#else
paint.drawRect( p + sw/2 - rBord, r.y(), 2*rBord, r.height() );
#endif
}
} else {
if ( m_oldpos >= 0 )
#if APPLE_CHANGES
v->updateContents( r.x(), m_oldpos + sw/2 - rBord, r.width(), 2*rBord, true );
#else
paint.drawRect( r.x(), m_oldpos + sw/2 - rBord,
r.width(), 2*rBord );
#endif
if ( p >= 0 ){
#if APPLE_CHANGES
paint.setPen( Qt::NoPen );
paint.setBrush( Qt::gray );
v->setDrawingAlpha((float)0.25);
paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord );
v->setDrawingAlpha((float)1.0);
#else
paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord );
#endif
}
}
m_oldpos = p;
#if APPLE_CHANGES
v->unlockDrawingFocus();
v->enableFlushDrawing();
#endif
}
return res;
}