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
Contributor
  • 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
Contributor

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

@fperez
Member
fperez commented Jun 22, 2012

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 Member

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

@ccordoba12
ccordoba12 Jun 24, 2012 Contributor

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
Contributor
jdmarch commented Jun 24, 2012

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
Member
minrk commented Jun 24, 2012

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

@fperez
Member
fperez commented Jun 25, 2012

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

@jdmarch
Contributor
jdmarch commented Jun 25, 2012

Got the ok - thanks @punchagan

@fperez
Member
fperez commented Jun 25, 2012

Great, thanks! Merging now then.

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

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

@spyder-bot spyder-bot referenced this pull request in spyder-ide/spyder Feb 17, 2015
Closed

Which version of ipython is needed for Spyder 2.2.0? #1229

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