標籤:tin target oat ons count phi private into sub
2011年09月29日 23:47:46閱讀數:7269
Qt 4.0 |
automatically double-buffers |
Qt 4.1 |
QWidget::autoFillBackground |
Qt 4.2 |
delayed widget creation (DWC) |
stylesheet |
Qt 4.3 |
QWidget::render |
Qt 4.4 |
Alien Widget |
Qt 4.5 |
Translucent Windows |
Qt 4.6 |
widget‘s graphics effect |
Qt 4.8 |
lighthouse (qpa) |
Qt4.0
- 在Qt 4.0中,啟用雙緩衝,不必在paintEvent()中編寫雙緩衝代碼來避免閃爍。
Qt4.1
- 在Qt 4.1中,通過啟用背景自動傳遞(propagation),widget不再有任何預設的背景。引入backingstore這個東西。
Qt4.2
- 在Qt 4.2中,延時控制項建立(delayed widget creation)的引入,使得widget可以在沒有真實視窗控制代碼的情況下被建立。
QWindowSurface 與 QWidgetBackingStore
Even though QWidget is a QPaintDevice subclass, one will never render directly into a QWidget’s surface. Instead, during the paintEvent, the painting is redirected to an offscreen surface which is represented by the internal class QWindowSurface.
QWidgetBackingStore is responsible for figuring out which parts of the window surface needs to be updated prior to showing it to screen, so its really a repaint manager.
When the concept of backingstore was introduced in Qt 4.1, the two classes were the same, but the introduction of more varying ways to get content to screen made us split it in two.
Qt4.4
Qt::WA_NativeWindow |
建立原生表單,即帶控制代碼 |
Qt::WA_PaintOnScreen |
強制建立原生表單 |
Qt::Window |
最上層視窗,必須是原生表單 (?) |
QGLWidget |
必須是原生表單 |
如果一個widget已經是alien Widget,如果對其設定上述標誌,或者對其調用winId()函數,都會導致其重新建立為一個native widget。
Qt4.5
QWidget::setWindowOpacity()函數,設定表單(即:isWindow()為真的widget)的整體不透明度, 從0.0到1.0之間, 值越大越不透明。
Qt::WA_TranslucentBackground,這個屬性每個QWidget都可以單獨設定。不被繪製的地區(背景)都是透明的,繪製的地區的透明程度通過顏色或圖片的Alpha Channel值來控制。
Qt4.6
- 在Qt 4.6中,graphics effect被引入。但是,現在,已經不建議使用:
Graphics EffectsState: DeprecatedReasoning: flawed design, we don’t recommend taking maintainership of this code.
QGraphicsEffect 的子類需要重新實現draw()函數。
以安裝了QGraphicsOpacityEffect了QWidget為例,當每次需要重繪時,QWidgetPrivate::drawWidget()不是發送QPaintEvent事件,以調用我們的paintEvent()函數;而是調用QGraphicsOpacityEffect的draw()函數,該函數內,通過QWidget::render()調用paintEvent()將內容繪製在一個QPixmap中,而後設定QPainter的不透明度,繪製QPixmap到目標。
Qt4.8
- 在Qt 4.8中,正式引入lighthouse了,...
參考
http://labs.qt.nokia.com/2011/04/01/qt-hidden-gems/
http://labs.qt.nokia.com/2009/02/13/bnilsenflush/
http://labs.qt.nokia.com/2009/12/16/qt-graphics-and-performance-an-overview/
http://labs.qt.nokia.com/2008/02/04/qt-44-and-painting-performance/
http://labs.qt.nokia.com/2008/05/12/qwidget-vs-graphics-view-ding-ding-ding
http://labs.qt.nokia.com/2007/08/09/qt-invaded-by-aliens-the-end-of-all-flicker/
http://www.cuteqt.com/blog/?p=340
6835722
在Qt 4.4中,Alien Widget誕生了(Window負責與視窗系統的聯絡。Alien被號稱是所有閃爍的終結者)