The S.O.L.I.D principles information is part of my signature, not the post :-)

The way you write, and your code suggests you don't really understand basic C++.
The answer to your question would be that the information of your UI should be held separately from the UI, thus available to any UI part in your application.

In your code, you have a member variable 'connection' which is not initialized (so it will probably crash in your eventFilter() and its not visible where you destroy it either.

Before you start working with a tool kit like Qt, better start with basic C++ on basic concepts of OOP.