If I understand correctly, you want to make the highlighted items twice as big as the other. This is how I would work:
In your QListView ( eg myListView : Qlistview) create a Slot that sets the height of the highlighted item and connect this slot to the:
myListView::SlotChangeHeight()
{
if (currentItem())
{
currentItem()->setHeight(44);
}
}
...
// in constructor myListView:
connect(this, SIGNAL(selectionChanged()), this, SLOT(SlotSelectionChanged()) );
myListView::SlotChangeHeight()
{
if (currentItem())
{
currentItem()->setHeight(44);
}
}
...
// in constructor myListView:
connect(this, SIGNAL(selectionChanged()), this, SLOT(SlotSelectionChanged()) );
To copy to clipboard, switch view to plain text mode
You need to keep track of the previous current Item in order to set it back to size 22.
So create a member QListViewITem * previous (or one of your own type...) and add the following lines just after" currentItem()->setHeight(44);"
if (previous != 0) {
previous->setHeight(22);
}
previous = currentItem();
if (previous != 0) {
previous->setHeight(22);
}
previous = currentItem();
To copy to clipboard, switch view to plain text mode
Don't forget to set previous to 0 in the constructor of myListview!
Bookmarks