summaryrefslogtreecommitdiff
path: root/core/pim/datebook/onoteedit.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/datebook/onoteedit.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/datebook/onoteedit.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/core/pim/datebook/onoteedit.cpp b/core/pim/datebook/onoteedit.cpp
new file mode 100644
index 0000000..d66ad86
--- a/dev/null
+++ b/core/pim/datebook/onoteedit.cpp
@@ -0,0 +1,19 @@
+#include "onoteedit.h"
+
+ONoteEdit::ONoteEdit (QWidget * parent, const char * name) :
+ QMultiLineEdit(parent,name) {
+ setDefaultTabStop(2);
+ setWordWrap(WidgetWidth);
+}
+
+// Copy indentation from previous line
+void ONoteEdit::newLine() {
+ int l,c;
+ getCursorPosition(&l,&c);
+ QString s=textLine(l);
+
+ insert("\n");
+
+ int i=0;
+ while (s[i]==' ' || s[i]=='\t') insert(QString(s[i])), i++;
+}