From e6249d1b0a13294a4894c0e2c7fce5a5929e7ffe Mon Sep 17 00:00:00 2001
From: Robert Kern <rkern@enthought.com>
Date: Tue, 10 Jul 2012 10:34:17 +0100
Subject: [PATCH] BUG: Be sure to use a QSize instead of a tuple for PyQt4
compatibility.
---
chaco/shell/plot_window.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/chaco/shell/plot_window.py b/chaco/shell/plot_window.py
index db8e5da..32fd969 100644
a
|
b
|
def _on_window_close(self, event): |
125 | 125 | |
126 | 126 | elif ETSConfig.toolkit == "qt4": |
127 | 127 | |
128 | | from pyface.qt import QtGui |
| 128 | from pyface.qt import QtCore, QtGui |
129 | 129 | |
130 | 130 | class PlotWindow(QtGui.QFrame): |
131 | 131 | """ A window for holding top-level plot containers. |
… |
… |
class PlotWindow(QtGui.QFrame): |
137 | 137 | def __init__(self, is_image=False, bgcolor="white", |
138 | 138 | image_default_origin="top left", *args, **kw): |
139 | 139 | |
| 140 | if 'size' in kw and isinstance(kw['size'], tuple): |
| 141 | # Convert to a QSize. |
| 142 | kw['size'] = QtCore.QSize(*kw['size']) |
140 | 143 | super(PlotWindow, self).__init__(None, *args, **kw ) |
141 | 144 | |
142 | 145 | # Some defaults which should be overridden by preferences. |
… |
… |
def __init__(self, is_image=False, bgcolor="white", |
163 | 166 | layout.addWidget(self.plot_window.control) |
164 | 167 | self.setLayout(layout) |
165 | 168 | |
166 | | size = kw.setdefault("size", (600,600)) |
167 | | self.set_size(*size) |
| 169 | size = kw.get("size", QtCore.QSize(600,600)) |
| 170 | self.set_size(size.width(), size.height()) |
168 | 171 | |
169 | 172 | self.show() |
170 | 173 | |