import sys
import names
import squish
import test
def install_handlers():
# Inject desired function into main module:
sys.modules['__main__'].handler_cellClicked = handler_cellClicked
# Install signal handler by name:
squish.installLazySignalHandler({"type": "QTableWidget", "unnamed": "1", "visible": "1"}, "cellClicked(int, int)", "handler_cellClicked")
# Inject desired function into main module:
sys.modules['__main__'].handler_itemChanged = handler_itemChanged
# Install signal handler by name:
squish.installSignalHandler(names.foo_QTableWidget, "itemChanged(QTableWidgetItem*)", "handler_itemChanged")
# installEventHandler() allows registering via function
# reference, no tricks like the above required:
squish.installEventHandler("MessageBoxOpened", handler_MessageBoxOpened)
def handler_cellClicked(obj, row, column):
test.log("cellClicked: " + str(row) + " / " + str(column))
def handler_itemChanged(obj, item):
test.log("itemChanged: " + str(item.text()))
def handler_MessageBoxOpened(msg):
test.log("MessageBoxOpened: " + msg)