• 5961阅读
  • 1回复

setViewportMargins 使用 [复制链接]

上一主题 下一主题
离线wqb_lmkj
 
只看楼主 倒序阅读 楼主  发表于: 2010-12-14
I am trying to paint some "locked" content around a scroll area that
will remain static while the user navigates within the scroll area.
It appears that I should use QAbstractScrollArea::setViewportMargins
to reserve space around the scroll area for this purpose. According
to the docs, "The marginal space is is left blank; put widgets in the
unused area." However I have been unable to get anything into the
margins, they always appear blank. I tried subclassing
QAbstractScrollArea and overriding the paintEvent() function, but this
only allows me to paint into the scrolling area, not the margins.
Does anyone have insight into or an example of how to layout widgets
in the margin or the proper way to override the paint event?

Thanks,
离线kartgokart

只看该作者 1楼 发表于: 2014-03-06
谁知道,回答一下啊
快速回复
限100 字节
 
上一个 下一个