##// END OF EJS Templates
Add custom_control and custom_page_control variables to override the Qt widgets used by qtconsole...
Carlos Cordoba -
Show More
@@ -158,6 +158,13 b' class ConsoleWidget(LoggingConfigurable, QtGui.QWidget):'
158 158 # widget (Ctrl+n, Ctrl+a, etc). Enable this if you want this widget to take
159 159 # priority (when it has focus) over, e.g., window-level menu shortcuts.
160 160 override_shortcuts = Bool(False)
161
162 # ------ Custom Qt Widgets -------------------------------------------------
163
164 # For other projects to easily override the Qt widgets used by the console
165 # (e.g. Spyder)
166 custom_control = None
167 custom_page_control = None
161 168
162 169 #------ Signals ------------------------------------------------------------
163 170
@@ -989,7 +996,9 b' class ConsoleWidget(LoggingConfigurable, QtGui.QWidget):'
989 996 """ Creates and connects the underlying text widget.
990 997 """
991 998 # Create the underlying control.
992 if self.kind == 'plain':
999 if self.custom_control:
1000 control = self.custom_control
1001 elif self.kind == 'plain':
993 1002 control = QtGui.QPlainTextEdit()
994 1003 elif self.kind == 'rich':
995 1004 control = QtGui.QTextEdit()
@@ -1026,7 +1035,9 b' class ConsoleWidget(LoggingConfigurable, QtGui.QWidget):'
1026 1035 def _create_page_control(self):
1027 1036 """ Creates and connects the underlying paging widget.
1028 1037 """
1029 if self.kind == 'plain':
1038 if self.custom_page_control:
1039 control = self.custom_page_control
1040 elif self.kind == 'plain':
1030 1041 control = QtGui.QPlainTextEdit()
1031 1042 elif self.kind == 'rich':
1032 1043 control = QtGui.QTextEdit()
General Comments 0
You need to be logged in to leave comments. Login now