Finally the coding period of GSOC has arrived. There is no end of excitement but also little fear. Just praying and hoping for the best. As we had our final exams during community bonding period, I wasn’t able to devote enough time to my project. But whenever I got time, I read code and worked to complete first milestone before starting the coding period. And yes, I almost completed the task of detaching the render window and submitted my first patch of the project i.e. Detaching the rendered window.
Here I am going to explain my first task step by step.
- 1. Detaching the render window means, whenever user want to have different window for rendered model and editor, he should be able to detach the render window from the Mainwindow by just clicking/choosing an option in menu. And after closing the render window, it should fit back to Mainwindow. So the main logic is to passing a widget between two different windows.
- 2. As I wanted new window for rendered model, I created a new Qt designer class in Qt creator. Using Qt creator is fun. You just need to chose one Qt file from the list and the rest part i.e . of generating the corresponding header file, C++ class file and also adding these files in openscad.pro will be done by the Qtcreator itself. Otherwise, if you add any header file or C++ file, you need to add those file names under HEADERS and SOURCES variable in openscad.pro file manually else the qmake will not be able to refer those files while making the Makefile.
- 3. Now coming to the first file, i.e. renderwindow.ui. This is an xml file, which I developed with the help of Qt designer. This file just requires a simple layout widget as a central widget which can hold the rendered model widget (qglview) when passed to it. So the basic xml code in this file is
<widget class="QWidget" name="centralwidget"> <layout class="QHBoxLayout" name="horizontalLayout"> </layout> </widget>
- 4. Next file is renderwindow.h which contains C++ class RenderWindow and declaration of constructor and various functions used.
- 5. Another and the most important file is renderwindow.cpp which contains the definition of constructor and all functions used.
(Will upload an example soon..)