Permanent link to this article: http://stupidbeauty.com/ShangHaiYanMoJi/2012/02/qt4-8-0%e6%96%87%e6%a1%a3%e7%bf%bb%e8%af%91%ef%bc%9aqfontdatabase%e7%b1%bb%e5%8f%82%e8%80%83qfontdatabase-class-reference/
Permanent link to this article: http://stupidbeauty.com/ShangHaiYanMoJi/2012/02/qt4-8-0%e6%96%87%e6%a1%a3%e7%bf%bb%e8%af%91%ef%bc%9aqwidget%e7%b1%bb%e5%8f%82%e8%80%83qwidget-class-reference/
Permanent link to this article: http://stupidbeauty.com/ShangHaiYanMoJi/2012/01/qt4-7%e6%96%87%e6%a1%a3%e7%bf%bb%e8%af%91%ef%bc%9avideowidget%e7%b1%bb%e5%8f%82%e8%80%83videowidget-class-reference/
Permanent link to this article: http://stupidbeauty.com/ShangHaiYanMoJi/2011/12/%e8%bd%ac%e8%bd%bd%ef%bc%9aqt%e7%bf%bb%e8%af%91-qpalette-class-referenceqt%e8%b0%83%e8%89%b2%e6%9d%bf/
Permanent link to this article: http://stupidbeauty.com/ShangHaiYanMoJi/2011/12/%e8%bd%ac%e8%bd%bd%ef%bc%9aqt4%e5%b7%a5%e4%bd%9c%e7%ac%94%e8%ae%b0%e4%b9%8bqlabel-qmovie%e7%bb%98%e5%9b%be/
Permanent link to this article: http://stupidbeauty.com/ShangHaiYanMoJi/2011/12/%e8%bd%ac%e8%bd%bd%ef%bc%9aqt%e7%bb%98%e5%9b%be%e7%b3%bb%e7%bb%9fthe-paint-system/
void QWidget::setMask ( const QBitmap & bitmap ) void QWidget::setMask ( const QRegion & region ) void QWidget::setMask ( const QRegion & region ) Causes only the parts of the widget which overlap region to be visible.
只有widget与region重叠的地方才会显示出来. 自己构造一个QRegion就行了.
void ShapedClock::resizeEvent(QResizeEvent * /* event */) { int side = qMin(width(), height()); QRegion maskedRegion(width() / 2 – side / 2, height() / 2 – side / 2, side, side, QRegion::Ellipse); setMask(maskedRegion); }
Permanent link to this article: http://stupidbeauty.com/ShangHaiYanMoJi/2011/12/%e8%bd%ac%e8%bd%bd%ef%bc%9aqtwidget-%e5%ae%9e%e7%8e%b0%e4%b8%8d%e8%a7%84%e5%88%99%e7%aa%97%e4%bd%93%e4%b8%8e%e6%8c%89%e9%92%ae/