By the way, I think you handle this a bit in the wrong way.
You should only have one GL Widget.
Then you can create different classes that do different things. Like a Building class or a Car class which each can serialise data and create the GL code. Then you can paint that GL code on the widget. There are several techniques and programming patterns you can use for this.
Bookmarks