0

As Qt programs happen to live within their MainWindow class, I am having troubles altering the design components via a member class, that, because of inter-inclusion of headers leading to compilation errors.

MainWindow class holding a EventManager member object needs to have its design components modified in a method of EventManager without having multi-inclusion issue, that considering that MainWindow needs to include EventManager to be able to hold it within its class as member.

What would be the best (programmatically speaking) method to achieve this goal ?

Ra'Jiska
  • 979
  • 2
  • 11
  • 23
  • To avoid cyclic inclusion you might consider using forward declaration for your `EventManager` class in `MainWindow` header. – vahancho May 23 '18 at 08:59
  • This is effectively something that I've considered, however I've been told that forward declarations often result from bad design which led me to seek a potentially better way of doing it. – Ra'Jiska May 23 '18 at 09:01
  • multi-inclusion issue? https://stackoverflow.com/questions/2832018/multiple-inclusion-of-header-file-c – JustWe May 24 '18 at 02:20
  • and cyclic inclusion https://stackoverflow.com/questions/625799/resolve-build-errors-due-to-circular-dependency-amongst-classes – JustWe May 24 '18 at 02:22

0 Answers0