def __init__(self, title): self._title = title # IDA 7+ Widgets if USING_IDA7API: import sip self._form = idaapi.create_empty_widget(self._title) self.widget = sip.wrapinstance(long(self._form), QtWidgets.QWidget) # legacy IDA PluginForm's else: self._form = idaapi.create_tform(self._title, None) if USING_PYQT5: self.widget = idaapi.PluginForm.FormToPyQtWidget(self._form) else: self.widget = idaapi.PluginForm.FormToPySideWidget(self._form)
def __init__(self, title, icon_path): self._title = title self._icon = QtGui.QIcon(icon_path) # IDA 7+ Widgets if using_ida7api: import sip self._form = idaapi.create_empty_widget(self._title) self._widget = sip.wrapinstance(long(self._form), QtWidgets.QWidget) # NOTE: LOL # legacy IDA PluginForm's else: self._form = idaapi.create_tform(self._title, None) if using_pyqt5: self._widget = idaapi.PluginForm.FormToPyQtWidget(self._form) else: self._widget = idaapi.PluginForm.FormToPySideWidget(self._form) self._widget.setWindowIcon(self._icon)
def __init__(self, window_title, icon_path): super(DockableWindow, self).__init__(window_title, icon_path) # IDA 7+ Widgets if IDAAPI.USING_IDA7API: import sip self._form = idaapi.create_empty_widget(self._window_title) self._widget = sip.wrapinstance(long(self._form), QtWidgets.QWidget) # legacy IDA PluginForm's else: self._form = idaapi.create_tform(self._window_title, None) if USING_PYQT5: self._widget = idaapi.PluginForm.FormToPyQtWidget( self._form, sys.modules[__name__]) else: self._widget = idaapi.PluginForm.FormToPySideWidget( self._form, sys.modules[__name__]) # set the window icon self._widget.setWindowIcon(self._window_icon)