Check Qt binding requirements
1956
def check_qt():
    """"""
    qt_infos = dict(pyqt5=("PyQt5", "5.6"))
    try:
        import qtpy
        package_name, required_ver = qt_infos[qtpy.API]
        actual_ver = qtpy.PYQT_VERSION
        if LooseVersion(actual_ver) < LooseVersion(required_ver):
            show_warning("Please check Spyder installation requirements:\n"
                         "%s %s+ is required (found v%s)."
                         % (package_name, required_ver, actual_ver))
    except ImportError:
        show_warning("Failed to import qtpy.\n"
                     "Please check Spyder installation requirements:\n\n"
                     "qtpy 1.2.0+ and\n"
                     "%s %s+\n\n"
                     "are required to run Spyder."
                     % (qt_infos['pyqt5']))
484859
def _pyqt4():
    """"""

    import sip

    # Validation of envivornment variable. Prevents an error if
    # the variable is invalid since it's just a hint.
    try:
        hint = int(QT_SIP_API_HINT)
    except TypeError:
        hint = None  # Variable was None, i.e. not set.
    except ValueError:
        raise ImportError("QT_SIP_API_HINT=%s must be a 1 or 2")

    for api in ("QString",
                "QVariant",
                "QDate",
                "QDateTime",
                "QTextStream",
                "QTime",
                "QUrl"):
        try:
            sip.setapi(api, hint or 2)
        except AttributeError:
            raise ImportError("PyQt4 < 4.6 isn't supported by Qt.py")
        except ValueError:
            actual = sip.getapi(api)
            if not hint:
                raise ImportError("API version already set to %d" % actual)
            else:
                # Having provided a hint indicates a soft constraint, one
                # that doesn't throw an exception.
                sys.stderr.write(
                    "Warning: API '%s' has already been set to %d.\n"
                    % (api, actual)
                )

    import PyQt4 as module
    _setup(module, ["uic"])

    try:
        import sip
        Qt.QtCompat.wrapInstance = (
            lambda ptr, base=None: _wrapinstance(
                sip.wrapinstance, ptr, base)
        )
        Qt.QtCompat.getCppPointer = lambda object: \
            sip.unwrapinstance(object)

    except ImportError:
        pass  # Optional

    if hasattr(Qt, "_uic"):
        Qt.QtCompat.loadUi = _loadUi

    if hasattr(Qt, "_QtGui"):
        setattr(Qt, "QtWidgets", _new_module("QtWidgets"))
        setattr(Qt, "_QtWidgets", Qt._QtGui)
        if hasattr(Qt._QtGui, "QX11Info"):
            setattr(Qt, "QtX11Extras", _new_module("QtX11Extras"))
            Qt.QtX11Extras.QX11Info = Qt._QtGui.QX11Info

        Qt.QtCompat.setSectionResizeMode = \
            Qt._QtGui.QHeaderView.setResizeMode

    if hasattr(Qt, "_QtCore"):
        Qt.__binding_version__ = Qt._QtCore.PYQT_VERSION_STR
        Qt.__qt_version__ = Qt._QtCore.QT_VERSION_STR
        QCoreApplication = Qt._QtCore.QCoreApplication
        Qt.QtCompat.qInstallMessageHandler = _qInstallMessageHandler
        Qt.QtCompat.translate = (
            lambda context, sourceText, disambiguation, n:
            QCoreApplication.translate(
                context,
                sourceText,
                disambiguation,
                QCoreApplication.CodecForTr,
                n)
        )

    _reassign_misplaced_members("PyQt4")

    # QFileDialog QtCompat decorator
    def _standardizeQFileDialog(some_function):
        """Decorator that makes PyQt4 return conform to other bindings"""
        def wrapper(*args, **kwargs):
            ret = (some_function(*args, **kwargs))

            # PyQt4 only returns the selected filename, force it to a
            # standard return of the selected filename, and a empty string
            # for the selected filter
            return ret, ''

        wrapper.__doc__ = some_function.__doc__
        wrapper.__name__ = some_function.__name__

        return wrapper

    decorators = {
        "QFileDialog": {
            "getOpenFileName": _standardizeQFileDialog,
            "getOpenFileNames": _standardizeQFileDialog,
            "getSaveFileName": _standardizeQFileDialog,
        }
    }
    _build_compatibility_members('PyQt4', decorators)
1114930
def patch_qt(qt_support_mode):
    '''
    
    '''
    if not qt_support_mode:
        return

    if qt_support_mode is True or qt_support_mode == 'True':
        # do not break backward compatibility
        qt_support_mode = 'auto'

    if qt_support_mode == 'auto':
        qt_support_mode = os.getenv('PYDEVD_PYQT_MODE', 'auto')

    # Avoid patching more than once
    global _patched_qt
    if _patched_qt:
        return

    _patched_qt = True

    if qt_support_mode == 'auto':

        patch_qt_on_import = None
        try:
            import PySide2  # @UnresolvedImport @UnusedImport
            qt_support_mode = 'pyside2'
        except:
            try:
                import Pyside  # @UnresolvedImport @UnusedImport
                qt_support_mode = 'pyside'
            except:
                try:
                    import PyQt5  # @UnresolvedImport @UnusedImport
                    qt_support_mode = 'pyqt5'
                except:
                    try:
                        import PyQt4  # @UnresolvedImport @UnusedImport
                        qt_support_mode = 'pyqt4'
                    except:
                        return

    if qt_support_mode == 'pyside2':
        try:
            import PySide2.QtCore  # @UnresolvedImport
            _internal_patch_qt(PySide2.QtCore, qt_support_mode)
        except:
            return

    elif qt_support_mode == 'pyside':
        try:
            import PySide.QtCore  # @UnresolvedImport
            _internal_patch_qt(PySide.QtCore, qt_support_mode)
        except:
            return

    elif qt_support_mode == 'pyqt5':
        try:
            import PyQt5.QtCore  # @UnresolvedImport
            _internal_patch_qt(PyQt5.QtCore)
        except:
            return

    elif qt_support_mode == 'pyqt4':
        # Ok, we have an issue here:
        # PyDev-452: Selecting PyQT API version using sip.setapi fails in debug mode
        # http://pyqt.sourceforge.net/Docs/PyQt4/incompatible_apis.html
        # Mostly, if the user uses a different API version (i.e.: v2 instead of v1),
        # that has to be done before importing PyQt4 modules (PySide/PyQt5 don't have this issue
        # as they only implements v2).
        patch_qt_on_import = 'PyQt4'
        def get_qt_core_module():
            import PyQt4.QtCore  # @UnresolvedImport
            return PyQt4.QtCore
        _patch_import_to_patch_pyqt_on_import(patch_qt_on_import, get_qt_core_module)

    else:
        raise ValueError('Unexpected qt support mode: %s' % (qt_support_mode,))
837941
function () {
            this.$BindableWidget.initWidget.call(this);

            var bindings = this._cfg.bind;
            var isBound = false;

            if (bindings.visible) {
                var visible = this._transform(bindings.visible.transform, bindings.visible.inside[bindings.visible.to], "toWidget");
                if (visible === true) {
                    this.show();
                }
                isBound = true;
            }
            if (!isBound) {
                this.$logWarn(this.BINDING_NEEDED, [this.$class, "visible"]);
            }
        }
280036
def check(self):
        """"""
        for name, valItem, dtype in self.values:
            val = valItem.text()
            if dtype:
                try:
                    val = dtype(val)
                except:
                    msgBox = QtWidgets.QMessageBox()
                    msgBox.setText(
                        'attribute %s has not the right dtype(%s)' %
                        (name, str(dtype)))
                    msgBox.exec_()
            self.args[name] = val
        self.accept()
242864
def qteIsMiniApplet(self, obj):
        
        try:
            ret = obj._qteAdmin.isMiniApplet
        except AttributeError:
            ret = False

        return ret
361271
def load_from_conf(self):
        """"""
        for checkbox, (option, default) in list(self.checkboxes.items()):
            checkbox.setChecked(self.get_option(option, default))
            # QAbstractButton works differently for PySide and PyQt
            if not API == 'pyside':
                checkbox.clicked.connect(lambda _foo, opt=option:
                                         self.has_been_modified(opt))
            else:
                checkbox.clicked.connect(lambda opt=option:
                                         self.has_been_modified(opt))
        for radiobutton, (option, default) in list(self.radiobuttons.items()):
            radiobutton.setChecked(self.get_option(option, default))
            radiobutton.toggled.connect(lambda _foo, opt=option:
                                        self.has_been_modified(opt))
            if radiobutton.restart_required:
                self.restart_options[option] = radiobutton.label_text
        for lineedit, (option, default) in list(self.lineedits.items()):
            lineedit.setText(self.get_option(option, default))
            lineedit.textChanged.connect(lambda _foo, opt=option:
                                         self.has_been_modified(opt))
            if lineedit.restart_required:
                self.restart_options[option] = lineedit.label_text
        for textedit, (option, default) in list(self.textedits.items()):
            textedit.setPlainText(self.get_option(option, default))
            textedit.textChanged.connect(lambda opt=option:
                                         self.has_been_modified(opt))
            if textedit.restart_required:
                self.restart_options[option] = textedit.label_text
        for spinbox, (option, default) in list(self.spinboxes.items()):
            spinbox.setValue(self.get_option(option, default))
            spinbox.valueChanged.connect(lambda _foo, opt=option:
                                         self.has_been_modified(opt))
        for combobox, (option, default) in list(self.comboboxes.items()):
            value = self.get_option(option, default)
            for index in range(combobox.count()):
                data = from_qvariant(combobox.itemData(index), to_text_string)
                # For PyQt API v2, it is necessary to convert `data` to
                # unicode in case the original type was not a string, like an
                # integer for example (see qtpy.compat.from_qvariant):
                if to_text_string(data) == to_text_string(value):
                    break
            else:
                if combobox.count() == 0:
                    index = None
            if index:
                combobox.setCurrentIndex(index)
            combobox.currentIndexChanged.connect(lambda _foo, opt=option:
                                                 self.has_been_modified(opt))
            if combobox.restart_required:
                self.restart_options[option] = combobox.label_text

        for (fontbox, sizebox), option in list(self.fontboxes.items()):
            font = self.get_font(option)
            fontbox.setCurrentFont(font)
            sizebox.setValue(font.pointSize())
            if option is None:
                property = 'plugin_font'
            else:
                property = option
            fontbox.currentIndexChanged.connect(lambda _foo, opt=property:
                                                self.has_been_modified(opt))
            sizebox.valueChanged.connect(lambda _foo, opt=property:
                                         self.has_been_modified(opt))
        for clayout, (option, default) in list(self.coloredits.items()):
            property = to_qvariant(option)
            edit = clayout.lineedit
            btn = clayout.colorbtn
            edit.setText(self.get_option(option, default))
            # QAbstractButton works differently for PySide and PyQt
            if not API == 'pyside':
                btn.clicked.connect(lambda _foo, opt=option:
                                    self.has_been_modified(opt))
            else:
                btn.clicked.connect(lambda opt=option:
                                    self.has_been_modified(opt))
            edit.textChanged.connect(lambda _foo, opt=option:
                                     self.has_been_modified(opt))
        for (clayout, cb_bold, cb_italic
             ), (option, default) in list(self.scedits.items()):
            edit = clayout.lineedit
            btn = clayout.colorbtn
            color, bold, italic = self.get_option(option, default)
            edit.setText(color)
            cb_bold.setChecked(bold)
            cb_italic.setChecked(italic)
            edit.textChanged.connect(lambda _foo, opt=option:
                                     self.has_been_modified(opt))
            # QAbstractButton works differently for PySide and PyQt
            if not API == 'pyside':
                btn.clicked.connect(lambda _foo, opt=option:
                                    self.has_been_modified(opt))
                cb_bold.clicked.connect(lambda _foo, opt=option:
                                        self.has_been_modified(opt))
                cb_italic.clicked.connect(lambda _foo, opt=option:
                                          self.has_been_modified(opt))
            else:
                btn.clicked.connect(lambda opt=option:
                                    self.has_been_modified(opt))
                cb_bold.clicked.connect(lambda opt=option:
                                        self.has_been_modified(opt))
                cb_italic.clicked.connect(lambda opt=option:
                                          self.has_been_modified(opt))
1366047
def autodetect():
    
    logging.getLogger(__name__).debug('auto-detecting QT_API')
    try:
        logging.getLogger(__name__).debug('trying PyQt5')
        import PyQt5
        os.environ[QT_API] = PYQT5_API[0]
        logging.getLogger(__name__).debug('imported PyQt5')
    except ImportError:
        try:
            logging.getLogger(__name__).debug('trying PyQt4')
            setup_apiv2()
            import PyQt4
            os.environ[QT_API] = PYQT4_API[0]
            logging.getLogger(__name__).debug('imported PyQt4')
        except ImportError:
            try:
                logging.getLogger(__name__).debug('trying PySide')
                import PySide
                os.environ[QT_API] = PYSIDE_API[0]
                logging.getLogger(__name__).debug('imported PySide')
            except ImportError:
                raise PythonQtError('No Qt bindings could be found')
164534
def __initialize_ui(self):
        

        umbra.ui.common.set_window_default_icon(self)

        self.__model = SearchResultsModel(self)
        self.__delegate = RichText_QStyledItemDelegate(self)

        self.Search_Results_treeView.setParent(None)
        self.Search_Results_treeView = SearchResults_QTreeView(self,
                                                               self.__model,
                                                               message="No Search Result to view!")
        self.Search_Results_treeView.setItemDelegate(self.__delegate)
        self.Search_Results_treeView.setObjectName("Search_Results_treeView")
        self.Search_Results_frame_gridLayout.addWidget(self.Search_Results_treeView, 0, 0)
        self.__view = self.Search_Results_treeView
        self.__view.setContextMenuPolicy(Qt.ActionsContextMenu)
        self.__view_add_actions()

        self.__search_patterns_model = self.__container.search_and_replace.search_patterns_model
        self.Search_comboBox.setModel(self.__container.search_and_replace.search_patterns_model)
        self.Search_comboBox.setInsertPolicy(QComboBox.InsertAtTop)
        self.Search_comboBox.completer().setCaseSensitivity(Qt.CaseSensitive)

        self.__replace_with_patterns_model = self.__container.search_and_replace.replace_with_patterns_model
        self.Replace_With_comboBox.setModel(self.__container.search_and_replace.replace_with_patterns_model)
        self.Replace_With_comboBox.setInsertPolicy(QComboBox.InsertAtTop)
        self.Replace_With_comboBox.completer().setCaseSensitivity(Qt.CaseSensitive)

        self.Where_lineEdit.setParent(None)
        self.Where_lineEdit = Search_QLineEdit(self)
        self.Where_lineEdit.setObjectName("Where_lineEdit")
        self.Where_frame_gridLayout.addWidget(self.Where_lineEdit, 0, 0)
        self.__locations_menu = QMenu()
        for title, location in self.__locations.iteritems():
            self.__locations_menu.addAction(self.__container.engine.actions_manager.register_action(
                "Actions|Umbra|Components|factory.script_editor|Search In Files|{0}".format(title),
                text="{0}".format(title),
                slot=functools.partial(self.__add_location, location)))
        self.Where_lineEdit.search_active_label.set_menu(self.__locations_menu)
        self.Where_lineEdit.setPlaceholderText("Use the magnifier to add locations!")

        self.installEventFilter(ValidationFilter(self))

        # Signals / Slots.
        self.__view.selectionModel().selectionChanged.connect(self.__view_selectionModel__selectionChanged)
        self.__view.doubleClicked.connect(self.__view__doubleClicked)
        self.__search_patterns_model.pattern_inserted.connect(functools.partial(
            self.__patterns_model__pattern_inserted, self.Search_comboBox))
        self.__replace_with_patterns_model.pattern_inserted.connect(functools.partial(
            self.__patterns_model__pattern_inserted, self.Replace_With_comboBox))
        self.Search_pushButton.clicked.connect(self.__Search_pushButton__clicked)
        self.Close_pushButton.clicked.connect(self.__Close_pushButton__clicked)
401790
private void checkPrimitiveBinding(List<ValidationMessage> errors, String path, String type, ElementDefinition elementContext, Element element, StructureDefinition profile) {
		if (!element.hasPrimitiveValue())
			return;

		String value = element.primitiveValue();
		// System.out.println("check "+value+" in "+path);

		// firstly, resolve the value set
		ElementDefinitionBindingComponent binding = elementContext.getBinding();
		if (binding.hasValueSet() && binding.getValueSet() instanceof Reference) {
			ValueSet vs = resolveBindingReference(profile, binding.getValueSet());
			if (warning(errors, IssueType.CODEINVALID, element.line(), element.col(), path, vs != null, "ValueSet {0} not found", describeReference(binding.getValueSet()))) {
				long t = System.nanoTime();
				ValidationResult vr = context.validateCode(null, value, null, vs);
				txTime = txTime + (System.nanoTime() - t);
				if (vr != null && !vr.isOk()) {
					if (binding.getStrength() == BindingStrength.REQUIRED)
						rule(errors, IssueType.CODEINVALID, element.line(), element.col(), path, false, "The value provided ('"+value+"') is not in the value set " + describeReference(binding.getValueSet()) + " (" + vs.getUrl() + ", and a code is required from this value set");
					else if (binding.getStrength() == BindingStrength.EXTENSIBLE)
						warning(errors, IssueType.CODEINVALID, element.line(), element.col(), path, false, "The value provided ('"+value+"') is not in the value set " + describeReference(binding.getValueSet()) + " (" + vs.getUrl() + ", and a code should come from this value set unless it has no suitable code");
					else if (binding.getStrength() == BindingStrength.PREFERRED)
						hint(errors, IssueType.CODEINVALID, element.line(), element.col(), path, false,  "The value provided ('"+value+"') is not in the value set " + describeReference(binding.getValueSet()) + " (" + vs.getUrl() + ", and a code is recommended to come from this value set");
				}
			}
		} else
			hint(errors, IssueType.CODEINVALID, element.line(), element.col(), path, !type.equals("code"), "Binding has no source, so can't be checked");
	}
363803
def _pyqt5():
    """"""

    import PyQt5 as module
    _setup(module, ["uic"])

    try:
        import sip
        Qt.QtCompat.wrapInstance = (
            lambda ptr, base=None: _wrapinstance(
                sip.wrapinstance, ptr, base)
        )
        Qt.QtCompat.getCppPointer = lambda object: \
            sip.unwrapinstance(object)

    except ImportError:
        pass  # Optional

    if hasattr(Qt, "_uic"):
        Qt.QtCompat.loadUi = _loadUi

    if hasattr(Qt, "_QtCore"):
        Qt.__binding_version__ = Qt._QtCore.PYQT_VERSION_STR
        Qt.__qt_version__ = Qt._QtCore.QT_VERSION_STR
        Qt.QtCompat.qInstallMessageHandler = _qInstallMessageHandler
        Qt.QtCompat.translate = Qt._QtCore.QCoreApplication.translate

    if hasattr(Qt, "_QtWidgets"):
        Qt.QtCompat.setSectionResizeMode = \
            Qt._QtWidgets.QHeaderView.setSectionResizeMode

    _reassign_misplaced_members("PyQt5")
    _build_compatibility_members('PyQt5')
743703
def setup(self, fname):
        """"""
        combo_label = QLabel(_("Select a run configuration:"))
        self.combo = QComboBox()
        self.combo.setMaxVisibleItems(20)
        self.combo.setSizeAdjustPolicy(QComboBox.AdjustToMinimumContentsLength)
        self.combo.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        
        self.stack = QStackedWidget()

        configurations = _get_run_configurations()
        for index, (filename, options) in enumerate(configurations):
            if fname == filename:
                break
        else:
            # There is no run configuration for script *fname*:
            # creating a temporary configuration that will be kept only if
            # dialog changes are accepted by the user
            configurations.insert(0, (fname, RunConfiguration(fname).get()))
            index = 0
        for filename, options in configurations:
            widget = RunConfigOptions(self)
            widget.set(options)
            self.combo.addItem(filename)
            self.stack.addWidget(widget)
        self.combo.currentIndexChanged.connect(self.stack.setCurrentIndex)
        self.combo.setCurrentIndex(index)

        self.add_widgets(combo_label, self.combo, 10, self.stack)
        self.add_button_box(QDialogButtonBox.Ok|QDialogButtonBox.Cancel)

        self.setWindowTitle(_("Run configuration per file"))
810429
def _none():
    """"""

    Mock = type("Mock", (), {"__getattr__": lambda Qt, attr: None})

    Qt.__binding__ = "None"
    Qt.__qt_version__ = "0.0.0"
    Qt.__binding_version__ = "0.0.0"
    Qt.QtCompat.loadUi = lambda uifile, baseinstance=None: None
    Qt.QtCompat.setSectionResizeMode = lambda *args, **kwargs: None

    for submodule in _common_members.keys():
        setattr(Qt, submodule, Mock())
        setattr(Qt, "_" + submodule, Mock())
515086
def __initialize_ui(self):
        

        umbra.ui.common.set_window_default_icon(self)

        for model, settings_key, combo_box in \
                (("_SearchAndReplace__search_patterns_model", "recent_search_patterns", self.Search_comboBox),
                 ("_SearchAndReplace__replace_with_patterns_model", "recent_replace_with_patterns",
                  self.Replace_With_comboBox)):
            self.__dict__[model] = PatternsModel()
            patterns = foundations.common.ordered_uniqify([foundations.strings.to_string(pattern) for pattern in
                                                           self.__container.settings.get_key(
                                                               self.__container.settings_section,
                                                               settings_key).toStringList()])
            [PatternNode(parent=self.__dict__[model].root_node, name=pattern)
             for pattern in patterns[:self.__maximum_stored_patterns]]
            combo_box.setInsertPolicy(QComboBox.InsertAtTop)
            combo_box.setModel(self.__dict__[model])

            combo_box.completer().setCaseSensitivity(Qt.CaseSensitive)

            # Signals / Slots.
            self.__dict__[model].pattern_inserted.connect(
                functools.partial(self.__patterns_model__pattern_inserted, settings_key, combo_box))

        self.Wrap_Around_checkBox.setChecked(True)

        self.installEventFilter(ValidationFilter(self))

        # Signals / Slots.
        self.Search_pushButton.clicked.connect(self.__Search_pushButton__clicked)
        self.Replace_pushButton.clicked.connect(self.__Replace_pushButton__clicked)
        self.Replace_All_pushButton.clicked.connect(self.__Replace_All_pushButton__clicked)
        self.Close_pushButton.clicked.connect(self.__Close_pushButton__clicked)
1151237
def eventFilter( self, object, event ):
        
        if ( event.type() == event.KeyPress ):
            if ( event.key() == Qt.Key_Escape ):
                self._completerTree.hide()
                self.completer().popup().hide()
                
                self.cancelEdit()
                
            elif ( event.key() in (Qt.Key_Return, Qt.Key_Enter) ):
                self.acceptEdit()
                return True
                
            elif ( event.key() == Qt.Key_Tab ):
                if ( self.completer().popup().isVisible() ):
                    text   = nativestring(self.completer().currentCompletion())
                    super(XNavigationEdit, self).setText(text)
                    return True
                else:
                    self.acceptEdit()
                    return False
            
        elif ( event.type() == event.MouseButtonPress ):
            if ( not self._completerTree.rect().contains(event.pos()) ):
                self._completerTree.hide()
                self.completer().popup().hide()
                
                self.cancelEdit()
        
        return False
165575
def __initialize_ui(self):
        

        self.viewport().installEventFilter(ReadOnlyFilter(self))

        if issubclass(type(self), QListView):
            super(type(self), self).setUniformItemSizes(True)
        elif issubclass(type(self), QTreeView):
            super(type(self), self).setUniformRowHeights(True)
663062
def QCapsulate(self, widget, name, blocking = False, nude = False):
        

        class QuickWindow(QtWidgets.QMainWindow):

            class Signals(QtCore.QObject):
                close = QtCore.Signal()
                show  = QtCore.Signal()

            def __init__(self, blocking = False, parent = None, nude = False):
                super().__init__(parent)
                self.propagate = True # send signals or not
                self.setStyleSheet(style.main_gui)
                if (blocking):
                    self.setWindowModality(QtCore.Qt.ApplicationModal)
                if (nude):
                    # http://doc.qt.io/qt-5/qt.html#WindowType-enum
                    # TODO: create a widget for a proper splashscreen (omitting X11 and centering manually)
                    # self.setWindowFlags(QtCore.Qt.Popup) # Qt 5.9+ : setFlags()
                    # self.setWindowFlags(QtCore.Qt.SplashScreen | QtCore.Qt.WindowStaysOnTopHint)
                    self.setWindowFlags(QtCore.Qt.Dialog)
                self.signals = self.Signals()
                

            def closeEvent(self, e):
                if (self.propagate):
                    self.signals.close.emit()
                e.accept()
                
            def showEvent(self, e):
                if (self.propagate):
                    self.signals.show.emit()
                e.accept()
                
            def setPropagate(self):
                self.propagate = True
                
            def unSetPropagate(self):
                self.propagate = False
                

        win = QuickWindow(blocking = blocking, nude = nude)
        win.setCentralWidget(widget)
        win.setLayout(QtWidgets.QHBoxLayout())
        win.setWindowTitle(name)
        return win