kdeui Library API Documentation

KTextEdit Class Reference

A KDE'ified QTextEdit. More...

#include <ktextedit.h>

Inheritance diagram for KTextEdit:

Inheritance graph
[legend]
Collaboration diagram for KTextEdit:

Collaboration graph
[legend]
List of all members.

Public Slots

void checkSpelling ()

Public Member Functions

 KTextEdit (const QString &text, const QString &context=QString::null, QWidget *parent=0, const char *name=0)
 KTextEdit (QWidget *parent=0L, const char *name=0)
 ~KTextEdit ()
virtual void setReadOnly (bool readOnly)
virtual void setPalette (const QPalette &palette)
void setCheckSpellingEnabled (bool check)
bool checkSpellingEnabled () const
void highLightWord (unsigned int length, unsigned int pos)

Protected Member Functions

virtual void keyPressEvent (QKeyEvent *)
virtual void focusInEvent (QFocusEvent *)
virtual void contentsWheelEvent (QWheelEvent *)
virtual void deleteWordBack ()
virtual void deleteWordForward ()
virtual QPopupMenucreatePopupMenu (const QPoint &pos)
virtual QPopupMenucreatePopupMenu ()
virtual void virtual_hook (int id, void *data)

Detailed Description

A KDE'ified QTextEdit.

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.

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 43 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 54 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 62 of file ktextedit.cpp.

References KCursor::setAutoHideCursor().

KTextEdit::~KTextEdit  ) 
 

Destroys the KTextEdit object.

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

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

Referenced by KAboutContainerBase::addLicensePage(), and KAboutContainerBase::addTextPage().

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

Reimplemented for tracking custom palettes.

Definition at line 261 of file ktextedit.cpp.

Referenced by setReadOnly().

void KTextEdit::setCheckSpellingEnabled bool  check  ) 
 

Turns spell checking for this text edit on or off.

See also:
checkSpellingEnabled()
Since:
3.2

Definition at line 274 of file ktextedit.cpp.

bool KTextEdit::checkSpellingEnabled  )  const
 

Returns true if spell checking is enabled for this text edit.

@ see setCheckSpellingEnabled()

Since:
3.2

Definition at line 304 of file ktextedit.cpp.

void KTextEdit::checkSpelling  )  [slot]
 

Create a modal dialog to check the spelling.

This slot will not return until spell checking has been completed.

Since:
3.2

Definition at line 344 of file ktextedit.cpp.

Referenced by createPopupMenu().

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

Reimplemented to catch "delete word" key events.

Reimplemented from QTextEdit.

Definition at line 74 of file ktextedit.cpp.

References QKeyEvent::accept(), KStdAccel::backwardWord(), KStdAccel::beginningOfLine(), QApplication::clipboard(), QTextEdit::copy(), KStdAccel::copy(), QTextEdit::cut(), KStdAccel::cut(), deleteWordBack(), KStdAccel::deleteWordBack(), deleteWordForward(), KStdAccel::deleteWordForward(), KStdAccel::end(), KStdAccel::endOfLine(), KStdAccel::forwardWord(), QTextEdit::getCursorPosition(), KStdAccel::home(), QKeyEvent::ignore(), QTextEdit::insert(), QString::isEmpty(), QKeyEvent::key(), QTextEdit::keyPressEvent(), QTextEdit::moveCursor(), KStdAccel::next(), QTextEdit::paste(), KStdAccel::paste(), KStdAccel::pasteSelection(), KStdAccel::prior(), QTextEdit::redo(), KStdAccel::redo(), QKeyEvent::state(), QTextEdit::text(), QTextEdit::undo(), and KStdAccel::undo().

void KTextEdit::focusInEvent QFocusEvent  )  [protected, virtual]
 

Reimplemented to instantiate a KDictSpellingHighlighter, if spellchecking is enabled.

Definition at line 296 of file ktextedit.cpp.

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

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

Definition at line 253 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 194 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 201 of file ktextedit.cpp.

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

Referenced by keyPressEvent().

QPopupMenu * KTextEdit::createPopupMenu const QPoint pos  )  [protected, virtual]
 

Reimplemented from QTextEdit to add spelling related items when appropriate.

Reimplemented from QTextEdit.

Definition at line 213 of file ktextedit.cpp.

References QPopupMenu::changeItem(), checkSpelling(), QTextEdit::createPopupMenu(), QPopupMenu::idAt(), QPopupMenu::insertItem(), QPopupMenu::insertSeparator(), QTextEdit::isReadOnly(), QPopupMenu::setItemChecked(), QPopupMenu::setItemEnabled(), QTextEdit::tabChangesFocus(), QTextEdit::text(), and QPopupMenu::text().

QPopupMenu * KTextEdit::createPopupMenu  )  [protected, virtual]
 

This is just a reimplementation of a deprecated method from QTextEdit and is just here to keep source compatibility.

This should not be used in new code. Specifically reimplementing this method will probably not do what you expect. See the method above.

Deprecated:

Reimplemented from QTextEdit.

Definition at line 248 of file ktextedit.cpp.

References QTextEdit::createPopupMenu().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdeui Library Version 3.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Jul 20 12:34:36 2006 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003