changed some QtGui.* to QtWidgets.* and has_keys removed