[Qt-interest] Qt Bug: Clicking a QAbstractItemView child after QMainWindow::setCentralWidget() is called causes flashing

Neil Hooey nhooey at gmail.com
Tue Jun 16 18:27:02 CEST 2009


There seems to be a bug in Qt 4.5 that only reproduces in Scratchbox 2
or on a Nokia n810 device.

After calling QMainWindow::setCentralWidget(), and then clicking on
anything that inherits from QAbstractItemView (a QTableView, for
example), there is a brief flashing which looks like an unbuffered
redrawing of the Qt surface.

I've created a test program to reproduce the bug, which is attached to
this email and linked to at the bottom as well.

Steps to reproduce:
1. Download the tarball attached to this email, or copy the source
files in case it's been clipped.
2. Copy the tarball to your nokia device, or to your Scratchbox 2
environment (Scratchbox 1 does NOT reproduce this bug).
3. Untar, cd in to the directory, run make, run testTable.
4. Click on the white box, which is a QTableView, and note that there
is no flashing.
5. Click on the "Hello" button until it changes to "Goodbye". Now
QMainWindow::setCentralWidget() has been called.
6. Click on the white box, which is a QTableView, and observe the very
brief flash that occurs only the first time you click it.

I think this is a bug with Qt, related to the way a QAbstractItemView
is initialized when it is created in the view. It must be triggering a
redraw of the object the first time it's been clicked.

Does anyone know of a workaround for now, or if this bug exists in
past or future versions of Qt?

Thanks,

- Neil

Makefile
http://nokia-qt-abstract-item-view-flashing-bug.pastebin.com/f2c7c10a

testTable.pro
http://nokia-qt-abstract-item-view-flashing-bug.pastebin.com/f7c3fa992

testTable.h
http://nokia-qt-abstract-item-view-flashing-bug.pastebin.com/f3544ed34

testTable.cc
http://nokia-qt-abstract-item-view-flashing-bug.pastebin.com/f150283af
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testTable.tar.gz
Type: application/x-gzip
Size: 2422 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090616/f39e8e02/attachment.gz 


More information about the Qt-interest-old mailing list