~ubuntu-branches/ubuntu/utopic/python-chaco/utopic

« back to all changes in this revision

Viewing changes to chaco/shell/plot_window.py

  • Committer: Package Import Robot
  • Author(s): Andrew Starr-Bochicchio
  • Date: 2014-06-01 17:04:08 UTC
  • mfrom: (7.2.5 sid)
  • Revision ID: package-import@ubuntu.com-20140601170408-m86xvdjd83a4qon0
Tags: 4.4.1-1ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
 - Let the binary-predeb target work on the usr/lib/python* directory
   as we don't have usr/share/pyshared anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.
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.
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