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 Member Functions

 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.

virtual void setPalette (const QPalette &palette)
 Reimplemented for tracking custom palettes.


Protected Member Functions

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.

virtual void virtual_hook (int id, void *data)

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 39 of file ktextedit.cpp.

References KStdAccel::name(), and KCursor::setAutoHideCursor().

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

Constructs a KTextEdit object.

See QTextEdit::QTextEdit for details.

Definition at line 47 of file ktextedit.cpp.

References KStdAccel::name(), and KCursor::setAutoHideCursor().

KTextEdit::~KTextEdit  ) 
 

Destroys the KTextEdit object.

Definition at line 54 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 153 of file ktextedit.cpp.

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

void KTextEdit::setPalette const QPalette palette  )  [virtual]
 

Reimplemented for tracking custom palettes.

Definition at line 145 of file ktextedit.cpp.

Referenced by setReadOnly().

void KTextEdit::keyPressEvent QKeyEvent  )  [protected, virtual]
 

Reimplemented to catch "delete word" key events.

Reimplemented from QTextEdit.

Definition at line 59 of file ktextedit.cpp.

References QKeyEvent::accept(), QApplication::clipboard(), QTextEdit::copy(), KStdAccel::copy(), QTextEdit::cut(), KStdAccel::cut(), deleteWordBack(), KStdAccel::deleteWordBack(), deleteWordForward(), KStdAccel::deleteWordForward(), QKeyEvent::ignore(), QTextEdit::insert(), QString::isEmpty(), QKeyEvent::key(), KStdAccel::key(), QTextEdit::keyPressEvent(), QTextEdit::paste(), KStdAccel::paste(), QTextEdit::redo(), KStdAccel::redo(), QKeyEvent::state(), QTextEdit::text(), QTextEdit::undo(), and KStdAccel::undo().

void KTextEdit::contentsWheelEvent QWheelEvent  )  [protected, virtual]
 

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

Definition at line 137 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 123 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 130 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.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 27 22:15:10 2005 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001