2020-02-25 07:00:42 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2014-03-24 19:47:32 +00:00
|
|
|
import pyqtgraph as pg
|
2021-05-28 14:39:00 +00:00
|
|
|
import os
|
2015-07-18 13:38:34 +00:00
|
|
|
import pytest
|
|
|
|
|
2014-04-26 17:45:34 +00:00
|
|
|
|
|
|
|
app = pg.mkQApp()
|
2014-03-24 19:47:32 +00:00
|
|
|
|
|
|
|
def test_isQObjectAlive():
|
|
|
|
o1 = pg.QtCore.QObject()
|
|
|
|
o2 = pg.QtCore.QObject()
|
|
|
|
o2.setParent(o1)
|
|
|
|
del o1
|
|
|
|
assert not pg.Qt.isQObjectAlive(o2)
|
2014-04-26 17:45:34 +00:00
|
|
|
|
2018-02-17 04:42:34 +00:00
|
|
|
@pytest.mark.skipif(pg.Qt.QT_LIB == 'PySide', reason='pysideuic does not appear to be '
|
|
|
|
'packaged with conda')
|
2020-06-04 04:22:01 +00:00
|
|
|
@pytest.mark.skipif(
|
|
|
|
pg.Qt.QT_LIB == "PySide2"
|
|
|
|
and tuple(map(int, pg.Qt.PySide2.__version__.split("."))) >= (5, 14)
|
|
|
|
and tuple(map(int, pg.Qt.PySide2.__version__.split("."))) < (5, 14, 2, 2),
|
|
|
|
reason="new PySide2 doesn't have loadUi functionality"
|
|
|
|
)
|
2014-04-26 17:45:34 +00:00
|
|
|
def test_loadUiType():
|
|
|
|
path = os.path.dirname(__file__)
|
|
|
|
formClass, baseClass = pg.Qt.loadUiType(os.path.join(path, 'uictest.ui'))
|
|
|
|
w = baseClass()
|
|
|
|
ui = formClass()
|
|
|
|
ui.setupUi(w)
|
|
|
|
w.show()
|
|
|
|
app.processEvents()
|