summaryrefslogtreecommitdiff
path: root/core/pim/datebook/onoteedit.cpp
authorhakan <hakan>2002-05-12 09:54:24 (UTC)
committer hakan <hakan>2002-05-12 09:54:24 (UTC)
commit6f19bc4691ec2c0ebbe36fc1aff09e879564fe7d (patch) (unidiff)
tree6fac867effefe67c98896418047fe794a88c6953 /core/pim/datebook/onoteedit.cpp
parent6f5ac2fbf69f019cc9d3a1522fc507c6b88d2bd6 (diff)
downloadopie-6f19bc4691ec2c0ebbe36fc1aff09e879564fe7d.zip
opie-6f19bc4691ec2c0ebbe36fc1aff09e879564fe7d.tar.gz
opie-6f19bc4691ec2c0ebbe36fc1aff09e879564fe7d.tar.bz2
Added a ONoteEdit class which is a QMultiLineEdit subclass copying indentation from line to line
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 @@
1#include "onoteedit.h"
2
3ONoteEdit::ONoteEdit (QWidget * parent, const char * name) :
4 QMultiLineEdit(parent,name) {
5 setDefaultTabStop(2);
6 setWordWrap(WidgetWidth);
7}
8
9// Copy indentation from previous line
10void ONoteEdit::newLine() {
11 int l,c;
12 getCursorPosition(&l,&c);
13 QString s=textLine(l);
14
15 insert("\n");
16
17 int i=0;
18 while (s[i]==' ' || s[i]=='\t') insert(QString(s[i])), i++;
19}