kdeui Library API Documentation

KTextEdit Class Reference

This is just a little subclass of QTextEdit, implementing some standard KDE features, like Cursor auto-hiding, configurable wheelscrolling (fast-scroll or zoom) and deleting of entire words with Ctrl-Backspace or Ctrl-Delete. A KDE'ified QTextEdit. More...

#include <ktextedit.h>

Inheritance diagram for KTextEdit:

QTextEdit List of all members.

Public Methods

 KTextEdit (const QString &text, const QString &context=QString::null, QWidget *parent=0, const char *name=0)
 Constructs a KTextEdit object.

 KTextEdit (QWidget *parent=0L, const char *name=0)
 Constructs a KTextEdit object.

 ~KTextEdit ()
 Destroys the KTextEdit object.

virtual void setReadOnly (bool readOnly)
 Reimplemented to set a proper "deactivated" background color.


Protected Methods

virtual void keyPressEvent (QKeyEvent *)
 Reimplemented to catch "delete word" key events.

virtual void contentsWheelEvent (QWheelEvent *)
 Reimplemented to allow fast-wheelscrolling with Ctrl-Wheel or zoom.

virtual void deleteWordBack ()
 Deletes a word backwards from the current cursor position, if available.

virtual void deleteWordForward ()
 Deletes a word forwards from the current cursor position, if available.


Detailed Description

This is just a little subclass of QTextEdit, implementing some standard KDE features, like Cursor auto-hiding, configurable wheelscrolling (fast-scroll or zoom) and deleting of entire words with Ctrl-Backspace or Ctrl-Delete. A KDE'ified QTextEdit.

Basic rule: whenever you want to use QTextEdit, use KTextEdit!

See also:
QTextEdit
Author:
Carsten Pfeiffer <pfeiffer@kde.org>
Since:
3.1

Definition at line 38 of file ktextedit.h.


Constructor & Destructor Documentation

KTextEdit::KTextEdit const QString   text,
const QString   context = QString::null,
QWidget   parent = 0,
const char *    name = 0
 

Constructs a KTextEdit object.

See QTextEdit::QTextEdit for details.

Definition at line 26 of file ktextedit.cpp.

References KCursor::setAutoHideCursor().

KTextEdit::KTextEdit QWidget   parent = 0L,
const char *    name = 0
 

Constructs a KTextEdit object.

See QTextEdit::QTextEdit for details.

Definition at line 33 of file ktextedit.cpp.

References KCursor::setAutoHideCursor().

KTextEdit::~KTextEdit  
 

Destroys the KTextEdit object.

Definition at line 39 of file ktextedit.cpp.


Member Function Documentation

void KTextEdit::setReadOnly bool    readOnly [virtual]
 

Reimplemented to set a proper "deactivated" background color.

Reimplemented from QTextEdit.

Definition at line 119 of file ktextedit.cpp.

References QPalette::color(), QTextEdit::color(), QPalette::setColor(), and QTextEdit::setReadOnly().

void KTextEdit::keyPressEvent QKeyEvent   [protected, virtual]
 

Reimplemented to catch "delete word" key events.

Reimplemented from QTextEdit.

Definition at line 43 of file ktextedit.cpp.

References QKeyEvent::accept(), QTextEdit::copy(), KStdAccel::copy(), QTextEdit::cut(), KStdAccel::cut(), deleteWordBack(), KStdAccel::deleteWordBack(), deleteWordForward(), KStdAccel::deleteWordForward(), QKeyEvent::ignore(), QKeyEvent::key(), KStdAccel::key(), QTextEdit::keyPressEvent(), QTextEdit::paste(), KStdAccel::paste(), QTextEdit::redo(), KStdAccel::redo(), QKeyEvent::state(), QTextEdit::undo(), and KStdAccel::undo().

void KTextEdit::contentsWheelEvent QWheelEvent   [protected, virtual]
 

Reimplemented to allow fast-wheelscrolling with Ctrl-Wheel or zoom.

Definition at line 111 of file ktextedit.cpp.

References QScrollView::contentsWheelEvent(), and KGlobalSettings::wheelMouseZooms().

void KTextEdit::deleteWordBack   [protected, virtual]
 

Deletes a word backwards from the current cursor position, if available.

Definition at line 97 of file ktextedit.cpp.

References QTextEdit::moveCursor(), QTextEdit::removeSelectedText(), and QTextEdit::removeSelection().

Referenced by keyPressEvent().

void KTextEdit::deleteWordForward   [protected, virtual]
 

Deletes a word forwards from the current cursor position, if available.

Definition at line 104 of file ktextedit.cpp.

References QTextEdit::moveCursor(), QTextEdit::removeSelectedText(), and QTextEdit::removeSelection().

Referenced by keyPressEvent().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:21:07 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001