[][src]Struct qt_widgets::QPlainTextEdit

#[repr(C)]pub struct QPlainTextEdit { /* fields omitted */ }

The QPlainTextEdit class provides a widget that is used to edit and display plain text.

C++ class: QPlainTextEdit.

C++ documentation:

The QPlainTextEdit class provides a widget that is used to edit and display plain text.

Methods

impl QPlainTextEdit[src]

pub fn slot_set_plain_text(&self) -> Receiver<(*const QString,)>[src]

Changes the text of the text edit to the string text. Any previous text is removed.

Returns a built-in Qt slot QPlainTextEdit::setPlainText that can be passed to qt_core::Signal::connect.

C++ documentation:

Changes the text of the text edit to the string text. Any previous text is removed.

text is interpreted as plain text.

Note that the undo/redo history is cleared by this function.

Note: Setter function for property plainText.

See also toPlainText().

pub fn slot_cut(&self) -> Receiver<()>[src]

Copies the selected text to the clipboard and deletes it from the text edit.

Returns a built-in Qt slot QPlainTextEdit::cut that can be passed to qt_core::Signal::connect.

C++ documentation:

Copies the selected text to the clipboard and deletes it from the text edit.

If there is no selected text nothing happens.

See also copy() and paste().

pub fn slot_copy(&self) -> Receiver<()>[src]

Copies any selected text to the clipboard.

Returns a built-in Qt slot QPlainTextEdit::copy that can be passed to qt_core::Signal::connect.

C++ documentation:

Copies any selected text to the clipboard.

See also copyAvailable().

pub fn slot_paste(&self) -> Receiver<()>[src]

Pastes the text from the clipboard into the text edit at the current cursor position.

Returns a built-in Qt slot QPlainTextEdit::paste that can be passed to qt_core::Signal::connect.

C++ documentation:

Pastes the text from the clipboard into the text edit at the current cursor position.

If there is no text in the clipboard nothing happens.

To change the behavior of this function, i.e. to modify what QPlainTextEdit can paste and how it is being pasted, reimplement the virtual canInsertFromMimeData() and insertFromMimeData() functions.

See also cut() and copy().

pub fn slot_undo(&self) -> Receiver<()>[src]

Undoes the last operation.

Returns a built-in Qt slot QPlainTextEdit::undo that can be passed to qt_core::Signal::connect.

C++ documentation:

Undoes the last operation.

If there is no operation to undo, i.e. there is no undo step in the undo/redo history, nothing happens.

See also redo().

pub fn slot_redo(&self) -> Receiver<()>[src]

Redoes the last operation.

Returns a built-in Qt slot QPlainTextEdit::redo that can be passed to qt_core::Signal::connect.

C++ documentation:

Redoes the last operation.

If there is no operation to redo, i.e. there is no redo step in the undo/redo history, nothing happens.

See also undo().

pub fn slot_clear(&self) -> Receiver<()>[src]

Deletes all the text in the text edit.

Returns a built-in Qt slot QPlainTextEdit::clear that can be passed to qt_core::Signal::connect.

C++ documentation:

Deletes all the text in the text edit.

Note that the undo/redo history is cleared by this function.

See also cut() and setPlainText().

pub fn slot_select_all(&self) -> Receiver<()>[src]

Selects all text.

Returns a built-in Qt slot QPlainTextEdit::selectAll that can be passed to qt_core::Signal::connect.

C++ documentation:

Selects all text.

See also copy(), cut(), and textCursor().

pub fn slot_insert_plain_text(&self) -> Receiver<(*const QString,)>[src]

Convenience slot that inserts text at the current cursor position.

Returns a built-in Qt slot QPlainTextEdit::insertPlainText that can be passed to qt_core::Signal::connect.

C++ documentation:

Convenience slot that inserts text at the current cursor position.

It is equivalent to

edit->textCursor().insertText(text);

pub fn slot_append_plain_text(&self) -> Receiver<(*const QString,)>[src]

Appends a new paragraph with text to the end of the text edit.

Returns a built-in Qt slot QPlainTextEdit::appendPlainText that can be passed to qt_core::Signal::connect.

C++ documentation:

Appends a new paragraph with text to the end of the text edit.

See also appendHtml().

pub fn slot_append_html(&self) -> Receiver<(*const QString,)>[src]

Appends a new paragraph with html to the end of the text edit.

Returns a built-in Qt slot QPlainTextEdit::appendHtml that can be passed to qt_core::Signal::connect.

C++ documentation:

Appends a new paragraph with html to the end of the text edit.

appendPlainText()

pub fn slot_center_cursor(&self) -> Receiver<()>[src]

Scrolls the document in order to center the cursor vertically.

Returns a built-in Qt slot QPlainTextEdit::centerCursor that can be passed to qt_core::Signal::connect.

C++ documentation:

Scrolls the document in order to center the cursor vertically.

See also ensureCursorVisible() and centerOnScroll.

pub fn slot_zoom_in(&self) -> Receiver<(c_int,)>[src]

Zooms in on the text by making the base font size range points larger and recalculating all font sizes to be the new size. This does not change the size of any images.

Returns a built-in Qt slot QPlainTextEdit::zoomIn that can be passed to qt_core::Signal::connect.

C++ documentation:

Zooms in on the text by making the base font size range points larger and recalculating all font sizes to be the new size. This does not change the size of any images.

See also zoomOut().

pub fn slot_zoom_out(&self) -> Receiver<(c_int,)>[src]

Zooms out on the text by making the base font size range points smaller and recalculating all font sizes to be the new size. This does not change the size of any images.

Returns a built-in Qt slot QPlainTextEdit::zoomOut that can be passed to qt_core::Signal::connect.

C++ documentation:

Zooms out on the text by making the base font size range points smaller and recalculating all font sizes to be the new size. This does not change the size of any images.

See also zoomIn().

pub fn text_changed(&self) -> Signal<()>[src]

This signal is emitted whenever the document's content changes; for example, when text is inserted or deleted, or when formatting is applied.

Returns a built-in Qt signal QPlainTextEdit::textChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted whenever the document's content changes; for example, when text is inserted or deleted, or when formatting is applied.

Note: Notifier signal for property plainText.

pub fn undo_available(&self) -> Signal<(bool,)>[src]

This signal is emitted whenever undo operations become available (available is true) or unavailable (available is false).

Returns a built-in Qt signal QPlainTextEdit::undoAvailable that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted whenever undo operations become available (available is true) or unavailable (available is false).

pub fn redo_available(&self) -> Signal<(bool,)>[src]

This signal is emitted whenever redo operations become available (available is true) or unavailable (available is false).

Returns a built-in Qt signal QPlainTextEdit::redoAvailable that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted whenever redo operations become available (available is true) or unavailable (available is false).

pub fn copy_available(&self) -> Signal<(bool,)>[src]

This signal is emitted when text is selected or de-selected in the text edit.

Returns a built-in Qt signal QPlainTextEdit::copyAvailable that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when text is selected or de-selected in the text edit.

When text is selected this signal will be emitted with yes set to true. If no text has been selected or if the selected text is de-selected this signal is emitted with yes set to false.

If yes is true then copy() can be used to copy the selection to the clipboard. If yes is false then copy() does nothing.

See also selectionChanged().

pub fn selection_changed(&self) -> Signal<()>[src]

This signal is emitted whenever the selection changes.

Returns a built-in Qt signal QPlainTextEdit::selectionChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted whenever the selection changes.

See also copyAvailable().

pub fn cursor_position_changed(&self) -> Signal<()>[src]

This signal is emitted whenever the position of the cursor changed.

Returns a built-in Qt signal QPlainTextEdit::cursorPositionChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted whenever the position of the cursor changed.

pub fn update_request(&self) -> Signal<(*const QRect, c_int)>[src]

This signal is emitted when the text document needs an update of the specified rect. If the text is scrolled, rect will cover the entire viewport area. If the text is scrolled vertically, dy carries the amount of pixels the viewport was scrolled.

Returns a built-in Qt signal QPlainTextEdit::updateRequest that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the text document needs an update of the specified rect. If the text is scrolled, rect will cover the entire viewport area. If the text is scrolled vertically, dy carries the amount of pixels the viewport was scrolled.

The purpose of the signal is to support extra widgets in plain text edit subclasses that e.g. show line numbers, breakpoints, or other extra information.

pub fn block_count_changed(&self) -> Signal<(c_int,)>[src]

This signal is emitted whenever the block count changes. The new block count is passed in newBlockCount.

Returns a built-in Qt signal QPlainTextEdit::blockCountChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted whenever the block count changes. The new block count is passed in newBlockCount.

pub fn modification_changed(&self) -> Signal<(bool,)>[src]

This signal is emitted whenever the content of the document changes in a way that affects the modification state. If changed is true, the document has been modified; otherwise it is false.

Returns a built-in Qt signal QPlainTextEdit::modificationChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted whenever the content of the document changes in a way that affects the modification state. If changed is true, the document has been modified; otherwise it is false.

For example, calling setModified(false) on a document and then inserting text causes the signal to get emitted. If you undo that operation, causing the document to return to its original unmodified state, the signal will get emitted again.

pub unsafe fn anchor_at(
    &self,
    pos: impl CastInto<Ref<QPoint>>
) -> CppBox<QString>
[src]

Returns the reference of the anchor at position pos, or an empty string if no anchor exists at that point.

Calls C++ function: QString QPlainTextEdit::anchorAt(const QPoint& pos) const.

C++ documentation:

Returns the reference of the anchor at position pos, or an empty string if no anchor exists at that point.

This function was introduced in Qt 4.7.

pub unsafe fn append_html(&self, html: impl CastInto<Ref<QString>>)[src]

Appends a new paragraph with html to the end of the text edit.

Calls C++ function: [slot] void QPlainTextEdit::appendHtml(const QString& html).

C++ documentation:

Appends a new paragraph with html to the end of the text edit.

appendPlainText()

pub unsafe fn append_plain_text(&self, text: impl CastInto<Ref<QString>>)[src]

Appends a new paragraph with text to the end of the text edit.

Calls C++ function: [slot] void QPlainTextEdit::appendPlainText(const QString& text).

C++ documentation:

Appends a new paragraph with text to the end of the text edit.

See also appendHtml().

pub unsafe fn background_visible(&self) -> bool[src]

This property holds whether the palette background is visible outside the document area

Calls C++ function: bool QPlainTextEdit::backgroundVisible() const.

C++ documentation:

This property holds whether the palette background is visible outside the document area

If set to true, the plain text edit paints the palette background on the viewport area not covered by the text document. Otherwise, if set to false, it won't. The feature makes it possible for the user to visually distinguish between the area of the document, painted with the base color of the palette, and the empty area not covered by any document.

The default is false.

Access functions:

bool backgroundVisible() const
void setBackgroundVisible(bool visible)

pub unsafe fn block_count(&self) -> c_int[src]

This property holds the number of text blocks in the document.

Calls C++ function: int QPlainTextEdit::blockCount() const.

C++ documentation:

This property holds the number of text blocks in the document.

By default, in an empty document, this property contains a value of 1.

Access functions:

int blockCount() const

pub unsafe fn can_paste(&self) -> bool[src]

Returns whether text can be pasted from the clipboard into the textedit.

Calls C++ function: bool QPlainTextEdit::canPaste() const.

C++ documentation:

Returns whether text can be pasted from the clipboard into the textedit.

pub unsafe fn center_cursor(&self)[src]

Scrolls the document in order to center the cursor vertically.

Calls C++ function: [slot] void QPlainTextEdit::centerCursor().

C++ documentation:

Scrolls the document in order to center the cursor vertically.

See also ensureCursorVisible() and centerOnScroll.

pub unsafe fn center_on_scroll(&self) -> bool[src]

This property holds whether the cursor should be centered on screen

Calls C++ function: bool QPlainTextEdit::centerOnScroll() const.

C++ documentation:

This property holds whether the cursor should be centered on screen

If set to true, the plain text edit scrolls the document vertically to make the cursor visible at the center of the viewport. This also allows the text edit to scroll below the end of the document. Otherwise, if set to false, the plain text edit scrolls the smallest amount possible to ensure the cursor is visible. The same algorithm is applied to any new line appended through appendPlainText().

The default is false.

Access functions:

bool centerOnScroll() const
void setCenterOnScroll(bool enabled)

See also centerCursor() and ensureCursorVisible().

pub unsafe fn clear(&self)[src]

Deletes all the text in the text edit.

Calls C++ function: [slot] void QPlainTextEdit::clear().

C++ documentation:

Deletes all the text in the text edit.

Note that the undo/redo history is cleared by this function.

See also cut() and setPlainText().

pub unsafe fn copy(&self)[src]

Copies any selected text to the clipboard.

Calls C++ function: [slot] void QPlainTextEdit::copy().

C++ documentation:

Copies any selected text to the clipboard.

See also copyAvailable().

pub unsafe fn create_standard_context_menu_0a(&self) -> QPtr<QMenu>[src]

This function creates the standard context menu which is shown when the user clicks on the text edit with the right mouse button. It is called from the default contextMenuEvent() handler. The popup menu's ownership is transferred to the caller.

Calls C++ function: QMenu* QPlainTextEdit::createStandardContextMenu().

C++ documentation:

This function creates the standard context menu which is shown when the user clicks on the text edit with the right mouse button. It is called from the default contextMenuEvent() handler. The popup menu's ownership is transferred to the caller.

We recommend that you use the createStandardContextMenu(QPoint) version instead which will enable the actions that are sensitive to where the user clicked.

pub unsafe fn create_standard_context_menu_1a(
    &self,
    position: impl CastInto<Ref<QPoint>>
) -> QPtr<QMenu>
[src]

This function creates the standard context menu which is shown when the user clicks on the text edit with the right mouse button. It is called from the default contextMenuEvent() handler and it takes the position in document coordinates where the mouse click was. This can enable actions that are sensitive to the position where the user clicked. The popup menu's ownership is transferred to the caller.

Calls C++ function: QMenu* QPlainTextEdit::createStandardContextMenu(const QPoint& position).

C++ documentation:

This function creates the standard context menu which is shown when the user clicks on the text edit with the right mouse button. It is called from the default contextMenuEvent() handler and it takes the position in document coordinates where the mouse click was. This can enable actions that are sensitive to the position where the user clicked. The popup menu's ownership is transferred to the caller.

This function was introduced in Qt 5.5.

pub unsafe fn current_char_format(&self) -> CppBox<QTextCharFormat>[src]

Returns the char format that is used when inserting new text.

Calls C++ function: QTextCharFormat QPlainTextEdit::currentCharFormat() const.

C++ documentation:

Returns the char format that is used when inserting new text.

See also setCurrentCharFormat().

pub unsafe fn cursor_for_position(
    &self,
    pos: impl CastInto<Ref<QPoint>>
) -> CppBox<QTextCursor>
[src]

returns a QTextCursor at position pos (in viewport coordinates).

Calls C++ function: QTextCursor QPlainTextEdit::cursorForPosition(const QPoint& pos) const.

C++ documentation:

returns a QTextCursor at position pos (in viewport coordinates).

pub unsafe fn cursor_rect_1a(
    &self,
    cursor: impl CastInto<Ref<QTextCursor>>
) -> CppBox<QRect>
[src]

returns a rectangle (in viewport coordinates) that includes the cursor.

Calls C++ function: QRect QPlainTextEdit::cursorRect(const QTextCursor& cursor) const.

C++ documentation:

returns a rectangle (in viewport coordinates) that includes the cursor.

pub unsafe fn cursor_rect_0a(&self) -> CppBox<QRect>[src]

returns a rectangle (in viewport coordinates) that includes the cursor of the text edit.

Calls C++ function: QRect QPlainTextEdit::cursorRect() const.

C++ documentation:

returns a rectangle (in viewport coordinates) that includes the cursor of the text edit.

pub unsafe fn cursor_width(&self) -> c_int[src]

This property specifies the width of the cursor in pixels. The default value is 1.

Calls C++ function: int QPlainTextEdit::cursorWidth() const.

C++ documentation:

This property specifies the width of the cursor in pixels. The default value is 1.

Access functions:

int cursorWidth() const
void setCursorWidth(int width)

pub unsafe fn cut(&self)[src]

Copies the selected text to the clipboard and deletes it from the text edit.

Calls C++ function: [slot] void QPlainTextEdit::cut().

C++ documentation:

Copies the selected text to the clipboard and deletes it from the text edit.

If there is no selected text nothing happens.

See also copy() and paste().

pub unsafe fn document(&self) -> QPtr<QTextDocument>[src]

Returns a pointer to the underlying document.

Calls C++ function: QTextDocument* QPlainTextEdit::document() const.

C++ documentation:

Returns a pointer to the underlying document.

See also setDocument().

pub unsafe fn document_title(&self) -> CppBox<QString>[src]

This property holds the title of the document parsed from the text.

Calls C++ function: QString QPlainTextEdit::documentTitle() const.

C++ documentation:

This property holds the title of the document parsed from the text.

By default, this property contains an empty string.

Access functions:

QString documentTitle() const
void setDocumentTitle(const QString &title)

pub unsafe fn ensure_cursor_visible(&self)[src]

Ensures that the cursor is visible by scrolling the text edit if necessary.

Calls C++ function: void QPlainTextEdit::ensureCursorVisible().

C++ documentation:

Ensures that the cursor is visible by scrolling the text edit if necessary.

See also centerCursor() and centerOnScroll.

pub unsafe fn extra_selections(&self) -> CppBox<QListOfExtraSelection>[src]

Returns previously set extra selections.

Calls C++ function: QList<QTextEdit::ExtraSelection> QPlainTextEdit::extraSelections() const.

C++ documentation:

Returns previously set extra selections.

See also setExtraSelections().

pub unsafe fn find_q_string_q_flags_find_flag(
    &self,
    exp: impl CastInto<Ref<QString>>,
    options: QFlags<FindFlag>
) -> bool
[src]

Finds the next occurrence of the string, exp, using the given options. Returns true if exp was found and changes the cursor to select the match; otherwise returns false.

Calls C++ function: bool QPlainTextEdit::find(const QString& exp, QFlags<QTextDocument::FindFlag> options = …).

C++ documentation:

Finds the next occurrence of the string, exp, using the given options. Returns true if exp was found and changes the cursor to select the match; otherwise returns false.

pub unsafe fn find_q_reg_exp_q_flags_find_flag(
    &self,
    exp: impl CastInto<Ref<QRegExp>>,
    options: QFlags<FindFlag>
) -> bool
[src]

This is an overloaded function.

Calls C++ function: bool QPlainTextEdit::find(const QRegExp& exp, QFlags<QTextDocument::FindFlag> options = …).

C++ documentation:

This is an overloaded function.

Finds the next occurrence, matching the regular expression, exp, using the given options. The QTextDocument::FindCaseSensitively option is ignored for this overload, use QRegExp::caseSensitivity instead.

Returns true if a match was found and changes the cursor to select the match; otherwise returns false.

This function was introduced in Qt 5.3.

pub unsafe fn find_q_string(&self, exp: impl CastInto<Ref<QString>>) -> bool[src]

Finds the next occurrence of the string, exp, using the given options. Returns true if exp was found and changes the cursor to select the match; otherwise returns false.

Calls C++ function: bool QPlainTextEdit::find(const QString& exp).

C++ documentation:

Finds the next occurrence of the string, exp, using the given options. Returns true if exp was found and changes the cursor to select the match; otherwise returns false.

pub unsafe fn find_q_reg_exp(&self, exp: impl CastInto<Ref<QRegExp>>) -> bool[src]

This is an overloaded function.

Calls C++ function: bool QPlainTextEdit::find(const QRegExp& exp).

C++ documentation:

This is an overloaded function.

Finds the next occurrence, matching the regular expression, exp, using the given options. The QTextDocument::FindCaseSensitively option is ignored for this overload, use QRegExp::caseSensitivity instead.

Returns true if a match was found and changes the cursor to select the match; otherwise returns false.

This function was introduced in Qt 5.3.

pub unsafe fn find_q_regular_expression_q_flags_find_flag(
    &self,
    exp: impl CastInto<Ref<QRegularExpression>>,
    options: QFlags<FindFlag>
) -> bool
[src]

This is supported on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

This is an overloaded function.

Calls C++ function: bool QPlainTextEdit::find(const QRegularExpression& exp, QFlags<QTextDocument::FindFlag> options = …).

C++ documentation:

This is an overloaded function.

Finds the next occurrence, matching the regular expression, exp, using the given options. The QTextDocument::FindCaseSensitively option is ignored for this overload, use QRegularExpression::CaseInsensitiveOption instead.

Returns true if a match was found and changes the cursor to select the match; otherwise returns false.

This function was introduced in Qt 5.13.

pub unsafe fn find_q_regular_expression(
    &self,
    exp: impl CastInto<Ref<QRegularExpression>>
) -> bool
[src]

This is supported on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

This is an overloaded function.

Calls C++ function: bool QPlainTextEdit::find(const QRegularExpression& exp).

C++ documentation:

This is an overloaded function.

Finds the next occurrence, matching the regular expression, exp, using the given options. The QTextDocument::FindCaseSensitively option is ignored for this overload, use QRegularExpression::CaseInsensitiveOption instead.

Returns true if a match was found and changes the cursor to select the match; otherwise returns false.

This function was introduced in Qt 5.13.

pub unsafe fn input_method_query_1a(
    &self,
    property: InputMethodQuery
) -> CppBox<QVariant>
[src]

Reimplemented from QWidget::inputMethodQuery().

Calls C++ function: virtual QVariant QPlainTextEdit::inputMethodQuery(Qt::InputMethodQuery property) const.

C++ documentation:

Reimplemented from QWidget::inputMethodQuery().

pub unsafe fn input_method_query_2a(
    &self,
    query: InputMethodQuery,
    argument: impl CastInto<Ref<QVariant>>
) -> CppBox<QVariant>
[src]

Reimplemented from QWidget::inputMethodQuery().

Calls C++ function: QVariant QPlainTextEdit::inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const.

Warning: no exact match found in C++ documentation. Below is the C++ documentation for virtual QVariant QPlainTextEdit::inputMethodQuery(Qt::InputMethodQuery property) const:

Reimplemented from QWidget::inputMethodQuery().

pub unsafe fn insert_plain_text(&self, text: impl CastInto<Ref<QString>>)[src]

Convenience slot that inserts text at the current cursor position.

Calls C++ function: [slot] void QPlainTextEdit::insertPlainText(const QString& text).

C++ documentation:

Convenience slot that inserts text at the current cursor position.

It is equivalent to

edit->textCursor().insertText(text);

pub unsafe fn is_read_only(&self) -> bool[src]

This property holds whether the text edit is read-only

Calls C++ function: bool QPlainTextEdit::isReadOnly() const.

C++ documentation:

This property holds whether the text edit is read-only

In a read-only text edit the user can only navigate through the text and select text; modifying the text is not possible.

This property's default is false.

Access functions:

bool isReadOnly() const
void setReadOnly(bool ro)

pub unsafe fn is_undo_redo_enabled(&self) -> bool[src]

This property holds whether undo and redo are enabled

Calls C++ function: bool QPlainTextEdit::isUndoRedoEnabled() const.

C++ documentation:

This property holds whether undo and redo are enabled

Users are only able to undo or redo actions if this property is true, and if there is an action that can be undone (or redone).

By default, this property is true.

Access functions:

bool isUndoRedoEnabled() const
void setUndoRedoEnabled(bool enable)

pub unsafe fn line_wrap_mode(&self) -> LineWrapMode[src]

This property holds the line wrap mode

Calls C++ function: QPlainTextEdit::LineWrapMode QPlainTextEdit::lineWrapMode() const.

C++ documentation:

This property holds the line wrap mode

The default mode is WidgetWidth which causes words to be wrapped at the right edge of the text edit. Wrapping occurs at whitespace, keeping whole words intact. If you want wrapping to occur within words use setWordWrapMode().

Access functions:

LineWrapMode lineWrapMode() const
void setLineWrapMode(LineWrapMode mode)

pub unsafe fn load_resource(
    &self,
    type_: c_int,
    name: impl CastInto<Ref<QUrl>>
) -> CppBox<QVariant>
[src]

Loads the resource specified by the given type and name.

Calls C++ function: virtual QVariant QPlainTextEdit::loadResource(int type, const QUrl& name).

C++ documentation:

Loads the resource specified by the given type and name.

This function is an extension of QTextDocument::loadResource().

See also QTextDocument::loadResource().

pub unsafe fn maximum_block_count(&self) -> c_int[src]

This property holds the limit for blocks in the document.

Calls C++ function: int QPlainTextEdit::maximumBlockCount() const.

C++ documentation:

This property holds the limit for blocks in the document.

Specifies the maximum number of blocks the document may have. If there are more blocks in the document that specified with this property blocks are removed from the beginning of the document.

A negative or zero value specifies that the document may contain an unlimited amount of blocks.

The default value is 0.

Note that setting this property will apply the limit immediately to the document contents. Setting this property also disables the undo redo history.

Access functions:

int maximumBlockCount() const
void setMaximumBlockCount(int maximum)

pub unsafe fn merge_current_char_format(
    &self,
    modifier: impl CastInto<Ref<QTextCharFormat>>
)
[src]

Merges the properties specified in modifier into the current character format by calling QTextCursor::mergeCharFormat on the editor's cursor. If the editor has a selection then the properties of modifier are directly applied to the selection.

Calls C++ function: void QPlainTextEdit::mergeCurrentCharFormat(const QTextCharFormat& modifier).

C++ documentation:

Merges the properties specified in modifier into the current character format by calling QTextCursor::mergeCharFormat on the editor's cursor. If the editor has a selection then the properties of modifier are directly applied to the selection.

See also QTextCursor::mergeCharFormat().

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QPlainTextEdit::metaObject() const.

pub unsafe fn move_cursor_2a(&self, operation: MoveOperation, mode: MoveMode)[src]

Moves the cursor by performing the given operation.

Calls C++ function: void QPlainTextEdit::moveCursor(QTextCursor::MoveOperation operation, QTextCursor::MoveMode mode = …).

C++ documentation:

Moves the cursor by performing the given operation.

If mode is QTextCursor::KeepAnchor, the cursor selects the text it moves over. This is the same effect that the user achieves when they hold down the Shift key and move the cursor with the cursor keys.

See also QTextCursor::movePosition().

pub unsafe fn move_cursor_1a(&self, operation: MoveOperation)[src]

Moves the cursor by performing the given operation.

Calls C++ function: void QPlainTextEdit::moveCursor(QTextCursor::MoveOperation operation).

C++ documentation:

Moves the cursor by performing the given operation.

If mode is QTextCursor::KeepAnchor, the cursor selects the text it moves over. This is the same effect that the user achieves when they hold down the Shift key and move the cursor with the cursor keys.

See also QTextCursor::movePosition().

pub unsafe fn from_q_widget(
    parent: impl CastInto<Ptr<QWidget>>
) -> QBox<QPlainTextEdit>
[src]

Constructs an empty QPlainTextEdit with parent parent.

Calls C++ function: [constructor] void QPlainTextEdit::QPlainTextEdit(QWidget* parent = …).

C++ documentation:

Constructs an empty QPlainTextEdit with parent parent.

pub unsafe fn from_q_string_q_widget(
    text: impl CastInto<Ref<QString>>,
    parent: impl CastInto<Ptr<QWidget>>
) -> QBox<QPlainTextEdit>
[src]

Constructs a QPlainTextEdit with parent parent. The text edit will display the plain text text.

Calls C++ function: [constructor] void QPlainTextEdit::QPlainTextEdit(const QString& text, QWidget* parent = …).

C++ documentation:

Constructs a QPlainTextEdit with parent parent. The text edit will display the plain text text.

pub unsafe fn new() -> QBox<QPlainTextEdit>[src]

The QPlainTextEdit class provides a widget that is used to edit and display plain text.

Calls C++ function: [constructor] void QPlainTextEdit::QPlainTextEdit().

C++ documentation:

The QPlainTextEdit class provides a widget that is used to edit and display plain text.

pub unsafe fn from_q_string(
    text: impl CastInto<Ref<QString>>
) -> QBox<QPlainTextEdit>
[src]

Constructs a QPlainTextEdit with parent parent. The text edit will display the plain text text.

Calls C++ function: [constructor] void QPlainTextEdit::QPlainTextEdit(const QString& text).

C++ documentation:

Constructs a QPlainTextEdit with parent parent. The text edit will display the plain text text.

pub unsafe fn overwrite_mode(&self) -> bool[src]

This property holds whether text entered by the user will overwrite existing text

Calls C++ function: bool QPlainTextEdit::overwriteMode() const.

C++ documentation:

This property holds whether text entered by the user will overwrite existing text

As with many text editors, the plain text editor widget can be configured to insert or overwrite existing text with new text entered by the user.

If this property is true, existing text is overwritten, character-for-character by new text; otherwise, text is inserted at the cursor position, displacing existing text.

By default, this property is false (new text does not overwrite existing text).

Access functions:

bool overwriteMode() const
void setOverwriteMode(bool overwrite)

pub unsafe fn paste(&self)[src]

Pastes the text from the clipboard into the text edit at the current cursor position.

Calls C++ function: [slot] void QPlainTextEdit::paste().

C++ documentation:

Pastes the text from the clipboard into the text edit at the current cursor position.

If there is no text in the clipboard nothing happens.

To change the behavior of this function, i.e. to modify what QPlainTextEdit can paste and how it is being pasted, reimplement the virtual canInsertFromMimeData() and insertFromMimeData() functions.

See also cut() and copy().

pub unsafe fn placeholder_text(&self) -> CppBox<QString>[src]

This property holds the editor placeholder text

Calls C++ function: QString QPlainTextEdit::placeholderText() const.

C++ documentation:

This property holds the editor placeholder text

Setting this property makes the editor display a grayed-out placeholder text as long as the document() is empty.

By default, this property contains an empty string.

This property was introduced in Qt 5.3.

Access functions:

QString placeholderText() const
void setPlaceholderText(const QString &placeholderText)

See also document().

pub unsafe fn print(&self, printer: impl CastInto<Ptr<QPagedPaintDevice>>)[src]

Convenience function to print the text edit's document to the given printer. This is equivalent to calling the print method on the document directly except that this function also supports QPrinter::Selection as print range.

Calls C++ function: void QPlainTextEdit::print(QPagedPaintDevice* printer) const.

C++ documentation:

Convenience function to print the text edit's document to the given printer. This is equivalent to calling the print method on the document directly except that this function also supports QPrinter::Selection as print range.

See also QTextDocument::print().

pub unsafe fn qt_metacall(
    &self,
    arg1: Call,
    arg2: c_int,
    arg3: *mut *mut c_void
) -> c_int
[src]

Calls C++ function: virtual int QPlainTextEdit::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(&self, arg1: *const c_char) -> *mut c_void[src]

Calls C++ function: virtual void* QPlainTextEdit::qt_metacast(const char* arg1).

pub unsafe fn redo(&self)[src]

Redoes the last operation.

Calls C++ function: [slot] void QPlainTextEdit::redo().

C++ documentation:

Redoes the last operation.

If there is no operation to redo, i.e. there is no redo step in the undo/redo history, nothing happens.

See also undo().

pub unsafe fn select_all(&self)[src]

Selects all text.

Calls C++ function: [slot] void QPlainTextEdit::selectAll().

C++ documentation:

Selects all text.

See also copy(), cut(), and textCursor().

pub unsafe fn set_background_visible(&self, visible: bool)[src]

This property holds whether the palette background is visible outside the document area

Calls C++ function: void QPlainTextEdit::setBackgroundVisible(bool visible).

C++ documentation:

This property holds whether the palette background is visible outside the document area

If set to true, the plain text edit paints the palette background on the viewport area not covered by the text document. Otherwise, if set to false, it won't. The feature makes it possible for the user to visually distinguish between the area of the document, painted with the base color of the palette, and the empty area not covered by any document.

The default is false.

Access functions:

bool backgroundVisible() const
void setBackgroundVisible(bool visible)

pub unsafe fn set_center_on_scroll(&self, enabled: bool)[src]

This property holds whether the cursor should be centered on screen

Calls C++ function: void QPlainTextEdit::setCenterOnScroll(bool enabled).

C++ documentation:

This property holds whether the cursor should be centered on screen

If set to true, the plain text edit scrolls the document vertically to make the cursor visible at the center of the viewport. This also allows the text edit to scroll below the end of the document. Otherwise, if set to false, the plain text edit scrolls the smallest amount possible to ensure the cursor is visible. The same algorithm is applied to any new line appended through appendPlainText().

The default is false.

Access functions:

bool centerOnScroll() const
void setCenterOnScroll(bool enabled)

See also centerCursor() and ensureCursorVisible().

pub unsafe fn set_current_char_format(
    &self,
    format: impl CastInto<Ref<QTextCharFormat>>
)
[src]

Sets the char format that is be used when inserting new text to format by calling QTextCursor::setCharFormat() on the editor's cursor. If the editor has a selection then the char format is directly applied to the selection.

Calls C++ function: void QPlainTextEdit::setCurrentCharFormat(const QTextCharFormat& format).

C++ documentation:

Sets the char format that is be used when inserting new text to format by calling QTextCursor::setCharFormat() on the editor's cursor. If the editor has a selection then the char format is directly applied to the selection.

See also currentCharFormat().

pub unsafe fn set_cursor_width(&self, width: c_int)[src]

This property specifies the width of the cursor in pixels. The default value is 1.

Calls C++ function: void QPlainTextEdit::setCursorWidth(int width).

C++ documentation:

This property specifies the width of the cursor in pixels. The default value is 1.

Access functions:

int cursorWidth() const
void setCursorWidth(int width)

pub unsafe fn set_document(&self, document: impl CastInto<Ptr<QTextDocument>>)[src]

Makes document the new document of the text editor.

Calls C++ function: void QPlainTextEdit::setDocument(QTextDocument* document).

C++ documentation:

Makes document the new document of the text editor.

The parent QObject of the provided document remains the owner of the object. If the current document is a child of the text editor, then it is deleted.

The document must have a document layout that inherits QPlainTextDocumentLayout (see QTextDocument::setDocumentLayout()).

See also document().

pub unsafe fn set_document_title(&self, title: impl CastInto<Ref<QString>>)[src]

This property holds the title of the document parsed from the text.

Calls C++ function: void QPlainTextEdit::setDocumentTitle(const QString& title).

C++ documentation:

This property holds the title of the document parsed from the text.

By default, this property contains an empty string.

Access functions:

QString documentTitle() const
void setDocumentTitle(const QString &title)

pub unsafe fn set_extra_selections(
    &self,
    selections: impl CastInto<Ref<QListOfExtraSelection>>
)
[src]

This function allows temporarily marking certain regions in the document with a given color, specified as selections. This can be useful for example in a programming editor to mark a whole line of text with a given background color to indicate the existence of a breakpoint.

Calls C++ function: void QPlainTextEdit::setExtraSelections(const QList<QTextEdit::ExtraSelection>& selections).

C++ documentation:

This function allows temporarily marking certain regions in the document with a given color, specified as selections. This can be useful for example in a programming editor to mark a whole line of text with a given background color to indicate the existence of a breakpoint.

See also QTextEdit::ExtraSelection and extraSelections().

pub unsafe fn set_line_wrap_mode(&self, mode: LineWrapMode)[src]

This property holds the line wrap mode

Calls C++ function: void QPlainTextEdit::setLineWrapMode(QPlainTextEdit::LineWrapMode mode).

C++ documentation:

This property holds the line wrap mode

The default mode is WidgetWidth which causes words to be wrapped at the right edge of the text edit. Wrapping occurs at whitespace, keeping whole words intact. If you want wrapping to occur within words use setWordWrapMode().

Access functions:

LineWrapMode lineWrapMode() const
void setLineWrapMode(LineWrapMode mode)

pub unsafe fn set_maximum_block_count(&self, maximum: c_int)[src]

This property holds the limit for blocks in the document.

Calls C++ function: void QPlainTextEdit::setMaximumBlockCount(int maximum).

C++ documentation:

This property holds the limit for blocks in the document.

Specifies the maximum number of blocks the document may have. If there are more blocks in the document that specified with this property blocks are removed from the beginning of the document.

A negative or zero value specifies that the document may contain an unlimited amount of blocks.

The default value is 0.

Note that setting this property will apply the limit immediately to the document contents. Setting this property also disables the undo redo history.

Access functions:

int maximumBlockCount() const
void setMaximumBlockCount(int maximum)

pub unsafe fn set_overwrite_mode(&self, overwrite: bool)[src]

This property holds whether text entered by the user will overwrite existing text

Calls C++ function: void QPlainTextEdit::setOverwriteMode(bool overwrite).

C++ documentation:

This property holds whether text entered by the user will overwrite existing text

As with many text editors, the plain text editor widget can be configured to insert or overwrite existing text with new text entered by the user.

If this property is true, existing text is overwritten, character-for-character by new text; otherwise, text is inserted at the cursor position, displacing existing text.

By default, this property is false (new text does not overwrite existing text).

Access functions:

bool overwriteMode() const
void setOverwriteMode(bool overwrite)

pub unsafe fn set_placeholder_text(
    &self,
    placeholder_text: impl CastInto<Ref<QString>>
)
[src]

This property holds the editor placeholder text

Calls C++ function: void QPlainTextEdit::setPlaceholderText(const QString& placeholderText).

C++ documentation:

This property holds the editor placeholder text

Setting this property makes the editor display a grayed-out placeholder text as long as the document() is empty.

By default, this property contains an empty string.

This property was introduced in Qt 5.3.

Access functions:

QString placeholderText() const
void setPlaceholderText(const QString &placeholderText)

See also document().

pub unsafe fn set_plain_text(&self, text: impl CastInto<Ref<QString>>)[src]

Changes the text of the text edit to the string text. Any previous text is removed.

Calls C++ function: [slot] void QPlainTextEdit::setPlainText(const QString& text).

C++ documentation:

Changes the text of the text edit to the string text. Any previous text is removed.

text is interpreted as plain text.

Note that the undo/redo history is cleared by this function.

Note: Setter function for property plainText.

See also toPlainText().

pub unsafe fn set_read_only(&self, ro: bool)[src]

This property holds whether the text edit is read-only

Calls C++ function: void QPlainTextEdit::setReadOnly(bool ro).

C++ documentation:

This property holds whether the text edit is read-only

In a read-only text edit the user can only navigate through the text and select text; modifying the text is not possible.

This property's default is false.

Access functions:

bool isReadOnly() const
void setReadOnly(bool ro)

pub unsafe fn set_tab_changes_focus(&self, b: bool)[src]

This property holds whether Tab changes focus or is accepted as input

Calls C++ function: void QPlainTextEdit::setTabChangesFocus(bool b).

C++ documentation:

This property holds whether Tab changes focus or is accepted as input

In some occasions text edits should not allow the user to input tabulators or change indentation using the Tab key, as this breaks the focus chain. The default is false.

Access functions:

bool tabChangesFocus() const
void setTabChangesFocus(bool b)

pub unsafe fn set_tab_stop_distance(&self, distance: c_double)[src]

This is supported on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

This property holds the tab stop distance in pixels

Calls C++ function: void QPlainTextEdit::setTabStopDistance(double distance).

C++ documentation:

This property holds the tab stop distance in pixels

By default, this property contains a value of 80.

This property was introduced in Qt 5.10.

Access functions:

qreal tabStopDistance() const
void setTabStopDistance(qreal distance)

pub unsafe fn set_tab_stop_width(&self, width: c_int)[src]

This property holds the tab stop width in pixels

Calls C++ function: void QPlainTextEdit::setTabStopWidth(int width).

C++ documentation:

This property holds the tab stop width in pixels

By default, this property contains a value of 80.

Access functions:

int tabStopWidth() const
void setTabStopWidth(int width)

pub unsafe fn set_text_cursor(&self, cursor: impl CastInto<Ref<QTextCursor>>)[src]

Sets the visible cursor.

Calls C++ function: void QPlainTextEdit::setTextCursor(const QTextCursor& cursor).

C++ documentation:

Sets the visible cursor.

See also textCursor().

pub unsafe fn set_text_interaction_flags(
    &self,
    flags: QFlags<TextInteractionFlag>
)
[src]

Specifies how the label should interact with user input if it displays text.

Calls C++ function: void QPlainTextEdit::setTextInteractionFlags(QFlags<Qt::TextInteractionFlag> flags).

C++ documentation:

Specifies how the label should interact with user input if it displays text.

If the flags contain either Qt::LinksAccessibleByKeyboard or Qt::TextSelectableByKeyboard then the focus policy is also automatically set to Qt::ClickFocus.

The default value depends on whether the QPlainTextEdit is read-only or editable.

Access functions:

Qt::TextInteractionFlags textInteractionFlags() const
void setTextInteractionFlags(Qt::TextInteractionFlags flags)

pub unsafe fn set_undo_redo_enabled(&self, enable: bool)[src]

This property holds whether undo and redo are enabled

Calls C++ function: void QPlainTextEdit::setUndoRedoEnabled(bool enable).

C++ documentation:

This property holds whether undo and redo are enabled

Users are only able to undo or redo actions if this property is true, and if there is an action that can be undone (or redone).

By default, this property is true.

Access functions:

bool isUndoRedoEnabled() const
void setUndoRedoEnabled(bool enable)

pub unsafe fn set_word_wrap_mode(&self, policy: WrapMode)[src]

This property holds the mode QPlainTextEdit will use when wrapping text by words

Calls C++ function: void QPlainTextEdit::setWordWrapMode(QTextOption::WrapMode policy).

C++ documentation:

This property holds the mode QPlainTextEdit will use when wrapping text by words

By default, this property is set to QTextOption::WrapAtWordBoundaryOrAnywhere.

Access functions:

QTextOption::WrapMode wordWrapMode() const
void setWordWrapMode(QTextOption::WrapMode policy)

See also QTextOption::WrapMode.

pub unsafe fn static_meta_object() -> Ref<QMetaObject>[src]

Returns a reference to the staticMetaObject field.

pub unsafe fn tab_changes_focus(&self) -> bool[src]

This property holds whether Tab changes focus or is accepted as input

Calls C++ function: bool QPlainTextEdit::tabChangesFocus() const.

C++ documentation:

This property holds whether Tab changes focus or is accepted as input

In some occasions text edits should not allow the user to input tabulators or change indentation using the Tab key, as this breaks the focus chain. The default is false.

Access functions:

bool tabChangesFocus() const
void setTabChangesFocus(bool b)

pub unsafe fn tab_stop_distance(&self) -> c_double[src]

This is supported on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

This property holds the tab stop distance in pixels

Calls C++ function: double QPlainTextEdit::tabStopDistance() const.

C++ documentation:

This property holds the tab stop distance in pixels

By default, this property contains a value of 80.

This property was introduced in Qt 5.10.

Access functions:

qreal tabStopDistance() const
void setTabStopDistance(qreal distance)

pub unsafe fn tab_stop_width(&self) -> c_int[src]

This property holds the tab stop width in pixels

Calls C++ function: int QPlainTextEdit::tabStopWidth() const.

C++ documentation:

This property holds the tab stop width in pixels

By default, this property contains a value of 80.

Access functions:

int tabStopWidth() const
void setTabStopWidth(int width)

pub unsafe fn text_cursor(&self) -> CppBox<QTextCursor>[src]

Returns a copy of the QTextCursor that represents the currently visible cursor. Note that changes on the returned cursor do not affect QPlainTextEdit's cursor; use setTextCursor() to update the visible cursor.

Calls C++ function: QTextCursor QPlainTextEdit::textCursor() const.

C++ documentation:

Returns a copy of the QTextCursor that represents the currently visible cursor. Note that changes on the returned cursor do not affect QPlainTextEdit's cursor; use setTextCursor() to update the visible cursor.

See also setTextCursor().

pub unsafe fn text_interaction_flags(&self) -> QFlags<TextInteractionFlag>[src]

Specifies how the label should interact with user input if it displays text.

Calls C++ function: QFlags<Qt::TextInteractionFlag> QPlainTextEdit::textInteractionFlags() const.

C++ documentation:

Specifies how the label should interact with user input if it displays text.

If the flags contain either Qt::LinksAccessibleByKeyboard or Qt::TextSelectableByKeyboard then the focus policy is also automatically set to Qt::ClickFocus.

The default value depends on whether the QPlainTextEdit is read-only or editable.

Access functions:

Qt::TextInteractionFlags textInteractionFlags() const
void setTextInteractionFlags(Qt::TextInteractionFlags flags)

pub unsafe fn to_plain_text(&self) -> CppBox<QString>[src]

Returns the text of the text edit as plain text.

Calls C++ function: QString QPlainTextEdit::toPlainText() const.

C++ documentation:

Returns the text of the text edit as plain text.

Note: Getter function for property plainText.

See also QPlainTextEdit::setPlainText().

pub unsafe fn tr(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QPlainTextEdit::tr(const char* s, const char* c, int n).

pub unsafe fn tr_utf8(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QPlainTextEdit::trUtf8(const char* s, const char* c, int n).

pub unsafe fn undo(&self)[src]

Undoes the last operation.

Calls C++ function: [slot] void QPlainTextEdit::undo().

C++ documentation:

Undoes the last operation.

If there is no operation to undo, i.e. there is no undo step in the undo/redo history, nothing happens.

See also redo().

pub unsafe fn word_wrap_mode(&self) -> WrapMode[src]

This property holds the mode QPlainTextEdit will use when wrapping text by words

Calls C++ function: QTextOption::WrapMode QPlainTextEdit::wordWrapMode() const.

C++ documentation:

This property holds the mode QPlainTextEdit will use when wrapping text by words

By default, this property is set to QTextOption::WrapAtWordBoundaryOrAnywhere.

Access functions:

QTextOption::WrapMode wordWrapMode() const
void setWordWrapMode(QTextOption::WrapMode policy)

See also QTextOption::WrapMode.

pub unsafe fn zoom_in_1a(&self, range: c_int)[src]

Zooms in on the text by making the base font size range points larger and recalculating all font sizes to be the new size. This does not change the size of any images.

Calls C++ function: [slot] void QPlainTextEdit::zoomIn(int range = …).

C++ documentation:

Zooms in on the text by making the base font size range points larger and recalculating all font sizes to be the new size. This does not change the size of any images.

See also zoomOut().

pub unsafe fn zoom_in_0a(&self)[src]

Zooms in on the text by making the base font size range points larger and recalculating all font sizes to be the new size. This does not change the size of any images.

Calls C++ function: [slot] void QPlainTextEdit::zoomIn().

C++ documentation:

Zooms in on the text by making the base font size range points larger and recalculating all font sizes to be the new size. This does not change the size of any images.

See also zoomOut().

pub unsafe fn zoom_out_1a(&self, range: c_int)[src]

Zooms out on the text by making the base font size range points smaller and recalculating all font sizes to be the new size. This does not change the size of any images.

Calls C++ function: [slot] void QPlainTextEdit::zoomOut(int range = …).

C++ documentation:

Zooms out on the text by making the base font size range points smaller and recalculating all font sizes to be the new size. This does not change the size of any images.

See also zoomIn().

pub unsafe fn zoom_out_0a(&self)[src]

Zooms out on the text by making the base font size range points smaller and recalculating all font sizes to be the new size. This does not change the size of any images.

Calls C++ function: [slot] void QPlainTextEdit::zoomOut().

C++ documentation:

Zooms out on the text by making the base font size range points smaller and recalculating all font sizes to be the new size. This does not change the size of any images.

See also zoomIn().

Methods from Deref<Target = QAbstractScrollArea>

pub unsafe fn add_scroll_bar_widget(
    &self,
    widget: impl CastInto<Ptr<QWidget>>,
    alignment: QFlags<AlignmentFlag>
)
[src]

Adds widget as a scroll bar widget in the location specified by alignment.

Calls C++ function: void QAbstractScrollArea::addScrollBarWidget(QWidget* widget, QFlags<Qt::AlignmentFlag> alignment).

C++ documentation:

Adds widget as a scroll bar widget in the location specified by alignment.

Scroll bar widgets are shown next to the horizontal or vertical scroll bar, and can be placed on either side of it. If you want the scroll bar widgets to be always visible, set the scrollBarPolicy for the corresponding scroll bar to AlwaysOn.

alignment must be one of Qt::Alignleft and Qt::AlignRight, which maps to the horizontal scroll bar, or Qt::AlignTop and Qt::AlignBottom, which maps to the vertical scroll bar.

A scroll bar widget can be removed by either re-parenting the widget or deleting it. It's also possible to hide a widget with QWidget::hide()

The scroll bar widget will be resized to fit the scroll bar geometry for the current style. The following describes the case for scroll bar widgets on the horizontal scroll bar:

The height of the widget will be set to match the height of the scroll bar. To control the width of the widget, use QWidget::setMinimumWidth and QWidget::setMaximumWidth, or implement QWidget::sizeHint() and set a horizontal size policy. If you want a square widget, call QStyle::pixelMetric(QStyle::PM_ScrollBarExtent) and set the width to this value.

This function was introduced in Qt 4.2.

See also scrollBarWidgets().

pub unsafe fn corner_widget(&self) -> QPtr<QWidget>[src]

Returns the widget in the corner between the two scroll bars.

Calls C++ function: QWidget* QAbstractScrollArea::cornerWidget() const.

C++ documentation:

Returns the widget in the corner between the two scroll bars.

By default, no corner widget is present.

This function was introduced in Qt 4.2.

See also setCornerWidget().

pub unsafe fn horizontal_scroll_bar(&self) -> QPtr<QScrollBar>[src]

Returns the horizontal scroll bar.

Calls C++ function: QScrollBar* QAbstractScrollArea::horizontalScrollBar() const.

C++ documentation:

Returns the horizontal scroll bar.

See also setHorizontalScrollBar(), horizontalScrollBarPolicy, and verticalScrollBar().

pub unsafe fn horizontal_scroll_bar_policy(&self) -> ScrollBarPolicy[src]

This property holds the policy for the horizontal scroll bar

Calls C++ function: Qt::ScrollBarPolicy QAbstractScrollArea::horizontalScrollBarPolicy() const.

C++ documentation:

This property holds the policy for the horizontal scroll bar

The default policy is Qt::ScrollBarAsNeeded.

Access functions:

Qt::ScrollBarPolicy horizontalScrollBarPolicy() const
void setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy)

See also verticalScrollBarPolicy.

pub unsafe fn maximum_viewport_size(&self) -> CppBox<QSize>[src]

Returns the size of the viewport as if the scroll bars had no valid scrolling range.

Calls C++ function: QSize QAbstractScrollArea::maximumViewportSize() const.

C++ documentation:

Returns the size of the viewport as if the scroll bars had no valid scrolling range.

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QAbstractScrollArea::metaObject() const.

pub unsafe fn minimum_size_hint(&self) -> CppBox<QSize>[src]

Reimplemented from QWidget::minimumSizeHint().

Calls C++ function: virtual QSize QAbstractScrollArea::minimumSizeHint() const.

C++ documentation:

Reimplemented from QWidget::minimumSizeHint().

pub unsafe fn qt_metacall(
    &self,
    arg1: Call,
    arg2: c_int,
    arg3: *mut *mut c_void
) -> c_int
[src]

Calls C++ function: virtual int QAbstractScrollArea::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(&self, arg1: *const c_char) -> *mut c_void[src]

Calls C++ function: virtual void* QAbstractScrollArea::qt_metacast(const char* arg1).

pub unsafe fn scroll_bar_widgets(
    &self,
    alignment: QFlags<AlignmentFlag>
) -> CppBox<QListOfQWidget>
[src]

Returns a list of the currently set scroll bar widgets. alignment can be any combination of the four location flags.

Calls C++ function: QList<QWidget*> QAbstractScrollArea::scrollBarWidgets(QFlags<Qt::AlignmentFlag> alignment).

C++ documentation:

Returns a list of the currently set scroll bar widgets. alignment can be any combination of the four location flags.

This function was introduced in Qt 4.2.

See also addScrollBarWidget().

pub unsafe fn set_corner_widget(&self, widget: impl CastInto<Ptr<QWidget>>)[src]

Sets the widget in the corner between the two scroll bars to be widget.

Calls C++ function: void QAbstractScrollArea::setCornerWidget(QWidget* widget).

C++ documentation:

Sets the widget in the corner between the two scroll bars to be widget.

You will probably also want to set at least one of the scroll bar modes to AlwaysOn.

Passing 0 shows no widget in the corner.

Any previous corner widget is hidden.

You may call setCornerWidget() with the same widget at different times.

All widgets set here will be deleted by the scroll area when it is destroyed unless you separately reparent the widget after setting some other corner widget (or 0).

Any newly set widget should have no current parent.

By default, no corner widget is present.

This function was introduced in Qt 4.2.

See also cornerWidget(), horizontalScrollBarPolicy, and horizontalScrollBarPolicy.

pub unsafe fn set_horizontal_scroll_bar(
    &self,
    scrollbar: impl CastInto<Ptr<QScrollBar>>
)
[src]

Replaces the existing horizontal scroll bar with scrollBar, and sets all the former scroll bar's slider properties on the new scroll bar. The former scroll bar is then deleted.

Calls C++ function: void QAbstractScrollArea::setHorizontalScrollBar(QScrollBar* scrollbar).

C++ documentation:

Replaces the existing horizontal scroll bar with scrollBar, and sets all the former scroll bar's slider properties on the new scroll bar. The former scroll bar is then deleted.

QAbstractScrollArea already provides horizontal and vertical scroll bars by default. You can call this function to replace the default horizontal scroll bar with your own custom scroll bar.

This function was introduced in Qt 4.2.

See also horizontalScrollBar() and setVerticalScrollBar().

pub unsafe fn set_horizontal_scroll_bar_policy(&self, arg1: ScrollBarPolicy)[src]

This property holds the policy for the horizontal scroll bar

Calls C++ function: void QAbstractScrollArea::setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy arg1).

C++ documentation:

This property holds the policy for the horizontal scroll bar

The default policy is Qt::ScrollBarAsNeeded.

Access functions:

Qt::ScrollBarPolicy horizontalScrollBarPolicy() const
void setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy)

See also verticalScrollBarPolicy.

pub unsafe fn set_size_adjust_policy(&self, policy: SizeAdjustPolicy)[src]

This property holds the policy describing how the size of the scroll area changes when the size of the viewport changes.

Calls C++ function: void QAbstractScrollArea::setSizeAdjustPolicy(QAbstractScrollArea::SizeAdjustPolicy policy).

C++ documentation:

This property holds the policy describing how the size of the scroll area changes when the size of the viewport changes.

The default policy is QAbstractScrollArea::AdjustIgnored. Changing this property might actually resize the scrollarea.

This property was introduced in Qt 5.2.

Access functions:

SizeAdjustPolicy sizeAdjustPolicy() const
void setSizeAdjustPolicy(SizeAdjustPolicy policy)

pub unsafe fn set_vertical_scroll_bar(
    &self,
    scrollbar: impl CastInto<Ptr<QScrollBar>>
)
[src]

Replaces the existing vertical scroll bar with scrollBar, and sets all the former scroll bar's slider properties on the new scroll bar. The former scroll bar is then deleted.

Calls C++ function: void QAbstractScrollArea::setVerticalScrollBar(QScrollBar* scrollbar).

C++ documentation:

Replaces the existing vertical scroll bar with scrollBar, and sets all the former scroll bar's slider properties on the new scroll bar. The former scroll bar is then deleted.

QAbstractScrollArea already provides vertical and horizontal scroll bars by default. You can call this function to replace the default vertical scroll bar with your own custom scroll bar.

This function was introduced in Qt 4.2.

See also verticalScrollBar() and setHorizontalScrollBar().

pub unsafe fn set_vertical_scroll_bar_policy(&self, arg1: ScrollBarPolicy)[src]

This property holds the policy for the vertical scroll bar

Calls C++ function: void QAbstractScrollArea::setVerticalScrollBarPolicy(Qt::ScrollBarPolicy arg1).

C++ documentation:

This property holds the policy for the vertical scroll bar

The default policy is Qt::ScrollBarAsNeeded.

Access functions:

Qt::ScrollBarPolicy verticalScrollBarPolicy() const
void setVerticalScrollBarPolicy(Qt::ScrollBarPolicy)

See also horizontalScrollBarPolicy.

pub unsafe fn set_viewport(&self, widget: impl CastInto<Ptr<QWidget>>)[src]

Sets the viewport to be the given widget. The QAbstractScrollArea will take ownership of the given widget.

Calls C++ function: void QAbstractScrollArea::setViewport(QWidget* widget).

C++ documentation:

Sets the viewport to be the given widget. The QAbstractScrollArea will take ownership of the given widget.

If widget is 0, QAbstractScrollArea will assign a new QWidget instance for the viewport.

This function was introduced in Qt 4.2.

See also viewport().

pub unsafe fn setup_viewport(&self, viewport: impl CastInto<Ptr<QWidget>>)[src]

This slot is called by QAbstractScrollArea after setViewport(viewport) has been called. Reimplement this function in a subclass of QAbstractScrollArea to initialize the new viewport before it is used.

Calls C++ function: virtual void QAbstractScrollArea::setupViewport(QWidget* viewport).

C++ documentation:

This slot is called by QAbstractScrollArea after setViewport(viewport) has been called. Reimplement this function in a subclass of QAbstractScrollArea to initialize the new viewport before it is used.

See also setViewport().

pub unsafe fn size_adjust_policy(&self) -> SizeAdjustPolicy[src]

This property holds the policy describing how the size of the scroll area changes when the size of the viewport changes.

Calls C++ function: QAbstractScrollArea::SizeAdjustPolicy QAbstractScrollArea::sizeAdjustPolicy() const.

C++ documentation:

This property holds the policy describing how the size of the scroll area changes when the size of the viewport changes.

The default policy is QAbstractScrollArea::AdjustIgnored. Changing this property might actually resize the scrollarea.

This property was introduced in Qt 5.2.

Access functions:

SizeAdjustPolicy sizeAdjustPolicy() const
void setSizeAdjustPolicy(SizeAdjustPolicy policy)

pub unsafe fn size_hint(&self) -> CppBox<QSize>[src]

Reimplemented from QWidget::sizeHint().

Calls C++ function: virtual QSize QAbstractScrollArea::sizeHint() const.

C++ documentation:

Reimplemented from QWidget::sizeHint().

Returns the sizeHint property of the scroll area. The size is determined by using viewportSizeHint() plus some extra space for scroll bars, if needed.

pub unsafe fn vertical_scroll_bar(&self) -> QPtr<QScrollBar>[src]

Returns the vertical scroll bar.

Calls C++ function: QScrollBar* QAbstractScrollArea::verticalScrollBar() const.

C++ documentation:

Returns the vertical scroll bar.

See also setVerticalScrollBar(), verticalScrollBarPolicy, and horizontalScrollBar().

pub unsafe fn vertical_scroll_bar_policy(&self) -> ScrollBarPolicy[src]

This property holds the policy for the vertical scroll bar

Calls C++ function: Qt::ScrollBarPolicy QAbstractScrollArea::verticalScrollBarPolicy() const.

C++ documentation:

This property holds the policy for the vertical scroll bar

The default policy is Qt::ScrollBarAsNeeded.

Access functions:

Qt::ScrollBarPolicy verticalScrollBarPolicy() const
void setVerticalScrollBarPolicy(Qt::ScrollBarPolicy)

See also horizontalScrollBarPolicy.

pub unsafe fn viewport(&self) -> QPtr<QWidget>[src]

Returns the viewport widget.

Calls C++ function: QWidget* QAbstractScrollArea::viewport() const.

C++ documentation:

Returns the viewport widget.

Use the QScrollArea::widget() function to retrieve the contents of the viewport widget.

See also setViewport() and QScrollArea::widget().

Trait Implementations

impl CppDeletable for QPlainTextEdit[src]

unsafe fn delete(&self)[src]

Destructor.

Calls C++ function: virtual [destructor] void QPlainTextEdit::~QPlainTextEdit().

C++ documentation:

Destructor.

impl Deref for QPlainTextEdit[src]

type Target = QAbstractScrollArea

The resulting type after dereferencing.

fn deref(&self) -> &QAbstractScrollArea[src]

Calls C++ function: QAbstractScrollArea* static_cast<QAbstractScrollArea*>(QPlainTextEdit* ptr).

impl DynamicCast<QPlainTextEdit> for QAbstractScrollArea[src]

unsafe fn dynamic_cast(ptr: Ptr<QAbstractScrollArea>) -> Ptr<QPlainTextEdit>[src]

Calls C++ function: QPlainTextEdit* dynamic_cast<QPlainTextEdit*>(QAbstractScrollArea* ptr).

impl DynamicCast<QPlainTextEdit> for QFrame[src]

unsafe fn dynamic_cast(ptr: Ptr<QFrame>) -> Ptr<QPlainTextEdit>[src]

Calls C++ function: QPlainTextEdit* dynamic_cast<QPlainTextEdit*>(QFrame* ptr).

impl DynamicCast<QPlainTextEdit> for QWidget[src]

unsafe fn dynamic_cast(ptr: Ptr<QWidget>) -> Ptr<QPlainTextEdit>[src]

Calls C++ function: QPlainTextEdit* dynamic_cast<QPlainTextEdit*>(QWidget* ptr).

impl DynamicCast<QPlainTextEdit> for QObject[src]

unsafe fn dynamic_cast(ptr: Ptr<QObject>) -> Ptr<QPlainTextEdit>[src]

Calls C++ function: QPlainTextEdit* dynamic_cast<QPlainTextEdit*>(QObject* ptr).

impl DynamicCast<QPlainTextEdit> for QPaintDevice[src]

unsafe fn dynamic_cast(ptr: Ptr<QPaintDevice>) -> Ptr<QPlainTextEdit>[src]

Calls C++ function: QPlainTextEdit* dynamic_cast<QPlainTextEdit*>(QPaintDevice* ptr).

impl StaticDowncast<QPlainTextEdit> for QAbstractScrollArea[src]

unsafe fn static_downcast(ptr: Ptr<QAbstractScrollArea>) -> Ptr<QPlainTextEdit>[src]

Calls C++ function: QPlainTextEdit* static_cast<QPlainTextEdit*>(QAbstractScrollArea* ptr).

impl StaticDowncast<QPlainTextEdit> for QFrame[src]

unsafe fn static_downcast(ptr: Ptr<QFrame>) -> Ptr<QPlainTextEdit>[src]

Calls C++ function: QPlainTextEdit* static_cast<QPlainTextEdit*>(QFrame* ptr).

impl StaticDowncast<QPlainTextEdit> for QWidget[src]

unsafe fn static_downcast(ptr: Ptr<QWidget>) -> Ptr<QPlainTextEdit>[src]

Calls C++ function: QPlainTextEdit* static_cast<QPlainTextEdit*>(QWidget* ptr).

impl StaticDowncast<QPlainTextEdit> for QObject[src]

unsafe fn static_downcast(ptr: Ptr<QObject>) -> Ptr<QPlainTextEdit>[src]

Calls C++ function: QPlainTextEdit* static_cast<QPlainTextEdit*>(QObject* ptr).

impl StaticDowncast<QPlainTextEdit> for QPaintDevice[src]

unsafe fn static_downcast(ptr: Ptr<QPaintDevice>) -> Ptr<QPlainTextEdit>[src]

Calls C++ function: QPlainTextEdit* static_cast<QPlainTextEdit*>(QPaintDevice* ptr).

impl StaticUpcast<QAbstractScrollArea> for QPlainTextEdit[src]

unsafe fn static_upcast(ptr: Ptr<QPlainTextEdit>) -> Ptr<QAbstractScrollArea>[src]

Calls C++ function: QAbstractScrollArea* static_cast<QAbstractScrollArea*>(QPlainTextEdit* ptr).

impl StaticUpcast<QFrame> for QPlainTextEdit[src]

unsafe fn static_upcast(ptr: Ptr<QPlainTextEdit>) -> Ptr<QFrame>[src]

Calls C++ function: QFrame* static_cast<QFrame*>(QPlainTextEdit* ptr).

impl StaticUpcast<QObject> for QPlainTextEdit[src]

unsafe fn static_upcast(ptr: Ptr<QPlainTextEdit>) -> Ptr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QPlainTextEdit* ptr).

impl StaticUpcast<QPaintDevice> for QPlainTextEdit[src]

unsafe fn static_upcast(ptr: Ptr<QPlainTextEdit>) -> Ptr<QPaintDevice>[src]

Calls C++ function: QPaintDevice* static_cast<QPaintDevice*>(QPlainTextEdit* ptr).

impl StaticUpcast<QWidget> for QPlainTextEdit[src]

unsafe fn static_upcast(ptr: Ptr<QPlainTextEdit>) -> Ptr<QWidget>[src]

Calls C++ function: QWidget* static_cast<QWidget*>(QPlainTextEdit* ptr).

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.