Remove call to expandAll() - later calls to setExpandedState() should
automatically expand connected networks.
Before, Qt4 would collapse disconnected networks and expand connected
networks, but Qt5 would always expand both. After, both collapse
disconnected and expand connected.