Fixed unicode titles in Dock

This commit is contained in:
Luke Campagnola 2014-02-12 03:02:09 -05:00
parent 9677b1492b
commit 1ecceeaa92
4 changed files with 20 additions and 2 deletions

View File

@ -61,6 +61,7 @@ pyqtgraph-0.9.9 [unreleased]
- Fixed ImageItem exception building histogram when image has only one value
- Fixed MeshData exception caused when vertexes have no matching faces
- Fixed GLViewWidget exception handler
- Fixed unicode support in Dock
pyqtgraph-0.9.8 2013-11-24

View File

@ -2,6 +2,7 @@ from ..Qt import QtCore, QtGui
from .DockDrop import *
from ..widgets.VerticalLabel import VerticalLabel
from ..python2_3 import asUnicode
class Dock(QtGui.QWidget, DockDrop):
@ -167,7 +168,7 @@ class Dock(QtGui.QWidget, DockDrop):
self.resizeOverlay(self.size())
def name(self):
return str(self.label.text())
return asUnicode(self.label.text())
def container(self):
return self._container

View File

@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
#import sip
#sip.setapi('QString', 1)
import pyqtgraph as pg
pg.mkQApp()
import pyqtgraph.dockarea as da
def test_dock():
name = pg.asUnicode("évènts_zàhéér")
dock = da.Dock(name=name)
# make sure unicode names work correctly
assert dock.name() == name
# no surprises in return type.
assert type(dock.name()) == type(name)

View File

@ -1,5 +1,5 @@
"""
Helper functions which smooth out the differences between python 2 and 3.
Helper functions that smooth out the differences between python 2 and 3.
"""
import sys