Skip to content

Commit

Permalink
syntax highlighting for README
Browse files Browse the repository at this point in the history
  • Loading branch information
uweschmitt committed Jun 13, 2014
1 parent 7fee6fc commit acc8f35
Showing 1 changed file with 27 additions and 22 deletions.
49 changes: 27 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,39 @@ nested object structure.

Example:

from qt_object_viewer import ObjectTreeDialog
```python

from PyQt4.QtGui import QApplication
from qt_object_viewer import ObjectTreeDialog

app = QApplication([])
dlg = ObjectTreeDialog([1, 2, 3, dict(a=3, b=4, c=(1, 2, dict(d=(4, 5))))])
dlg.show()
app.exec_()
from PyQt4.QtGui import QApplication

app = QApplication([])
dlg = ObjectTreeDialog([1, 2, 3, dict(a=3, b=4, c=(1, 2, dict(d=(4, 5))))])
dlg.show()
app.exec_()
```

Or if you want to embed the widget:

from qt_object_viewer import ObjectTreeWidget
```python
from qt_object_viewer import ObjectTreeWidget

from PyQt4.QtGui import QDialog, QVBoxLayout
from PyQt4.QtCore import Qt
from PyQt4.QtGui import QDialog, QVBoxLayout
from PyQt4.QtCore import Qt

class MyDialog(QDialog):
class MyDialog(QDialog):

def __init__(self, root_object, parent=None, f=Qt.WindowFlags()):
QDialog.__init__(self, parent, f)
self.resize(480, 640)
self.vertical_layout = QVBoxLayout(self)
self.tree_view = ObjectTreeWidget(self)
self.tree_view.set_root_object(root_object)
self.tree_view.expand_top_level()
self.vertical_layout.addWidget(self.tree_view)
def __init__(self, root_object, parent=None, f=Qt.WindowFlags()):
QDialog.__init__(self, parent, f)
self.resize(480, 640)
self.vertical_layout = QVBoxLayout(self)
self.tree_view = ObjectTreeWidget(self)
self.tree_view.set_root_object(root_object)
self.tree_view.expand_top_level()
self.vertical_layout.addWidget(self.tree_view)

app = QApplication([])
dlg = MyDialog([1, 2, 3, dict(a=3, b=4, c=(1, 2, dict(d=(4, 5))))])
dlg.show()
app.exec_()
app = QApplication([])
dlg = MyDialog([1, 2, 3, dict(a=3, b=4, c=(1, 2, dict(d=(4, 5))))])
dlg.show()
app.exec_()
```

0 comments on commit acc8f35

Please sign in to comment.