PDA

View Full Version : items in view would disappear on scrolling



sepehr
16th March 2009, 14:45
I add a QTableView as a tab for QTabWidget using addTab method,when not scrolling is needed everything is fine but as soon as page scrolls some items would disappear,what should i do?(does it have anything to do with repainting the items in the view ?)
for getting the picture more clearly,take a loot at these

with no scrolling:
http://i42.tinypic.com/29o6d6x.jpg
with scrolling:
http://i44.tinypic.com/kbwruo.jpg

aamer4yu
16th March 2009, 14:57
How are you populating the tableview ?

sepehr
16th March 2009, 15:01
using data function of the model,the data function uses a qsqlquery to retrive data(because of some bugs in sqlModel of qt i coded the model myself)

aLiEnHeAd
20th March 2009, 15:02
Do you use WinXP or Vista?
If have a similar problem which occurs only with Qt 4.5.0 and Windows Vista...

sepehr
21st March 2009, 07:20
I'm using windows XP,
I just used another simple model to check whether my model is the problem or not


model=new QStandardItemModel (4, 4);
for (int row = 0; row < 4; ++row) {
for (int column = 0; column < 4; ++column) {
QStandardItem *item = new QStandardItem(QString("row %0, column %1").arg(row).arg(column));
model->setItem(row, column, item);
}
}

it still has the problem,seemingly sth is wrong with QTabWidget,what am I missing? I also used to show my view using show method and all items are showing while scrolling and works just fine.it's very critical which I get over this,any ideas?