Thank you all for the answers. In fact, I poorly designed classes. The solution is to use a class WorldGui that does not derive from MainWindow, but use a pointer to MainWindow as a member variable of WorldGui. Then use the technique of signal/slot to communicate MainWindow with WorldGui.
Bookmarks