def __init__(self, *args, **kwargs): """ Engine Constructor """ self._qt_app = None Engine.__init__(self, *args, **kwargs)
def __init__(self, tk, *args, **kwargs): """ Constructor """ self.__impl = None # Now continue with the standard initialization Engine.__init__(self, tk, *args, **kwargs) self._host_info = {"name": "Desktop", "version": "unknown"}
def __init__(self, tk, *args, **kwargs): """ Constructor """ self.__impl = None # Need to init logging before init_engine to satisfy logging from framework setup self._initialize_logging() # Now continue with the standard initialization Engine.__init__(self, tk, *args, **kwargs)
def __init__(self, tk, *args, **kwargs): """ Constructor """ self.__impl = None # Now continue with the standard initialization Engine.__init__(self, tk, *args, **kwargs)
def _define_qt_base(self): """ check for pyside then pyqt """ base = Engine._define_qt_base(self) # If QtCore hasn't been set, then nothing was. if base["qt_core"] is None: return self._define_unavailable_base() try: QtCore = base["qt_core"] DialogBase = base["dialog_base"] QtWrapper = base["wrapper"] # tell QT to interpret C strings as utf-8 utf8 = QtCore.QTextCodec.codecForName("utf-8") QtCore.QTextCodec.setCodecForCStrings(utf8) # a simple dialog proxy that pushes the window forward class ProxyDialog(DialogBase): _requires_visibility_hack = (True if sgtk.util.is_windows() and not self._is_site_engine else False) def setVisible(self, make_visible): # On Windows, a bug in Qt seems to prevent the first dialog we invoke to appear in the # background process. This seems to be related to the fact that the background process # doesn't even have a presence in the task bar. If we give the background process a # taskbar presence, then dialogs will appear right away. So when there is a request to # show the first dialog, we will "show" another dialog first, which will clean up # whatever incoherent state there is in Qt and will allow the requested dialog to # appear. if self._requires_visibility_hack: d = DialogBase() d.show() d.activateWindow() d.raise_() d.close() d.deleteLater() self._requires_visibility_hack = False DialogBase.setVisible(self, make_visible) def show(self): DialogBase.show(self) self.activateWindow() self.raise_() def exec_(self): self.activateWindow() self.raise_() # the trick of activating + raising does not seem to be enough for # modal dialogs. So force put them on top as well. self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint | self.windowFlags()) return DialogBase.exec_(self) base["dialog_base"] = ProxyDialog self._has_ui = True self._has_qt = True # Strip the name since PySide has a \n at the end for some reason. self.log_debug("Successfully initialized %s '%s' located in %s." % ( QtWrapper.__name__.strip(), QtWrapper.__version__, QtWrapper.__file__, )) return base except Exception as e: self.log_warning( "Error setting up qt. Qt based UI support will not " "be available: %s" % e) return self._define_unavailable_base()
def __init__(self, *args, **kwargs): self._current_file = tde4.getProjectPath() self._custom_scripts_dir_path = None Engine.__init__(self, *args, **kwargs)