def createMainWidget(argv): """ Function to create the main widget. @param argv list of commandline parameters (list of strings) @return reference to the main widget (QWidget) """ from Helpviewer.HelpWindow import HelpWindow searchWord = None for arg in reversed(argv): if arg.startswith("--search="): searchWord = argv[1].split("=", 1)[1] argv.remove(arg) elif arg.startswith("--"): argv.remove(arg) try: home = argv[1] except IndexError: home = "" help = HelpWindow(home, '.', None, 'help viewer', searchWord=searchWord) return help