本文整理汇总了C++中KHTMLView::setMarginWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ KHTMLView::setMarginWidth方法的具体用法?C++ KHTMLView::setMarginWidth怎么用?C++ KHTMLView::setMarginWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KHTMLView
的用法示例。
在下文中一共展示了KHTMLView::setMarginWidth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotViewCleared
void RenderFrame::slotViewCleared()
{
if(element() && m_widget->inherits("QScrollView")) {
#ifdef DEBUG_LAYOUT
kdDebug(6031) << "frame is a scrollview!" << endl;
#endif
QScrollView *view = static_cast<QScrollView *>(m_widget);
if(!element()->frameBorder || !((static_cast<HTMLFrameSetElementImpl *>(element()->parentNode()))->frameBorder()))
view->setFrameStyle(QFrame::NoFrame);
#if APPLE_CHANGES
// Qt creates QScrollView w/ a default style of QFrame::StyledPanel | QFrame::Sunken.
else
view->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
#else
view->setHScrollBarMode(element()->scrolling );
view->setVScrollBarMode(element()->scrolling );
#endif
if(view->inherits("KHTMLView")) {
#ifdef DEBUG_LAYOUT
kdDebug(6031) << "frame is a KHTMLview!" << endl;
#endif
KHTMLView *htmlView = static_cast<KHTMLView *>(view);
if(element()->marginWidth != -1) htmlView->setMarginWidth(element()->marginWidth);
if(element()->marginHeight != -1) htmlView->setMarginHeight(element()->marginHeight);
}
}
}
示例2: parseAttribute
void HTMLBodyElementImpl::parseAttribute(AttributeImpl *attr)
{
switch(attr->id())
{
case ATTR_BACKGROUND:
{
QString url = khtml::parseURL( attr->value() ).string();
if (!url.isEmpty()) {
url = getDocument()->completeURL( url );
addCSSProperty(CSS_PROP_BACKGROUND_IMAGE, "url('"+url+"')" );
m_bgSet = true;
}
else
m_bgSet = false;
break;
}
case ATTR_MARGINWIDTH: {
KHTMLView* w = getDocument()->view();
w->setMarginWidth( -1 ); // unset this, so it doesn't override the setting here
addCSSLength(CSS_PROP_MARGIN_RIGHT, attr->value() );
}
/* nobreak; */
case ATTR_LEFTMARGIN:
addCSSLength(CSS_PROP_MARGIN_LEFT, attr->value() );
break;
case ATTR_MARGINHEIGHT: {
KHTMLView* w = getDocument()->view();
w->setMarginHeight( -1 ); // unset this, so it doesn't override the setting here
addCSSLength(CSS_PROP_MARGIN_BOTTOM, attr->value());
}
/* nobreak */
case ATTR_TOPMARGIN:
addCSSLength(CSS_PROP_MARGIN_TOP, attr->value());
break;
case ATTR_BGCOLOR:
addCSSProperty(CSS_PROP_BACKGROUND_COLOR, attr->value());
m_bgSet = !attr->value().isNull();
break;
case ATTR_TEXT:
addCSSProperty(CSS_PROP_COLOR, attr->value());
m_fgSet = !attr->value().isNull();
break;
case ATTR_BGPROPERTIES:
if ( strcasecmp( attr->value(), "fixed" ) == 0)
addCSSProperty(CSS_PROP_BACKGROUND_ATTACHMENT, CSS_VAL_FIXED);
break;
case ATTR_VLINK:
case ATTR_ALINK:
case ATTR_LINK:
{
if(!m_styleSheet) {
m_styleSheet = new CSSStyleSheetImpl(this,DOMString(),true);
m_styleSheet->ref();
}
QString aStr;
if ( attr->id() == ATTR_LINK )
aStr = "a:link";
else if ( attr->id() == ATTR_VLINK )
aStr = "a:visited";
else if ( attr->id() == ATTR_ALINK )
aStr = "a:active";
aStr += " { color: " + attr->value().string() + "; }";
m_styleSheet->parseString(aStr);
m_styleSheet->setNonCSSHints();
break;
}
case ATTR_ONLOAD:
getDocument()->setWindowEventListener(EventImpl::LOAD_EVENT,
getDocument()->createHTMLEventListener(attr->value().string()));
break;
case ATTR_ONUNLOAD:
getDocument()->setWindowEventListener(EventImpl::UNLOAD_EVENT,
getDocument()->createHTMLEventListener(attr->value().string()));
break;
case ATTR_ONBLUR:
getDocument()->setWindowEventListener(EventImpl::BLUR_EVENT,
getDocument()->createHTMLEventListener(attr->value().string()));
break;
case ATTR_ONFOCUS:
getDocument()->setWindowEventListener(EventImpl::FOCUS_EVENT,
getDocument()->createHTMLEventListener(attr->value().string()));
break;
case ATTR_ONRESIZE:
getDocument()->setWindowEventListener(EventImpl::RESIZE_EVENT,
getDocument()->createHTMLEventListener(attr->value().string()));
break;
case ATTR_NOSAVE:
break;
default:
HTMLElementImpl::parseAttribute(attr);
}
}