diff python/hexviewer.py @ 109:ad14c7c52589

Created qt property viewer
author Windel Bouwman
date Thu, 03 Jan 2013 18:33:29 +0100
parents 6a303f835c6d
children d38729d35c4d
line wrap: on
line diff
--- a/python/hexviewer.py	Tue Jan 01 17:17:44 2013 +0100
+++ b/python/hexviewer.py	Thu Jan 03 18:33:29 2013 +0100
@@ -2,6 +2,7 @@
 
 from PyQt4.QtCore import *
 from PyQt4.QtGui import *
+from qtpropertyviewer import QtPropertyViewer
 import sys
 import hexfile
 
@@ -77,11 +78,17 @@
       filename = QFileDialog.getOpenFileName(self, "Open hex file...", "*.hex", "Intel hexfiles (*.hex)")
       if filename:
          h = hexfile.HexFile(filename)
+   @pyqtProperty(str)
+   def leetValue(self):
+      return '1337'
 
 if __name__ == '__main__':
    app = QApplication(sys.argv)
    bv = BinViewMain()
    bv.show()
    bv.bv.setHexFile(hexfile.HexFile('audio.hex'))
+   qpv = QtPropertyViewer()
+   qpv.propertyModel.InspectedWidget = bv
+   qpv.show()
    app.exec_()