[PyKDE] A small patch for QScintilla (in ReadOnly mode)

Ulrich Berning ulrich.berning at desys.de
Thu May 15 17:55:01 BST 2003


Hi all,

when QScintilla is in ReadOnly mode [->setReadOnly(TRUE)] , an attempt 
to modify the document results in the Scintilla notification 
SCN_MODIFYATTEMPTRO.
This notification is not handled by QScintilla and results in a warning 
"Unknown notification: 2004".

The attached patch adds this notification to the signal mapping between 
Scintilla and Qt.

Ciao,
Ulli

-------------- next part --------------
diff -uNr qscintilla-1.52-x11-commercial-snapshot-20030511.orig/qt/ScintillaQt.cxx qscintilla-1.52-x11-commercial-snapshot-20030511/qt/ScintillaQt.cxx
--- qscintilla-1.52-x11-commercial-snapshot-20030511.orig/qt/ScintillaQt.cxx	Mon May 12 02:05:05 2003
+++ qscintilla-1.52-x11-commercial-snapshot-20030511/qt/ScintillaQt.cxx	Thu May 15 17:35:58 2003
@@ -38,6 +38,7 @@
 #undef	SCN_MACRORECORD
 #undef	SCN_MARGINCLICK
 #undef	SCN_MODIFIED
+#undef	SCN_MODIFYATTEMPTRO
 #undef	SCN_NEEDSHOWN
 #undef	SCN_PAINTED
 #undef	SCN_SAVEPOINTLEFT
@@ -60,6 +61,7 @@
 	SCN_MACRORECORD = 2009,
 	SCN_MARGINCLICK = 2010,
 	SCN_MODIFIED = 2008,
+	SCN_MODIFYATTEMPTRO = 2004,
 	SCN_NEEDSHOWN = 2011,
 	SCN_PAINTED = 2013,
 	SCN_SAVEPOINTLEFT = 2003,
@@ -342,6 +344,10 @@
 					 scn.text,scn.length,scn.linesAdded,
 					 scn.line,scn.foldLevelNow,
 					 scn.foldLevelPrev);
+		break;
+
+	case SCN_MODIFYATTEMPTRO:
+		emit qsb -> SCN_MODIFYATTEMPTRO();
 		break;
 
 	case SCN_NEEDSHOWN:
diff -uNr qscintilla-1.52-x11-commercial-snapshot-20030511.orig/qt/qextscintillabase.h qscintilla-1.52-x11-commercial-snapshot-20030511/qt/qextscintillabase.h
--- qscintilla-1.52-x11-commercial-snapshot-20030511.orig/qt/qextscintillabase.h	Mon May 12 02:05:05 2003
+++ qscintilla-1.52-x11-commercial-snapshot-20030511/qt/qextscintillabase.h	Thu May 15 17:35:58 2003
@@ -1926,6 +1926,12 @@
 	//!
 	void SCN_MODIFIED(int,int,const char *,int,int,int,int,int);
 
+	//! When in read-only mode, this signal is emitted if the user tries
+	//! to change the text.
+	//!
+	//! \sa SCI_SETREADONLY, SCN_GETREADONLY
+	void SCN_MODIFYATTEMPTRO();
+
 	//!
 	void SCN_NEEDSHOWN(int,int);
 


More information about the PyQt mailing list