MCPcopy
hub / github.com/mne-tools/mne-python / pixel_ratio

Function pixel_ratio

mne/conftest.py:710–724  ·  view source on GitHub ↗

Get the pixel ratio.

()

Source from the content-addressed store, hash-verified

708
709@pytest.fixture(scope="session")
710def pixel_ratio():
711 """Get the pixel ratio."""
712 # _check_qt_version will init an app for us, so no need for us to do it
713 if not check_version("pyvista", "0.32") or not _check_qt_version():
714 return 1.0
715 from qtpy.QtCore import Qt
716 from qtpy.QtWidgets import QMainWindow
717
718 app = _init_mne_qtapp()
719 app.processEvents()
720 window = QMainWindow()
721 window.setAttribute(Qt.WA_DeleteOnClose, True)
722 ratio = float(window.devicePixelRatio())
723 window.close()
724 return ratio
725
726
727@pytest.fixture(scope="function", params=[testing._pytest_param()])

Callers

nothing calls this directly

Calls 4

check_versionFunction · 0.90
_check_qt_versionFunction · 0.90
_init_mne_qtappFunction · 0.90
closeMethod · 0.45

Tested by

no test coverage detected