A text edit field that edits latex code. More...
#include <klflatexedit.h>
Public Slots | |
void | setLatex (const QString &latex) |
void | clearLatex () |
void | setHeightHintLines (int lines) |
void | insertDelimiter (const QString &delim, int charsBack=1) |
Signals | |
void | insertContextMenuActions (const QPoint &pos, QList< QAction * > *actionList) |
Protected Member Functions | |
virtual void | contextMenuEvent (QContextMenuEvent *event) |
virtual bool | canInsertFromMimeData (const QMimeData *source) const |
virtual void | insertFromMimeData (const QMimeData *source) |
Properties | |
int | heightHintLines |
A text edit field that edits latex code.
Implementation of a QTextEdit to type latex code.
Definition at line 51 of file klflatexedit.h.
KLFLatexEdit::KLFLatexEdit | ( | QWidget * | mainwin | ) |
Definition at line 39 of file klflatexedit.cpp.
References QTextEdit::cursorPositionChanged().
|
virtual |
Definition at line 50 of file klflatexedit.cpp.
|
protectedvirtual |
Definition at line 149 of file klflatexedit.cpp.
References QTextEdit::canInsertFromMimeData(), KLFMainWin::canOpenData(), QMimeData::formats(), and klfDbg.
|
slot |
Definition at line 54 of file klflatexedit.cpp.
References KLFLatexSyntaxHighlighter::resetEditing(), and setLatex().
|
protectedvirtual |
Definition at line 88 of file klflatexedit.cpp.
References QMenu::addAction(), QMenu::addSeparator(), QTextEdit::createStandardContextMenu(), QTextEdit::cursorForPosition(), insertContextMenuActions(), QMenu::popup(), QAction::setData(), QAction::setMenu(), QTextEdit::setTextCursor(), QList::size(), QTextEdit::textCursor(), and KLFLatexSymbolsCache::theCache().
|
inline |
See sizeHint(). This gets the preferred height of this widget in number of text lines, as set by setHeightHintLints().
Definition at line 72 of file klflatexedit.h.
|
signal |
This signal is emitted just before the context menu is shown. If someone wants to add entries into the context menu, then connect to this signal, and append new actions to the actionList
.
Referenced by contextMenuEvent().
|
slot |
Inserts a delimiter delim
, and brings the cursor charsBack
characters back. Eg. you can insert "\mathrm{}"
and bring the cursor 1 space back.
Definition at line 178 of file klflatexedit.cpp.
References QTextCursor::beginEditBlock(), QTextCursor::endEditBlock(), QString::insert(), QTextCursor::insertText(), QString::isEmpty(), QString::length(), QTextCursor::movePosition(), QTextCursor::removeSelectedText(), QTextCursor::selection(), QTextEdit::setTextCursor(), and QTextEdit::textCursor().
|
protectedvirtual |
Definition at line 160 of file klflatexedit.cpp.
References QMimeData::formats(), QTextEdit::insertFromMimeData(), klfDbg, and KLFMainWin::openData().
|
slot |
See sizeHint(). This sets the preferred height of this widget in number of text lines.
Definition at line 81 of file klflatexedit.cpp.
|
slot |
Sets the current latex code to latex
.
Definition at line 61 of file klflatexedit.cpp.
References QTextCursor::beginEditBlock(), QTextCursor::endEditBlock(), QTextCursor::insertText(), QTextCursor::removeSelectedText(), QTextCursor::select(), and QTextEdit::textCursor().
Referenced by clearLatex().
|
inline |
This function may be used to give a pointer to a KLFMainWin that we will call to open data when we get a paste/drop. If they can open the data, then we consider the data pasted. Otherwise, rely on the QTextEdit built-in functionality.
This pointer may also be NULL, in which case we will only rely on QTextEdit built-in functionality.
Definition at line 68 of file klflatexedit.h.
|
virtual |
The size hint of the widget. If heightHintLines()
is set to -1
, this directly calles the superclass function. Otherwise this returns the size in pixels this widget wants to have, given the value of heightHintLines() number of lines in the current font.
Definition at line 72 of file klflatexedit.cpp.
References QFontMetrics::height(), and QSize::width().
|
inline |
Definition at line 60 of file klflatexedit.h.
|
readwrite |
Definition at line 55 of file klflatexedit.h.