File: test_TextItem.py

package info (click to toggle)
python-pyqtgraph 0.13.7-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,072 kB
  • sloc: python: 54,043; makefile: 127; ansic: 40; sh: 2
file content (23 lines) | stat: -rw-r--r-- 407 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import pyqtgraph as pg

app = pg.mkQApp()


def test_TextItem_setAngle():
    plt = pg.PlotWidget()
    plt.show()
    plt.setXRange(-10, 10)
    plt.setYRange(-20, 20)
    item = pg.TextItem(text="test")
    plt.addItem(item)

    t1 = item.transform()

    item.setAngle(30)
    app.processEvents()

    t2 = item.transform()

    assert t1 != t2
    assert not t1.isRotating()
    assert t2.isRotating()