Source code for qarbon.qt.gui.objectinfowidget
# ----------------------------------------------------------------------------
# This file is part of qarbon (http://qarbon.rtfd.org/)
#
# Copyright (c) 2013 European Synchrotron Radiation Facility, Grenoble, France
#
# Distributed under the terms of the GNU Lesser General Public License,
# either version 3 of the License, or (at your option) any later version.
# See LICENSE.txt for more info.
# ----------------------------------------------------------------------------
"""A widget which displays/edits information about a QObject.
Example::
from qarbon.external.qt import QtCore, QtGui
from qarbon.qt.gui.application import Application
from qarbon.qt.gui.qobjectinfowidget import ObjectInfoWidget
app = Application()
# mw will be the QObject to be "seen"
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 = ObjectInfoWidget(qobject=mw)
inspector.setAttribute(QtCore.Qt.WA_QuitOnClose, False)
inspector.show()
app.exec_()"""
__all__ = ["ObjectInfoWidget"]
from qarbon.external.qt import QtCore, QtGui
from qarbon.qt.gui.icon import Icon
from qarbon.qt.gui.propertyeditor import PropertyEditor
from qarbon.qt.gui.treeqobject import TreeQObjectWidget
def buildGUI():
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()
return mw
def main():
from qarbon.qt.gui.application import Application
app = Application()
w = buildGUI()
w.show()
inspector = ObjectInfoWidget(qobject=w)
inspector.setAttribute(QtCore.Qt.WA_QuitOnClose, False)
inspector.show()
app.exec_()
if __name__ == "__main__":
main()