If you are new to C++ then some of the compiler errors can be a bit confusing and daunting at first. For example if the compiler given you an expected primary-expression error (e.g. expected primary-expression before ‘.’ token), at face value it does not make sense.
rgbviewer.cpp: In member function ‘virtualvoid RGBViewer::accept()’:rgbviewer.cpp:19:error: expected primary-expression before ‘(’ token
rgbviewer.cpp:19:error: expected primary-expression before ‘.’ token
rgbviewer.cpp:20:error: expected primary-expression before ‘.’ token
rgbviewer.cpp:21:error: expected primary-expression before ‘.’ token
All this means is that I need to initialize the type ‘Ui_RGBViewerClass’ as the compiler does not understand it. In other words, I need to use a new.
Here is the ‘fixed’ version below of the same code snippet.