PDA

View Full Version : Problem when resizing rows in QTreeWidget



hubbobubbo
14th June 2010, 14:02
Hi

I have a QTreeWidget and I simply want to make the selected row higher then the not selected ones for clarity. So I did like this:

void myClass::onCurrentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* previous)
{
if(previous!=NULL)
{
QSize sizeHintRow;
sizeHintRow.setHeight(30);
previous->setSizeHint(0,sizeHintRow);

if(current != NULL)
{
sizeHintRow.setHeight(60);
current->setSizeHint(0,sizeHintRow);
}
}
}

However when adding two rows and switching between them once, the first one becomes unresponsive and cannot be selected anymore. Removing the code above makes everything work just fine.Testing this on Win32.

To me this does not seem too complex, am I missing something basic on what I aqm allowed to do?