Add custom_control and custom_page_control variables to override the Qt widgets used by qtconsole #2007

Merged
merged 2 commits into from Jun 25, 2012

Projects

None yet

4 participants

@ccordoba12
  • This will let other project to easily provide its own widgets
  • Try to fix #1920
@ccordoba12 ccordoba12 Add custom_control and custom_page_control variables to override the …
…Qt widgets used by qtconsole

- This will let other project to easily provide its own widgets
- Try to fix #1920
6173df6
@ccordoba12

@fperez, I tried this approach in conjunction with Spyder and it works great, letting us easily use our subclass of QTextEdit.

@fperez
IPython member

Great, thanks for the report. @jdmarch, @epatters, since Enthought is likely the largest consumer of the Qt code, I'd like to make sure it doesn't cause any headaches for your gang before proceeding further...

@minrk minrk commented on the diff Jun 23, 2012
IPython/frontend/qt/console/console_widget.py
@@ -989,7 +996,9 @@ def _create_control(self):
""" Creates and connects the underlying text widget.
"""
# Create the underlying control.
- if self.kind == 'plain':
+ if self.custom_control:
+ control = self.custom_control
@minrk
minrk Jun 23, 2012

Shouldn't this be a callable? control = self.custom_control()

@ccordoba12
ccordoba12 Jun 24, 2012

I was planning to use it as: self.custom_control = SpyderControlWidget() but I think you're right. It would better match how you create control in the next line. I'm going to change it.

@jdmarch

Looks fine to me. Handing it on to bleeding edgers for a look as well.

@ccordoba12 ccordoba12 Call custom control variables when creating the widgets
- This better matches how they are normally created
d8c3121
@minrk
IPython member

This looks fine to me now, so when we get one more OK from @jdmarch's beeding edgers, it's ready to go.

@fperez
IPython member

Targeting for 0.13 then, @jdmarch let us know how things go so we can squeeze this one in before release.

@jdmarch

Got the ok - thanks @punchagan

@fperez
IPython member

Great, thanks! Merging now then.

@fperez fperez merged commit 4abd769 into ipython:master Jun 25, 2012
@ccordoba12

Thanks guys for your support and to Enthought guys for giving their OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment