[Qt-interest] QTreeWidgetItem, setSelected(true) does not expand parents
Luc Devallonné
luc.devallonne at mnemis.com
Thu Jan 15 23:40:43 CET 2009
Hello,
You may want to try to call recursively
widgetItem->parent()->setExpanded(true) to all parents of your
QTreeWidgetItem;
And then treeWidget->scrollToItem(widgetItem)
Hope it helps
Luc
On Thu, Jan 15, 2009 at 9:21 PM, Murat Uenalan
<murat.uenalan at googlemail.com> wrote:
> I have a QGraphicsView with QGraphicsItem which are also listed in a
> corresponding QTreeWidget on the side.
> So when I click on a the QGraphicsItem, the corresponding QTreeWidgetItem
> should be highlighted (ie. selected).
> The problem is that the QGraphicsItems are children of a parent, which might
> be collapsed. As here:
>
> +parent
>
> contra
>
> .parent
> |
> '-- leaf
>
> Is there any standard method to expand all parents and bring the widget in
> the, lets say, center of the QTreeWidget ? So it is sure that the item is
> visible in any circumstance ? Otherwise I propose
> QTreeWidgetItem::takeEyespot(false) which unburries the item and brings it
> into the eyespot.
>
> Thanks for any help,
> Mu
>
>
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
More information about the Qt-interest-old
mailing list