Fixed AxisItem to support unicode in tick strings

This commit is contained in:
Luke Campagnola 2013-12-29 09:17:23 -05:00
parent a199b75c66
commit 21c1686221
3 changed files with 7 additions and 4 deletions

View File

@ -34,6 +34,7 @@ pyqtgraph-0.9.9 [unreleased]
- Gave .name() methods to PlotDataItem, PlotCurveItem, and ScatterPlotItem
- fixed ImageItem handling of rgb images
- fixed makeARGB re-ordering of color channels
- fixed unicode usage in AxisItem tick strings
pyqtgraph-0.9.8 2013-11-24

View File

@ -24,6 +24,7 @@ Contributors
* Felix Schill
* Guillaume Poulin
* Antony Lee
* Mattias Põldaru
Requirements
------------
@ -43,7 +44,8 @@ Installation Methods
--------------------
* To use with a specific project, simply copy the pyqtgraph subdirectory
anywhere that is importable from your project
anywhere that is importable from your project. PyQtGraph may also be
used as a git subtree by cloning the git-core repository from github.
* To install system-wide from source distribution:
`$ python setup.py install`
* For instalation packages, see the website (pyqtgraph.org)
@ -62,4 +64,4 @@ Some (incomplete) documentation exists at this time.
`$ make html`
Please feel free to pester Luke or post to the forum if you need a specific
section of documentation.
section of documentation to be expanded.

View File

@ -795,7 +795,7 @@ class AxisItem(GraphicsWidget):
if s is None:
rects.append(None)
else:
br = p.boundingRect(QtCore.QRectF(0, 0, 100, 100), QtCore.Qt.AlignCenter, str(s))
br = p.boundingRect(QtCore.QRectF(0, 0, 100, 100), QtCore.Qt.AlignCenter, asUnicode(s))
## boundingRect is usually just a bit too large
## (but this probably depends on per-font metrics?)
br.setHeight(br.height() * 0.8)
@ -830,7 +830,7 @@ class AxisItem(GraphicsWidget):
vstr = strings[j]
if vstr is None: ## this tick was ignored because it is out of bounds
continue
vstr = str(vstr)
vstr = asUnicode(vstr)
x = tickPositions[i][j]
#textRect = p.boundingRect(QtCore.QRectF(0, 0, 100, 100), QtCore.Qt.AlignCenter, vstr)
textRect = rects[j]