QRadioButtons in a QButtonGroup so that when one is selected, the others remain unselected. createGroupView() is notable in that it is comprised of a QStackedWidget. The QStacked widget has the ability to show different widgets in the same location based on the index it’s sent to. In the MainWindow class, we use the QStackedWidget to display the 2D or 3D images within the same group box as seen on the left side of Figure 1. The QStackedWidget in a sense consists of an array of pointers to different widgets, and displays the widget we set it to point to. We set our QStackedWidget to contain two QLabels and a GLWiget (which extends QGLWidget) of our design. The radio buttons in the Display group box are responsible for changing the widget which is displayed from the QStackedWidget by means of two functions found in MainWindow.cpp: display and displayGL(). Regarding MainWindow.cpp, there are five functions we must concern ourselves with to understand what is displayed in our View group box to the left of the application: load(), preview(), applyFilter(), display(), and displayGL(). load() brings up the dialogue box to pix a file to upload, but also uses the IP library functions IP_readImage() and IP_castImage() to make the image into an ImagePtr which we can more easily manipulate later, and to make it black and white before we perform half-toning operations. load() also sets the output image size to the default 16 and computes the aspect ratio of the image for later use. preview() is called by every function in change.cpp; it simply updates whatever is being displayed on the left side of the app immediately when a parameter is changed within one of the group boxes by calling applyFilter() and either display() or displayGL() with the correct argument depending on which radio button is checked in the Display group box.
QRadioButtons in a QButtonGroup so that when one is selected, the others remain unselected. createGroupView() is notable in that it is comprised of a QStackedWidget. The QStacked widget has the ability to show different widgets in the same location based on the index it’s sent to. In the MainWindow class, we use the QStackedWidget to display the 2D or 3D images within the same group box as seen on the left side of Figure 1. The QStackedWidget in a sense consists of an array of pointers to different widgets, and displays the widget we set it to point to. We set our QStackedWidget to contain two QLabels and a GLWiget (which extends QGLWidget) of our design. The radio buttons in the Display group box are responsible for changing the widget which is displayed from the QStackedWidget by means of two functions found in MainWindow.cpp: display and displayGL(). Regarding MainWindow.cpp, there are five functions we must concern ourselves with to understand what is displayed in our View group box to the left of the application: load(), preview(), applyFilter(), display(), and displayGL(). load() brings up the dialogue box to pix a file to upload, but also uses the IP library functions IP_readImage() and IP_castImage() to make the image into an ImagePtr which we can more easily manipulate later, and to make it black and white before we perform half-toning operations. load() also sets the output image size to the default 16 and computes the aspect ratio of the image for later use. preview() is called by every function in change.cpp; it simply updates whatever is being displayed on the left side of the app immediately when a parameter is changed within one of the group boxes by calling applyFilter() and either display() or displayGL() with the correct argument depending on which radio button is checked in the Display group box.
nail_art_report.docx