The treebuilder module#

This module implements a TreeBuilder emitting Qt signals.

class TreeBuilder(document)[source]#

Bases: TreeBuilder, QObject

A TreeBuilder that uses Qt signals instead of callbacks.

The signals begin_*, end_*, change_* signals can be used to connect a QAbstractItemModel to a tree builder, they are not needed for normal operation.

started#

emitted when a new update job started

updated#

emitted when one full run finished

preview#

emitted with premature tree when peek_threshold is reached

begin_remove_rows#

emitted before removing a slice of nodes (Context, first, last)

end_remove_rows#

emitted after removing nodes

begin_insert_rows#

emitted before inserting nodes (Context, first, last)

end_insert_rows#

emitted after inserting nodes

change_position#

emitted when a slice of Tokens changes position (Context, first, last)

change_root_lexicon#

emitted when the root lexicon has changed

peek_threshold = 5000#

after how many characters a build preview is presented

peek(start, tree)[source]#

Reimplemented to get a sneak preview.

replace_nodes(context, slice_, nodes)[source]#

Reimplemented for fine-grained signals.

replace_pos(context, index, offset)[source]#

Reimplemented for fine-grained signals.

replace_root_lexicon(lexicon)[source]#

Reimplemented for fine-grained signals.

process_started()[source]#

Reimplemented to emit the started signal.

process_finished()[source]#

Reimplemented to emit the updated signal.