<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font face="Consolas">Hi,<br>
<br>
We develop a tool for manipulating atomic structures and have
embedded all the manipulation widgets in a panel bar (widget on
the right in attached screen0.png). The Panel bar has expandable
buttons, which upon expansion display different interfaces for
manipulating the atomic structures.<br>
<br>
The whole thing is implemented using a MVC approach using a
QTreeView and an overloaded QItemDelegate class used for handling
painting of the buttons, sizeHints, etc. The widget interfaces
however, are displayed by setting setIndexWidget() on the tree
view. <br>
<br>
This works fine if the widgets have a fixed size. However if the
atomic structure changes (molecule to crystal), previously hidden
GUI elements may be shown in the widget, which gives rise to a
compressed (bad) layout since the index widget has a fixed size
(screen1.png).<br>
<br>
The only way I could fix this was to use an idle time, that keeps
triggering the emission of the signal<br>
<br>
sizeHintChanged(const QModelIndex & index)<br>
<br>
from the delegate. This immediately triggers a smooth update of
the index widget resulting in screen2.png. From a user perspective
it works fine, but to me it appears somewhat hacky. Is there eg. a
way to monitor layout changes in visible index widgets?<br>
<br>
Best regards,<br>
<br>
Mads<br>
</font><br>
<pre class="moz-signature" cols="72">--
+-----------------------------------------------------+
| Mads Ipsen |
+----------------------+------------------------------+
| Gåsebæksvej 7, 4. tv | |
| DK-2500 Valby | phone: +45-29716388 |
| Denmark | email: <a class="moz-txt-link-abbreviated" href="mailto:mads.ipsen@gmail.com">mads.ipsen@gmail.com</a> |
+----------------------+------------------------------+
</pre>
</body>
</html>