KDEUI
ktextedit.cpp
Go to the documentation of this file.
114 void slotReplaceText(const QString &text, int replacementIndex, int /*replacedLength*/, int matchedLength);
184 //Laurent in sonnet/dialog.cpp we emit done(QString) too => it calls here twice spellCheckerFinished not necessary
196 //Laurent in sonnet/dialog.cpp we emit done(QString) too => it calls here twice spellCheckerFinished not necessary
214 void KTextEdit::Private::spellCheckerAutoCorrect(const QString& currentWord,const QString& autoCorrectWord)
225 void KTextEdit::Private::spellCheckerCorrected( const QString& oldWord, int pos,const QString& newWord)
276 void KTextEdit::Private::slotFindHighlight(const QString& text, int matchingIndex, int matchingLength)
288 void KTextEdit::Private::slotReplaceText(const QString &text, int replacementIndex, int replacedLength, int matchedLength) {
289 //kDebug() << "Replace: [" << text << "] ri:" << replacementIndex << " rl:" << replacedLength << " ml:" << matchedLength;
680 QMetaObject::invokeMethod(this, "mousePopupMenuImplementation", Q_ARG(QPoint, event->globalPos()));
888 d->replace = new KReplace(d->repDlg->pattern(), d->repDlg->replacement(), d->repDlg->options(), this);
890 if (d->replace->options() & KFind::FromCursor || d->replace->options() & KFind::FindBackwards) {
939 d->replace->deleteLater(); // we are in a slot connected to m_replace, don't delete it right away
int position() const
text
void setCheckSpellingEnabled(bool check)
Turns background spell checking for this text edit on or off.
Definition: ktextedit.cpp:752
QString i18n(const char *text)
Qt::KeyboardModifiers modifiers() const
const KShortcut & deleteWordForward()
Delete a word forward from mouse/cursor position.
Definition: kstandardshortcut.cpp:339
void removeSelectedText()
Type type() const
const QPalette & palette() const
void rehighlight()
void checkSpellingChanged(bool)
emit signal when we activate or not autospellchecking
QCursor cursor() const
void clearSelection()
virtual void deleteWordForward()
Deletes a word forwards from the current cursor position, if available.
Definition: ktextedit.cpp:512
QMenu * createStandardContextMenu()
void setColor(ColorGroup group, ColorRole role, const QColor &color)
QTextCursor cursorForPosition(const QPoint &pos) const
QWidget * window() const
StandardShortcut find(const QKeySequence &seq)
Return the StandardShortcut id of the standard accel action which uses this key sequence, or AccelNone if none of them do.
Definition: kstandardshortcut.cpp:295
int selectionStart() const
bool checkSpellingEnabled() const
Returns true if background spell checking is enabled for this text edit.
static void information(QWidget *parent, const QString &text, const QString &caption=QString(), const QString &dontShowAgainName=QString(), Options options=Notify)
Display an "Information" dialog.
Definition: kmessagebox.cpp:960
bool tabChangesFocus() const
This interface is a workaround to keep binary compatibility in KDE4, because adding the virtual keywo...
Definition: ktextedit.h:45
void setIcon(const QIcon &icon)
const QColor & color(ColorGroup group, ColorRole role) const
const T & at(int i) const
int size() const
virtual void paintEvent(QPaintEvent *event)
Sonnet::Highlighter * highlighter() const
Returns the current highlighter, which is 0 if spell checking is disabled.
Definition: ktextedit.cpp:741
QString selectedText() const
bool contains(const QString &str, Qt::CaseSensitivity cs) const
static void deleteWord(QTextCursor cursor, QTextCursor::MoveOperation op)
Definition: ktextedit.cpp:500
void setAttribute(Qt::WidgetAttribute attribute, bool on)
int exec()
virtual void wheelEvent(QWheelEvent *e)
QWidget * viewport() const
virtual void focusInEvent(QFocusEvent *e)
QDBusConnection sessionBus()
KAction * find(const QObject *recvr, const char *slot, QObject *parent)
Initiate a 'find' request in the current document.
Definition: kstandardaction.cpp:329
bool hasFocus() const
QString toPlainText() const
QString clickMessage() const
void chop(int n)
int anchor() const
QPalette::ColorRole foregroundRole() const
KAction * findNext(const QObject *recvr, const char *slot, QObject *parent)
Find the next instance of a stored 'find'.
Definition: kstandardaction.cpp:334
void update()
bool movePosition(MoveOperation operation, MoveMode mode, int n)
QString i18nc(const char *ctxt, const char *text)
void setWindowIcon(const QIcon &icon)
KSharedConfigPtr config()
void setSpellCheckingConfigFileName(const QString &fileName)
Allows to override the config file where the settings for spell checking, like the current language o...
Definition: ktextedit.cpp:334
void select(SelectionType selection)
int indexOf(const T &value, int from) const
bool find(const QString &exp, QFlags< QTextDocument::FindFlag > options)
void languageChanged(const QString &language)
Emitted when the user changes the language in the spellcheck dialog shown by checkSpelling() or when ...
void highlightWord(int length, int pos)
Selects the characters at the specified position.
Definition: ktextedit.cpp:849
void mousePopupMenuImplementation(const QPoint &pos)
Definition: ktextedit.cpp:1182
static void activateWindow(WId win, long time=0)
Requests that window win is activated.
Definition: kwindowsystem_mac.cpp:355
void setSpellInterface(KTextEditSpellInterface *spellInterface)
Sets the spell interface, which is used to delegate certain function calls to the interface...
Definition: ktextedit.cpp:1061
bool hasSelection() const
void setFont(const QFont &font)
void insertAction(QAction *before, QAction *action)
Definition: kstandardaction.h:141
enabled
bool testAttribute(Qt::WidgetAttribute attribute) const
int count(const T &value) const
Definition: kstandardshortcut.h:69
void changeLanguage(const QString &lang)
virtual void setReadOnly(bool readOnly)
Reimplemented to set a proper "deactivated" background color.
Definition: ktextedit.cpp:807
void setClickMessage(const QString &msg)
This makes the text edit display a grayed-out hinting text as long as the user didn't enter any text...
Definition: ktextedit.cpp:1134
virtual void paintEvent(QPaintEvent *)
Reimplemented to paint clickMessage.
Definition: ktextedit.cpp:1152
QClipboard * clipboard()
void setHighlighter(Sonnet::Highlighter *_highLighter)
Sets a custom backgound spell highlighter for this text edit.
Definition: ktextedit.cpp:746
void setUpdatesEnabled(bool enable)
void setPen(const QColor &color)
virtual void focusOutEvent(QFocusEvent *e)
void endEditBlock()
void insertText(const QString &text)
bool isEmpty() const
bool isEmpty() const
QString trimmed() const
Definition: kstandardaction.h:133
QString text() const
static bool wheelMouseZooms()
Typically, QScrollView derived classes can be scrolled fast by holding down the Ctrl-button during wh...
Definition: kglobalsettings.cpp:707
virtual void wheelEvent(QWheelEvent *)
Reimplemented to allow fast-wheelscrolling with Ctrl-Wheel or zoom.
Definition: ktextedit.cpp:728
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
const KShortcut & beginningOfLine()
Goto beginning of current line.
Definition: kstandardshortcut.cpp:349
QPoint pos() const
KAction * clear(const QObject *recvr, const char *slot, QObject *parent)
Clear the content of the focus widget.
Definition: kstandardaction.cpp:314
void drawText(const QPointF &position, const QString &text)
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const
virtual void clear()
virtual void createHighlighter()
Allows to create a specific highlighter if reimplemented.
Definition: ktextedit.cpp:736
void setTextCursor(const QTextCursor &cursor)
virtual void wheelEvent(QWheelEvent *e)
void addWordToDictionary(const QString &word)
Adds the given word permanently to the dictionary.
Definition: highlighter.cpp:413
bool matches(QKeySequence::StandardKey key) const
const KShortcut & copy()
Copy selected area into the clipboard.
Definition: kstandardshortcut.cpp:335
virtual bool event(QEvent *event)
KTextEdit(const QString &text, QWidget *parent=0)
Constructs a KTextEdit object.
Definition: ktextedit.cpp:317
const QString & spellCheckingLanguage() const
QString right(int n) const
void setCurrentLanguage(const QString &lang)
Definition: highlighter.cpp:300
virtual void deleteWordBack()
Deletes a word backwards from the current cursor position, if available.
Definition: ktextedit.cpp:507
bool isWordMisspelled(const QString &word)
Checks if a given word is marked as misspelled by the highlighter.
Definition: highlighter.cpp:433
static void setAutoHideCursor(QWidget *w, bool enable, bool customEventFilter=false)
Sets auto-hiding the cursor for widget w.
Definition: kcursor.cpp:202
QTextBlock block() const
QTextDocument * document() const
void accept()
void setParent(QObject *parent)
const QFont & font() const
static int startServiceByDesktopName(const QString &_name, const QString &URL, QString *error=0, QString *serviceName=0, int *pid=0, const QByteArray &startup_id=QByteArray(), bool noWait=false)
void beginEditBlock()
QString text() const
bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType type, QGenericReturnArgument ret, QGenericArgument val0, QGenericArgument val1, QGenericArgument val2, QGenericArgument val3, QGenericArgument val4, QGenericArgument val5, QGenericArgument val6, QGenericArgument val7, QGenericArgument val8, QGenericArgument val9)
void setItalic(bool enable)
const KShortcut & cut()
Cut selected area and store it in the clipboard.
Definition: kstandardshortcut.cpp:334
QStringList suggestionsForWord(const QString &word, int max=10)
Returns a list of suggested replacements for the given misspelled word.
Definition: highlighter.cpp:423
bool isEmpty() const
virtual void contextMenuEvent(QContextMenuEvent *)
Reimplemented from QTextEdit to add spelling related items when appropriate.
Definition: ktextedit.cpp:617
KAction * replace(const QObject *recvr, const char *slot, QObject *parent)
Find and replace matches.
Definition: kstandardaction.cpp:344
QString text(Mode mode) const
void ensureCursorVisible()
const KShortcut & deleteWordBack()
Delete a word back from mouse/cursor position.
Definition: kstandardshortcut.cpp:338
virtual void focusInEvent(QFocusEvent *)
Reimplemented to instantiate a KDictSpellingHighlighter, if spellchecking is enabled.
Definition: ktextedit.cpp:786
const KShortcut & pasteSelection()
Paste the selection at mouse/cursor position.
Definition: kstandardshortcut.cpp:337
QColor color() const
Definition: kicontheme.h:203
void showSpellConfigDialog(const QString &configFileName, const QString &windowIcon=QString())
Opens a Sonnet::ConfigDialog for this text edit.
Definition: ktextedit.cpp:357
virtual void keyPressEvent(QKeyEvent *e)
int length() const
void spellCheckerAutoCorrect(const QString ¤tWord, const QString &autoCorrectWord)
void setCheckSpellingEnabledInternal(bool check)
Enable or disable the spellchecking.
Definition: ktextedit.cpp:760
void setLanguage(const QString &language)
Sets the language/dictionary that will be selected by default in this config dialog.
Definition: configdialog.cpp:92
void setAlphaF(qreal alpha)
KAction * findPrev(const QObject *recvr, const char *slot, QObject *parent)
Find a previous instance of a stored 'find'.
Definition: kstandardaction.cpp:339
bool checkSpellingEnabledInternal() const
Checks whether spellchecking is enabled or disabled.
Definition: ktextedit.cpp:802
void show()
bool isReadOnly() const
virtual void keyPressEvent(QKeyEvent *)
Reimplemented for internal reasons.
Definition: ktextedit.cpp:1121
Definition: kfind.h:139
const_iterator constEnd() const
const_iterator constBegin() const
static void assignIconsToContextMenu(ContextMenus type, QList< QAction * > actions)
Assigns standard icons to the various standard text edit context menus.
Definition: kicontheme.cpp:599
int selectionEnd() const
void setSpellCheckingLanguage(const QString &language)
Set the spell check language which will be used for highlighting spelling mistakes and for the spellc...
Definition: ktextedit.cpp:344
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QList< QAction * > actions() const
QObject * parent() const
QDBusPendingCall asyncCall(const QString &method, const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, const QVariant &arg4, const QVariant &arg5, const QVariant &arg6, const QVariant &arg7, const QVariant &arg8)
Definition: kicontheme.h:202
void setEnabled(bool)
virtual bool event(QEvent *)
Reimplemented to catch "delete word" shortcut events.
Definition: ktextedit.cpp:371
void aboutToShowContextMenu(QMenu *menu)
Emitted before the context menu is displayed.
QTextCursor textCursor() const
static void error(QWidget *parent, const QString &text, const QString &caption=QString(), Options options=Notify)
Display an "Error" dialog.
Definition: kmessagebox.cpp:818
const KShortcut & paste()
Paste contents of clipboard at mouse/cursor position.
Definition: kstandardshortcut.cpp:336
void rect(int *x, int *y, int *width, int *height) const
void setPosition(int pos, MoveMode m)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.