42 #ifndef QPLAINTEXTEDIT_H 43 #define QPLAINTEXTEDIT_H 45 #include <QtGui/qtextedit.h> 47 #include <QtGui/qabstractscrollarea.h> 48 #include <QtGui/qtextdocument.h> 49 #include <QtGui/qtextoption.h> 50 #include <QtGui/qtextcursor.h> 51 #include <QtGui/qtextformat.h> 52 #include <QtGui/qabstracttextdocumentlayout.h> 54 #ifndef QT_NO_TEXTEDIT 84 Qt::TextInteractionFlags textInteractionFlags;
86 int maximumBlockCount;
87 bool backgroundVisible;
105 bool isReadOnly()
const;
106 void setReadOnly(
bool ro);
108 void setTextInteractionFlags(Qt::TextInteractionFlags flags);
109 Qt::TextInteractionFlags textInteractionFlags()
const;
115 bool tabChangesFocus()
const;
116 void setTabChangesFocus(
bool b);
124 {
return document()->isUndoRedoEnabled(); }
126 { document()->setUndoRedoEnabled(enable); }
129 { document()->setMaximumBlockCount(maximum); }
131 {
return document()->maximumBlockCount(); }
140 void setBackgroundVisible(
bool visible);
141 bool backgroundVisible()
const;
143 void setCenterOnScroll(
bool enabled);
144 bool centerOnScroll()
const;
146 bool find(
const QString &exp, QTextDocument::FindFlags options = 0);
149 {
return document()->toPlainText(); }
151 void ensureCursorVisible();
154 #ifndef QT_NO_CONTEXTMENU 155 QMenu *createStandardContextMenu();
160 QRect cursorRect()
const;
164 bool overwriteMode()
const;
165 void setOverwriteMode(
bool overwrite);
167 int tabStopWidth()
const;
168 void setTabStopWidth(
int width);
170 int cursorWidth()
const;
171 void setCursorWidth(
int width);
178 bool canPaste()
const;
180 #ifndef QT_NO_PRINTER 181 void print(
QPrinter *printer)
const;
184 int blockCount()
const;
190 #ifndef QT_NO_CLIPBOARD 202 void insertPlainText(
const QString &text);
204 void appendPlainText(
const QString &text);
205 void appendHtml(
const QString &html);
211 void undoAvailable(
bool b);
212 void redoAvailable(
bool b);
213 void copyAvailable(
bool b);
214 void selectionChanged();
215 void cursorPositionChanged();
217 void updateRequest(
const QRect &rect,
int dy);
218 void blockCountChanged(
int newBlockCount);
219 void modificationChanged(
bool);
233 #ifndef QT_NO_CONTEXTMENU 236 #ifndef QT_NO_DRAGANDDROP 246 #ifndef QT_NO_WHEELEVENT 250 virtual QMimeData *createMimeDataFromSelection()
const;
251 virtual bool canInsertFromMimeData(
const QMimeData *source)
const;
252 virtual void insertFromMimeData(
const QMimeData *source);
272 Q_PRIVATE_SLOT(d_func(),
void _q_verticalScrollbarActionTriggered(
int))
293 int pageCount() const;
299 void ensureBlockLayout(const
QTextBlock &block) const;
301 void setCursorWidth(
int width);
302 int cursorWidth() const;
304 void requestUpdate();
307 void documentChanged(
int from,
int ,
int charsAdded);
311 void setTextWidth(
qreal newWidth);
312 qreal textWidth() const;
327 #endif // QT_NO_TEXTEDIT 329 #endif // QPLAINTEXTEDIT_H The QVariant class acts like a union for the most common Qt data types.
The QPainter class performs low-level painting on widgets and other paint devices.
bool isUndoRedoEnabled() const
The QKeyEvent class describes a key event.
QString documentTitle() const
The QTextCharFormat class provides formatting information for characters in a QTextDocument.
#define QT_END_NAMESPACE
This macro expands to.
#define QDOC_PROPERTY(text)
The QPlainTextDocumentLayout class implements a plain text layout for QTextDocument.
The QWheelEvent class contains parameters that describe a wheel event.
The QTextFrame class represents a frame in a QTextDocument.
The QPointF class defines a point in the plane using floating point precision.
virtual void timerEvent(QTimerEvent *)
This event handler can be reimplemented in a subclass to receive timer events for the object...
WrapMode
This enum describes how text is wrapped in a document.
int maximumBlockCount() const
static void clear(QVariant::Private *d)
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
#define Q_PRIVATE_SLOT(d, signature)
static QSize documentSize(QTextControl *control)
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress...
The QSizeF class defines the size of a two-dimensional object using floating point precision...
void setMaximumBlockCount(int maximum)
static QCursor * moveCursor
#define QT_BEGIN_NAMESPACE
This macro expands to.
MoveMode
If the anchor() is kept where it is and the position() is moved, the text in between will be selected...
The QRectF class defines a rectangle in the plane using floating point precision. ...
void changeEvent(QEvent *)
This event handler can be reimplemented to handle state changes.
The QTextCursor class offers an API to access and modify QTextDocuments.
void setUndoRedoEnabled(bool enable)
The QPrinter class is a paint device that paints on a printer.
The QResizeEvent class contains event parameters for resize events.
The QTextBlock class provides a container for text fragments in a QTextDocument.
The QPlainTextEdit class provides a widget that is used to edit and display plain text...
The QDragLeaveEvent class provides an event that is sent to a widget when a drag and drop action leav...
The QShowEvent class provides an event that is sent when a widget is shown.
The QMimeData class provides a container for data that records information about its MIME type...
The QMouseEvent class contains parameters that describe a mouse event.
The QDropEvent class provides an event which is sent when a drag and drop action is completed...
The QTimerEvent class contains parameters that describe a timer event.
QString toPlainText() const
Returns the text of the text edit as plain text.
The QDragEnterEvent class provides an event which is sent to a widget when a drag and drop action ent...
The QPoint class defines a point in the plane using integer precision.
The QAbstractTextDocumentLayout::PaintContext class is a convenience class defining the parameters us...
The QRect class defines a rectangle in the plane using integer precision.
The QTextOption class provides a description of general rich text properties.
void setDocumentTitle(const QString &title)
The QTextDocument class holds formatted text that can be viewed and edited using a QTextEdit...
#define Q_DECLARE_PRIVATE(Class)
The QPaintEvent class contains event parameters for paint events.
The QEvent class is the base class of all event classes.
The QFocusEvent class contains event parameters for widget focus events.
The QList class is a template class that provides lists.
The QAbstractTextDocumentLayout class is an abstract base class used to implement custom layouts for ...