mirror of
https://github.com/idapython/src
synced 2026-06-08 14:47:00 +00:00
37 lines
828 B
Python
37 lines
828 B
Python
|
|
from idaapi import PluginForm
|
|
from PyQt5 import QtCore, QtGui, QtWidgets
|
|
import sip
|
|
|
|
class MyPluginFormClass(PluginForm):
|
|
def OnCreate(self, form):
|
|
"""
|
|
Called when the widget is created
|
|
"""
|
|
|
|
# Get parent widget
|
|
self.parent = self.FormToPyQtWidget(form)
|
|
self.PopulateForm()
|
|
|
|
|
|
def PopulateForm(self):
|
|
# Create layout
|
|
layout = QtWidgets.QVBoxLayout()
|
|
|
|
layout.addWidget(
|
|
QtWidgets.QLabel("Hello from <font color=red>PyQt</font>"))
|
|
layout.addWidget(
|
|
QtWidgets.QLabel("Hello from <font color=blue>IDAPython</font>"))
|
|
|
|
self.parent.setLayout(layout)
|
|
|
|
|
|
def OnClose(self, form):
|
|
"""
|
|
Called when the widget is closed
|
|
"""
|
|
pass
|
|
|
|
plg = MyPluginFormClass()
|
|
plg.Show("PyQt hello world")
|