author | hakan <hakan> | 2002-05-12 09:54:24 (UTC) |
---|---|---|
committer | hakan <hakan> | 2002-05-12 09:54:24 (UTC) |
commit | 6f19bc4691ec2c0ebbe36fc1aff09e879564fe7d (patch) (side-by-side diff) | |
tree | 6fac867effefe67c98896418047fe794a88c6953 /core/pim/datebook/onoteedit.cpp | |
parent | 6f5ac2fbf69f019cc9d3a1522fc507c6b88d2bd6 (diff) | |
download | opie-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) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/onoteedit.cpp | 19 |
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++; +} |