@SGaist Thank you, but this is actually the class where I am creating the tables when database is empty and holding all the models and necessary functions to work on them. So it is fine in this case :)
Sorry, I meant the second code block, not the first. I'm not very familiar with assertions in general, so I've never heard of Q_ASSERT.
The assertion here is only a tool to detect creating more than one instance of the class. Q_ASSERT is a Qt macro for regular debug assertions, it will be removed in release mode, so its purpose (as assertions in general) is to catch programmer errors while debugging. So if you use the class above like this:
Singleton object2; //< Here the assertion will be tripped and you can catch the error while debugging
Adding the code in the second block fixed the issue.
Do you mean the main window constructor where the connect is made? All code blocks are part of one single example, so I'd expect them to work together only. :)
I appreciate your response, it lead me to a lot of research on the topic! I figured out it was much easier to implement a tabview on the main view and then to connect the signals with the child objects which were themselves individual views.