def QWheelEvent_to_string(wheelEvent): buttons_str = get_mouse_button_string(wheelEvent.buttons()) key_str = get_key_modifiers_string(wheelEvent.modifiers()) mainwin = QApplication.instance().getMainWindow() topLeftCorner_global = mainwin.mapToGlobal( QPoint(0,0) ) relPos = wheelEvent.globalPos() - topLeftCorner_global return "PyQt4.QtGui.QWheelEvent({}, mainwin.mapToGlobal( QPoint(0,0) ) + {}, {}, {}, {}, {})".format( wheelEvent.pos(), relPos, wheelEvent.delta(), buttons_str, key_str, wheelEvent.orientation() )
def QWheelEvent_to_string(wheelEvent): from ilastik.shell.gui.startShellGui import shell buttons_str = get_mouse_button_string(wheelEvent.buttons()) key_str = get_key_modifiers_string(wheelEvent.modifiers()) topLeftCorner_global = shell.mapToGlobal( QPoint(0,0) ) relPos = wheelEvent.globalPos() - topLeftCorner_global return "PyQt4.QtGui.QWheelEvent({}, shell.mapToGlobal( QPoint(0,0) ) + {}, {}, {}, {}, {})".format( wheelEvent.pos(), relPos, wheelEvent.delta(), buttons_str, key_str, wheelEvent.orientation() )
def QKeyEvent_to_string(keyEvent): text = str(keyEvent.text()) text = text.replace('\n', '\\n') text = '"""' + text + '"""' type_name = get_event_type_name( keyEvent.type() ) mod_str = get_key_modifiers_string(keyEvent.modifiers()) return "PyQt4.QtGui.QKeyEvent({}, 0x{:x}, {}, {}, {}, {})".format( type_name, keyEvent.key(), mod_str, text, keyEvent.isAutoRepeat(), keyEvent.count() )
def QContextMenuEvent_to_string(contextMenuEvent): key_str = get_key_modifiers_string(contextMenuEvent.modifiers()) mainwin = QApplication.instance().getMainWindow() topLeftCorner_global = mainwin.mapToGlobal(QPoint(0, 0)) relPos = contextMenuEvent.globalPos() - topLeftCorner_global return "PyQt4.QtGui.QContextMenuEvent({}, {}, mainwin.mapToGlobal( QPoint(0,0) ) + {}, {})".format( int(contextMenuEvent.reason()), contextMenuEvent.pos(), relPos, key_str)
def QContextMenuEvent_to_string(contextMenuEvent): from ilastik.shell.gui.startShellGui import shell key_str = get_key_modifiers_string(contextMenuEvent.modifiers()) topLeftCorner_global = shell.mapToGlobal(QPoint(0, 0)) relPos = contextMenuEvent.globalPos() - topLeftCorner_global return "PyQt4.QtGui.QContextMenuEvent({}, {}, shell.mapToGlobal( QPoint(0,0) ) + {}, {})".format( int(contextMenuEvent.reason()), contextMenuEvent.pos(), relPos, key_str)
def QMouseEvent_to_string(mouseEvent): type_name = get_event_type_name( mouseEvent.type() ) button_str = get_mouse_button_string(mouseEvent.button()) buttons_str = get_mouse_button_string(mouseEvent.buttons()) key_str = get_key_modifiers_string(mouseEvent.modifiers()) mainwin = QApplication.instance().getMainWindow() topLeftCorner_global = mainwin.mapToGlobal( QPoint(0,0) ) relPos = mouseEvent.globalPos() - topLeftCorner_global return "PyQt4.QtGui.QMouseEvent({}, {}, mainwin.mapToGlobal( QPoint(0,0) ) + {}, {}, {}, {})".format( type_name, mouseEvent.pos(), relPos, button_str, buttons_str, key_str )
def QWheelEvent_to_string(wheelEvent): buttons_str = get_mouse_button_string(wheelEvent.buttons()) key_str = get_key_modifiers_string(wheelEvent.modifiers()) mainwin = QApplication.instance().getMainWindow() topLeftCorner_global = mainwin.mapToGlobal(QPoint(0, 0)) relPos = wheelEvent.globalPos() - topLeftCorner_global return "PyQt4.QtGui.QWheelEvent({}, mainwin.mapToGlobal( QPoint(0,0) ) + {}, {}, {}, {}, {})".format( wheelEvent.pos(), relPos, wheelEvent.delta(), buttons_str, key_str, wheelEvent.orientation())
def QWheelEvent_to_string(wheelEvent): from ilastik.shell.gui.startShellGui import shell buttons_str = get_mouse_button_string(wheelEvent.buttons()) key_str = get_key_modifiers_string(wheelEvent.modifiers()) topLeftCorner_global = shell.mapToGlobal(QPoint(0, 0)) relPos = wheelEvent.globalPos() - topLeftCorner_global return "PyQt4.QtGui.QWheelEvent({}, shell.mapToGlobal( QPoint(0,0) ) + {}, {}, {}, {}, {})".format( wheelEvent.pos(), relPos, wheelEvent.delta(), buttons_str, key_str, wheelEvent.orientation())
def QMouseEvent_to_string(mouseEvent): from ilastik.shell.gui.startShellGui import shell type_name = get_event_type_name( mouseEvent.type() ) button_str = get_mouse_button_string(mouseEvent.button()) buttons_str = get_mouse_button_string(mouseEvent.buttons()) key_str = get_key_modifiers_string(mouseEvent.modifiers()) topLeftCorner_global = shell.mapToGlobal( QPoint(0,0) ) relPos = mouseEvent.globalPos() - topLeftCorner_global return "PyQt4.QtGui.QMouseEvent({}, {}, shell.mapToGlobal( QPoint(0,0) ) + {}, {}, {}, {})".format( type_name, mouseEvent.pos(), relPos, button_str, buttons_str, key_str )
def QMouseEvent_to_string(mouseEvent): type_name = get_event_type_name(mouseEvent.type()) button_str = get_mouse_button_string(mouseEvent.button()) buttons_str = get_mouse_button_string(mouseEvent.buttons()) key_str = get_key_modifiers_string(mouseEvent.modifiers()) mainwin = QApplication.instance().getMainWindow() topLeftCorner_global = mainwin.mapToGlobal(QPoint(0, 0)) relPos = mouseEvent.globalPos() - topLeftCorner_global return "PyQt4.QtGui.QMouseEvent({}, {}, mainwin.mapToGlobal( QPoint(0,0) ) + {}, {}, {}, {})".format( type_name, mouseEvent.pos(), relPos, button_str, buttons_str, key_str)
def QMouseEvent_to_string(mouseEvent): from ilastik.shell.gui.startShellGui import shell type_name = get_event_type_name(mouseEvent.type()) button_str = get_mouse_button_string(mouseEvent.button()) buttons_str = get_mouse_button_string(mouseEvent.buttons()) key_str = get_key_modifiers_string(mouseEvent.modifiers()) topLeftCorner_global = shell.mapToGlobal(QPoint(0, 0)) relPos = mouseEvent.globalPos() - topLeftCorner_global return "PyQt4.QtGui.QMouseEvent({}, {}, shell.mapToGlobal( QPoint(0,0) ) + {}, {}, {}, {})".format( type_name, mouseEvent.pos(), relPos, button_str, buttons_str, key_str)
def QKeyEvent_to_string(keyEvent): text = str(keyEvent.text()) text = text.replace('\n', '\\n') text = text.replace('"', '\\"') text = text.replace("'", "\\'") text = '"""' + text + '"""' type_name = get_event_type_name(keyEvent.type()) mod_str = get_key_modifiers_string(keyEvent.modifiers()) return "PyQt4.QtGui.QKeyEvent({}, 0x{:x}, {}, {}, {}, {})".format( type_name, keyEvent.key(), mod_str, text, keyEvent.isAutoRepeat(), keyEvent.count())
def QContextMenuEvent_to_string(contextMenuEvent): key_str = get_key_modifiers_string(contextMenuEvent.modifiers()) mainwin = QApplication.instance().getMainWindow() topLeftCorner_global = mainwin.mapToGlobal( QPoint(0,0) ) relPos = contextMenuEvent.globalPos() - topLeftCorner_global return "PyQt4.QtGui.QContextMenuEvent({}, {}, mainwin.mapToGlobal( QPoint(0,0) ) + {}, {})".format( int(contextMenuEvent.reason()), contextMenuEvent.pos(), relPos, key_str )
def QContextMenuEvent_to_string(contextMenuEvent): from ilastik.shell.gui.startShellGui import shell key_str = get_key_modifiers_string(contextMenuEvent.modifiers()) topLeftCorner_global = shell.mapToGlobal( QPoint(0,0) ) relPos = contextMenuEvent.globalPos() - topLeftCorner_global return "PyQt4.QtGui.QContextMenuEvent({}, {}, shell.mapToGlobal( QPoint(0,0) ) + {}, {})".format( int(contextMenuEvent.reason()), contextMenuEvent.pos(), relPos, key_str )
def QContextMenuEvent_to_string(contextMenuEvent): key_str = get_key_modifiers_string(contextMenuEvent.modifiers()) return "PyQt4.QtGui.QContextMenuEvent({}, {}, {}, {})".format( int(contextMenuEvent.reason()), contextMenuEvent.pos(), contextMenuEvent.globalPos(), key_str )
def QMouseEvent_to_string(mouseEvent): type_name = get_event_type_name( mouseEvent.type() ) button_str = get_mouse_button_string(mouseEvent.button()) buttons_str = get_mouse_button_string(mouseEvent.buttons()) key_str = get_key_modifiers_string(mouseEvent.modifiers()) return "PyQt4.QtGui.QMouseEvent({}, {}, {}, {}, {})".format( type_name, mouseEvent.pos(), button_str, buttons_str, key_str )
def QWheelEvent_to_string(wheelEvent): buttons_str = get_mouse_button_string(wheelEvent.buttons()) key_str = get_key_modifiers_string(wheelEvent.modifiers()) return "PyQt4.QtGui.QWheelEvent({}, {}, {}, {}, {})".format( wheelEvent.pos(), wheelEvent.delta(), buttons_str, key_str, wheelEvent.orientation() )