![]() |
University of Murcia, Spain ![]() |
The Designer GUISo far, we have discussed block oriented programming by source code writing. In this section we will describe the Designer, a tool provided by the QVision to perform visual block-oriented programming.We will start by extending the movement edge detector example application, created in section Creating custom processing blocks, to include the visual design tool. The full source code of that application can be found in the examples/movementEdgeDetector directory included in the actual QVision release. Its source code is also documented here. First, the application should include the header file for the QVDesignerGUI class. Add the following line at the includes section of the movementEdgeDetector.cpp file:
#include <QVDesignerGUI>
Then, we can create in the main function the designer object. It should substitute the old QVDefaultGUI object, because only one GUI object should be present in a QVision application. Replace the following line from the movementEdgeDetector.cpp:
QVDefaultGUI interface; With the lines:
QVDesignerGUI interface; QVDesignerGUI::registerUserType<MovingEdgesDetector>("MovingEdgesDetector"); QVDesignerGUI::registerUserType<QVCannyEdgeDetector>("QVCannyEdgeDetector"); QVDesignerGUI::registerUserType< QVImageRetarderBlock<uChar,1> >("QVImageRetarderBlock<uChar,1>"); The application will open the following window when it is launched:
![]() It is a slate widget, that allows the user to inspect and modify the application block structure. Blocks are presented as boxes, containing the block name, and the input/output properties. Property links are shown using green dashed lines (for synchronous links) or orange discontinuous lines (for asynchronous links) between the dynamic properties. The application contains no sequential property links. The only asynchronous links are between the processing blocks, and the output image canvas blocks. The user can stop and resume the application. When it is stopped, the data path structure can be modified. The user can add or delete nodes (processing blocks), and/or create new data links, or delete existing ones. |