title: Preferred way to design application arhitecture in Qt
body: <p>I have application which has <code>MainWindow</code> that is divided in three main parts:</p>
  <p><a href="https://i.stack.imgur.com/8tUea.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8tUea.png" alt="enter image description here" /></a></p>
  <p>Thing is, all three parts need to communicate between themselves. For example, there is a <code>QListView</code> in left section where you select items, and depending on the selected item options change in the right section.</p>
  <p>I have come up with three solutions:</p>
  <ol>
  <li>draw everything within the <code>MainWindow</code> which would make <code>MainWindow</code> one big superclass:</li>
  </ol>
  <p>This solution solves all problems with communication between widgets because all of them are part of <code>MainWindow::ui</code> but then I get one big (potentially messy) class.</p>
  <ol start="2">
  <li>put each section in it's own class and make <code>MainWindow</code> a singleton:</li>
  </ol>
  <p>This solution is... well a singleton. And I don't really like singletons. I will have access to <code>MainWindow</code> from everywhere (essentially I am creating a global variable) and I would still have to expose <code>MainWindow::ui</code> (and <code>::ui</code>s of other sections) via getter which would mean that everything will have access to <code>::ui</code>s.</p>
  <ol start="3">
  <li>put each section in it's own class and connect everything via signals and slots:</li>
  </ol>
  <p>This would probably be the best solution but with this solution I need to create getter for each widget from <code>EachSection::ui</code> (to be able to connect it in <code>MainWindow</code> with it's counterparts), I would need a lot of calls to <code>connect()</code> and I also have a problem if two slots react to same signal but they need to react in specific order.</p>
  <p>So what would be the best approach?</p>