exopy.utils.widgets.qt_tree_widget module

Tree widget for enaml.

This tree widget has limited functionality, it supports only : - single selection - single column tree - no undo capabilities - single TreeNode fitting an object.

It should be used with the TreeNode declarative class and the Menu item given in qt_tree_menu.enaml.

This is vastly inspired from TraitsUI implementation.

exopy.utils.widgets.qt_tree_widget.pixmap_cache(name, path=None)[source]

Return the QPixmap corresponding to a filename. If the filename does not contain a path component, ‘path’ is used (or if ‘path’ is not specified, the local ‘images’ directory is used).

exopy.utils.widgets.qt_tree_widget.INDEX_GUARD = 1

Cyclic notification guard flags

exopy.utils.widgets.qt_tree_widget.STD_ICON_MAP = {'<group>': 22, '<item>': 25, '<open>': 21}

Standard icons map.

class exopy.utils.widgets.qt_tree_widget.QtTreeWidget(parent=None, **kwargs)[source]

Bases: enaml.widgets.raw_widget.RawWidget

Simple style of tree editor.

root_node

Root object of the tree.

scrollable

Is the tree editor is scrollable? This value overrides the default.

selected_item

The currently selected object

hide_root

Flag to hide the root node of the tree.

auto_expand

Flag controlling the automatic expansion of nodes.

drag_drop

Is drag and drop allowed on the tree.

show_icons

Whether or not to show the icons for the leaves and nodes.

nodes

Nodes declared by the user as children of this widget.

hug_height = 'ignore'
create_widget(parent)[source]

Finishes initializing the editor by creating the underlying toolkit widget.

destroy()[source]

Disposes of the contents of an editor.

get_object(nid)[source]

Gets the object associated with a specified node.

get_parent(obj, name='')[source]

Returns the object that is the immmediate parent of a specified object in the tree.

get_node(obj, name='')[source]

Returns the node associated with a specified object.

w
e
a
k
r
f