13 saveAction->setShortcut(
tr(
"Ctrl+S"));
16 quitAction->setShortcut(
tr(
"Ctrl+Q"));
41 cursor.insertText(
"Text documents are represented by the "
42 "QTextDocument class, rather than by QString objects. "
43 "Each QTextDocument object contains information about "
44 "the document's internal representation, its structure, "
45 "and keeps track of modifications to provide undo/redo "
46 "facilities. This approach allows features such as the "
47 "layout management to be delegated to specialized "
48 "classes, but also provides a focus for the framework.",
57 cursor.insertFrame(frameFormat);
65 cursor.insertText(
"Documents are either converted from external sources "
66 "or created from scratch using Qt. The creation process "
67 "can done by an editor widget, such as QTextEdit, or by "
68 "explicit calls to the Scribe API.", boldCharFormat);
77 cursor.insertText(
"There are two complementary ways to visualize the "
78 "contents of a document: as a linear buffer that is "
79 "used by editors to modify the contents, and as an "
80 "object hierarchy containing structural information "
81 "that is useful to layout engines. In the hierarchical "
82 "model, the objects generally correspond to visual "
83 "elements such as frames, tables, and lists. At a lower "
84 "level, these elements describe properties such as the "
85 "style of text used and its alignment. The linear "
86 "representation of the document is used for editing and "
87 "manipulation of the document's contents.",
101 tr(
"Save document as:"),
"",
tr(
"XML (*.xml)"));
127 processFrame(childFrame);
129 processBlock(childBlock);
The QAction class provides an abstraction for user commands that can be added to different user inter...
void triggered(bool checked=false)
This signal is emitted when an action is activated by the user; for example, when the user clicks a m...
static QString getSaveFileName(QWidget *parent=nullptr, const QString &caption=QString(), const QString &dir=QString(), const QString &filter=QString(), QString *selectedFilter=nullptr, Options options=Options())
This is a convenience static function that will return a file name selected by the user.
void setCentralWidget(QWidget *widget)
Sets the given widget to be the main window's central widget.
static StandardButton warning(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isValid() const
Returns true if this text block is valid; otherwise returns false.
void setFontWeight(int weight)
Sets the text format's font weight to weight.
\reentrant \inmodule QtGui
\reentrant \inmodule QtGui
QTextFrame * rootFrame() const
Returns the document's root frame.
The QTextEdit class provides a widget that is used to edit and display both plain and rich text.
QTextCursor textCursor() const
Returns a copy of the QTextCursor that represents the currently visible cursor.
QTextDocument * document
the underlying document of the text editor.
void setPadding(qreal padding)
Sets the width of the frame's internal padding in pixels.
void setBorder(qreal border)
Sets the width (in pixels) of the frame's border.
void setMargin(qreal margin)
Sets the frame's margin in pixels.
QTextCursor lastCursorPosition() const
Returns the last cursor position inside the frame.
QSet< QString >::iterator it