mirror of
https://github.com/pyapp-kit/superqt.git
synced 2025-12-15 18:50:05 +01:00
feat: add QIcon backed by iconify (#209)
* feat: add iconify * update docs * update docs * rearrange * update example * update test deps * importorskip * Update src/superqt/iconify/__init__.py Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com> * Update src/superqt/iconify/__init__.py Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com> * merge * change test * bump dep * change doc * Update src/superqt/iconify/__init__.py Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com> * pragma and bump version --------- Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>
This commit is contained in:
22
tests/test_iconify.py
Normal file
22
tests/test_iconify.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import pytest
|
||||
from qtpy.QtWidgets import QPushButton
|
||||
|
||||
from superqt import QIconifyIcon
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pytestqt.qtbot import QtBot
|
||||
|
||||
|
||||
def test_qiconify(qtbot: "QtBot", monkeypatch: "pytest.MonkeyPatch") -> None:
|
||||
monkeypatch.setenv("PYCONIFY_CACHE", "0")
|
||||
pytest.importorskip("pyconify")
|
||||
|
||||
icon = QIconifyIcon("bi:alarm-fill", color="red", rotate=90)
|
||||
assert icon.path.name.endswith(".svg")
|
||||
|
||||
btn = QPushButton()
|
||||
qtbot.addWidget(btn)
|
||||
btn.setIcon(icon)
|
||||
btn.show()
|
||||
Reference in New Issue
Block a user