What about using a ui file instead of defining the UI in C++? See other classes for an example.