diff --git a/examples/ex_pyqt.py b/examples/ex_pyqt.py new file mode 100644 index 0000000..eb62f0a --- /dev/null +++ b/examples/ex_pyqt.py @@ -0,0 +1,35 @@ +from idaapi import PluginForm +from PyQt4 import QtCore, QtGui +import sip + +class MyPluginFormClass(PluginForm): + def OnCreate(self, form): + """ + Called when the plugin form is created + """ + + # Get parent widget + self.parent = self.FormToPyQtWidget(form) + self.PopulateForm() + + + def PopulateForm(self): + # Create layout + layout = QtGui.QVBoxLayout() + + layout.addWidget( + QtGui.QLabel("Hello from PyQt")) + layout.addWidget( + QtGui.QLabel("Hello from IDAPython")) + + self.parent.setLayout(layout) + + + def OnClose(self, form): + """ + Called when the plugin form is closed + """ + pass + +plg = MyPluginFormClass() +plg.Show("PyQt hello world") diff --git a/examples/ex_pyside.py b/examples/ex_pyside.py new file mode 100644 index 0000000..4f9f433 --- /dev/null +++ b/examples/ex_pyside.py @@ -0,0 +1,34 @@ +from idaapi import PluginForm +from PySide import QtGui, QtCore + +class MyPluginFormClass(PluginForm): + def OnCreate(self, form): + """ + Called when the plugin form is created + """ + + # Get parent widget + self.parent = self.FormToPySideWidget(form) + self.PopulateForm() + + + def PopulateForm(self): + # Create layout + layout = QtGui.QVBoxLayout() + + layout.addWidget( + QtGui.QLabel("Hello from PySide")) + layout.addWidget( + QtGui.QLabel("Hello from IDAPython")) + + self.parent.setLayout(layout) + + + def OnClose(self, form): + """ + Called when the plugin form is closed + """ + pass + +plg = MyPluginFormClass() +plg.Show("PySide hello world")