Previous topic

qarbon.qt.gui.propertyeditor

Next topic

qarbon.qt.gui.util

This Page

qarbon.qt.gui.treeqobject

A tree widget representing QObject hierarchy (for development purposes).

The most common use case of this widget is to debug applications which may have “zombie” widgets lying around when some widget is removed, reparented in a dynammic GUI.

Example:

from qarbon.external.qt import QtCore, QtGui
from qarbon.qt.gui.application import Application
from qarbon.qt.gui.treeqobject import TreeQObjectWidget

app = Application()

# mw will be the QObject to be "seen" in the Tree (along with all its
# childs, of course)

mw = QtGui.QMainWindow()
mw.setObjectName("main window")
w = QtGui.QWidget()
w.setObjectName("central widget")
mw.setCentralWidget(w)
l = QtGui.QVBoxLayout()
w.setLayout(l)
l1 = QtGui.QLabel("H1")
l1.setObjectName("label 1")
l.addWidget(l1)
l2 = QtGui.QLabel("H2")
l2.setObjectName("label 2")
l.addWidget(l2)
mw.show()

inspector = TreeQObjectWidget(qobject=w)
inspector.setAttribute(QtCore.Qt.WA_QuitOnClose, False)
inspector.show()
app.exec_()

Functions

getQObjectIcon
getQObjectTree
getQObjectTreeStr
getQObjectTreeAsDict
getQObjectTreeAsList

Inheritance diagram of TreeQObjectWidget

Classes

TreeQObjectWidget A tree representation of the selected QObject childs.
class qarbon.qt.gui.treeqobject.QObjectRepresentation[source]

Bases: qarbon.external.enum._enum.Enum

possible displays of a QObject

qarbon.qt.gui.treeqobject.getQObjectTree(qobject=None, ffilter=<function _filter at 0x36eab90>)
qarbon.qt.gui.treeqobject.getQObjectTreeStr(qobject=None, representation=<QObjectRepresentation.ClassName: 0>, ffilter=<function _filter at 0x36eab90>)[source]
class qarbon.qt.gui.treeqobject.TreeQObjectInfoModel(parent=None, data=None)[source]

Bases: qarbon.qt.gui.basemodel.BaseModel

ColumnNames = ('Class', 'Object name')
ColumnRoles = ((<QObjectRepresentation.ClassName: 0>,), <QObjectRepresentation.ObjectName: 1>)
role(column, depth=0)[source]
roleIcon(taurus_role)[source]
roleSize(taurus_role)[source]
roleToolTip(role)[source]
setupModelData(qobject)[source]
class qarbon.qt.gui.treeqobject.TreeQObjectWidget(parent=None, with_navigation_bar=True, with_filter_widget=True, perspective=None, proxy=None, qobject=None)[source]

Bases: qarbon.qt.gui.basetree.BaseTreeWidget

A tree representation of the selected QObject childs.

The use case of this widget is to debug applications which may have “zombie” widgets lying around when some widget is removed, reparented in a dynammic GUI.

KnownPerspectives = {'Default': {'model': [<class 'qarbon.qt.gui.treeqobject.TreeQObjectInfoModel'>], 'icon': '', 'tooltip': 'QObject tree view', 'label': 'Default perspecive'}}
DftPerspective = 'Default'