-rw-r--r-- | noncore/apps/opie-write/qtextedit.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/apps/opie-write/qtextedit.cpp b/noncore/apps/opie-write/qtextedit.cpp index 73b7b7b..bba8a65 100644 --- a/noncore/apps/opie-write/qtextedit.cpp +++ b/noncore/apps/opie-write/qtextedit.cpp @@ -628,96 +628,97 @@ QTextEdit::QTextEdit( QWidget *parent, const char *name ) { init(); } /*! Constructs a QTextEdit with parent \a parent and name \a name. The text edit will display the text \a text using context \a context. The \a context is a path which the text edit's QMimeSourceFactory uses to resolve the locations of files and images. It is passed to the mimeSourceFactory() when quering data. For example if the text contains an image tag, \c{<img src="image.png">}, and the context is "path/to/look/in", the QMimeSourceFactory will try to load the image from "path/to/look/in/image.png". If the tag was \c{<img src="/image.png">}, the context will not be used (because QMimeSourceFactory recognizes that we have used an absolute path) and will try to load "/image.png". The context is applied in exactly the same way to \e hrefs, for example, \c{<a href="target.html">Target</a>}, would resolve to "path/to/look/in/target.html". */ QTextEdit::QTextEdit( const QString& text, const QString& context, QWidget *parent, const char *name) : QScrollView( parent, name, WStaticContents | WRepaintNoErase | WResizeNoErase ), doc( new QTextDocument( 0 ) ), undoRedoInfo( doc ) { init(); setText( text, context ); } /*! \reimp */ QTextEdit::~QTextEdit() { delete undoRedoInfo.d; undoRedoInfo.d = 0; delete cursor; delete doc; delete d; } void QTextEdit::init() { setFrameStyle( Sunken ); + setVScrollBarMode( AlwaysOn ); undoEnabled = TRUE; readonly = TRUE; setReadOnly( FALSE ); d = new QTextEditPrivate; connect( doc, SIGNAL( minimumWidthChanged(int) ), this, SLOT( documentWidthChanged(int) ) ); mousePressed = FALSE; inDoubleClick = FALSE; modified = FALSE; onLink = QString::null; overWrite = FALSE; wrapMode = WidgetWidth; wrapWidth = -1; wPolicy = AtWhiteSpace; inDnD = FALSE; doc->setFormatter( new QTextFormatterBreakWords ); doc->formatCollection()->defaultFormat()->setFont( QScrollView::font() ); doc->formatCollection()->defaultFormat()->setColor( colorGroup().color( QColorGroup::Text ) ); currentFormat = doc->formatCollection()->defaultFormat(); currentAlignment = Qt3::AlignAuto; viewport()->setBackgroundMode( PaletteBase ); viewport()->setAcceptDrops( TRUE ); resizeContents( 0, doc->lastParagraph() ? ( doc->lastParagraph()->paragId() + 1 ) * doc->formatCollection()->defaultFormat()->height() : 0 ); setKeyCompression( TRUE ); viewport()->setMouseTracking( TRUE ); #ifndef QT_NO_CURSOR viewport()->setCursor( isReadOnly() ? arrowCursor : ibeamCursor ); #endif cursor = new QTextCursor( doc ); formatTimer = new QTimer( this ); connect( formatTimer, SIGNAL( timeout() ), this, SLOT( formatMore() ) ); lastFormatted = doc->firstParagraph(); scrollTimer = new QTimer( this ); connect( scrollTimer, SIGNAL( timeout() ), this, SLOT( autoScrollTimerDone() ) ); interval = 0; changeIntervalTimer = new QTimer( this ); connect( changeIntervalTimer, SIGNAL( timeout() ), this, SLOT( doChangeInterval() ) ); |