Each widget which is described in the next section is designed such that it can be used like any other standard Qt-Widget.
Some widgets use ROSE data structures ( see ROSE specific widgets), some don't ( General widgets ). These general widgets are used as super-classes for the ROSE-widgets.
All ROSE-specific widgets can handle/display SgNode's and have some common signals and slots. There are two SgNode "input"-functions (slots) and two "output"-functions (signals) which every ROSE-widget should have. The link mechanism (see MDI-Widget-Creator Interface) uses these signals/slots to connect two ROSE-widgets together.
setNode() Takes the given node as base for the whole display. TreeView's usually set the new node as root.
gotoNode() Selects the given node (and in tree-view expands until this node is visible), and highlights it, the displayed data set does not change
nodeActivated() This signal is usually sent when the user clicks on some node
nodeActivatedAlt() Alternative way of activating a node, mostly double-click (but may vary from view to view)
Additionally to the signal and slot mechanism, the SgNode's can be exchanged from window-to window by drag & drop. The exchange of data via D&D is handled by mime-data. There are some convenience functions to build QMimeData objects out of SgNode's in the file SageMimeData.h
setNode() is connected with
Theses functions can use the annotations created by the AsmToSourceMapper to put also the associated SgNode's of the linked Binary/Source Tree in the QMimeData object.
see also Implementation Guide for own ROSE-widgets
Some of the widgets have a function called
setFilter() which can be used to show only part's of the AST. For a more detailed documentation see AstFilterInterface and the derived classes.
To set a filter for a widget, create a new AstFilter on the heap (possibly combine them with AstFilterAnd, and pass the pointer to the filter to
setFilter(). The class should take ownership of the filter and free it when it's not needed any more.
Widgets which are used as base-classes for ROSE specific widgets
There is a common mechanism for creating all these ROSE-specific widgets and give the user the possibility to link them together. As an example you can look at the MdiView of the RoseQt GUI which uses this mechanism. The Mechanism described below is responsible for creating new widgets, and the custom link-menu in the top-left of each sub-widget.
Class which extends QCodeEditWidget to support SgNode's.
Uses node->get_file_info() to display the original source code (NOT the unparsed code) setNode() and getNode() load the file where the SgNode occures in and sets the cursor at the right position (start_of_construct)
Displays a disassembled binary.
Treeview for browsing a Sage-AST.
This view shows a Qt-TreeView of a Sage-AST.
For changing the display call setNode() which sets a new rootNode or gotoNode() which selects a given node
If the user clicks on a node the signal nodeActivated() is emitted, on when double clicking nodeActivatedAlt() is called
It's possible to filter the view with an AstFilterInterface. For example filtering out all nodes which are part of header files etc.
To get icons and node-descriptions the functions in namespace AstDisplayInfo are used
A custom model is used for respresenting the AST: QtAstModel
Layout of an AST in a graphicsview (similar to zgrViewer ).
This widget shows the AST layouted as a tree. For actual layouting the class TreeLayoutGenerator is used, but this can be replaced easily (for example to use different algorithms, or layout a general graph instead of a tree)
The actual code for displaying the nodes and edges is implemented in DisplayTreeNode and DisplayEdge
Displays a call-graph.
Displays a callgraph associated with a project, and layouts it with a spring embedder algorithm uses the ProjectManager to build up a callgraph
A tree showing namespaces,classes,function,loops (not raw SgNodes).
This view is intended for user which are not familiar with the ROSE data structures, it presents a view of the code including only elements a C++ developer should be familiar with (classes, namespaces,functions etc)
There are two usage modes:
Generic Qt-Widget for displaying Kiviats (polar diagrams).
This class doesn't depend on rose, the rose specific version for displaying MetricAttributes is MetricsKiviat
Extension of KiviatView for showing metric attributes.
Provides configuration dialog for ranges and normalization of metric attributes.
Declaration of Metrics Config Class for local configurations
Widget for filtering according to metric attribute (show "hot regions" of code).
Shows information about an SgNode (similar to pdf generator).
Shows following information about an SgNode:
ComboBox which displays all files associated with an SgProject User can select a file, and according signals are emitted.
Display of ProjectManager Status.
You can use this mechanism in your GUI by creating a SubWindowFactory which is a QMdiArea. For a more detailed description see the documentation of SubWindowFactory and WidgetCreatorInterface.
Generated on Tue Sep 15 14:48:47 2009 for RoseQtWidgets by