[][src]Struct qt_widgets::QComboBox

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

The QComboBox widget is a combined button and popup list.

C++ class: QComboBox.

C++ documentation:

The QComboBox widget is a combined button and popup list.

A QComboBox provides a means of presenting a list of options to the user in a way that takes up the minimum amount of screen space.

A combobox is a selection widget that displays the current item, and can pop up a list of selectable items. A combobox may be editable, allowing the user to modify each item in the list.

Comboboxes can contain pixmaps as well as strings; the insertItem() and setItemText() functions are suitably overloaded. For editable comboboxes, the function clearEditText() is provided, to clear the displayed string without changing the combobox's contents.

There are two signals emitted if the current item of a combobox changes, currentIndexChanged() and activated(). currentIndexChanged() is always emitted regardless if the change was done programmatically or by user interaction, while activated() is only emitted when the change is caused by user interaction. The highlighted() signal is emitted when the user highlights an item in the combobox popup list. All three signals exist in two versions, one with a QString argument and one with an int argument. If the user selects or highlights a pixmap, only the int signals are emitted. Whenever the text of an editable combobox is changed the editTextChanged() signal is emitted.

When the user enters a new string in an editable combobox, the widget may or may not insert it, and it can insert it in several locations. The default policy is InsertAtBottom but you can change this using setInsertPolicy().

It is possible to constrain the input to an editable combobox using QValidator; see setValidator(). By default, any input is accepted.

A combobox can be populated using the insert functions, insertItem() and insertItems() for example. Items can be changed with setItemText(). An item can be removed with removeItem() and all items can be removed with clear(). The text of the current item is returned by currentText(), and the text of a numbered item is returned with text(). The current item can be set with setCurrentIndex(). The number of items in the combobox is returned by count(); the maximum number of items can be set with setMaxCount(). You can allow editing using setEditable(). For editable comboboxes you can set auto-completion using setCompleter() and whether or not the user can add duplicates is set with setDuplicatesEnabled().

QComboBox uses the model/view framework for its popup list and to store its items. By default a QStandardItemModel stores the items and a QListView subclass displays the popuplist. You can access the model and view directly (with model() and view()), but QComboBox also provides functions to set and get item data (e.g., setItemData() and itemText()). You can also set a new model and view (with setModel() and setView()). For the text and icon in the combobox label, the data in the model that has the Qt::DisplayRole and Qt::DecorationRole is used. Note that you cannot alter the SelectionMode of the view(), e.g., by using setSelectionMode().

Methods

impl QComboBox[src]

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

Clears the combobox, removing all items.

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

C++ documentation:

Clears the combobox, removing all items.

Note: If you have set an external model on the combobox this model will still be cleared when calling this function.

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

Clears the contents of the line edit used for editing in the combobox.

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

C++ documentation:

Clears the contents of the line edit used for editing in the combobox.

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

Sets the text in the combobox's text edit.

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

C++ documentation:

Sets the text in the combobox's text edit.

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

This property holds the index of the current item in the combobox.

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

C++ documentation:

This property holds the index of the current item in the combobox.

The current index can change when inserting or removing items.

By default, for an empty combo box or a combo box in which no current item is set, this property has a value of -1.

Access functions:

int currentIndex() const
void setCurrentIndex(int index)

Notifier signal:

void currentIndexChanged(int index)
void currentIndexChanged(const QString &text)

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

This property holds the current text

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

C++ documentation:

This property holds the current text

If the combo box is editable, the current text is the value displayed by the line edit. Otherwise, it is the value of the current item or an empty string if the combo box is empty or no current item is set.

The setter setCurrentText() simply calls setEditText() if the combo box is editable. Otherwise, if there is a matching text in the list, currentIndex is set to the corresponding index.

Access functions:

QString currentText() const
void setCurrentText(const QString &text)

Notifier signal:

void currentTextChanged(const QString &text)

See also editable and setEditText().

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

This signal is emitted when the text in the combobox's line edit widget is changed. The new text is specified by text.

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

C++ documentation:

This signal is emitted when the text in the combobox's line edit widget is changed. The new text is specified by text.

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

This signal is sent when the user chooses an item in the combobox. The item's index is passed. Note that this signal is sent even when the choice is not changed. If you need to know when the choice actually changes, use signal currentIndexChanged().

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

C++ documentation:

This signal is sent when the user chooses an item in the combobox. The item's index is passed. Note that this signal is sent even when the choice is not changed. If you need to know when the choice actually changes, use signal currentIndexChanged().

Note: Signal activated is overloaded in this class. To connect to this one using the function pointer syntax, you must specify the signal type in a static cast, as shown in this example:

connect(comboBox, static_cast<void(QComboBox::)(int)>(&QComboBox::activated), [=](int index){ / ... */ });

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

This signal is sent when the user chooses an item in the combobox. The item's text is passed. Note that this signal is sent even when the choice is not changed. If you need to know when the choice actually changes, use signal currentIndexChanged().

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

C++ documentation:

This signal is sent when the user chooses an item in the combobox. The item's text is passed. Note that this signal is sent even when the choice is not changed. If you need to know when the choice actually changes, use signal currentIndexChanged().

Note: Signal activated is overloaded in this class. To connect to this one using the function pointer syntax, you must specify the signal type in a static cast, as shown in this example:

connect(comboBox, static_cast<void(QComboBox::)(const QString &)>(&QComboBox::activated), [=](const QString &text){ / ... */ });

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

This signal is sent when an item in the combobox popup list is highlighted by the user. The item's index is passed.

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

C++ documentation:

This signal is sent when an item in the combobox popup list is highlighted by the user. The item's index is passed.

Note: Signal highlighted is overloaded in this class. To connect to this one using the function pointer syntax, you must specify the signal type in a static cast, as shown in this example:

connect(comboBox, static_cast<void(QComboBox::)(int)>(&QComboBox::highlighted), [=](int index){ / ... */ });

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

This signal is sent when an item in the combobox popup list is highlighted by the user. The item's text is passed.

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

C++ documentation:

This signal is sent when an item in the combobox popup list is highlighted by the user. The item's text is passed.

Note: Signal highlighted is overloaded in this class. To connect to this one using the function pointer syntax, you must specify the signal type in a static cast, as shown in this example:

connect(comboBox, static_cast<void(QComboBox::)(const QString &)>(&QComboBox::highlighted), [=](const QString &text){ / ... */ });

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

This signal is sent whenever the currentIndex in the combobox changes either through user interaction or programmatically. The item's index is passed or -1 if the combobox becomes empty or the currentIndex was reset.

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

C++ documentation:

This signal is sent whenever the currentIndex in the combobox changes either through user interaction or programmatically. The item's index is passed or -1 if the combobox becomes empty or the currentIndex was reset.

Note: Signal currentIndexChanged is overloaded in this class. To connect to this one using the function pointer syntax, you must specify the signal type in a static cast, as shown in this example:

connect(comboBox, static_cast<void(QComboBox::)(int)>(&QComboBox::currentIndexChanged), [=](int index){ / ... */ });

This function was introduced in Qt 4.1.

Note: Notifier signal for property currentIndex.

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

This signal is sent whenever the currentIndex in the combobox changes either through user interaction or programmatically. The item's text is passed.

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

C++ documentation:

This signal is sent whenever the currentIndex in the combobox changes either through user interaction or programmatically. The item's text is passed.

Note: Signal currentIndexChanged is overloaded in this class. To connect to this one using the function pointer syntax, you must specify the signal type in a static cast, as shown in this example:

connect(comboBox, static_cast<void(QComboBox::)(const QString &)>(&QComboBox::currentIndexChanged), [=](const QString &text){ / ... */ });

This function was introduced in Qt 4.1.

Note: Notifier signal for property currentIndex.

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

This signal is sent whenever currentText changes. The new value is passed as text.

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

C++ documentation:

This signal is sent whenever currentText changes. The new value is passed as text.

This function was introduced in Qt 5.0.

Note: Notifier signal for property currentText.

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

Adds an item to the combobox with the given text, and containing the specified userData (stored in the Qt::UserRole). The item is appended to the list of existing items.

Calls C++ function: void QComboBox::addItem(const QString& text, const QVariant& userData = …).

C++ documentation:

Adds an item to the combobox with the given text, and containing the specified userData (stored in the Qt::UserRole). The item is appended to the list of existing items.

pub unsafe fn add_item_q_icon_q_string_q_variant(
    &self,
    icon: impl CastInto<Ref<QIcon>>,
    text: impl CastInto<Ref<QString>>,
    user_data: impl CastInto<Ref<QVariant>>
)
[src]

Adds an item to the combobox with the given icon and text, and containing the specified userData (stored in the Qt::UserRole). The item is appended to the list of existing items.

Calls C++ function: void QComboBox::addItem(const QIcon& icon, const QString& text, const QVariant& userData = …).

C++ documentation:

Adds an item to the combobox with the given icon and text, and containing the specified userData (stored in the Qt::UserRole). The item is appended to the list of existing items.

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

Adds an item to the combobox with the given text, and containing the specified userData (stored in the Qt::UserRole). The item is appended to the list of existing items.

Calls C++ function: void QComboBox::addItem(const QString& text).

C++ documentation:

Adds an item to the combobox with the given text, and containing the specified userData (stored in the Qt::UserRole). The item is appended to the list of existing items.

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

Adds an item to the combobox with the given icon and text, and containing the specified userData (stored in the Qt::UserRole). The item is appended to the list of existing items.

Calls C++ function: void QComboBox::addItem(const QIcon& icon, const QString& text).

C++ documentation:

Adds an item to the combobox with the given icon and text, and containing the specified userData (stored in the Qt::UserRole). The item is appended to the list of existing items.

pub unsafe fn add_items(&self, texts: impl CastInto<Ref<QStringList>>)[src]

Adds each of the strings in the given texts to the combobox. Each item is appended to the list of existing items in turn.

Calls C++ function: void QComboBox::addItems(const QStringList& texts).

C++ documentation:

Adds each of the strings in the given texts to the combobox. Each item is appended to the list of existing items in turn.

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

This property holds whether the combobox provides auto-completion for editable items

Calls C++ function: bool QComboBox::autoCompletion() const.

C++ documentation:

This property holds whether the combobox provides auto-completion for editable items

Use setCompleter() instead.

By default, this property is true.

This property was introduced in Qt 4.1.

Access functions:

bool autoCompletion() const
void setAutoCompletion(bool enable)

See also editable.

pub unsafe fn auto_completion_case_sensitivity(&self) -> CaseSensitivity[src]

This property holds whether string comparisons are case-sensitive or case-insensitive for auto-completion

Calls C++ function: Qt::CaseSensitivity QComboBox::autoCompletionCaseSensitivity() const.

C++ documentation:

This property holds whether string comparisons are case-sensitive or case-insensitive for auto-completion

By default, this property is Qt::CaseInsensitive.

Use setCompleter() instead. Case sensitivity of the auto completion can be changed using QCompleter::setCaseSensitivity().

Access functions:

Qt::CaseSensitivity autoCompletionCaseSensitivity() const
void setAutoCompletionCaseSensitivity(Qt::CaseSensitivity sensitivity)

See also autoCompletion.

Member Function Documentation

pub unsafe fn clear(&self)[src]

Clears the combobox, removing all items.

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

C++ documentation:

Clears the combobox, removing all items.

Note: If you have set an external model on the combobox this model will still be cleared when calling this function.

pub unsafe fn clear_edit_text(&self)[src]

Clears the contents of the line edit used for editing in the combobox.

Calls C++ function: [slot] void QComboBox::clearEditText().

C++ documentation:

Clears the contents of the line edit used for editing in the combobox.

pub unsafe fn completer(&self) -> QPtr<QCompleter>[src]

Returns the completer that is used to auto complete text input for the combobox.

Calls C++ function: QCompleter* QComboBox::completer() const.

C++ documentation:

Returns the completer that is used to auto complete text input for the combobox.

This function was introduced in Qt 4.2.

See also setCompleter() and editable.

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

This property holds the number of items in the combobox

Calls C++ function: int QComboBox::count() const.

C++ documentation:

This property holds the number of items in the combobox

By default, for an empty combo box, this property has a value of 0.

Access functions:

int count() const

pub unsafe fn current_data_1a(&self, role: c_int) -> CppBox<QVariant>[src]

This property holds the data for the current item

Calls C++ function: QVariant QComboBox::currentData(int role = …) const.

C++ documentation:

This property holds the data for the current item

By default, for an empty combo box or a combo box in which no current item is set, this property contains an invalid QVariant.

This property was introduced in Qt 5.2.

Access functions:

QVariant currentData(int role = Qt::UserRole) const

pub unsafe fn current_data_0a(&self) -> CppBox<QVariant>[src]

This property holds the data for the current item

Calls C++ function: QVariant QComboBox::currentData() const.

C++ documentation:

This property holds the data for the current item

By default, for an empty combo box or a combo box in which no current item is set, this property contains an invalid QVariant.

This property was introduced in Qt 5.2.

Access functions:

QVariant currentData(int role = Qt::UserRole) const

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

This property holds the index of the current item in the combobox.

Calls C++ function: int QComboBox::currentIndex() const.

C++ documentation:

This property holds the index of the current item in the combobox.

The current index can change when inserting or removing items.

By default, for an empty combo box or a combo box in which no current item is set, this property has a value of -1.

Access functions:

int currentIndex() const
void setCurrentIndex(int index)

Notifier signal:

void currentIndexChanged(int index)
void currentIndexChanged(const QString &text)

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

This property holds the current text

Calls C++ function: QString QComboBox::currentText() const.

C++ documentation:

This property holds the current text

If the combo box is editable, the current text is the value displayed by the line edit. Otherwise, it is the value of the current item or an empty string if the combo box is empty or no current item is set.

The setter setCurrentText() simply calls setEditText() if the combo box is editable. Otherwise, if there is a matching text in the list, currentIndex is set to the corresponding index.

Access functions:

QString currentText() const
void setCurrentText(const QString &text)

Notifier signal:

void currentTextChanged(const QString &text)

See also editable and setEditText().

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

This property holds whether the user can enter duplicate items into the combobox

Calls C++ function: bool QComboBox::duplicatesEnabled() const.

C++ documentation:

This property holds whether the user can enter duplicate items into the combobox

Note that it is always possible to programmatically insert duplicate items into the combobox.

By default, this property is false (duplicates are not allowed).

Access functions:

bool duplicatesEnabled() const
void setDuplicatesEnabled(bool enable)

pub unsafe fn event(&self, event: impl CastInto<Ptr<QEvent>>) -> bool[src]

Reimplemented from QObject::event().

Calls C++ function: virtual bool QComboBox::event(QEvent* event).

C++ documentation:

Reimplemented from QObject::event().

pub unsafe fn find_data_3a(
    &self,
    data: impl CastInto<Ref<QVariant>>,
    role: c_int,
    flags: QFlags<MatchFlag>
) -> c_int
[src]

Returns the index of the item containing the given data for the given role; otherwise returns -1.

Calls C++ function: int QComboBox::findData(const QVariant& data, int role = …, QFlags<Qt::MatchFlag> flags = …) const.

C++ documentation:

Returns the index of the item containing the given data for the given role; otherwise returns -1.

The flags specify how the items in the combobox are searched.

pub unsafe fn find_data_2a(
    &self,
    data: impl CastInto<Ref<QVariant>>,
    role: c_int
) -> c_int
[src]

Returns the index of the item containing the given data for the given role; otherwise returns -1.

Calls C++ function: int QComboBox::findData(const QVariant& data, int role = …) const.

C++ documentation:

Returns the index of the item containing the given data for the given role; otherwise returns -1.

The flags specify how the items in the combobox are searched.

pub unsafe fn find_data_1a(&self, data: impl CastInto<Ref<QVariant>>) -> c_int[src]

Returns the index of the item containing the given data for the given role; otherwise returns -1.

Calls C++ function: int QComboBox::findData(const QVariant& data) const.

C++ documentation:

Returns the index of the item containing the given data for the given role; otherwise returns -1.

The flags specify how the items in the combobox are searched.

pub unsafe fn find_text_2a(
    &self,
    text: impl CastInto<Ref<QString>>,
    flags: QFlags<MatchFlag>
) -> c_int
[src]

Returns the index of the item containing the given text; otherwise returns -1.

Calls C++ function: int QComboBox::findText(const QString& text, QFlags<Qt::MatchFlag> flags = …) const.

C++ documentation:

Returns the index of the item containing the given text; otherwise returns -1.

The flags specify how the items in the combobox are searched.

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

Returns the index of the item containing the given text; otherwise returns -1.

Calls C++ function: int QComboBox::findText(const QString& text) const.

C++ documentation:

Returns the index of the item containing the given text; otherwise returns -1.

The flags specify how the items in the combobox are searched.

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

This property holds whether the combo box draws itself with a frame

Calls C++ function: bool QComboBox::hasFrame() const.

C++ documentation:

This property holds whether the combo box draws itself with a frame

If enabled (the default) the combo box draws itself inside a frame, otherwise the combo box draws itself without any frame.

Access functions:

bool hasFrame() const
void setFrame(bool)

pub unsafe fn hide_popup(&self)[src]

Hides the list of items in the combobox if it is currently visible and resets the internal state, so that if the custom pop-up was shown inside the reimplemented showPopup(), then you also need to reimplement the hidePopup() function to hide your custom pop-up and call the base class implementation to reset the internal state whenever your custom pop-up widget is hidden.

Calls C++ function: virtual void QComboBox::hidePopup().

C++ documentation:

Hides the list of items in the combobox if it is currently visible and resets the internal state, so that if the custom pop-up was shown inside the reimplemented showPopup(), then you also need to reimplement the hidePopup() function to hide your custom pop-up and call the base class implementation to reset the internal state whenever your custom pop-up widget is hidden.

See also showPopup().

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

This property holds the size of the icons shown in the combobox.

Calls C++ function: QSize QComboBox::iconSize() const.

C++ documentation:

This property holds the size of the icons shown in the combobox.

Unless explicitly set this returns the default value of the current style. This size is the maximum size that icons can have; icons of smaller size are not scaled up.

Access functions:

QSize iconSize() const
void setIconSize(const QSize &size)

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

Reimplemented from QWidget::inputMethodQuery().

Calls C++ function: virtual QVariant QComboBox::inputMethodQuery(Qt::InputMethodQuery arg1) 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 QComboBox::inputMethodQuery(Qt::InputMethodQuery query, const QVariant& argument) const.

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

Reimplemented from QWidget::inputMethodQuery().

pub unsafe fn insert_item_int_q_string_q_variant(
    &self,
    index: c_int,
    text: impl CastInto<Ref<QString>>,
    user_data: impl CastInto<Ref<QVariant>>
)
[src]

Inserts the text and userData (stored in the Qt::UserRole) into the combobox at the given index.

Calls C++ function: void QComboBox::insertItem(int index, const QString& text, const QVariant& userData = …).

C++ documentation:

Inserts the text and userData (stored in the Qt::UserRole) into the combobox at the given index.

If the index is equal to or higher than the total number of items, the new item is appended to the list of existing items. If the index is zero or negative, the new item is prepended to the list of existing items.

See also insertItems().

pub unsafe fn insert_item_int_q_icon_q_string_q_variant(
    &self,
    index: c_int,
    icon: impl CastInto<Ref<QIcon>>,
    text: impl CastInto<Ref<QString>>,
    user_data: impl CastInto<Ref<QVariant>>
)
[src]

Inserts the icon, text and userData (stored in the Qt::UserRole) into the combobox at the given index.

Calls C++ function: void QComboBox::insertItem(int index, const QIcon& icon, const QString& text, const QVariant& userData = …).

C++ documentation:

Inserts the icon, text and userData (stored in the Qt::UserRole) into the combobox at the given index.

If the index is equal to or higher than the total number of items, the new item is appended to the list of existing items. If the index is zero or negative, the new item is prepended to the list of existing items.

See also insertItems().

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

Inserts the text and userData (stored in the Qt::UserRole) into the combobox at the given index.

Calls C++ function: void QComboBox::insertItem(int index, const QString& text).

C++ documentation:

Inserts the text and userData (stored in the Qt::UserRole) into the combobox at the given index.

If the index is equal to or higher than the total number of items, the new item is appended to the list of existing items. If the index is zero or negative, the new item is prepended to the list of existing items.

See also insertItems().

pub unsafe fn insert_item_int_q_icon_q_string(
    &self,
    index: c_int,
    icon: impl CastInto<Ref<QIcon>>,
    text: impl CastInto<Ref<QString>>
)
[src]

Inserts the icon, text and userData (stored in the Qt::UserRole) into the combobox at the given index.

Calls C++ function: void QComboBox::insertItem(int index, const QIcon& icon, const QString& text).

C++ documentation:

Inserts the icon, text and userData (stored in the Qt::UserRole) into the combobox at the given index.

If the index is equal to or higher than the total number of items, the new item is appended to the list of existing items. If the index is zero or negative, the new item is prepended to the list of existing items.

See also insertItems().

pub unsafe fn insert_items(
    &self,
    index: c_int,
    texts: impl CastInto<Ref<QStringList>>
)
[src]

Inserts the strings from the list into the combobox as separate items, starting at the index specified.

Calls C++ function: void QComboBox::insertItems(int index, const QStringList& texts).

C++ documentation:

Inserts the strings from the list into the combobox as separate items, starting at the index specified.

If the index is equal to or higher than the total number of items, the new items are appended to the list of existing items. If the index is zero or negative, the new items are prepended to the list of existing items.

See also insertItem().

pub unsafe fn insert_policy(&self) -> InsertPolicy[src]

This property holds the policy used to determine where user-inserted items should appear in the combobox

Calls C++ function: QComboBox::InsertPolicy QComboBox::insertPolicy() const.

C++ documentation:

This property holds the policy used to determine where user-inserted items should appear in the combobox

The default value is InsertAtBottom, indicating that new items will appear at the bottom of the list of items.

Access functions:

InsertPolicy insertPolicy() const
void setInsertPolicy(InsertPolicy policy)

See also InsertPolicy.

pub unsafe fn insert_separator(&self, index: c_int)[src]

Inserts a separator item into the combobox at the given index.

Calls C++ function: void QComboBox::insertSeparator(int index).

C++ documentation:

Inserts a separator item into the combobox at the given index.

If the index is equal to or higher than the total number of items, the new item is appended to the list of existing items. If the index is zero or negative, the new item is prepended to the list of existing items.

This function was introduced in Qt 4.4.

See also insertItem().

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

This property holds whether the combo box can be edited by the user

Calls C++ function: bool QComboBox::isEditable() const.

C++ documentation:

This property holds whether the combo box can be edited by the user

By default, this property is false. The effect of editing depends on the insert policy.

Note: When disabling the editable state, the validator and completer are removed.

Access functions:

bool isEditable() const
void setEditable(bool editable)

See also InsertPolicy.

pub unsafe fn item_data_2a(&self, index: c_int, role: c_int) -> CppBox<QVariant>[src]

Returns the data for the given role in the given index in the combobox, or QVariant::Invalid if there is no data for this role.

Calls C++ function: QVariant QComboBox::itemData(int index, int role = …) const.

C++ documentation:

Returns the data for the given role in the given index in the combobox, or QVariant::Invalid if there is no data for this role.

See also setItemData().

pub unsafe fn item_data_1a(&self, index: c_int) -> CppBox<QVariant>[src]

Returns the data for the given role in the given index in the combobox, or QVariant::Invalid if there is no data for this role.

Calls C++ function: QVariant QComboBox::itemData(int index) const.

C++ documentation:

Returns the data for the given role in the given index in the combobox, or QVariant::Invalid if there is no data for this role.

See also setItemData().

pub unsafe fn item_delegate(&self) -> QPtr<QAbstractItemDelegate>[src]

Returns the item delegate used by the popup list view.

Calls C++ function: QAbstractItemDelegate* QComboBox::itemDelegate() const.

C++ documentation:

Returns the item delegate used by the popup list view.

See also setItemDelegate().

pub unsafe fn item_icon(&self, index: c_int) -> CppBox<QIcon>[src]

Returns the icon for the given index in the combobox.

Calls C++ function: QIcon QComboBox::itemIcon(int index) const.

C++ documentation:

Returns the icon for the given index in the combobox.

See also setItemIcon().

pub unsafe fn item_text(&self, index: c_int) -> CppBox<QString>[src]

Returns the text for the given index in the combobox.

Calls C++ function: QString QComboBox::itemText(int index) const.

C++ documentation:

Returns the text for the given index in the combobox.

See also setItemText().

pub unsafe fn line_edit(&self) -> QPtr<QLineEdit>[src]

Returns the line edit used to edit items in the combobox, or 0 if there is no line edit.

Calls C++ function: QLineEdit* QComboBox::lineEdit() const.

C++ documentation:

Returns the line edit used to edit items in the combobox, or 0 if there is no line edit.

Only editable combo boxes have a line edit.

See also setLineEdit().

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

This property holds the maximum number of items allowed in the combobox

Calls C++ function: int QComboBox::maxCount() const.

C++ documentation:

This property holds the maximum number of items allowed in the combobox

Note: If you set the maximum number to be less then the current amount of items in the combobox, the extra items will be truncated. This also applies if you have set an external model on the combobox.

By default, this property's value is derived from the highest signed integer available (typically 2147483647).

Access functions:

int maxCount() const
void setMaxCount(int max)

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

This property holds the maximum allowed size on screen of the combo box, measured in items

Calls C++ function: int QComboBox::maxVisibleItems() const.

C++ documentation:

This property holds the maximum allowed size on screen of the combo box, measured in items

By default, this property has a value of 10.

Note: This property is ignored for non-editable comboboxes in styles that returns true for QStyle::SH_ComboBox_Popup such as the Mac style or the Gtk+ Style.

Access functions:

int maxVisibleItems() const
void setMaxVisibleItems(int maxItems)

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

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

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

This property holds the minimum number of characters that should fit into the combobox.

Calls C++ function: int QComboBox::minimumContentsLength() const.

C++ documentation:

This property holds the minimum number of characters that should fit into the combobox.

The default value is 0.

If this property is set to a positive value, the minimumSizeHint() and sizeHint() take it into account.

Access functions:

int minimumContentsLength() const
void setMinimumContentsLength(int characters)

See also sizeAdjustPolicy.

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

Reimplemented from QWidget::minimumSizeHint().

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

C++ documentation:

Reimplemented from QWidget::minimumSizeHint().

pub unsafe fn model(&self) -> QPtr<QAbstractItemModel>[src]

Returns the model used by the combobox.

Calls C++ function: QAbstractItemModel* QComboBox::model() const.

C++ documentation:

Returns the model used by the combobox.

See also setModel().

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

This property holds the column in the model that is visible.

Calls C++ function: int QComboBox::modelColumn() const.

C++ documentation:

This property holds the column in the model that is visible.

If set prior to populating the combo box, the pop-up view will not be affected and will show the first column (using this property's default value).

By default, this property has a value of 0.

Access functions:

int modelColumn() const
void setModelColumn(int visibleColumn)

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

Constructs a combobox with the given parent, using the default model QStandardItemModel.

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

C++ documentation:

Constructs a combobox with the given parent, using the default model QStandardItemModel.

pub unsafe fn new_0a() -> QBox<QComboBox>[src]

The QComboBox widget is a combined button and popup list.

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

C++ documentation:

The QComboBox widget is a combined button and popup list.

A QComboBox provides a means of presenting a list of options to the user in a way that takes up the minimum amount of screen space.

A combobox is a selection widget that displays the current item, and can pop up a list of selectable items. A combobox may be editable, allowing the user to modify each item in the list.

Comboboxes can contain pixmaps as well as strings; the insertItem() and setItemText() functions are suitably overloaded. For editable comboboxes, the function clearEditText() is provided, to clear the displayed string without changing the combobox's contents.

There are two signals emitted if the current item of a combobox changes, currentIndexChanged() and activated(). currentIndexChanged() is always emitted regardless if the change was done programmatically or by user interaction, while activated() is only emitted when the change is caused by user interaction. The highlighted() signal is emitted when the user highlights an item in the combobox popup list. All three signals exist in two versions, one with a QString argument and one with an int argument. If the user selects or highlights a pixmap, only the int signals are emitted. Whenever the text of an editable combobox is changed the editTextChanged() signal is emitted.

When the user enters a new string in an editable combobox, the widget may or may not insert it, and it can insert it in several locations. The default policy is InsertAtBottom but you can change this using setInsertPolicy().

It is possible to constrain the input to an editable combobox using QValidator; see setValidator(). By default, any input is accepted.

A combobox can be populated using the insert functions, insertItem() and insertItems() for example. Items can be changed with setItemText(). An item can be removed with removeItem() and all items can be removed with clear(). The text of the current item is returned by currentText(), and the text of a numbered item is returned with text(). The current item can be set with setCurrentIndex(). The number of items in the combobox is returned by count(); the maximum number of items can be set with setMaxCount(). You can allow editing using setEditable(). For editable comboboxes you can set auto-completion using setCompleter() and whether or not the user can add duplicates is set with setDuplicatesEnabled().

QComboBox uses the model/view framework for its popup list and to store its items. By default a QStandardItemModel stores the items and a QListView subclass displays the popuplist. You can access the model and view directly (with model() and view()), but QComboBox also provides functions to set and get item data (e.g., setItemData() and itemText()). You can also set a new model and view (with setModel() and setView()). For the text and icon in the combobox label, the data in the model that has the Qt::DisplayRole and Qt::DecorationRole is used. Note that you cannot alter the SelectionMode of the view(), e.g., by using setSelectionMode().

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

Calls C++ function: virtual int QComboBox::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* QComboBox::qt_metacast(const char* arg1).

pub unsafe fn remove_item(&self, index: c_int)[src]

Removes the item at the given index from the combobox. This will update the current index if the index is removed.

Calls C++ function: void QComboBox::removeItem(int index).

C++ documentation:

Removes the item at the given index from the combobox. This will update the current index if the index is removed.

This function does nothing if index is out of range.

pub unsafe fn root_model_index(&self) -> CppBox<QModelIndex>[src]

Returns the root model item index for the items in the combobox.

Calls C++ function: QModelIndex QComboBox::rootModelIndex() const.

C++ documentation:

Returns the root model item index for the items in the combobox.

See also setRootModelIndex().

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

Use setCompleter() instead.

Calls C++ function: void QComboBox::setAutoCompletion(bool enable).

C++ documentation:

Use setCompleter() instead.

Note: Setter function for property autoCompletion.

See also autoCompletion().

pub unsafe fn set_auto_completion_case_sensitivity(
    &self,
    sensitivity: CaseSensitivity
)
[src]

Use setCompleter() and QCompleter::setCaseSensitivity() instead.

Calls C++ function: void QComboBox::setAutoCompletionCaseSensitivity(Qt::CaseSensitivity sensitivity).

C++ documentation:

Use setCompleter() and QCompleter::setCaseSensitivity() instead.

Note: Setter function for property autoCompletionCaseSensitivity.

See also autoCompletionCaseSensitivity().

pub unsafe fn set_completer(&self, c: impl CastInto<Ptr<QCompleter>>)[src]

Sets the completer to use instead of the current completer. If completer is 0, auto completion is disabled.

Calls C++ function: void QComboBox::setCompleter(QCompleter* c).

C++ documentation:

Sets the completer to use instead of the current completer. If completer is 0, auto completion is disabled.

By default, for an editable combo box, a QCompleter that performs case insensitive inline completion is automatically created.

Note: The completer is removed when the editable property becomes false.

This function was introduced in Qt 4.2.

See also completer().

pub unsafe fn set_current_index(&self, index: c_int)[src]

This property holds the index of the current item in the combobox.

Calls C++ function: [slot] void QComboBox::setCurrentIndex(int index).

C++ documentation:

This property holds the index of the current item in the combobox.

The current index can change when inserting or removing items.

By default, for an empty combo box or a combo box in which no current item is set, this property has a value of -1.

Access functions:

int currentIndex() const
void setCurrentIndex(int index)

Notifier signal:

void currentIndexChanged(int index)
void currentIndexChanged(const QString &text)

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

This property holds the current text

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

C++ documentation:

This property holds the current text

If the combo box is editable, the current text is the value displayed by the line edit. Otherwise, it is the value of the current item or an empty string if the combo box is empty or no current item is set.

The setter setCurrentText() simply calls setEditText() if the combo box is editable. Otherwise, if there is a matching text in the list, currentIndex is set to the corresponding index.

Access functions:

QString currentText() const
void setCurrentText(const QString &text)

Notifier signal:

void currentTextChanged(const QString &text)

See also editable and setEditText().

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

This property holds whether the user can enter duplicate items into the combobox

Calls C++ function: void QComboBox::setDuplicatesEnabled(bool enable).

C++ documentation:

This property holds whether the user can enter duplicate items into the combobox

Note that it is always possible to programmatically insert duplicate items into the combobox.

By default, this property is false (duplicates are not allowed).

Access functions:

bool duplicatesEnabled() const
void setDuplicatesEnabled(bool enable)

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

Sets the text in the combobox's text edit.

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

C++ documentation:

Sets the text in the combobox's text edit.

pub unsafe fn set_editable(&self, editable: bool)[src]

This property holds whether the combo box can be edited by the user

Calls C++ function: void QComboBox::setEditable(bool editable).

C++ documentation:

This property holds whether the combo box can be edited by the user

By default, this property is false. The effect of editing depends on the insert policy.

Note: When disabling the editable state, the validator and completer are removed.

Access functions:

bool isEditable() const
void setEditable(bool editable)

See also InsertPolicy.

pub unsafe fn set_frame(&self, arg1: bool)[src]

This property holds whether the combo box draws itself with a frame

Calls C++ function: void QComboBox::setFrame(bool arg1).

C++ documentation:

This property holds whether the combo box draws itself with a frame

If enabled (the default) the combo box draws itself inside a frame, otherwise the combo box draws itself without any frame.

Access functions:

bool hasFrame() const
void setFrame(bool)

pub unsafe fn set_icon_size(&self, size: impl CastInto<Ref<QSize>>)[src]

This property holds the size of the icons shown in the combobox.

Calls C++ function: void QComboBox::setIconSize(const QSize& size).

C++ documentation:

This property holds the size of the icons shown in the combobox.

Unless explicitly set this returns the default value of the current style. This size is the maximum size that icons can have; icons of smaller size are not scaled up.

Access functions:

QSize iconSize() const
void setIconSize(const QSize &size)

pub unsafe fn set_insert_policy(&self, policy: InsertPolicy)[src]

This property holds the policy used to determine where user-inserted items should appear in the combobox

Calls C++ function: void QComboBox::setInsertPolicy(QComboBox::InsertPolicy policy).

C++ documentation:

This property holds the policy used to determine where user-inserted items should appear in the combobox

The default value is InsertAtBottom, indicating that new items will appear at the bottom of the list of items.

Access functions:

InsertPolicy insertPolicy() const
void setInsertPolicy(InsertPolicy policy)

See also InsertPolicy.

pub unsafe fn set_item_data_3a(
    &self,
    index: c_int,
    value: impl CastInto<Ref<QVariant>>,
    role: c_int
)
[src]

Sets the data role for the item on the given index in the combobox to the specified value.

Calls C++ function: void QComboBox::setItemData(int index, const QVariant& value, int role = …).

C++ documentation:

Sets the data role for the item on the given index in the combobox to the specified value.

See also itemData().

pub unsafe fn set_item_data_2a(
    &self,
    index: c_int,
    value: impl CastInto<Ref<QVariant>>
)
[src]

Sets the data role for the item on the given index in the combobox to the specified value.

Calls C++ function: void QComboBox::setItemData(int index, const QVariant& value).

C++ documentation:

Sets the data role for the item on the given index in the combobox to the specified value.

See also itemData().

pub unsafe fn set_item_delegate(
    &self,
    delegate: impl CastInto<Ptr<QAbstractItemDelegate>>
)
[src]

Sets the item delegate for the popup list view. The combobox takes ownership of the delegate.

Calls C++ function: void QComboBox::setItemDelegate(QAbstractItemDelegate* delegate).

C++ documentation:

Sets the item delegate for the popup list view. The combobox takes ownership of the delegate.

Warning: You should not share the same instance of a delegate between comboboxes, widget mappers or views. Doing so can cause incorrect or unintuitive editing behavior since each view connected to a given delegate may receive the closeEditor() signal, and attempt to access, modify or close an editor that has already been closed.

See also itemDelegate().

pub unsafe fn set_item_icon(
    &self,
    index: c_int,
    icon: impl CastInto<Ref<QIcon>>
)
[src]

Sets the icon for the item on the given index in the combobox.

Calls C++ function: void QComboBox::setItemIcon(int index, const QIcon& icon).

C++ documentation:

Sets the icon for the item on the given index in the combobox.

See also itemIcon().

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

Sets the text for the item on the given index in the combobox.

Calls C++ function: void QComboBox::setItemText(int index, const QString& text).

C++ documentation:

Sets the text for the item on the given index in the combobox.

See also itemText().

pub unsafe fn set_line_edit(&self, edit: impl CastInto<Ptr<QLineEdit>>)[src]

Sets the line edit to use instead of the current line edit widget.

Calls C++ function: void QComboBox::setLineEdit(QLineEdit* edit).

C++ documentation:

Sets the line edit to use instead of the current line edit widget.

The combo box takes ownership of the line edit.

See also lineEdit().

pub unsafe fn set_max_count(&self, max: c_int)[src]

This property holds the maximum number of items allowed in the combobox

Calls C++ function: void QComboBox::setMaxCount(int max).

C++ documentation:

This property holds the maximum number of items allowed in the combobox

Note: If you set the maximum number to be less then the current amount of items in the combobox, the extra items will be truncated. This also applies if you have set an external model on the combobox.

By default, this property's value is derived from the highest signed integer available (typically 2147483647).

Access functions:

int maxCount() const
void setMaxCount(int max)

pub unsafe fn set_max_visible_items(&self, max_items: c_int)[src]

This property holds the maximum allowed size on screen of the combo box, measured in items

Calls C++ function: void QComboBox::setMaxVisibleItems(int maxItems).

C++ documentation:

This property holds the maximum allowed size on screen of the combo box, measured in items

By default, this property has a value of 10.

Note: This property is ignored for non-editable comboboxes in styles that returns true for QStyle::SH_ComboBox_Popup such as the Mac style or the Gtk+ Style.

Access functions:

int maxVisibleItems() const
void setMaxVisibleItems(int maxItems)

pub unsafe fn set_minimum_contents_length(&self, characters: c_int)[src]

This property holds the minimum number of characters that should fit into the combobox.

Calls C++ function: void QComboBox::setMinimumContentsLength(int characters).

C++ documentation:

This property holds the minimum number of characters that should fit into the combobox.

The default value is 0.

If this property is set to a positive value, the minimumSizeHint() and sizeHint() take it into account.

Access functions:

int minimumContentsLength() const
void setMinimumContentsLength(int characters)

See also sizeAdjustPolicy.

pub unsafe fn set_model(&self, model: impl CastInto<Ptr<QAbstractItemModel>>)[src]

Sets the model to be model. model must not be 0. If you want to clear the contents of a model, call clear().

Calls C++ function: void QComboBox::setModel(QAbstractItemModel* model).

C++ documentation:

Sets the model to be model. model must not be 0. If you want to clear the contents of a model, call clear().

See also model() and clear().

pub unsafe fn set_model_column(&self, visible_column: c_int)[src]

This property holds the column in the model that is visible.

Calls C++ function: void QComboBox::setModelColumn(int visibleColumn).

C++ documentation:

This property holds the column in the model that is visible.

If set prior to populating the combo box, the pop-up view will not be affected and will show the first column (using this property's default value).

By default, this property has a value of 0.

Access functions:

int modelColumn() const
void setModelColumn(int visibleColumn)

pub unsafe fn set_root_model_index(
    &self,
    index: impl CastInto<Ref<QModelIndex>>
)
[src]

Sets the root model item index for the items in the combobox.

Calls C++ function: void QComboBox::setRootModelIndex(const QModelIndex& index).

C++ documentation:

Sets the root model item index for the items in the combobox.

See also rootModelIndex().

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

This property holds the policy describing how the size of the combobox changes when the content changes

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

C++ documentation:

This property holds the policy describing how the size of the combobox changes when the content changes

The default value is AdjustToContentsOnFirstShow.

Access functions:

SizeAdjustPolicy sizeAdjustPolicy() const
void setSizeAdjustPolicy(SizeAdjustPolicy policy)

See also SizeAdjustPolicy.

pub unsafe fn set_validator(&self, v: impl CastInto<Ptr<QValidator>>)[src]

Sets the validator to use instead of the current validator.

Calls C++ function: void QComboBox::setValidator(const QValidator* v).

C++ documentation:

Sets the validator to use instead of the current validator.

Note: The validator is removed when the editable property becomes false.

See also validator().

pub unsafe fn set_view(&self, item_view: impl CastInto<Ptr<QAbstractItemView>>)[src]

Sets the view to be used in the combobox popup to the given itemView. The combobox takes ownership of the view.

Calls C++ function: void QComboBox::setView(QAbstractItemView* itemView).

C++ documentation:

Sets the view to be used in the combobox popup to the given itemView. The combobox takes ownership of the view.

Note: If you want to use the convenience views (like QListWidget, QTableWidget or QTreeWidget), make sure to call setModel() on the combobox with the convenience widgets model before calling this function.

See also view().

pub unsafe fn show_popup(&self)[src]

Displays the list of items in the combobox. If the list is empty then the no items will be shown.

Calls C++ function: virtual void QComboBox::showPopup().

C++ documentation:

Displays the list of items in the combobox. If the list is empty then the no items will be shown.

If you reimplement this function to show a custom pop-up, make sure you call hidePopup() to reset the internal state.

See also hidePopup().

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

This property holds the policy describing how the size of the combobox changes when the content changes

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

C++ documentation:

This property holds the policy describing how the size of the combobox changes when the content changes

The default value is AdjustToContentsOnFirstShow.

Access functions:

SizeAdjustPolicy sizeAdjustPolicy() const
void setSizeAdjustPolicy(SizeAdjustPolicy policy)

See also SizeAdjustPolicy.

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

Reimplemented from QWidget::sizeHint().

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

C++ documentation:

Reimplemented from QWidget::sizeHint().

This implementation caches the size hint to avoid resizing when the contents change dynamically. To invalidate the cached value change the sizeAdjustPolicy.

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

Returns a reference to the staticMetaObject field.

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

This is supported on cpp_lib_version="5.14.0" only.

This signal is sent when the user chooses an item in the combobox. The item's text is passed. Note that this signal is sent even when the choice is not changed. If you need to know when the choice actually changes, use signal currentIndexChanged().

Calls C++ function: void QComboBox::textActivated(const QString& arg1).

C++ documentation:

This signal is sent when the user chooses an item in the combobox. The item's text is passed. Note that this signal is sent even when the choice is not changed. If you need to know when the choice actually changes, use signal currentIndexChanged().

This function was introduced in Qt 5.14.

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

This is supported on cpp_lib_version="5.14.0" only.

This signal is sent when an item in the combobox popup list is highlighted by the user. The item's text is passed.

Calls C++ function: void QComboBox::textHighlighted(const QString& arg1).

C++ documentation:

This signal is sent when an item in the combobox popup list is highlighted by the user. The item's text is passed.

This function was introduced in Qt 5.14.

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

Calls C++ function: static QString QComboBox::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 QComboBox::trUtf8(const char* s, const char* c, int n).

pub unsafe fn validator(&self) -> QPtr<QValidator>[src]

Returns the validator that is used to constrain text input for the combobox.

Calls C++ function: const QValidator* QComboBox::validator() const.

C++ documentation:

Returns the validator that is used to constrain text input for the combobox.

See also setValidator() and editable.

pub unsafe fn view(&self) -> QPtr<QAbstractItemView>[src]

Returns the list view used for the combobox popup.

Calls C++ function: QAbstractItemView* QComboBox::view() const.

C++ documentation:

Returns the list view used for the combobox popup.

See also setView().

Methods from Deref<Target = QWidget>

pub fn slot_set_enabled(&self) -> Receiver<(bool,)>[src]

This property holds whether the widget is enabled

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

C++ documentation:

This property holds whether the widget is enabled

In general an enabled widget handles keyboard and mouse events; a disabled widget does not. An exception is made with QAbstractButton.

Some widgets display themselves differently when they are disabled. For example a button might draw its label grayed out. If your widget needs to know when it becomes enabled or disabled, you can use the changeEvent() with type QEvent::EnabledChange.

Disabling a widget implicitly disables all its children. Enabling respectively enables all child widgets unless they have been explicitly disabled. It it not possible to explicitly enable a child widget which is not a window while its parent widget remains disabled.

By default, this property is true.

Access functions:

bool isEnabled() const
void setEnabled(bool)

See also isEnabledTo(), QKeyEvent, QMouseEvent, and changeEvent().

pub fn slot_set_disabled(&self) -> Receiver<(bool,)>[src]

Disables widget input events if disable is true; otherwise enables input events.

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

C++ documentation:

Disables widget input events if disable is true; otherwise enables input events.

See the enabled documentation for more information.

See also isEnabledTo(), QKeyEvent, QMouseEvent, and changeEvent().

pub fn slot_set_window_modified(&self) -> Receiver<(bool,)>[src]

This property holds whether the document shown in the window has unsaved changes

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

C++ documentation:

This property holds whether the document shown in the window has unsaved changes

A modified window is a window whose content has changed but has not been saved to disk. This flag will have different effects varied by the platform. On macOS the close button will have a modified look; on other platforms, the window title will have an '*' (asterisk).

The window title must contain a "[*]" placeholder, which indicates where the '*' should appear. Normally, it should appear right after the file name (e.g., "document1.txt[*] - Text Editor"). If the window isn't modified, the placeholder is simply removed.

Note that if a widget is set as modified, all its ancestors will also be set as modified. However, if you call setWindowModified(false) on a widget, this will not propagate to its parent because other children of the parent might have been modified.

Access functions:

bool isWindowModified() const
void setWindowModified(bool)

See also windowTitle, Application Example, SDI Example, and MDI Example.

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

This property holds the window title (caption)

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

C++ documentation:

This property holds the window title (caption)

This property only makes sense for top-level widgets, such as windows and dialogs. If no caption has been set, the title is based of the windowFilePath. If neither of these is set, then the title is an empty string.

If you use the windowModified mechanism, the window title must contain a "[*]" placeholder, which indicates where the '*' should appear. Normally, it should appear right after the file name (e.g., "document1.txt[*] - Text Editor"). If the windowModified property is false (the default), the placeholder is simply removed.

On some desktop platforms (including Windows and Unix), the application name (from QGuiApplication::applicationDisplayName) is added at the end of the window title, if set. This is done by the QPA plugin, so it is shown to the user, but isn't part of the windowTitle string.

Access functions:

QString windowTitle() const
void setWindowTitle(const QString &)

Notifier signal:

void windowTitleChanged(const QString &title)

See also windowIcon, windowModified, and windowFilePath.

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

This property holds the widget's style sheet

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

C++ documentation:

This property holds the widget's style sheet

The style sheet contains a textual description of customizations to the widget's style, as described in the Qt Style Sheets document.

Since Qt 4.5, Qt style sheets fully supports macOS.

Warning: Qt style sheets are currently not supported for custom QStyle subclasses. We plan to address this in some future release.

This property was introduced in Qt 4.2.

Access functions:

QString styleSheet() const
void setStyleSheet(const QString &styleSheet)

See also setStyle(), QApplication::styleSheet, and Qt Style Sheets.

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

This is an overloaded function.

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

C++ documentation:

This is an overloaded function.

Gives the keyboard input focus to this widget (or its focus proxy) if this widget or one of its parents is the active window.

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

Updates the widget unless updates are disabled or the widget is hidden.

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

C++ documentation:

Updates the widget unless updates are disabled or the widget is hidden.

This function does not cause an immediate repaint; instead it schedules a paint event for processing when Qt returns to the main event loop. This permits Qt to optimize for more speed and less flicker than a call to repaint() does.

Calling update() several times normally results in just one paintEvent() call.

Qt normally erases the widget's area before the paintEvent() call. If the Qt::WA_OpaquePaintEvent widget attribute is set, the widget is responsible for painting all its pixels with an opaque color.

See also repaint(), paintEvent(), setUpdatesEnabled(), and Analog Clock Example.

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

Repaints the widget directly by calling paintEvent() immediately, unless updates are disabled or the widget is hidden.

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

C++ documentation:

Repaints the widget directly by calling paintEvent() immediately, unless updates are disabled or the widget is hidden.

We suggest only using repaint() if you need an immediate repaint, for example during animation. In almost all circumstances update() is better, as it permits Qt to optimize for speed and minimize flicker.

Warning: If you call repaint() in a function which may itself be called from paintEvent(), you may get infinite recursion. The update() function never causes recursion.

See also update(), paintEvent(), and setUpdatesEnabled().

pub fn slot_set_visible(&self) -> Receiver<(bool,)>[src]

This property holds whether the widget is visible

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

C++ documentation:

This property holds whether the widget is visible

Calling setVisible(true) or show() sets the widget to visible status if all its parent widgets up to the window are visible. If an ancestor is not visible, the widget won't become visible until all its ancestors are shown. If its size or position has changed, Qt guarantees that a widget gets move and resize events just before it is shown. If the widget has not been resized yet, Qt will adjust the widget's size to a useful default using adjustSize().

Calling setVisible(false) or hide() hides a widget explicitly. An explicitly hidden widget will never become visible, even if all its ancestors become visible, unless you show it.

A widget receives show and hide events when its visibility status changes. Between a hide and a show event, there is no need to waste CPU cycles preparing or displaying information to the user. A video application, for example, might simply stop generating new frames.

A widget that happens to be obscured by other windows on the screen is considered to be visible. The same applies to iconified windows and windows that exist on another virtual desktop (on platforms that support this concept). A widget receives spontaneous show and hide events when its mapping status is changed by the window system, e.g. a spontaneous hide event when the user minimizes the window, and a spontaneous show event when the window is restored again.

You almost never have to reimplement the setVisible() function. If you need to change some settings before a widget is shown, use showEvent() instead. If you need to do some delayed initialization use the Polish event delivered to the event() function.

Access functions:

bool isVisible() const
virtual void setVisible(bool visible)

See also show(), hide(), isHidden(), isVisibleTo(), isMinimized(), showEvent(), and hideEvent().

pub fn slot_set_hidden(&self) -> Receiver<(bool,)>[src]

Convenience function, equivalent to setVisible(!hidden).

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

C++ documentation:

Convenience function, equivalent to setVisible(!hidden).

See also isHidden().

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

Shows the widget and its child widgets.

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

C++ documentation:

Shows the widget and its child widgets.

This is equivalent to calling showFullScreen(), showMaximized(), or setVisible(true), depending on the platform's default behavior for the window flags.

See also raise(), showEvent(), hide(), setVisible(), showMinimized(), showMaximized(), showNormal(), isVisible(), and windowFlags().

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

Hides the widget. This function is equivalent to setVisible(false).

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

C++ documentation:

Hides the widget. This function is equivalent to setVisible(false).

Note: If you are working with QDialog or its subclasses and you invoke the show() function after this function, the dialog will be displayed in its original position.

See also hideEvent(), isHidden(), show(), setVisible(), isVisible(), and close().

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

Shows the widget minimized, as an icon.

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

C++ documentation:

Shows the widget minimized, as an icon.

Calling this function only affects windows.

See also showNormal(), showMaximized(), show(), hide(), isVisible(), and isMinimized().

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

Shows the widget maximized.

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

C++ documentation:

Shows the widget maximized.

Calling this function only affects windows.

On X11, this function may not work properly with certain window managers. See the Window Geometry documentation for an explanation.

See also setWindowState(), showNormal(), showMinimized(), show(), hide(), and isVisible().

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

Shows the widget in full-screen mode.

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

C++ documentation:

Shows the widget in full-screen mode.

Calling this function only affects windows.

To return from full-screen mode, call showNormal().

Full-screen mode works fine under Windows, but has certain problems under X. These problems are due to limitations of the ICCCM protocol that specifies the communication between X11 clients and the window manager. ICCCM simply does not understand the concept of non-decorated full-screen windows. Therefore, the best we can do is to request a borderless window and place and resize it to fill the entire screen. Depending on the window manager, this may or may not work. The borderless window is requested using MOTIF hints, which are at least partially supported by virtually all modern window managers.

An alternative would be to bypass the window manager entirely and create a window with the Qt::X11BypassWindowManagerHint flag. This has other severe problems though, like totally broken keyboard focus and very strange effects on desktop changes or when the user raises other windows.

X11 window managers that follow modern post-ICCCM specifications support full-screen mode properly.

See also showNormal(), showMaximized(), show(), hide(), and isVisible().

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

Restores the widget after it has been maximized or minimized.

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

C++ documentation:

Restores the widget after it has been maximized or minimized.

Calling this function only affects windows.

See also setWindowState(), showMinimized(), showMaximized(), show(), hide(), and isVisible().

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

Closes this widget. Returns true if the widget was closed; otherwise returns false.

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

C++ documentation:

Closes this widget. Returns true if the widget was closed; otherwise returns false.

First it sends the widget a QCloseEvent. The widget is hidden if it accepts the close event. If it ignores the event, nothing happens. The default implementation of QWidget::closeEvent() accepts the close event.

If the widget has the Qt::WA_DeleteOnClose flag, the widget is also deleted. A close events is delivered to the widget no matter if the widget is visible or not.

The QApplication::lastWindowClosed() signal is emitted when the last visible primary window (i.e. window with no parent) with the Qt::WA_QuitOnClose attribute set is closed. By default this attribute is set for all widgets except transient windows such as splash screens, tool windows, and popup menus.

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

Raises this widget to the top of the parent widget's stack.

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

C++ documentation:

Raises this widget to the top of the parent widget's stack.

After this call the widget will be visually in front of any overlapping sibling widgets.

Note: When using activateWindow(), you can call this function to ensure that the window is stacked on top.

See also lower() and stackUnder().

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

Lowers the widget to the bottom of the parent widget's stack.

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

C++ documentation:

Lowers the widget to the bottom of the parent widget's stack.

After this call the widget will be visually behind (and therefore obscured by) any overlapping sibling widgets.

See also raise() and stackUnder().

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

This signal is emitted when the window's title has changed, with the new title as an argument.

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

C++ documentation:

This signal is emitted when the window's title has changed, with the new title as an argument.

This function was introduced in Qt 5.2.

Note: Notifier signal for property windowTitle.

pub fn window_icon_changed(&self) -> Signal<(*const QIcon,)>[src]

This signal is emitted when the window's icon has changed, with the new icon as an argument.

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

C++ documentation:

This signal is emitted when the window's icon has changed, with the new icon as an argument.

This function was introduced in Qt 5.2.

Note: Notifier signal for property windowIcon.

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

This signal is emitted when the window's icon text has changed, with the new iconText as an argument.

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

C++ documentation:

This signal is emitted when the window's icon text has changed, with the new iconText as an argument.

This signal is deprecated.

This function was introduced in Qt 5.2.

Note: Notifier signal for property windowIconText.

pub fn custom_context_menu_requested(&self) -> Signal<(*const QPoint,)>[src]

This signal is emitted when the widget's contextMenuPolicy is Qt::CustomContextMenu, and the user has requested a context menu on the widget. The position pos is the position of the context menu event that the widget receives. Normally this is in widget coordinates. The exception to this rule is QAbstractScrollArea and its subclasses that map the context menu event to coordinates of the viewport().

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

C++ documentation:

This signal is emitted when the widget's contextMenuPolicy is Qt::CustomContextMenu, and the user has requested a context menu on the widget. The position pos is the position of the context menu event that the widget receives. Normally this is in widget coordinates. The exception to this rule is QAbstractScrollArea and its subclasses that map the context menu event to coordinates of the viewport().

See also mapToGlobal(), QMenu, and contextMenuPolicy.

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

Updates the widget's micro focus.

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

C++ documentation:

Updates the widget's micro focus.

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

This property holds whether drop events are enabled for this widget

Calls C++ function: bool QWidget::acceptDrops() const.

C++ documentation:

This property holds whether drop events are enabled for this widget

Setting this property to true announces to the system that this widget may be able to accept drop events.

If the widget is the desktop (windowType() == Qt::Desktop), this may fail if another application is using the desktop; you can call acceptDrops() to test if this occurs.

Warning: Do not modify this property in a drag and drop event handler.

By default, this property is false.

Access functions:

bool acceptDrops() const
void setAcceptDrops(bool on)

See also Drag and Drop.

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

This property holds the widget's description as seen by assistive technologies

Calls C++ function: QString QWidget::accessibleDescription() const.

C++ documentation:

This property holds the widget's description as seen by assistive technologies

The accessible description of a widget should convey what a widget does. While the accessibleName should be a short and consise string (e.g. Save), the description should give more context, such as Saves the current document.

This property has to be localized.

By default, this property contains an empty string and Qt falls back to using the tool tip to provide this information.

Access functions:

QString accessibleDescription() const
void setAccessibleDescription(const QString &description)

See also QWidget::accessibleName and QAccessibleInterface::text().

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

This property holds the widget's name as seen by assistive technologies

Calls C++ function: QString QWidget::accessibleName() const.

C++ documentation:

This property holds the widget's name as seen by assistive technologies

This is the primary name by which assistive technology such as screen readers announce this widget. For most widgets setting this property is not required. For example for QPushButton the button's text will be used.

It is important to set this property when the widget does not provide any text. For example a button that only contains an icon needs to set this property to work with screen readers. The name should be short and equivalent to the visual information conveyed by the widget.

This property has to be localized.

By default, this property contains an empty string.

Access functions:

QString accessibleName() const
void setAccessibleName(const QString &name)

See also QWidget::accessibleDescription and QAccessibleInterface::text().

pub unsafe fn actions(&self) -> CppBox<QListOfQAction>[src]

Returns the (possibly empty) list of this widget's actions.

Calls C++ function: QList<QAction*> QWidget::actions() const.

C++ documentation:

Returns the (possibly empty) list of this widget's actions.

See also contextMenuPolicy, insertAction(), and removeAction().

pub unsafe fn activate_window(&self)[src]

Sets the top-level widget containing this widget to be the active window.

Calls C++ function: void QWidget::activateWindow().

C++ documentation:

Sets the top-level widget containing this widget to be the active window.

An active window is a visible top-level window that has the keyboard input focus.

This function performs the same operation as clicking the mouse on the title bar of a top-level window. On X11, the result depends on the Window Manager. If you want to ensure that the window is stacked on top as well you should also call raise(). Note that the window must be visible, otherwise activateWindow() has no effect.

On Windows, if you are calling this when the application is not currently the active one then it will not make it the active window. It will change the color of the taskbar entry to indicate that the window has changed in some way. This is because Microsoft does not allow an application to interrupt what the user is currently doing in another application.

See also isActiveWindow(), window(), show(), and QWindowsWindowFunctions::setWindowActivationBehavior().

pub unsafe fn add_action(&self, action: impl CastInto<Ptr<QAction>>)[src]

Appends the action action to this widget's list of actions.

Calls C++ function: void QWidget::addAction(QAction* action).

C++ documentation:

Appends the action action to this widget's list of actions.

All QWidgets have a list of QActions, however they can be represented graphically in many different ways. The default use of the QAction list (as returned by actions()) is to create a context QMenu.

A QWidget should only have one of each action and adding an action it already has will not cause the same action to be in the widget twice.

The ownership of action is not transferred to this QWidget.

See also removeAction(), insertAction(), actions(), and QMenu.

pub unsafe fn add_actions(&self, actions: impl CastInto<Ref<QListOfQAction>>)[src]

Appends the actions actions to this widget's list of actions.

Calls C++ function: void QWidget::addActions(QList<QAction*> actions).

C++ documentation:

Appends the actions actions to this widget's list of actions.

See also removeAction(), QMenu, and addAction().

pub unsafe fn adjust_size(&self)[src]

Adjusts the size of the widget to fit its contents.

Calls C++ function: void QWidget::adjustSize().

C++ documentation:

Adjusts the size of the widget to fit its contents.

This function uses sizeHint() if it is valid, i.e., the size hint's width and height are >= 0. Otherwise, it sets the size to the children rectangle that covers all child widgets (the union of all child widget rectangles).

For windows, the screen size is also taken into account. If the sizeHint() is less than (200, 100) and the size policy is expanding, the window will be at least (200, 100). The maximum size of a window is 2/3 of the screen's width and height.

See also sizeHint() and childrenRect().

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

This property holds whether the widget background is filled automatically

Calls C++ function: bool QWidget::autoFillBackground() const.

C++ documentation:

This property holds whether the widget background is filled automatically

If enabled, this property will cause Qt to fill the background of the widget before invoking the paint event. The color used is defined by the QPalette::Window color role from the widget's palette.

In addition, Windows are always filled with QPalette::Window, unless the WA_OpaquePaintEvent or WA_NoSystemBackground attributes are set.

This property cannot be turned off (i.e., set to false) if a widget's parent has a static gradient for its background.

Warning: Use this property with caution in conjunction with Qt Style Sheets. When a widget has a style sheet with a valid background or a border-image, this property is automatically disabled.

By default, this property is false.

This property was introduced in Qt 4.1.

Access functions:

bool autoFillBackground() const
void setAutoFillBackground(bool enabled)

See also Qt::WA_OpaquePaintEvent, Qt::WA_NoSystemBackground, and Transparency and Double Buffering.

pub unsafe fn background_role(&self) -> ColorRole[src]

Returns the background role of the widget.

Calls C++ function: QPalette::ColorRole QWidget::backgroundRole() const.

C++ documentation:

Returns the background role of the widget.

The background role defines the brush from the widget's palette that is used to render the background.

If no explicit background role is set, the widget inherts its parent widget's background role.

See also setBackgroundRole() and foregroundRole().

pub unsafe fn backing_store(&self) -> Ptr<QBackingStore>[src]

Returns the QBackingStore this widget will be drawn into.

Calls C++ function: QBackingStore* QWidget::backingStore() const.

C++ documentation:

Returns the QBackingStore this widget will be drawn into.

This function was introduced in Qt 5.0.

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

This property holds the base size of the widget

Calls C++ function: QSize QWidget::baseSize() const.

C++ documentation:

This property holds the base size of the widget

The base size is used to calculate a proper widget size if the widget defines sizeIncrement().

By default, for a newly-created widget, this property contains a size with zero width and height.

Access functions:

QSize baseSize() const
void setBaseSize(const QSize &)
void setBaseSize(int basew, int baseh)

See also setSizeIncrement().

pub unsafe fn child_at_2a(&self, x: c_int, y: c_int) -> QPtr<QWidget>[src]

Returns the visible child widget at the position (x, y) in the widget's coordinate system. If there is no visible child widget at the specified position, the function returns 0.

Calls C++ function: QWidget* QWidget::childAt(int x, int y) const.

C++ documentation:

Returns the visible child widget at the position (x, y) in the widget's coordinate system. If there is no visible child widget at the specified position, the function returns 0.

pub unsafe fn child_at_1a(&self, p: impl CastInto<Ref<QPoint>>) -> QPtr<QWidget>[src]

This is an overloaded function.

Calls C++ function: QWidget* QWidget::childAt(const QPoint& p) const.

C++ documentation:

This is an overloaded function.

Returns the visible child widget at point p in the widget's own coordinate system.

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

This property holds the bounding rectangle of the widget's children

Calls C++ function: QRect QWidget::childrenRect() const.

C++ documentation:

This property holds the bounding rectangle of the widget's children

Hidden children are excluded.

By default, for a widget with no children, this property contains a rectangle with zero width and height located at the origin.

Access functions:

QRect childrenRect() const

See also childrenRegion() and geometry().

pub unsafe fn children_region(&self) -> CppBox<QRegion>[src]

This property holds the combined region occupied by the widget's children

Calls C++ function: QRegion QWidget::childrenRegion() const.

C++ documentation:

This property holds the combined region occupied by the widget's children

Hidden children are excluded.

By default, for a widget with no children, this property contains an empty region.

Access functions:

QRegion childrenRegion() const

See also childrenRect(), geometry(), and mask().

pub unsafe fn clear_focus(&self)[src]

Takes keyboard input focus from the widget.

Calls C++ function: void QWidget::clearFocus().

C++ documentation:

Takes keyboard input focus from the widget.

If the widget has active focus, a focus out event is sent to this widget to tell it that it has lost the focus.

This widget must enable focus setting in order to get the keyboard input focus, i.e. it must call setFocusPolicy().

See also hasFocus(), setFocus(), focusInEvent(), focusOutEvent(), setFocusPolicy(), and QApplication::focusWidget().

pub unsafe fn clear_mask(&self)[src]

Removes any mask set by setMask().

Calls C++ function: void QWidget::clearMask().

C++ documentation:

Removes any mask set by setMask().

See also setMask().

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

Closes this widget. Returns true if the widget was closed; otherwise returns false.

Calls C++ function: [slot] bool QWidget::close().

C++ documentation:

Closes this widget. Returns true if the widget was closed; otherwise returns false.

First it sends the widget a QCloseEvent. The widget is hidden if it accepts the close event. If it ignores the event, nothing happens. The default implementation of QWidget::closeEvent() accepts the close event.

If the widget has the Qt::WA_DeleteOnClose flag, the widget is also deleted. A close events is delivered to the widget no matter if the widget is visible or not.

The QApplication::lastWindowClosed() signal is emitted when the last visible primary window (i.e. window with no parent) with the Qt::WA_QuitOnClose attribute set is closed. By default this attribute is set for all widgets except transient windows such as splash screens, tool windows, and popup menus.

pub unsafe fn contents_margins(&self) -> CppBox<QMargins>[src]

The contentsMargins function returns the widget's contents margins.

Calls C++ function: QMargins QWidget::contentsMargins() const.

C++ documentation:

The contentsMargins function returns the widget's contents margins.

This function was introduced in Qt 4.6.

See also getContentsMargins(), setContentsMargins(), and contentsRect().

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

Returns the area inside the widget's margins.

Calls C++ function: QRect QWidget::contentsRect() const.

C++ documentation:

Returns the area inside the widget's margins.

See also setContentsMargins() and getContentsMargins().

pub unsafe fn context_menu_policy(&self) -> ContextMenuPolicy[src]

how the widget shows a context menu

Calls C++ function: Qt::ContextMenuPolicy QWidget::contextMenuPolicy() const.

C++ documentation:

how the widget shows a context menu

The default value of this property is Qt::DefaultContextMenu, which means the contextMenuEvent() handler is called. Other values are Qt::NoContextMenu, Qt::PreventContextMenu, Qt::ActionsContextMenu, and Qt::CustomContextMenu. With Qt::CustomContextMenu, the signal customContextMenuRequested() is emitted.

Access functions:

Qt::ContextMenuPolicy contextMenuPolicy() const
void setContextMenuPolicy(Qt::ContextMenuPolicy policy)

See also contextMenuEvent(), customContextMenuRequested(), and actions().

pub unsafe fn create_win_id(&self)[src]

Calls C++ function: void QWidget::createWinId().

pub unsafe fn cursor(&self) -> CppBox<QCursor>[src]

This property holds the cursor shape for this widget

Calls C++ function: QCursor QWidget::cursor() const.

C++ documentation:

This property holds the cursor shape for this widget

The mouse cursor will assume this shape when it's over this widget. See the list of predefined cursor objects for a range of useful shapes.

An editor widget might use an I-beam cursor:

setCursor(Qt::IBeamCursor);

If no cursor has been set, or after a call to unsetCursor(), the parent's cursor is used.

By default, this property contains a cursor with the Qt::ArrowCursor shape.

Some underlying window implementations will reset the cursor if it leaves a widget even if the mouse is grabbed. If you want to have a cursor set for all widgets, even when outside the window, consider QApplication::setOverrideCursor().

Access functions:

QCursor cursor() const
void setCursor(const QCursor &)
void unsetCursor()

See also QApplication::setOverrideCursor().

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

Calls C++ function: virtual int QWidget::devType() const.

pub unsafe fn effective_win_id(&self) -> c_ulonglong[src]

Returns the effective window system identifier of the widget, i.e. the native parent's window system identifier.

Calls C++ function: unsigned long long QWidget::effectiveWinId() const.

C++ documentation:

Returns the effective window system identifier of the widget, i.e. the native parent's window system identifier.

If the widget is native, this function returns the native widget ID. Otherwise, the window ID of the first native parent widget, i.e., the top-level widget that contains this widget, is returned.

Note: We recommend that you do not store this value as it is likely to change at run-time.

This function was introduced in Qt 4.4.

See also nativeParentWidget().

pub unsafe fn ensure_polished(&self)[src]

Ensures that the widget and its children have been polished by QStyle (i.e., have a proper font and palette).

Calls C++ function: void QWidget::ensurePolished() const.

C++ documentation:

Ensures that the widget and its children have been polished by QStyle (i.e., have a proper font and palette).

QWidget calls this function after it has been fully constructed but before it is shown the very first time. You can call this function if you want to ensure that the widget is polished before doing an operation, e.g., the correct font size might be needed in the widget's sizeHint() reimplementation. Note that this function is called from the default implementation of sizeHint().

Polishing is useful for final initialization that must happen after all constructors (from base classes as well as from subclasses) have been called.

If you need to change some settings when a widget is polished, reimplement event() and handle the QEvent::Polish event type.

Note: The function is declared const so that it can be called from other const functions (e.g., sizeHint()).

See also event().

pub unsafe fn focus_policy(&self) -> FocusPolicy[src]

This property holds the way the widget accepts keyboard focus

Calls C++ function: Qt::FocusPolicy QWidget::focusPolicy() const.

C++ documentation:

This property holds the way the widget accepts keyboard focus

The policy is Qt::TabFocus if the widget accepts keyboard focus by tabbing, Qt::ClickFocus if the widget accepts focus by clicking, Qt::StrongFocus if it accepts both, and Qt::NoFocus (the default) if it does not accept focus at all.

You must enable keyboard focus for a widget if it processes keyboard events. This is normally done from the widget's constructor. For instance, the QLineEdit constructor calls setFocusPolicy(Qt::StrongFocus).

If the widget has a focus proxy, then the focus policy will be propagated to it.

Access functions:

Qt::FocusPolicy focusPolicy() const
void setFocusPolicy(Qt::FocusPolicy policy)

See also focusInEvent(), focusOutEvent(), keyPressEvent(), keyReleaseEvent(), and enabled.

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

Returns the focus proxy, or 0 if there is no focus proxy.

Calls C++ function: QWidget* QWidget::focusProxy() const.

C++ documentation:

Returns the focus proxy, or 0 if there is no focus proxy.

See also setFocusProxy().

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

Returns the last child of this widget that setFocus had been called on. For top level widgets this is the widget that will get focus in case this window gets activated

Calls C++ function: QWidget* QWidget::focusWidget() const.

C++ documentation:

Returns the last child of this widget that setFocus had been called on. For top level widgets this is the widget that will get focus in case this window gets activated

This is not the same as QApplication::focusWidget(), which returns the focus widget in the currently active window.

pub unsafe fn font(&self) -> Ref<QFont>[src]

This property holds the font currently set for the widget

Calls C++ function: const QFont& QWidget::font() const.

C++ documentation:

This property holds the font currently set for the widget

This property describes the widget's requested font. The font is used by the widget's style when rendering standard components, and is available as a means to ensure that custom widgets can maintain consistency with the native platform's look and feel. It's common that different platforms, or different styles, define different fonts for an application.

When you assign a new font to a widget, the properties from this font are combined with the widget's default font to form the widget's final font. You can call fontInfo() to get a copy of the widget's final font. The final font is also used to initialize QPainter's font.

The default depends on the system environment. QApplication maintains a system/theme font which serves as a default for all widgets. There may also be special font defaults for certain types of widgets. You can also define default fonts for widgets yourself by passing a custom font and the name of a widget to QApplication::setFont(). Finally, the font is matched against Qt's font database to find the best match.

QWidget propagates explicit font properties from parent to child. If you change a specific property on a font and assign that font to a widget, that property will propagate to all the widget's children, overriding any system defaults for that property. Note that fonts by default don't propagate to windows (see isWindow()) unless the Qt::WA_WindowPropagation attribute is enabled.

QWidget's font propagation is similar to its palette propagation.

The current style, which is used to render the content of all standard Qt widgets, is free to choose to use the widget font, or in some cases, to ignore it (partially, or completely). In particular, certain styles like GTK style, Mac style, Windows XP, and Vista style, apply special modifications to the widget font to match the platform's native look and feel. Because of this, assigning properties to a widget's font is not guaranteed to change the appearance of the widget. Instead, you may choose to apply a styleSheet.

Note: If Qt Style Sheets are used on the same widget as setFont(), style sheets will take precedence if the settings conflict.

Access functions:

const QFont &font() const
void setFont(const QFont &)

See also fontInfo() and fontMetrics().

pub unsafe fn font_info(&self) -> CppBox<QFontInfo>[src]

Returns the font info for the widget's current font. Equivalent to QFontInfo(widget->font()).

Calls C++ function: QFontInfo QWidget::fontInfo() const.

C++ documentation:

Returns the font info for the widget's current font. Equivalent to QFontInfo(widget->font()).

See also font(), fontMetrics(), and setFont().

pub unsafe fn font_metrics(&self) -> CppBox<QFontMetrics>[src]

Returns the font metrics for the widget's current font. Equivalent to QFontMetrics(widget->font()).

Calls C++ function: QFontMetrics QWidget::fontMetrics() const.

C++ documentation:

Returns the font metrics for the widget's current font. Equivalent to QFontMetrics(widget->font()).

See also font(), fontInfo(), and setFont().

pub unsafe fn foreground_role(&self) -> ColorRole[src]

Returns the foreground role.

Calls C++ function: QPalette::ColorRole QWidget::foregroundRole() const.

C++ documentation:

Returns the foreground role.

The foreground role defines the color from the widget's palette that is used to draw the foreground.

If no explicit foreground role is set, the function returns a role that contrasts with the background role.

See also setForegroundRole() and backgroundRole().

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

geometry of the widget relative to its parent including any window frame

Calls C++ function: QRect QWidget::frameGeometry() const.

C++ documentation:

geometry of the widget relative to its parent including any window frame

See the Window Geometry documentation for an overview of geometry issues with windows.

By default, this property contains a value that depends on the user's platform and screen geometry.

Access functions:

QRect frameGeometry() const

See also geometry(), x(), y(), and pos().

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

This property holds the size of the widget including any window frame

Calls C++ function: QSize QWidget::frameSize() const.

C++ documentation:

This property holds the size of the widget including any window frame

By default, this property contains a value that depends on the user's platform and screen geometry.

Access functions:

QSize frameSize() const

pub unsafe fn geometry(&self) -> Ref<QRect>[src]

This property holds the geometry of the widget relative to its parent and excluding the window frame

Calls C++ function: const QRect& QWidget::geometry() const.

C++ documentation:

This property holds the geometry of the widget relative to its parent and excluding the window frame

When changing the geometry, the widget, if visible, receives a move event (moveEvent()) and/or a resize event (resizeEvent()) immediately. If the widget is not currently visible, it is guaranteed to receive appropriate events before it is shown.

The size component is adjusted if it lies outside the range defined by minimumSize() and maximumSize().

Warning: Calling setGeometry() inside resizeEvent() or moveEvent() can lead to infinite recursion.

See the Window Geometry documentation for an overview of geometry issues with windows.

By default, this property contains a value that depends on the user's platform and screen geometry.

Access functions:

const QRect &geometry() const
void setGeometry(int x, int y, int w, int h)
void setGeometry(const QRect &)

See also frameGeometry(), rect(), move(), resize(), moveEvent(), resizeEvent(), minimumSize(), and maximumSize().

pub unsafe fn get_contents_margins(
    &self,
    left: *mut c_int,
    top: *mut c_int,
    right: *mut c_int,
    bottom: *mut c_int
)
[src]

Returns the widget's contents margins for left, top, right, and bottom.

Calls C++ function: void QWidget::getContentsMargins(int* left, int* top, int* right, int* bottom) const.

C++ documentation:

Returns the widget's contents margins for left, top, right, and bottom.

See also setContentsMargins() and contentsRect().

pub unsafe fn grab_1a(
    &self,
    rectangle: impl CastInto<Ref<QRect>>
) -> CppBox<QPixmap>
[src]

Renders the widget into a pixmap restricted by the given rectangle. If the widget has any children, then they are also painted in the appropriate positions.

Calls C++ function: QPixmap QWidget::grab(const QRect& rectangle = …).

C++ documentation:

Renders the widget into a pixmap restricted by the given rectangle. If the widget has any children, then they are also painted in the appropriate positions.

If a rectangle with an invalid size is specified (the default), the entire widget is painted.

This function was introduced in Qt 5.0.

See also render() and QPixmap.

pub unsafe fn grab_0a(&self) -> CppBox<QPixmap>[src]

Renders the widget into a pixmap restricted by the given rectangle. If the widget has any children, then they are also painted in the appropriate positions.

Calls C++ function: QPixmap QWidget::grab().

C++ documentation:

Renders the widget into a pixmap restricted by the given rectangle. If the widget has any children, then they are also painted in the appropriate positions.

If a rectangle with an invalid size is specified (the default), the entire widget is painted.

This function was introduced in Qt 5.0.

See also render() and QPixmap.

pub unsafe fn grab_gesture_2a(
    &self,
    type_: GestureType,
    flags: QFlags<GestureFlag>
)
[src]

Subscribes the widget to a given gesture with specific flags.

Calls C++ function: void QWidget::grabGesture(Qt::GestureType type, QFlags<Qt::GestureFlag> flags = …).

C++ documentation:

Subscribes the widget to a given gesture with specific flags.

This function was introduced in Qt 4.6.

See also ungrabGesture() and QGestureEvent.

pub unsafe fn grab_gesture_1a(&self, type_: GestureType)[src]

Subscribes the widget to a given gesture with specific flags.

Calls C++ function: void QWidget::grabGesture(Qt::GestureType type).

C++ documentation:

Subscribes the widget to a given gesture with specific flags.

This function was introduced in Qt 4.6.

See also ungrabGesture() and QGestureEvent.

pub unsafe fn grab_keyboard(&self)[src]

Grabs the keyboard input.

Calls C++ function: void QWidget::grabKeyboard().

C++ documentation:

Grabs the keyboard input.

This widget receives all keyboard events until releaseKeyboard() is called; other widgets get no keyboard events at all. Mouse events are not affected. Use grabMouse() if you want to grab that.

The focus widget is not affected, except that it doesn't receive any keyboard events. setFocus() moves the focus as usual, but the new focus widget receives keyboard events only after releaseKeyboard() is called.

If a different widget is currently grabbing keyboard input, that widget's grab is released first.

See also releaseKeyboard(), grabMouse(), releaseMouse(), and focusWidget().

pub unsafe fn grab_mouse_0a(&self)[src]

Grabs the mouse input.

Calls C++ function: void QWidget::grabMouse().

C++ documentation:

Grabs the mouse input.

This widget receives all mouse events until releaseMouse() is called; other widgets get no mouse events at all. Keyboard events are not affected. Use grabKeyboard() if you want to grab that.

Warning: Bugs in mouse-grabbing applications very often lock the terminal. Use this function with extreme caution, and consider using the -nograb command line option while debugging.

It is almost never necessary to grab the mouse when using Qt, as Qt grabs and releases it sensibly. In particular, Qt grabs the mouse when a mouse button is pressed and keeps it until the last button is released.

Note: Only visible widgets can grab mouse input. If isVisible() returns false for a widget, that widget cannot call grabMouse().

Note: On Windows, grabMouse() only works when the mouse is inside a window owned by the process. On macOS, grabMouse() only works when the mouse is inside the frame of that widget.

See also releaseMouse(), grabKeyboard(), and releaseKeyboard().

pub unsafe fn grab_mouse_1a(&self, arg1: impl CastInto<Ref<QCursor>>)[src]

This function overloads grabMouse().

Calls C++ function: void QWidget::grabMouse(const QCursor& arg1).

C++ documentation:

This function overloads grabMouse().

Grabs the mouse input and changes the cursor shape.

The cursor will assume shape cursor (for as long as the mouse focus is grabbed) and this widget will be the only one to receive mouse events until releaseMouse() is called().

Warning: Grabbing the mouse might lock the terminal.

Note: See the note in QWidget::grabMouse().

See also releaseMouse(), grabKeyboard(), releaseKeyboard(), and setCursor().

pub unsafe fn grab_shortcut_2a(
    &self,
    key: impl CastInto<Ref<QKeySequence>>,
    context: ShortcutContext
) -> c_int
[src]

Adds a shortcut to Qt's shortcut system that watches for the given key sequence in the given context. If the context is Qt::ApplicationShortcut, the shortcut applies to the application as a whole. Otherwise, it is either local to this widget, Qt::WidgetShortcut, or to the window itself, Qt::WindowShortcut.

Calls C++ function: int QWidget::grabShortcut(const QKeySequence& key, Qt::ShortcutContext context = …).

C++ documentation:

Adds a shortcut to Qt's shortcut system that watches for the given key sequence in the given context. If the context is Qt::ApplicationShortcut, the shortcut applies to the application as a whole. Otherwise, it is either local to this widget, Qt::WidgetShortcut, or to the window itself, Qt::WindowShortcut.

If the same key sequence has been grabbed by several widgets, when the key sequence occurs a QEvent::Shortcut event is sent to all the widgets to which it applies in a non-deterministic order, but with the ``ambiguous'' flag set to true.

Warning: You should not normally need to use this function; instead create QActions with the shortcut key sequences you require (if you also want equivalent menu options and toolbar buttons), or create QShortcuts if you just need key sequences. Both QAction and QShortcut handle all the event filtering for you, and provide signals which are triggered when the user triggers the key sequence, so are much easier to use than this low-level function.

See also releaseShortcut() and setShortcutEnabled().

pub unsafe fn grab_shortcut_1a(
    &self,
    key: impl CastInto<Ref<QKeySequence>>
) -> c_int
[src]

Adds a shortcut to Qt's shortcut system that watches for the given key sequence in the given context. If the context is Qt::ApplicationShortcut, the shortcut applies to the application as a whole. Otherwise, it is either local to this widget, Qt::WidgetShortcut, or to the window itself, Qt::WindowShortcut.

Calls C++ function: int QWidget::grabShortcut(const QKeySequence& key).

C++ documentation:

Adds a shortcut to Qt's shortcut system that watches for the given key sequence in the given context. If the context is Qt::ApplicationShortcut, the shortcut applies to the application as a whole. Otherwise, it is either local to this widget, Qt::WidgetShortcut, or to the window itself, Qt::WindowShortcut.

If the same key sequence has been grabbed by several widgets, when the key sequence occurs a QEvent::Shortcut event is sent to all the widgets to which it applies in a non-deterministic order, but with the ``ambiguous'' flag set to true.

Warning: You should not normally need to use this function; instead create QActions with the shortcut key sequences you require (if you also want equivalent menu options and toolbar buttons), or create QShortcuts if you just need key sequences. Both QAction and QShortcut handle all the event filtering for you, and provide signals which are triggered when the user triggers the key sequence, so are much easier to use than this low-level function.

See also releaseShortcut() and setShortcutEnabled().

pub unsafe fn graphics_effect(&self) -> QPtr<QGraphicsEffect>[src]

The graphicsEffect function returns a pointer to the widget's graphics effect.

Calls C++ function: QGraphicsEffect* QWidget::graphicsEffect() const.

C++ documentation:

The graphicsEffect function returns a pointer to the widget's graphics effect.

If the widget has no graphics effect, 0 is returned.

This function was introduced in Qt 4.6.

See also setGraphicsEffect().

pub unsafe fn graphics_proxy_widget(&self) -> QPtr<QGraphicsProxyWidget>[src]

Returns the proxy widget for the corresponding embedded widget in a graphics view; otherwise returns 0.

Calls C++ function: QGraphicsProxyWidget* QWidget::graphicsProxyWidget() const.

C++ documentation:

Returns the proxy widget for the corresponding embedded widget in a graphics view; otherwise returns 0.

This function was introduced in Qt 4.5.

See also QGraphicsProxyWidget::createProxyForChildWidget() and QGraphicsScene::addWidget().

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

This property holds whether this widget (or its focus proxy) has the keyboard input focus

Calls C++ function: bool QWidget::hasFocus() const.

C++ documentation:

This property holds whether this widget (or its focus proxy) has the keyboard input focus

By default, this property is false.

Note: Obtaining the value of this property for a widget is effectively equivalent to checking whether QApplication::focusWidget() refers to the widget.

Access functions:

bool hasFocus() const

See also setFocus(), clearFocus(), setFocusPolicy(), and QApplication::focusWidget().

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

Returns true if the widget's preferred height depends on its width; otherwise returns false.

Calls C++ function: virtual bool QWidget::hasHeightForWidth() const.

C++ documentation:

Returns true if the widget's preferred height depends on its width; otherwise returns false.

This function was introduced in Qt 5.0.

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

This property holds whether mouse tracking is enabled for the widget

Calls C++ function: bool QWidget::hasMouseTracking() const.

C++ documentation:

This property holds whether mouse tracking is enabled for the widget

If mouse tracking is disabled (the default), the widget only receives mouse move events when at least one mouse button is pressed while the mouse is being moved.

If mouse tracking is enabled, the widget receives mouse move events even if no buttons are pressed.

Access functions:

bool hasMouseTracking() const
void setMouseTracking(bool enable)

See also mouseMoveEvent().

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

This property holds whether tablet tracking is enabled for the widget

Calls C++ function: bool QWidget::hasTabletTracking() const.

C++ documentation:

This property holds whether tablet tracking is enabled for the widget

If tablet tracking is disabled (the default), the widget only receives tablet move events when the stylus is in contact with the tablet, or at least one stylus button is pressed, while the stylus is being moved.

If tablet tracking is enabled, the widget receives tablet move events even while hovering in proximity. This is useful for monitoring position as well as the auxiliary properties such as rotation and tilt, and providing feedback in the UI.

This property was introduced in Qt 5.9.

Access functions:

bool hasTabletTracking() const
void setTabletTracking(bool enable)

See also tabletEvent().

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

This property holds the height of the widget excluding any window frame

Calls C++ function: int QWidget::height() const.

C++ documentation:

This property holds the height of the widget excluding any window frame

See the Window Geometry documentation for an overview of geometry issues with windows.

Note: Do not use this function to find the height of a screen on a multiple screen desktop. Read this note for details.

By default, this property contains a value that depends on the user's platform and screen geometry.

Access functions:

int height() const

See also geometry, width, and size.

pub unsafe fn height_for_width(&self, arg1: c_int) -> c_int[src]

Returns the preferred height for this widget, given the width w.

Calls C++ function: virtual int QWidget::heightForWidth(int arg1) const.

C++ documentation:

Returns the preferred height for this widget, given the width w.

If this widget has a layout, the default implementation returns the layout's preferred height. if there is no layout, the default implementation returns -1 indicating that the preferred height does not depend on the width.

pub unsafe fn hide(&self)[src]

Hides the widget. This function is equivalent to setVisible(false).

Calls C++ function: [slot] void QWidget::hide().

C++ documentation:

Hides the widget. This function is equivalent to setVisible(false).

Note: If you are working with QDialog or its subclasses and you invoke the show() function after this function, the dialog will be displayed in its original position.

See also hideEvent(), isHidden(), show(), setVisible(), isVisible(), and close().

pub unsafe fn input_method_hints(&self) -> QFlags<InputMethodHint>[src]

What input method specific hints the widget has.

Calls C++ function: QFlags<Qt::InputMethodHint> QWidget::inputMethodHints() const.

C++ documentation:

What input method specific hints the widget has.

This is only relevant for input widgets. It is used by the input method to retrieve hints as to how the input method should operate. For example, if the Qt::ImhFormattedNumbersOnly flag is set, the input method may change its visual components to reflect that only numbers can be entered.

Warning: Some widgets require certain flags in order to work as intended. To set a flag, do w->setInputMethodHints(w->inputMethodHints()|f) instead of w->setInputMethodHints(f).

Note: The flags are only hints, so the particular input method implementation is free to ignore them. If you want to be sure that a certain type of characters are entered, you should also set a QValidator on the widget.

The default value is Qt::ImhNone.

This property was introduced in Qt 4.6.

Access functions:

Qt::InputMethodHints inputMethodHints() const
void setInputMethodHints(Qt::InputMethodHints hints)

See also inputMethodQuery().

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

This method is only relevant for input widgets. It is used by the input method to query a set of properties of the widget to be able to support complex input method operations as support for surrounding text and reconversions.

Calls C++ function: virtual QVariant QWidget::inputMethodQuery(Qt::InputMethodQuery arg1) const.

C++ documentation:

This method is only relevant for input widgets. It is used by the input method to query a set of properties of the widget to be able to support complex input method operations as support for surrounding text and reconversions.

query specifies which property is queried.

See also inputMethodEvent(), QInputMethodEvent, QInputMethodQueryEvent, and inputMethodHints.

pub unsafe fn insert_action(
    &self,
    before: impl CastInto<Ptr<QAction>>,
    action: impl CastInto<Ptr<QAction>>
)
[src]

Inserts the action action to this widget's list of actions, before the action before. It appends the action if before is 0 or before is not a valid action for this widget.

Calls C++ function: void QWidget::insertAction(QAction* before, QAction* action).

C++ documentation:

Inserts the action action to this widget's list of actions, before the action before. It appends the action if before is 0 or before is not a valid action for this widget.

A QWidget should only have one of each action.

See also removeAction(), addAction(), QMenu, contextMenuPolicy, and actions().

pub unsafe fn insert_actions(
    &self,
    before: impl CastInto<Ptr<QAction>>,
    actions: impl CastInto<Ref<QListOfQAction>>
)
[src]

Inserts the actions actions to this widget's list of actions, before the action before. It appends the action if before is 0 or before is not a valid action for this widget.

Calls C++ function: void QWidget::insertActions(QAction* before, QList<QAction*> actions).

C++ documentation:

Inserts the actions actions to this widget's list of actions, before the action before. It appends the action if before is 0 or before is not a valid action for this widget.

A QWidget can have at most one of each action.

See also removeAction(), QMenu, insertAction(), and contextMenuPolicy.

pub unsafe fn internal_win_id(&self) -> c_ulonglong[src]

Calls C++ function: unsigned long long QWidget::internalWinId() const.

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

This property holds whether this widget's window is the active window

Calls C++ function: bool QWidget::isActiveWindow() const.

C++ documentation:

This property holds whether this widget's window is the active window

The active window is the window that contains the widget that has keyboard focus (The window may still have focus if it has no widgets or none of its widgets accepts keyboard focus).

When popup windows are visible, this property is true for both the active window and for the popup.

By default, this property is false.

Access functions:

bool isActiveWindow() const

See also activateWindow() and QApplication::activeWindow().

pub unsafe fn is_ancestor_of(&self, child: impl CastInto<Ptr<QWidget>>) -> bool[src]

Returns true if this widget is a parent, (or grandparent and so on to any level), of the given child, and both widgets are within the same window; otherwise returns false.

Calls C++ function: bool QWidget::isAncestorOf(const QWidget* child) const.

C++ documentation:

Returns true if this widget is a parent, (or grandparent and so on to any level), of the given child, and both widgets are within the same window; otherwise returns false.

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

This property holds whether the widget is enabled

Calls C++ function: bool QWidget::isEnabled() const.

C++ documentation:

This property holds whether the widget is enabled

In general an enabled widget handles keyboard and mouse events; a disabled widget does not. An exception is made with QAbstractButton.

Some widgets display themselves differently when they are disabled. For example a button might draw its label grayed out. If your widget needs to know when it becomes enabled or disabled, you can use the changeEvent() with type QEvent::EnabledChange.

Disabling a widget implicitly disables all its children. Enabling respectively enables all child widgets unless they have been explicitly disabled. It it not possible to explicitly enable a child widget which is not a window while its parent widget remains disabled.

By default, this property is true.

Access functions:

bool isEnabled() const
void setEnabled(bool)

See also isEnabledTo(), QKeyEvent, QMouseEvent, and changeEvent().

pub unsafe fn is_enabled_to(&self, arg1: impl CastInto<Ptr<QWidget>>) -> bool[src]

Returns true if this widget would become enabled if ancestor is enabled; otherwise returns false.

Calls C++ function: bool QWidget::isEnabledTo(const QWidget* arg1) const.

C++ documentation:

Returns true if this widget would become enabled if ancestor is enabled; otherwise returns false.

This is the case if neither the widget itself nor every parent up to but excluding ancestor has been explicitly disabled.

isEnabledTo(0) returns false if this widget or any if its ancestors was explicitly disabled.

The word ancestor here means a parent widget within the same window.

Therefore isEnabledTo(0) stops at this widget's window, unlike isEnabled() which also takes parent windows into considerations.

See also setEnabled() and enabled.

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

This function is deprecated. It is equivalent to isEnabled()

Calls C++ function: bool QWidget::isEnabledToTLW() const.

C++ documentation:

This function is deprecated. It is equivalent to isEnabled()

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

This property holds whether the widget is shown in full screen mode

Calls C++ function: bool QWidget::isFullScreen() const.

C++ documentation:

This property holds whether the widget is shown in full screen mode

A widget in full screen mode occupies the whole screen area and does not display window decorations, such as a title bar.

By default, this property is false.

Access functions:

bool isFullScreen() const

See also windowState(), minimized, and maximized.

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

Returns true if the widget is hidden, otherwise returns false.

Calls C++ function: bool QWidget::isHidden() const.

C++ documentation:

Returns true if the widget is hidden, otherwise returns false.

A hidden widget will only become visible when show() is called on it. It will not be automatically shown when the parent is shown.

To check visibility, use !isVisible() instead (notice the exclamation mark).

isHidden() implies !isVisible(), but a widget can be not visible and not hidden at the same time. This is the case for widgets that are children of widgets that are not visible.

Widgets are hidden if:

  • they were created as independent windows,
  • they were created as children of visible widgets,
  • hide() or setVisible(false) was called.

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

Calls C++ function: bool QWidget::isLeftToRight() const.

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

This property holds whether this widget is maximized

Calls C++ function: bool QWidget::isMaximized() const.

C++ documentation:

This property holds whether this widget is maximized

This property is only relevant for windows.

Note: Due to limitations on some window systems, this does not always report the expected results (e.g., if the user on X11 maximizes the window via the window manager, Qt has no way of distinguishing this from any other resize). This is expected to improve as window manager protocols evolve.

By default, this property is false.

Access functions:

bool isMaximized() const

See also windowState(), showMaximized(), visible, show(), hide(), showNormal(), and minimized.

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

This property holds whether this widget is minimized (iconified)

Calls C++ function: bool QWidget::isMinimized() const.

C++ documentation:

This property holds whether this widget is minimized (iconified)

This property is only relevant for windows.

By default, this property is false.

Access functions:

bool isMinimized() const

See also showMinimized(), visible, show(), hide(), showNormal(), and maximized.

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

This property holds whether the widget is a modal widget

Calls C++ function: bool QWidget::isModal() const.

C++ documentation:

This property holds whether the widget is a modal widget

This property only makes sense for windows. A modal widget prevents widgets in all other windows from getting any input.

By default, this property is false.

Access functions:

bool isModal() const

See also isWindow(), windowModality, and QDialog.

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

Calls C++ function: bool QWidget::isRightToLeft() const.

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

Use isWindow() instead.

Calls C++ function: bool QWidget::isTopLevel() const.

C++ documentation:

Use isWindow() instead.

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

This property holds whether the widget is visible

Calls C++ function: bool QWidget::isVisible() const.

C++ documentation:

This property holds whether the widget is visible

Calling setVisible(true) or show() sets the widget to visible status if all its parent widgets up to the window are visible. If an ancestor is not visible, the widget won't become visible until all its ancestors are shown. If its size or position has changed, Qt guarantees that a widget gets move and resize events just before it is shown. If the widget has not been resized yet, Qt will adjust the widget's size to a useful default using adjustSize().

Calling setVisible(false) or hide() hides a widget explicitly. An explicitly hidden widget will never become visible, even if all its ancestors become visible, unless you show it.

A widget receives show and hide events when its visibility status changes. Between a hide and a show event, there is no need to waste CPU cycles preparing or displaying information to the user. A video application, for example, might simply stop generating new frames.

A widget that happens to be obscured by other windows on the screen is considered to be visible. The same applies to iconified windows and windows that exist on another virtual desktop (on platforms that support this concept). A widget receives spontaneous show and hide events when its mapping status is changed by the window system, e.g. a spontaneous hide event when the user minimizes the window, and a spontaneous show event when the window is restored again.

You almost never have to reimplement the setVisible() function. If you need to change some settings before a widget is shown, use showEvent() instead. If you need to do some delayed initialization use the Polish event delivered to the event() function.

Access functions:

bool isVisible() const
virtual void setVisible(bool visible)

See also show(), hide(), isHidden(), isVisibleTo(), isMinimized(), showEvent(), and hideEvent().

pub unsafe fn is_visible_to(&self, arg1: impl CastInto<Ptr<QWidget>>) -> bool[src]

Returns true if this widget would become visible if ancestor is shown; otherwise returns false.

Calls C++ function: bool QWidget::isVisibleTo(const QWidget* arg1) const.

C++ documentation:

Returns true if this widget would become visible if ancestor is shown; otherwise returns false.

The true case occurs if neither the widget itself nor any parent up to but excluding ancestor has been explicitly hidden.

This function will still return true if the widget is obscured by other windows on the screen, but could be physically visible if it or they were to be moved.

isVisibleTo(0) is identical to isVisible().

See also show(), hide(), and isVisible().

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

Returns true if the widget is an independent window, otherwise returns false.

Calls C++ function: bool QWidget::isWindow() const.

C++ documentation:

Returns true if the widget is an independent window, otherwise returns false.

A window is a widget that isn't visually the child of any other widget and that usually has a frame and a window title.

A window can have a parent widget. It will then be grouped with its parent and deleted when the parent is deleted, minimized when the parent is minimized etc. If supported by the window manager, it will also have a common taskbar entry with its parent.

QDialog and QMainWindow widgets are by default windows, even if a parent widget is specified in the constructor. This behavior is specified by the Qt::Window flag.

See also window(), isModal(), and parentWidget().

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

This property holds whether the document shown in the window has unsaved changes

Calls C++ function: bool QWidget::isWindowModified() const.

C++ documentation:

This property holds whether the document shown in the window has unsaved changes

A modified window is a window whose content has changed but has not been saved to disk. This flag will have different effects varied by the platform. On macOS the close button will have a modified look; on other platforms, the window title will have an '*' (asterisk).

The window title must contain a "[*]" placeholder, which indicates where the '*' should appear. Normally, it should appear right after the file name (e.g., "document1.txt[*] - Text Editor"). If the window isn't modified, the placeholder is simply removed.

Note that if a widget is set as modified, all its ancestors will also be set as modified. However, if you call setWindowModified(false) on a widget, this will not propagate to its parent because other children of the parent might have been modified.

Access functions:

bool isWindowModified() const
void setWindowModified(bool)

See also windowTitle, Application Example, SDI Example, and MDI Example.

pub unsafe fn layout(&self) -> QPtr<QLayout>[src]

Returns the layout manager that is installed on this widget, or 0 if no layout manager is installed.

Calls C++ function: QLayout* QWidget::layout() const.

C++ documentation:

Returns the layout manager that is installed on this widget, or 0 if no layout manager is installed.

The layout manager sets the geometry of the widget's children that have been added to the layout.

See also setLayout(), sizePolicy(), and Layout Management.

pub unsafe fn layout_direction(&self) -> LayoutDirection[src]

This property holds the layout direction for this widget

Calls C++ function: Qt::LayoutDirection QWidget::layoutDirection() const.

C++ documentation:

This property holds the layout direction for this widget

By default, this property is set to Qt::LeftToRight.

When the layout direction is set on a widget, it will propagate to the widget's children, but not to a child that is a window and not to a child for which setLayoutDirection() has been explicitly called. Also, child widgets added after setLayoutDirection() has been called for the parent do not inherit the parent's layout direction.

This method no longer affects text layout direction since Qt 4.7.

Access functions:

Qt::LayoutDirection layoutDirection() const
void setLayoutDirection(Qt::LayoutDirection direction)
void unsetLayoutDirection()

See also QApplication::layoutDirection.

pub unsafe fn locale(&self) -> CppBox<QLocale>[src]

This property holds the widget's locale

Calls C++ function: QLocale QWidget::locale() const.

C++ documentation:

This property holds the widget's locale

As long as no special locale has been set, this is either the parent's locale or (if this widget is a top level widget), the default locale.

If the widget displays dates or numbers, these should be formatted using the widget's locale.

This property was introduced in Qt 4.3.

Access functions:

QLocale locale() const
void setLocale(const QLocale &locale)
void unsetLocale()

See also QLocale and QLocale::setDefault().

pub unsafe fn lower(&self)[src]

Lowers the widget to the bottom of the parent widget's stack.

Calls C++ function: [slot] void QWidget::lower().

C++ documentation:

Lowers the widget to the bottom of the parent widget's stack.

After this call the widget will be visually behind (and therefore obscured by) any overlapping sibling widgets.

See also raise() and stackUnder().

pub unsafe fn map_from(
    &self,
    arg1: impl CastInto<Ptr<QWidget>>,
    arg2: impl CastInto<Ref<QPoint>>
) -> CppBox<QPoint>
[src]

Translates the widget coordinate pos from the coordinate system of parent to this widget's coordinate system. The parent must not be 0 and must be a parent of the calling widget.

Calls C++ function: QPoint QWidget::mapFrom(const QWidget* arg1, const QPoint& arg2) const.

C++ documentation:

Translates the widget coordinate pos from the coordinate system of parent to this widget's coordinate system. The parent must not be 0 and must be a parent of the calling widget.

See also mapTo(), mapFromParent(), mapFromGlobal(), and underMouse().

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

Translates the global screen coordinate pos to widget coordinates.

Calls C++ function: QPoint QWidget::mapFromGlobal(const QPoint& arg1) const.

C++ documentation:

Translates the global screen coordinate pos to widget coordinates.

See also mapToGlobal(), mapFrom(), and mapFromParent().

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

Translates the parent widget coordinate pos to widget coordinates.

Calls C++ function: QPoint QWidget::mapFromParent(const QPoint& arg1) const.

C++ documentation:

Translates the parent widget coordinate pos to widget coordinates.

Same as mapFromGlobal() if the widget has no parent.

See also mapToParent(), mapFrom(), mapFromGlobal(), and underMouse().

pub unsafe fn map_to(
    &self,
    arg1: impl CastInto<Ptr<QWidget>>,
    arg2: impl CastInto<Ref<QPoint>>
) -> CppBox<QPoint>
[src]

Translates the widget coordinate pos to the coordinate system of parent. The parent must not be 0 and must be a parent of the calling widget.

Calls C++ function: QPoint QWidget::mapTo(const QWidget* arg1, const QPoint& arg2) const.

C++ documentation:

Translates the widget coordinate pos to the coordinate system of parent. The parent must not be 0 and must be a parent of the calling widget.

See also mapFrom(), mapToParent(), mapToGlobal(), and underMouse().

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

Translates the widget coordinate pos to global screen coordinates. For example, mapToGlobal(QPoint(0,0)) would give the global coordinates of the top-left pixel of the widget.

Calls C++ function: QPoint QWidget::mapToGlobal(const QPoint& arg1) const.

C++ documentation:

Translates the widget coordinate pos to global screen coordinates. For example, mapToGlobal(QPoint(0,0)) would give the global coordinates of the top-left pixel of the widget.

See also mapFromGlobal(), mapTo(), and mapToParent().

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

Translates the widget coordinate pos to a coordinate in the parent widget.

Calls C++ function: QPoint QWidget::mapToParent(const QPoint& arg1) const.

C++ documentation:

Translates the widget coordinate pos to a coordinate in the parent widget.

Same as mapToGlobal() if the widget has no parent.

See also mapFromParent(), mapTo(), mapToGlobal(), and underMouse().

pub unsafe fn mask(&self) -> CppBox<QRegion>[src]

Returns the mask currently set on a widget. If no mask is set the return value will be an empty region.

Calls C++ function: QRegion QWidget::mask() const.

C++ documentation:

Returns the mask currently set on a widget. If no mask is set the return value will be an empty region.

See also setMask(), clearMask(), QRegion::isEmpty(), and Shaped Clock Example.

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

This property holds the widget's maximum height in pixels

Calls C++ function: int QWidget::maximumHeight() const.

C++ documentation:

This property holds the widget's maximum height in pixels

This property corresponds to the height held by the maximumSize property.

By default, this property contains a value of 16777215.

Note: The definition of the QWIDGETSIZE_MAX macro limits the maximum size of widgets.

Access functions:

int maximumHeight() const
void setMaximumHeight(int maxh)

See also maximumSize and maximumWidth.

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

This property holds the widget's maximum size in pixels

Calls C++ function: QSize QWidget::maximumSize() const.

C++ documentation:

This property holds the widget's maximum size in pixels

The widget cannot be resized to a larger size than the maximum widget size.

By default, this property contains a size in which both width and height have values of 16777215.

Note: The definition of the QWIDGETSIZE_MAX macro limits the maximum size of widgets.

Access functions:

QSize maximumSize() const
void setMaximumSize(const QSize &)
void setMaximumSize(int maxw, int maxh)

See also maximumWidth, maximumHeight, minimumSize, and sizeIncrement.

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

This property holds the widget's maximum width in pixels

Calls C++ function: int QWidget::maximumWidth() const.

C++ documentation:

This property holds the widget's maximum width in pixels

This property corresponds to the width held by the maximumSize property.

By default, this property contains a value of 16777215.

Note: The definition of the QWIDGETSIZE_MAX macro limits the maximum size of widgets.

Access functions:

int maximumWidth() const
void setMaximumWidth(int maxw)

See also maximumSize and maximumHeight.

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

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

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

This property holds the widget's minimum height in pixels

Calls C++ function: int QWidget::minimumHeight() const.

C++ documentation:

This property holds the widget's minimum height in pixels

This property corresponds to the height held by the minimumSize property.

By default, this property has a value of 0.

Access functions:

int minimumHeight() const
void setMinimumHeight(int minh)

See also minimumSize and minimumWidth.

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

This property holds the widget's minimum size

Calls C++ function: QSize QWidget::minimumSize() const.

C++ documentation:

This property holds the widget's minimum size

The widget cannot be resized to a smaller size than the minimum widget size. The widget's size is forced to the minimum size if the current size is smaller.

The minimum size set by this function will override the minimum size defined by QLayout. In order to unset the minimum size, use a value of QSize(0, 0).

By default, this property contains a size with zero width and height.

Access functions:

QSize minimumSize() const
void setMinimumSize(const QSize &)
void setMinimumSize(int minw, int minh)

See also minimumWidth, minimumHeight, maximumSize, and sizeIncrement.

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

This property holds the recommended minimum size for the widget

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

C++ documentation:

This property holds the recommended minimum size for the widget

If the value of this property is an invalid size, no minimum size is recommended.

The default implementation of minimumSizeHint() returns an invalid size if there is no layout for this widget, and returns the layout's minimum size otherwise. Most built-in widgets reimplement minimumSizeHint().

QLayout will never resize a widget to a size smaller than the minimum size hint unless minimumSize() is set or the size policy is set to QSizePolicy::Ignore. If minimumSize() is set, the minimum size hint will be ignored.

Access functions:

virtual QSize minimumSizeHint() const

See also QSize::isValid(), resize(), setMinimumSize(), and sizePolicy().

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

This property holds the widget's minimum width in pixels

Calls C++ function: int QWidget::minimumWidth() const.

C++ documentation:

This property holds the widget's minimum width in pixels

This property corresponds to the width held by the minimumSize property.

By default, this property has a value of 0.

Access functions:

int minimumWidth() const
void setMinimumWidth(int minw)

See also minimumSize and minimumHeight.

pub unsafe fn move_2a(&self, x: c_int, y: c_int)[src]

This property holds the position of the widget within its parent widget

Calls C++ function: void QWidget::move(int x, int y).

C++ documentation:

This property holds the position of the widget within its parent widget

If the widget is a window, the position is that of the widget on the desktop, including its frame.

When changing the position, the widget, if visible, receives a move event (moveEvent()) immediately. If the widget is not currently visible, it is guaranteed to receive an event before it is shown.

By default, this property contains a position that refers to the origin.

Warning: Calling move() or setGeometry() inside moveEvent() can lead to infinite recursion.

See the Window Geometry documentation for an overview of geometry issues with windows.

Access functions:

QPoint pos() const
void move(int x, int y)
void move(const QPoint &)

See also frameGeometry, size, x(), and y().

pub unsafe fn move_1a(&self, arg1: impl CastInto<Ref<QPoint>>)[src]

This property holds the position of the widget within its parent widget

Calls C++ function: void QWidget::move(const QPoint& arg1).

C++ documentation:

This property holds the position of the widget within its parent widget

If the widget is a window, the position is that of the widget on the desktop, including its frame.

When changing the position, the widget, if visible, receives a move event (moveEvent()) immediately. If the widget is not currently visible, it is guaranteed to receive an event before it is shown.

By default, this property contains a position that refers to the origin.

Warning: Calling move() or setGeometry() inside moveEvent() can lead to infinite recursion.

See the Window Geometry documentation for an overview of geometry issues with windows.

Access functions:

QPoint pos() const
void move(int x, int y)
void move(const QPoint &)

See also frameGeometry, size, x(), and y().

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

Returns the native parent for this widget, i.e. the next ancestor widget that has a system identifier, or 0 if it does not have any native parent.

Calls C++ function: QWidget* QWidget::nativeParentWidget() const.

C++ documentation:

Returns the native parent for this widget, i.e. the next ancestor widget that has a system identifier, or 0 if it does not have any native parent.

This function was introduced in Qt 4.4.

See also effectiveWinId().

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

Returns the next widget in this widget's focus chain.

Calls C++ function: QWidget* QWidget::nextInFocusChain() const.

C++ documentation:

Returns the next widget in this widget's focus chain.

See also previousInFocusChain().

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

This property holds the geometry of the widget as it will appear when shown as a normal (not maximized or full screen) top-level widget

Calls C++ function: QRect QWidget::normalGeometry() const.

C++ documentation:

This property holds the geometry of the widget as it will appear when shown as a normal (not maximized or full screen) top-level widget

For child widgets this property always holds an empty rectangle.

By default, this property contains an empty rectangle.

Access functions:

QRect normalGeometry() const

See also QWidget::windowState() and QWidget::geometry.

pub unsafe fn override_window_flags(&self, type_: QFlags<WindowType>)[src]

Sets the window flags for the widget to flags, without telling the window system.

Calls C++ function: void QWidget::overrideWindowFlags(QFlags<Qt::WindowType> type).

C++ documentation:

Sets the window flags for the widget to flags, without telling the window system.

Warning: Do not call this function unless you really know what you're doing.

See also setWindowFlags().

pub unsafe fn override_window_state(&self, state: QFlags<WindowState>)[src]

Calls C++ function: void QWidget::overrideWindowState(QFlags<Qt::WindowState> state).

pub unsafe fn paint_engine(&self) -> Ptr<QPaintEngine>[src]

Reimplemented from QPaintDevice::paintEngine().

Calls C++ function: virtual QPaintEngine* QWidget::paintEngine() const.

C++ documentation:

Reimplemented from QPaintDevice::paintEngine().

Returns the widget's paint engine.

Note that this function should not be called explicitly by the user, since it's meant for reimplementation purposes only. The function is called by Qt internally, and the default implementation may not always return a valid pointer.

pub unsafe fn palette(&self) -> Ref<QPalette>[src]

This property holds the widget's palette

Calls C++ function: const QPalette& QWidget::palette() const.

C++ documentation:

This property holds the widget's palette

This property describes the widget's palette. The palette is used by the widget's style when rendering standard components, and is available as a means to ensure that custom widgets can maintain consistency with the native platform's look and feel. It's common that different platforms, or different styles, have different palettes.

When you assign a new palette to a widget, the color roles from this palette are combined with the widget's default palette to form the widget's final palette. The palette entry for the widget's background role is used to fill the widget's background (see QWidget::autoFillBackground), and the foreground role initializes QPainter's pen.

The default depends on the system environment. QApplication maintains a system/theme palette which serves as a default for all widgets. There may also be special palette defaults for certain types of widgets (e.g., on Windows XP and Vista, all classes that derive from QMenuBar have a special default palette). You can also define default palettes for widgets yourself by passing a custom palette and the name of a widget to QApplication::setPalette(). Finally, the style always has the option of polishing the palette as it's assigned (see QStyle::polish()).

QWidget propagates explicit palette roles from parent to child. If you assign a brush or color to a specific role on a palette and assign that palette to a widget, that role will propagate to all the widget's children, overriding any system defaults for that role. Note that palettes by default don't propagate to windows (see isWindow()) unless the Qt::WA_WindowPropagation attribute is enabled.

QWidget's palette propagation is similar to its font propagation.

The current style, which is used to render the content of all standard Qt widgets, is free to choose colors and brushes from the widget palette, or in some cases, to ignore the palette (partially, or completely). In particular, certain styles like GTK style, Mac style, Windows XP, and Vista style, depend on third party APIs to render the content of widgets, and these styles typically do not follow the palette. Because of this, assigning roles to a widget's palette is not guaranteed to change the appearance of the widget. Instead, you may choose to apply a styleSheet. You can refer to our Knowledge Base article here for more information.

Warning: Do not use this function in conjunction with Qt Style Sheets. When using style sheets, the palette of a widget can be customized using the "color", "background-color", "selection-color", "selection-background-color" and "alternate-background-color".

Access functions:

const QPalette &palette() const
void setPalette(const QPalette &)

See also QApplication::palette() and QWidget::font().

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

Returns the parent of this widget, or 0 if it does not have any parent widget.

Calls C++ function: QWidget* QWidget::parentWidget() const.

C++ documentation:

Returns the parent of this widget, or 0 if it does not have any parent widget.

pub unsafe fn pos(&self) -> CppBox<QPoint>[src]

This property holds the position of the widget within its parent widget

Calls C++ function: QPoint QWidget::pos() const.

C++ documentation:

This property holds the position of the widget within its parent widget

If the widget is a window, the position is that of the widget on the desktop, including its frame.

When changing the position, the widget, if visible, receives a move event (moveEvent()) immediately. If the widget is not currently visible, it is guaranteed to receive an event before it is shown.

By default, this property contains a position that refers to the origin.

Warning: Calling move() or setGeometry() inside moveEvent() can lead to infinite recursion.

See the Window Geometry documentation for an overview of geometry issues with windows.

Access functions:

QPoint pos() const
void move(int x, int y)
void move(const QPoint &)

See also frameGeometry, size, x(), and y().

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

The previousInFocusChain function returns the previous widget in this widget's focus chain.

Calls C++ function: QWidget* QWidget::previousInFocusChain() const.

C++ documentation:

The previousInFocusChain function returns the previous widget in this widget's focus chain.

This function was introduced in Qt 4.6.

See also nextInFocusChain().

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

Calls C++ function: virtual int QWidget::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* QWidget::qt_metacast(const char* arg1).

pub unsafe fn raise(&self)[src]

Raises this widget to the top of the parent widget's stack.

Calls C++ function: [slot] void QWidget::raise().

C++ documentation:

Raises this widget to the top of the parent widget's stack.

After this call the widget will be visually in front of any overlapping sibling widgets.

Note: When using activateWindow(), you can call this function to ensure that the window is stacked on top.

See also lower() and stackUnder().

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

This property holds the internal geometry of the widget excluding any window frame

Calls C++ function: QRect QWidget::rect() const.

C++ documentation:

This property holds the internal geometry of the widget excluding any window frame

The rect property equals QRect(0, 0, width(), height()).

See the Window Geometry documentation for an overview of geometry issues with windows.

By default, this property contains a value that depends on the user's platform and screen geometry.

Access functions:

QRect rect() const

See also size.

pub unsafe fn release_keyboard(&self)[src]

Releases the keyboard grab.

Calls C++ function: void QWidget::releaseKeyboard().

C++ documentation:

Releases the keyboard grab.

See also grabKeyboard(), grabMouse(), and releaseMouse().

pub unsafe fn release_mouse(&self)[src]

Releases the mouse grab.

Calls C++ function: void QWidget::releaseMouse().

C++ documentation:

Releases the mouse grab.

See also grabMouse(), grabKeyboard(), and releaseKeyboard().

pub unsafe fn release_shortcut(&self, id: c_int)[src]

Removes the shortcut with the given id from Qt's shortcut system. The widget will no longer receive QEvent::Shortcut events for the shortcut's key sequence (unless it has other shortcuts with the same key sequence).

Calls C++ function: void QWidget::releaseShortcut(int id).

C++ documentation:

Removes the shortcut with the given id from Qt's shortcut system. The widget will no longer receive QEvent::Shortcut events for the shortcut's key sequence (unless it has other shortcuts with the same key sequence).

Warning: You should not normally need to use this function since Qt's shortcut system removes shortcuts automatically when their parent widget is destroyed. It is best to use QAction or QShortcut to handle shortcuts, since they are easier to use than this low-level function. Note also that this is an expensive operation.

See also grabShortcut() and setShortcutEnabled().

pub unsafe fn remove_action(&self, action: impl CastInto<Ptr<QAction>>)[src]

Removes the action action from this widget's list of actions.

Calls C++ function: void QWidget::removeAction(QAction* action).

C++ documentation:

Removes the action action from this widget's list of actions.

See also insertAction(), actions(), and insertAction().

pub unsafe fn render_q_paint_device_q_point_q_region_q_flags_render_flag(
    &self,
    target: impl CastInto<Ptr<QPaintDevice>>,
    target_offset: impl CastInto<Ref<QPoint>>,
    source_region: impl CastInto<Ref<QRegion>>,
    render_flags: QFlags<RenderFlag>
)
[src]

Renders the sourceRegion of this widget into the target using renderFlags to determine how to render. Rendering starts at targetOffset in the target. For example:

Calls C++ function: void QWidget::render(QPaintDevice* target, const QPoint& targetOffset = …, const QRegion& sourceRegion = …, QFlags<QWidget::RenderFlag> renderFlags = …).

C++ documentation:

Renders the sourceRegion of this widget into the target using renderFlags to determine how to render. Rendering starts at targetOffset in the target. For example:


  QPixmap pixmap(widget->size());
  widget->render(&pixmap);

If sourceRegion is a null region, this function will use QWidget::rect() as the region, i.e. the entire widget.

Ensure that you call QPainter::end() for the target device's active painter (if any) before rendering. For example:

QPainter painter(this); ... painter.end(); myWidget->render(this);

Note: To obtain the contents of a QOpenGLWidget, use QOpenGLWidget::grabFramebuffer() instead.

Note: To obtain the contents of a QGLWidget (deprecated), use QGLWidget::grabFrameBuffer() or QGLWidget::renderPixmap() instead.

This function was introduced in Qt 4.3.

pub unsafe fn render_q_painter_q_point_q_region_q_flags_render_flag(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    target_offset: impl CastInto<Ref<QPoint>>,
    source_region: impl CastInto<Ref<QRegion>>,
    render_flags: QFlags<RenderFlag>
)
[src]

This is an overloaded function.

Calls C++ function: void QWidget::render(QPainter* painter, const QPoint& targetOffset = …, const QRegion& sourceRegion = …, QFlags<QWidget::RenderFlag> renderFlags = …).

C++ documentation:

This is an overloaded function.

Renders the widget into the painter's QPainter::device().

Transformations and settings applied to the painter will be used when rendering.

Note: The painter must be active. On macOS the widget will be rendered into a QPixmap and then drawn by the painter.

See also QPainter::device().

pub unsafe fn render_q_paint_device_q_point_q_region(
    &self,
    target: impl CastInto<Ptr<QPaintDevice>>,
    target_offset: impl CastInto<Ref<QPoint>>,
    source_region: impl CastInto<Ref<QRegion>>
)
[src]

Renders the sourceRegion of this widget into the target using renderFlags to determine how to render. Rendering starts at targetOffset in the target. For example:

Calls C++ function: void QWidget::render(QPaintDevice* target, const QPoint& targetOffset = …, const QRegion& sourceRegion = …).

C++ documentation:

Renders the sourceRegion of this widget into the target using renderFlags to determine how to render. Rendering starts at targetOffset in the target. For example:


  QPixmap pixmap(widget->size());
  widget->render(&pixmap);

If sourceRegion is a null region, this function will use QWidget::rect() as the region, i.e. the entire widget.

Ensure that you call QPainter::end() for the target device's active painter (if any) before rendering. For example:

QPainter painter(this); ... painter.end(); myWidget->render(this);

Note: To obtain the contents of a QOpenGLWidget, use QOpenGLWidget::grabFramebuffer() instead.

Note: To obtain the contents of a QGLWidget (deprecated), use QGLWidget::grabFrameBuffer() or QGLWidget::renderPixmap() instead.

This function was introduced in Qt 4.3.

pub unsafe fn render_q_paint_device_q_point(
    &self,
    target: impl CastInto<Ptr<QPaintDevice>>,
    target_offset: impl CastInto<Ref<QPoint>>
)
[src]

Renders the sourceRegion of this widget into the target using renderFlags to determine how to render. Rendering starts at targetOffset in the target. For example:

Calls C++ function: void QWidget::render(QPaintDevice* target, const QPoint& targetOffset = …).

C++ documentation:

Renders the sourceRegion of this widget into the target using renderFlags to determine how to render. Rendering starts at targetOffset in the target. For example:


  QPixmap pixmap(widget->size());
  widget->render(&pixmap);

If sourceRegion is a null region, this function will use QWidget::rect() as the region, i.e. the entire widget.

Ensure that you call QPainter::end() for the target device's active painter (if any) before rendering. For example:

QPainter painter(this); ... painter.end(); myWidget->render(this);

Note: To obtain the contents of a QOpenGLWidget, use QOpenGLWidget::grabFramebuffer() instead.

Note: To obtain the contents of a QGLWidget (deprecated), use QGLWidget::grabFrameBuffer() or QGLWidget::renderPixmap() instead.

This function was introduced in Qt 4.3.

pub unsafe fn render_q_paint_device(
    &self,
    target: impl CastInto<Ptr<QPaintDevice>>
)
[src]

Renders the sourceRegion of this widget into the target using renderFlags to determine how to render. Rendering starts at targetOffset in the target. For example:

Calls C++ function: void QWidget::render(QPaintDevice* target).

C++ documentation:

Renders the sourceRegion of this widget into the target using renderFlags to determine how to render. Rendering starts at targetOffset in the target. For example:


  QPixmap pixmap(widget->size());
  widget->render(&pixmap);

If sourceRegion is a null region, this function will use QWidget::rect() as the region, i.e. the entire widget.

Ensure that you call QPainter::end() for the target device's active painter (if any) before rendering. For example:

QPainter painter(this); ... painter.end(); myWidget->render(this);

Note: To obtain the contents of a QOpenGLWidget, use QOpenGLWidget::grabFramebuffer() instead.

Note: To obtain the contents of a QGLWidget (deprecated), use QGLWidget::grabFrameBuffer() or QGLWidget::renderPixmap() instead.

This function was introduced in Qt 4.3.

pub unsafe fn render_q_painter_q_point_q_region(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    target_offset: impl CastInto<Ref<QPoint>>,
    source_region: impl CastInto<Ref<QRegion>>
)
[src]

This is an overloaded function.

Calls C++ function: void QWidget::render(QPainter* painter, const QPoint& targetOffset = …, const QRegion& sourceRegion = …).

C++ documentation:

This is an overloaded function.

Renders the widget into the painter's QPainter::device().

Transformations and settings applied to the painter will be used when rendering.

Note: The painter must be active. On macOS the widget will be rendered into a QPixmap and then drawn by the painter.

See also QPainter::device().

pub unsafe fn render_q_painter_q_point(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    target_offset: impl CastInto<Ref<QPoint>>
)
[src]

This is an overloaded function.

Calls C++ function: void QWidget::render(QPainter* painter, const QPoint& targetOffset = …).

C++ documentation:

This is an overloaded function.

Renders the widget into the painter's QPainter::device().

Transformations and settings applied to the painter will be used when rendering.

Note: The painter must be active. On macOS the widget will be rendered into a QPixmap and then drawn by the painter.

See also QPainter::device().

pub unsafe fn render_q_painter(&self, painter: impl CastInto<Ptr<QPainter>>)[src]

This is an overloaded function.

Calls C++ function: void QWidget::render(QPainter* painter).

C++ documentation:

This is an overloaded function.

Renders the widget into the painter's QPainter::device().

Transformations and settings applied to the painter will be used when rendering.

Note: The painter must be active. On macOS the widget will be rendered into a QPixmap and then drawn by the painter.

See also QPainter::device().

pub unsafe fn repaint(&self)[src]

Repaints the widget directly by calling paintEvent() immediately, unless updates are disabled or the widget is hidden.

Calls C++ function: [slot] void QWidget::repaint().

C++ documentation:

Repaints the widget directly by calling paintEvent() immediately, unless updates are disabled or the widget is hidden.

We suggest only using repaint() if you need an immediate repaint, for example during animation. In almost all circumstances update() is better, as it permits Qt to optimize for speed and minimize flicker.

Warning: If you call repaint() in a function which may itself be called from paintEvent(), you may get infinite recursion. The update() function never causes recursion.

See also update(), paintEvent(), and setUpdatesEnabled().

pub unsafe fn repaint_4_int(&self, x: c_int, y: c_int, w: c_int, h: c_int)[src]

This is an overloaded function.

Calls C++ function: void QWidget::repaint(int x, int y, int w, int h).

C++ documentation:

This is an overloaded function.

This version repaints a rectangle (x, y, w, h) inside the widget.

If w is negative, it is replaced with width() - x, and if h is negative, it is replaced width height() - y.

pub unsafe fn repaint_q_rect(&self, arg1: impl CastInto<Ref<QRect>>)[src]

This is an overloaded function.

Calls C++ function: void QWidget::repaint(const QRect& arg1).

C++ documentation:

This is an overloaded function.

This version repaints a rectangle rect inside the widget.

pub unsafe fn repaint_q_region(&self, arg1: impl CastInto<Ref<QRegion>>)[src]

This is an overloaded function.

Calls C++ function: void QWidget::repaint(const QRegion& arg1).

C++ documentation:

This is an overloaded function.

This version repaints a region rgn inside the widget.

pub unsafe fn resize_2a(&self, w: c_int, h: c_int)[src]

This property holds the size of the widget excluding any window frame

Calls C++ function: void QWidget::resize(int w, int h).

C++ documentation:

This property holds the size of the widget excluding any window frame

If the widget is visible when it is being resized, it receives a resize event (resizeEvent()) immediately. If the widget is not currently visible, it is guaranteed to receive an event before it is shown.

The size is adjusted if it lies outside the range defined by minimumSize() and maximumSize().

By default, this property contains a value that depends on the user's platform and screen geometry.

Warning: Calling resize() or setGeometry() inside resizeEvent() can lead to infinite recursion.

Note: Setting the size to QSize(0, 0) will cause the widget to not appear on screen. This also applies to windows.

Access functions:

QSize size() const
void resize(int w, int h)
void resize(const QSize &)

See also pos, geometry, minimumSize, maximumSize, resizeEvent(), and adjustSize().

pub unsafe fn resize_1a(&self, arg1: impl CastInto<Ref<QSize>>)[src]

This property holds the size of the widget excluding any window frame

Calls C++ function: void QWidget::resize(const QSize& arg1).

C++ documentation:

This property holds the size of the widget excluding any window frame

If the widget is visible when it is being resized, it receives a resize event (resizeEvent()) immediately. If the widget is not currently visible, it is guaranteed to receive an event before it is shown.

The size is adjusted if it lies outside the range defined by minimumSize() and maximumSize().

By default, this property contains a value that depends on the user's platform and screen geometry.

Warning: Calling resize() or setGeometry() inside resizeEvent() can lead to infinite recursion.

Note: Setting the size to QSize(0, 0) will cause the widget to not appear on screen. This also applies to windows.

Access functions:

QSize size() const
void resize(int w, int h)
void resize(const QSize &)

See also pos, geometry, minimumSize, maximumSize, resizeEvent(), and adjustSize().

pub unsafe fn restore_geometry(
    &self,
    geometry: impl CastInto<Ref<QByteArray>>
) -> bool
[src]

Restores the geometry and state of top-level widgets stored in the byte array geometry. Returns true on success; otherwise returns false.

Calls C++ function: bool QWidget::restoreGeometry(const QByteArray& geometry).

C++ documentation:

Restores the geometry and state of top-level widgets stored in the byte array geometry. Returns true on success; otherwise returns false.

If the restored geometry is off-screen, it will be modified to be inside the available screen geometry.

To restore geometry saved using QSettings, you can use code like this:

QSettings settings("MyCompany", "MyApp"); myWidget->restoreGeometry(settings.value("myWidget/geometry").toByteArray());

See the Window Geometry documentation for an overview of geometry issues with windows.

Use QMainWindow::restoreState() to restore the geometry and the state of toolbars and dock widgets.

This function was introduced in Qt 4.2.

See also saveGeometry(), QSettings, QMainWindow::saveState(), and QMainWindow::restoreState().

pub unsafe fn save_geometry(&self) -> CppBox<QByteArray>[src]

Saves the current geometry and state for top-level widgets.

Calls C++ function: QByteArray QWidget::saveGeometry() const.

C++ documentation:

Saves the current geometry and state for top-level widgets.

To save the geometry when the window closes, you can implement a close event like this:

void MyWidget::closeEvent(QCloseEvent *event) { QSettings settings("MyCompany", "MyApp"); settings.setValue("geometry", saveGeometry()); QWidget::closeEvent(event); }

See the Window Geometry documentation for an overview of geometry issues with windows.

Use QMainWindow::saveState() to save the geometry and the state of toolbars and dock widgets.

This function was introduced in Qt 4.2.

See also restoreGeometry(), QMainWindow::saveState(), and QMainWindow::restoreState().

pub unsafe fn screen(&self) -> QPtr<QScreen>[src]

This is supported on cpp_lib_version="5.14.0" only.

Returns the screen the widget is on.

Calls C++ function: QScreen* QWidget::screen() const.

C++ documentation:

Returns the screen the widget is on.

This function was introduced in Qt 5.14.

See also windowHandle().

pub unsafe fn scroll_2a(&self, dx: c_int, dy: c_int)[src]

Scrolls the widget including its children dx pixels to the right and dy downward. Both dx and dy may be negative.

Calls C++ function: void QWidget::scroll(int dx, int dy).

C++ documentation:

Scrolls the widget including its children dx pixels to the right and dy downward. Both dx and dy may be negative.

After scrolling, the widgets will receive paint events for the areas that need to be repainted. For widgets that Qt knows to be opaque, this is only the newly exposed parts. For example, if an opaque widget is scrolled 8 pixels to the left, only an 8-pixel wide stripe at the right edge needs updating.

Since widgets propagate the contents of their parents by default, you need to set the autoFillBackground property, or use setAttribute() to set the Qt::WA_OpaquePaintEvent attribute, to make a widget opaque.

For widgets that use contents propagation, a scroll will cause an update of the entire scroll area.

See also Transparency and Double Buffering.

pub unsafe fn scroll_3a(
    &self,
    dx: c_int,
    dy: c_int,
    arg3: impl CastInto<Ref<QRect>>
)
[src]

This is an overloaded function.

Calls C++ function: void QWidget::scroll(int dx, int dy, const QRect& arg3).

C++ documentation:

This is an overloaded function.

This version only scrolls r and does not move the children of the widget.

If r is empty or invalid, the result is undefined.

See also QScrollArea.

pub unsafe fn set_accept_drops(&self, on: bool)[src]

This property holds whether drop events are enabled for this widget

Calls C++ function: void QWidget::setAcceptDrops(bool on).

C++ documentation:

This property holds whether drop events are enabled for this widget

Setting this property to true announces to the system that this widget may be able to accept drop events.

If the widget is the desktop (windowType() == Qt::Desktop), this may fail if another application is using the desktop; you can call acceptDrops() to test if this occurs.

Warning: Do not modify this property in a drag and drop event handler.

By default, this property is false.

Access functions:

bool acceptDrops() const
void setAcceptDrops(bool on)

See also Drag and Drop.

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

This property holds the widget's description as seen by assistive technologies

Calls C++ function: void QWidget::setAccessibleDescription(const QString& description).

C++ documentation:

This property holds the widget's description as seen by assistive technologies

The accessible description of a widget should convey what a widget does. While the accessibleName should be a short and consise string (e.g. Save), the description should give more context, such as Saves the current document.

This property has to be localized.

By default, this property contains an empty string and Qt falls back to using the tool tip to provide this information.

Access functions:

QString accessibleDescription() const
void setAccessibleDescription(const QString &description)

See also QWidget::accessibleName and QAccessibleInterface::text().

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

This property holds the widget's name as seen by assistive technologies

Calls C++ function: void QWidget::setAccessibleName(const QString& name).

C++ documentation:

This property holds the widget's name as seen by assistive technologies

This is the primary name by which assistive technology such as screen readers announce this widget. For most widgets setting this property is not required. For example for QPushButton the button's text will be used.

It is important to set this property when the widget does not provide any text. For example a button that only contains an icon needs to set this property to work with screen readers. The name should be short and equivalent to the visual information conveyed by the widget.

This property has to be localized.

By default, this property contains an empty string.

Access functions:

QString accessibleName() const
void setAccessibleName(const QString &name)

See also QWidget::accessibleDescription and QAccessibleInterface::text().

pub unsafe fn set_attribute_2a(&self, arg1: WidgetAttribute, on: bool)[src]

Sets the attribute attribute on this widget if on is true; otherwise clears the attribute.

Calls C++ function: void QWidget::setAttribute(Qt::WidgetAttribute arg1, bool on = …).

C++ documentation:

Sets the attribute attribute on this widget if on is true; otherwise clears the attribute.

See also testAttribute().

pub unsafe fn set_attribute_1a(&self, arg1: WidgetAttribute)[src]

Sets the attribute attribute on this widget if on is true; otherwise clears the attribute.

Calls C++ function: void QWidget::setAttribute(Qt::WidgetAttribute arg1).

C++ documentation:

Sets the attribute attribute on this widget if on is true; otherwise clears the attribute.

See also testAttribute().

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

This property holds whether the widget background is filled automatically

Calls C++ function: void QWidget::setAutoFillBackground(bool enabled).

C++ documentation:

This property holds whether the widget background is filled automatically

If enabled, this property will cause Qt to fill the background of the widget before invoking the paint event. The color used is defined by the QPalette::Window color role from the widget's palette.

In addition, Windows are always filled with QPalette::Window, unless the WA_OpaquePaintEvent or WA_NoSystemBackground attributes are set.

This property cannot be turned off (i.e., set to false) if a widget's parent has a static gradient for its background.

Warning: Use this property with caution in conjunction with Qt Style Sheets. When a widget has a style sheet with a valid background or a border-image, this property is automatically disabled.

By default, this property is false.

This property was introduced in Qt 4.1.

Access functions:

bool autoFillBackground() const
void setAutoFillBackground(bool enabled)

See also Qt::WA_OpaquePaintEvent, Qt::WA_NoSystemBackground, and Transparency and Double Buffering.

pub unsafe fn set_background_role(&self, arg1: ColorRole)[src]

Sets the background role of the widget to role.

Calls C++ function: void QWidget::setBackgroundRole(QPalette::ColorRole arg1).

C++ documentation:

Sets the background role of the widget to role.

The background role defines the brush from the widget's palette that is used to render the background.

If role is QPalette::NoRole, then the widget inherits its parent's background role.

Note that styles are free to choose any color from the palette. You can modify the palette or set a style sheet if you don't achieve the result you want with setBackgroundRole().

See also backgroundRole() and foregroundRole().

pub unsafe fn set_base_size_1a(&self, arg1: impl CastInto<Ref<QSize>>)[src]

This property holds the base size of the widget

Calls C++ function: void QWidget::setBaseSize(const QSize& arg1).

C++ documentation:

This property holds the base size of the widget

The base size is used to calculate a proper widget size if the widget defines sizeIncrement().

By default, for a newly-created widget, this property contains a size with zero width and height.

Access functions:

QSize baseSize() const
void setBaseSize(const QSize &)
void setBaseSize(int basew, int baseh)

See also setSizeIncrement().

pub unsafe fn set_base_size_2a(&self, basew: c_int, baseh: c_int)[src]

This property holds the base size of the widget

Calls C++ function: void QWidget::setBaseSize(int basew, int baseh).

C++ documentation:

This property holds the base size of the widget

The base size is used to calculate a proper widget size if the widget defines sizeIncrement().

By default, for a newly-created widget, this property contains a size with zero width and height.

Access functions:

QSize baseSize() const
void setBaseSize(const QSize &)
void setBaseSize(int basew, int baseh)

See also setSizeIncrement().

pub unsafe fn set_contents_margins_4a(
    &self,
    left: c_int,
    top: c_int,
    right: c_int,
    bottom: c_int
)
[src]

Sets the margins around the contents of the widget to have the sizes left, top, right, and bottom. The margins are used by the layout system, and may be used by subclasses to specify the area to draw in (e.g. excluding the frame).

Calls C++ function: void QWidget::setContentsMargins(int left, int top, int right, int bottom).

C++ documentation:

Sets the margins around the contents of the widget to have the sizes left, top, right, and bottom. The margins are used by the layout system, and may be used by subclasses to specify the area to draw in (e.g. excluding the frame).

Changing the margins will trigger a resizeEvent().

See also contentsMargins(), contentsRect(), and getContentsMargins().

pub unsafe fn set_contents_margins_1a(
    &self,
    margins: impl CastInto<Ref<QMargins>>
)
[src]

This is an overloaded function.

Calls C++ function: void QWidget::setContentsMargins(const QMargins& margins).

C++ documentation:

This is an overloaded function.

The setContentsMargins function sets the margins around the widget's contents.

Sets the margins around the contents of the widget to have the sizes determined by margins. The margins are used by the layout system, and may be used by subclasses to specify the area to draw in (e.g. excluding the frame).

Changing the margins will trigger a resizeEvent().

This function was introduced in Qt 4.6.

See also contentsRect() and getContentsMargins().

pub unsafe fn set_context_menu_policy(&self, policy: ContextMenuPolicy)[src]

how the widget shows a context menu

Calls C++ function: void QWidget::setContextMenuPolicy(Qt::ContextMenuPolicy policy).

C++ documentation:

how the widget shows a context menu

The default value of this property is Qt::DefaultContextMenu, which means the contextMenuEvent() handler is called. Other values are Qt::NoContextMenu, Qt::PreventContextMenu, Qt::ActionsContextMenu, and Qt::CustomContextMenu. With Qt::CustomContextMenu, the signal customContextMenuRequested() is emitted.

Access functions:

Qt::ContextMenuPolicy contextMenuPolicy() const
void setContextMenuPolicy(Qt::ContextMenuPolicy policy)

See also contextMenuEvent(), customContextMenuRequested(), and actions().

pub unsafe fn set_cursor(&self, arg1: impl CastInto<Ref<QCursor>>)[src]

This property holds the cursor shape for this widget

Calls C++ function: void QWidget::setCursor(const QCursor& arg1).

C++ documentation:

This property holds the cursor shape for this widget

The mouse cursor will assume this shape when it's over this widget. See the list of predefined cursor objects for a range of useful shapes.

An editor widget might use an I-beam cursor:

setCursor(Qt::IBeamCursor);

If no cursor has been set, or after a call to unsetCursor(), the parent's cursor is used.

By default, this property contains a cursor with the Qt::ArrowCursor shape.

Some underlying window implementations will reset the cursor if it leaves a widget even if the mouse is grabbed. If you want to have a cursor set for all widgets, even when outside the window, consider QApplication::setOverrideCursor().

Access functions:

QCursor cursor() const
void setCursor(const QCursor &)
void unsetCursor()

See also QApplication::setOverrideCursor().

pub unsafe fn set_disabled(&self, arg1: bool)[src]

Disables widget input events if disable is true; otherwise enables input events.

Calls C++ function: [slot] void QWidget::setDisabled(bool arg1).

C++ documentation:

Disables widget input events if disable is true; otherwise enables input events.

See the enabled documentation for more information.

See also isEnabledTo(), QKeyEvent, QMouseEvent, and changeEvent().

pub unsafe fn set_enabled(&self, arg1: bool)[src]

This property holds whether the widget is enabled

Calls C++ function: [slot] void QWidget::setEnabled(bool arg1).

C++ documentation:

This property holds whether the widget is enabled

In general an enabled widget handles keyboard and mouse events; a disabled widget does not. An exception is made with QAbstractButton.

Some widgets display themselves differently when they are disabled. For example a button might draw its label grayed out. If your widget needs to know when it becomes enabled or disabled, you can use the changeEvent() with type QEvent::EnabledChange.

Disabling a widget implicitly disables all its children. Enabling respectively enables all child widgets unless they have been explicitly disabled. It it not possible to explicitly enable a child widget which is not a window while its parent widget remains disabled.

By default, this property is true.

Access functions:

bool isEnabled() const
void setEnabled(bool)

See also isEnabledTo(), QKeyEvent, QMouseEvent, and changeEvent().

pub unsafe fn set_fixed_height(&self, h: c_int)[src]

Sets both the minimum and maximum heights of the widget to h without changing the widths. Provided for convenience.

Calls C++ function: void QWidget::setFixedHeight(int h).

C++ documentation:

Sets both the minimum and maximum heights of the widget to h without changing the widths. Provided for convenience.

See also sizeHint(), minimumSize(), maximumSize(), and setFixedSize().

pub unsafe fn set_fixed_size_1a(&self, arg1: impl CastInto<Ref<QSize>>)[src]

Sets both the minimum and maximum sizes of the widget to s, thereby preventing it from ever growing or shrinking.

Calls C++ function: void QWidget::setFixedSize(const QSize& arg1).

C++ documentation:

Sets both the minimum and maximum sizes of the widget to s, thereby preventing it from ever growing or shrinking.

This will override the default size constraints set by QLayout.

To remove constraints, set the size to QWIDGETSIZE_MAX.

Alternatively, if you want the widget to have a fixed size based on its contents, you can call QLayout::setSizeConstraint(QLayout::SetFixedSize);

See also maximumSize and minimumSize.

pub unsafe fn set_fixed_size_2a(&self, w: c_int, h: c_int)[src]

This is an overloaded function.

Calls C++ function: void QWidget::setFixedSize(int w, int h).

C++ documentation:

This is an overloaded function.

Sets the width of the widget to w and the height to h.

pub unsafe fn set_fixed_width(&self, w: c_int)[src]

Sets both the minimum and maximum width of the widget to w without changing the heights. Provided for convenience.

Calls C++ function: void QWidget::setFixedWidth(int w).

C++ documentation:

Sets both the minimum and maximum width of the widget to w without changing the heights. Provided for convenience.

See also sizeHint(), minimumSize(), maximumSize(), and setFixedSize().

pub unsafe fn set_focus_0a(&self)[src]

This is an overloaded function.

Calls C++ function: [slot] void QWidget::setFocus().

C++ documentation:

This is an overloaded function.

Gives the keyboard input focus to this widget (or its focus proxy) if this widget or one of its parents is the active window.

pub unsafe fn set_focus_1a(&self, reason: FocusReason)[src]

Gives the keyboard input focus to this widget (or its focus proxy) if this widget or one of its parents is the active window. The reason argument will be passed into any focus event sent from this function, it is used to give an explanation of what caused the widget to get focus. If the window is not active, the widget will be given the focus when the window becomes active.

Calls C++ function: void QWidget::setFocus(Qt::FocusReason reason).

C++ documentation:

Gives the keyboard input focus to this widget (or its focus proxy) if this widget or one of its parents is the active window. The reason argument will be passed into any focus event sent from this function, it is used to give an explanation of what caused the widget to get focus. If the window is not active, the widget will be given the focus when the window becomes active.

First, a focus about to change event is sent to the focus widget (if any) to tell it that it is about to lose the focus. Then focus is changed, a focus out event is sent to the previous focus item and a focus in event is sent to the new item to tell it that it just received the focus. (Nothing happens if the focus in and focus out widgets are the same.)

Note: On embedded platforms, setFocus() will not cause an input panel to be opened by the input method. If you want this to happen, you have to send a QEvent::RequestSoftwareInputPanel event to the widget yourself.

setFocus() gives focus to a widget regardless of its focus policy, but does not clear any keyboard grab (see grabKeyboard()).

Be aware that if the widget is hidden, it will not accept focus until it is shown.

Warning: If you call setFocus() in a function which may itself be called from focusOutEvent() or focusInEvent(), you may get an infinite recursion.

See also hasFocus(), clearFocus(), focusInEvent(), focusOutEvent(), setFocusPolicy(), focusWidget(), QApplication::focusWidget(), grabKeyboard(), grabMouse(), Keyboard Focus in Widgets, and QEvent::RequestSoftwareInputPanel.

pub unsafe fn set_focus_policy(&self, policy: FocusPolicy)[src]

This property holds the way the widget accepts keyboard focus

Calls C++ function: void QWidget::setFocusPolicy(Qt::FocusPolicy policy).

C++ documentation:

This property holds the way the widget accepts keyboard focus

The policy is Qt::TabFocus if the widget accepts keyboard focus by tabbing, Qt::ClickFocus if the widget accepts focus by clicking, Qt::StrongFocus if it accepts both, and Qt::NoFocus (the default) if it does not accept focus at all.

You must enable keyboard focus for a widget if it processes keyboard events. This is normally done from the widget's constructor. For instance, the QLineEdit constructor calls setFocusPolicy(Qt::StrongFocus).

If the widget has a focus proxy, then the focus policy will be propagated to it.

Access functions:

Qt::FocusPolicy focusPolicy() const
void setFocusPolicy(Qt::FocusPolicy policy)

See also focusInEvent(), focusOutEvent(), keyPressEvent(), keyReleaseEvent(), and enabled.

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

Sets the widget's focus proxy to widget w. If w is 0, the function resets this widget to have no focus proxy.

Calls C++ function: void QWidget::setFocusProxy(QWidget* arg1).

C++ documentation:

Sets the widget's focus proxy to widget w. If w is 0, the function resets this widget to have no focus proxy.

Some widgets can "have focus", but create a child widget, such as QLineEdit, to actually handle the focus. In this case, the widget can set the line edit to be its focus proxy.

setFocusProxy() sets the widget which will actually get focus when "this widget" gets it. If there is a focus proxy, setFocus() and hasFocus() operate on the focus proxy.

See also focusProxy().

pub unsafe fn set_font(&self, arg1: impl CastInto<Ref<QFont>>)[src]

This property holds the font currently set for the widget

Calls C++ function: void QWidget::setFont(const QFont& arg1).

C++ documentation:

This property holds the font currently set for the widget

This property describes the widget's requested font. The font is used by the widget's style when rendering standard components, and is available as a means to ensure that custom widgets can maintain consistency with the native platform's look and feel. It's common that different platforms, or different styles, define different fonts for an application.

When you assign a new font to a widget, the properties from this font are combined with the widget's default font to form the widget's final font. You can call fontInfo() to get a copy of the widget's final font. The final font is also used to initialize QPainter's font.

The default depends on the system environment. QApplication maintains a system/theme font which serves as a default for all widgets. There may also be special font defaults for certain types of widgets. You can also define default fonts for widgets yourself by passing a custom font and the name of a widget to QApplication::setFont(). Finally, the font is matched against Qt's font database to find the best match.

QWidget propagates explicit font properties from parent to child. If you change a specific property on a font and assign that font to a widget, that property will propagate to all the widget's children, overriding any system defaults for that property. Note that fonts by default don't propagate to windows (see isWindow()) unless the Qt::WA_WindowPropagation attribute is enabled.

QWidget's font propagation is similar to its palette propagation.

The current style, which is used to render the content of all standard Qt widgets, is free to choose to use the widget font, or in some cases, to ignore it (partially, or completely). In particular, certain styles like GTK style, Mac style, Windows XP, and Vista style, apply special modifications to the widget font to match the platform's native look and feel. Because of this, assigning properties to a widget's font is not guaranteed to change the appearance of the widget. Instead, you may choose to apply a styleSheet.

Note: If Qt Style Sheets are used on the same widget as setFont(), style sheets will take precedence if the settings conflict.

Access functions:

const QFont &font() const
void setFont(const QFont &)

See also fontInfo() and fontMetrics().

pub unsafe fn set_foreground_role(&self, arg1: ColorRole)[src]

Sets the foreground role of the widget to role.

Calls C++ function: void QWidget::setForegroundRole(QPalette::ColorRole arg1).

C++ documentation:

Sets the foreground role of the widget to role.

The foreground role defines the color from the widget's palette that is used to draw the foreground.

If role is QPalette::NoRole, the widget uses a foreground role that contrasts with the background role.

Note that styles are free to choose any color from the palette. You can modify the palette or set a style sheet if you don't achieve the result you want with setForegroundRole().

See also foregroundRole() and backgroundRole().

pub unsafe fn set_geometry_4a(&self, x: c_int, y: c_int, w: c_int, h: c_int)[src]

This property holds the geometry of the widget relative to its parent and excluding the window frame

Calls C++ function: void QWidget::setGeometry(int x, int y, int w, int h).

C++ documentation:

This property holds the geometry of the widget relative to its parent and excluding the window frame

When changing the geometry, the widget, if visible, receives a move event (moveEvent()) and/or a resize event (resizeEvent()) immediately. If the widget is not currently visible, it is guaranteed to receive appropriate events before it is shown.

The size component is adjusted if it lies outside the range defined by minimumSize() and maximumSize().

Warning: Calling setGeometry() inside resizeEvent() or moveEvent() can lead to infinite recursion.

See the Window Geometry documentation for an overview of geometry issues with windows.

By default, this property contains a value that depends on the user's platform and screen geometry.

Access functions:

const QRect &geometry() const
void setGeometry(int x, int y, int w, int h)
void setGeometry(const QRect &)

See also frameGeometry(), rect(), move(), resize(), moveEvent(), resizeEvent(), minimumSize(), and maximumSize().

pub unsafe fn set_geometry_1a(&self, arg1: impl CastInto<Ref<QRect>>)[src]

This property holds the geometry of the widget relative to its parent and excluding the window frame

Calls C++ function: void QWidget::setGeometry(const QRect& arg1).

C++ documentation:

This property holds the geometry of the widget relative to its parent and excluding the window frame

When changing the geometry, the widget, if visible, receives a move event (moveEvent()) and/or a resize event (resizeEvent()) immediately. If the widget is not currently visible, it is guaranteed to receive appropriate events before it is shown.

The size component is adjusted if it lies outside the range defined by minimumSize() and maximumSize().

Warning: Calling setGeometry() inside resizeEvent() or moveEvent() can lead to infinite recursion.

See the Window Geometry documentation for an overview of geometry issues with windows.

By default, this property contains a value that depends on the user's platform and screen geometry.

Access functions:

const QRect &geometry() const
void setGeometry(int x, int y, int w, int h)
void setGeometry(const QRect &)

See also frameGeometry(), rect(), move(), resize(), moveEvent(), resizeEvent(), minimumSize(), and maximumSize().

pub unsafe fn set_graphics_effect(
    &self,
    effect: impl CastInto<Ptr<QGraphicsEffect>>
)
[src]

The setGraphicsEffect function is for setting the widget's graphics effect.

Calls C++ function: void QWidget::setGraphicsEffect(QGraphicsEffect* effect).

C++ documentation:

The setGraphicsEffect function is for setting the widget's graphics effect.

Sets effect as the widget's effect. If there already is an effect installed on this widget, QWidget will delete the existing effect before installing the new effect.

If effect is the installed effect on a different widget, setGraphicsEffect() will remove the effect from the widget and install it on this widget.

QWidget takes ownership of effect.

Note: This function will apply the effect on itself and all its children.

Note: Graphics effects are not supported for OpenGL-based widgets, such as QGLWidget, QOpenGLWidget and QQuickWidget.

This function was introduced in Qt 4.6.

See also graphicsEffect().

pub unsafe fn set_hidden(&self, hidden: bool)[src]

Convenience function, equivalent to setVisible(!hidden).

Calls C++ function: [slot] void QWidget::setHidden(bool hidden).

C++ documentation:

Convenience function, equivalent to setVisible(!hidden).

See also isHidden().

pub unsafe fn set_input_method_hints(&self, hints: QFlags<InputMethodHint>)[src]

What input method specific hints the widget has.

Calls C++ function: void QWidget::setInputMethodHints(QFlags<Qt::InputMethodHint> hints).

C++ documentation:

What input method specific hints the widget has.

This is only relevant for input widgets. It is used by the input method to retrieve hints as to how the input method should operate. For example, if the Qt::ImhFormattedNumbersOnly flag is set, the input method may change its visual components to reflect that only numbers can be entered.

Warning: Some widgets require certain flags in order to work as intended. To set a flag, do w->setInputMethodHints(w->inputMethodHints()|f) instead of w->setInputMethodHints(f).

Note: The flags are only hints, so the particular input method implementation is free to ignore them. If you want to be sure that a certain type of characters are entered, you should also set a QValidator on the widget.

The default value is Qt::ImhNone.

This property was introduced in Qt 4.6.

Access functions:

Qt::InputMethodHints inputMethodHints() const
void setInputMethodHints(Qt::InputMethodHints hints)

See also inputMethodQuery().

pub unsafe fn set_layout(&self, arg1: impl CastInto<Ptr<QLayout>>)[src]

Sets the layout manager for this widget to layout.

Calls C++ function: void QWidget::setLayout(QLayout* arg1).

C++ documentation:

Sets the layout manager for this widget to layout.

If there already is a layout manager installed on this widget, QWidget won't let you install another. You must first delete the existing layout manager (returned by layout()) before you can call setLayout() with the new layout.

If layout is the layout manager on a different widget, setLayout() will reparent the layout and make it the layout manager for this widget.

Example:

QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(formWidget); setLayout(layout);

An alternative to calling this function is to pass this widget to the layout's constructor.

The QWidget will take ownership of layout.

See also layout() and Layout Management.

pub unsafe fn set_layout_direction(&self, direction: LayoutDirection)[src]

This property holds the layout direction for this widget

Calls C++ function: void QWidget::setLayoutDirection(Qt::LayoutDirection direction).

C++ documentation:

This property holds the layout direction for this widget

By default, this property is set to Qt::LeftToRight.

When the layout direction is set on a widget, it will propagate to the widget's children, but not to a child that is a window and not to a child for which setLayoutDirection() has been explicitly called. Also, child widgets added after setLayoutDirection() has been called for the parent do not inherit the parent's layout direction.

This method no longer affects text layout direction since Qt 4.7.

Access functions:

Qt::LayoutDirection layoutDirection() const
void setLayoutDirection(Qt::LayoutDirection direction)
void unsetLayoutDirection()

See also QApplication::layoutDirection.

pub unsafe fn set_locale(&self, locale: impl CastInto<Ref<QLocale>>)[src]

This property holds the widget's locale

Calls C++ function: void QWidget::setLocale(const QLocale& locale).

C++ documentation:

This property holds the widget's locale

As long as no special locale has been set, this is either the parent's locale or (if this widget is a top level widget), the default locale.

If the widget displays dates or numbers, these should be formatted using the widget's locale.

This property was introduced in Qt 4.3.

Access functions:

QLocale locale() const
void setLocale(const QLocale &locale)
void unsetLocale()

See also QLocale and QLocale::setDefault().

pub unsafe fn set_mask_q_bitmap(&self, arg1: impl CastInto<Ref<QBitmap>>)[src]

Causes only the pixels of the widget for which bitmap has a corresponding 1 bit to be visible. If the region includes pixels outside the rect() of the widget, window system controls in that area may or may not be visible, depending on the platform.

Calls C++ function: void QWidget::setMask(const QBitmap& arg1).

C++ documentation:

Causes only the pixels of the widget for which bitmap has a corresponding 1 bit to be visible. If the region includes pixels outside the rect() of the widget, window system controls in that area may or may not be visible, depending on the platform.

Note that this effect can be slow if the region is particularly complex.

The following code shows how an image with an alpha channel can be used to generate a mask for a widget:

QLabel topLevelLabel; QPixmap pixmap(":/images/tux.png"); topLevelLabel.setPixmap(pixmap); topLevelLabel.setMask(pixmap.mask());

The label shown by this code is masked using the image it contains, giving the appearance that an irregularly-shaped image is being drawn directly onto the screen.

Masked widgets receive mouse events only on their visible portions.

See also mask(), clearMask(), windowOpacity(), and Shaped Clock Example.

pub unsafe fn set_mask_q_region(&self, arg1: impl CastInto<Ref<QRegion>>)[src]

This is an overloaded function.

Calls C++ function: void QWidget::setMask(const QRegion& arg1).

C++ documentation:

This is an overloaded function.

Causes only the parts of the widget which overlap region to be visible. If the region includes pixels outside the rect() of the widget, window system controls in that area may or may not be visible, depending on the platform.

Note that this effect can be slow if the region is particularly complex.

See also windowOpacity.

pub unsafe fn set_maximum_height(&self, maxh: c_int)[src]

This property holds the widget's maximum height in pixels

Calls C++ function: void QWidget::setMaximumHeight(int maxh).

C++ documentation:

This property holds the widget's maximum height in pixels

This property corresponds to the height held by the maximumSize property.

By default, this property contains a value of 16777215.

Note: The definition of the QWIDGETSIZE_MAX macro limits the maximum size of widgets.

Access functions:

int maximumHeight() const
void setMaximumHeight(int maxh)

See also maximumSize and maximumWidth.

pub unsafe fn set_maximum_size_1a(&self, arg1: impl CastInto<Ref<QSize>>)[src]

This property holds the widget's maximum size in pixels

Calls C++ function: void QWidget::setMaximumSize(const QSize& arg1).

C++ documentation:

This property holds the widget's maximum size in pixels

The widget cannot be resized to a larger size than the maximum widget size.

By default, this property contains a size in which both width and height have values of 16777215.

Note: The definition of the QWIDGETSIZE_MAX macro limits the maximum size of widgets.

Access functions:

QSize maximumSize() const
void setMaximumSize(const QSize &)
void setMaximumSize(int maxw, int maxh)

See also maximumWidth, maximumHeight, minimumSize, and sizeIncrement.

pub unsafe fn set_maximum_size_2a(&self, maxw: c_int, maxh: c_int)[src]

This property holds the widget's maximum size in pixels

Calls C++ function: void QWidget::setMaximumSize(int maxw, int maxh).

C++ documentation:

This property holds the widget's maximum size in pixels

The widget cannot be resized to a larger size than the maximum widget size.

By default, this property contains a size in which both width and height have values of 16777215.

Note: The definition of the QWIDGETSIZE_MAX macro limits the maximum size of widgets.

Access functions:

QSize maximumSize() const
void setMaximumSize(const QSize &)
void setMaximumSize(int maxw, int maxh)

See also maximumWidth, maximumHeight, minimumSize, and sizeIncrement.

pub unsafe fn set_maximum_width(&self, maxw: c_int)[src]

This property holds the widget's maximum width in pixels

Calls C++ function: void QWidget::setMaximumWidth(int maxw).

C++ documentation:

This property holds the widget's maximum width in pixels

This property corresponds to the width held by the maximumSize property.

By default, this property contains a value of 16777215.

Note: The definition of the QWIDGETSIZE_MAX macro limits the maximum size of widgets.

Access functions:

int maximumWidth() const
void setMaximumWidth(int maxw)

See also maximumSize and maximumHeight.

pub unsafe fn set_minimum_height(&self, minh: c_int)[src]

This property holds the widget's minimum height in pixels

Calls C++ function: void QWidget::setMinimumHeight(int minh).

C++ documentation:

This property holds the widget's minimum height in pixels

This property corresponds to the height held by the minimumSize property.

By default, this property has a value of 0.

Access functions:

int minimumHeight() const
void setMinimumHeight(int minh)

See also minimumSize and minimumWidth.

pub unsafe fn set_minimum_size_1a(&self, arg1: impl CastInto<Ref<QSize>>)[src]

This property holds the widget's minimum size

Calls C++ function: void QWidget::setMinimumSize(const QSize& arg1).

C++ documentation:

This property holds the widget's minimum size

The widget cannot be resized to a smaller size than the minimum widget size. The widget's size is forced to the minimum size if the current size is smaller.

The minimum size set by this function will override the minimum size defined by QLayout. In order to unset the minimum size, use a value of QSize(0, 0).

By default, this property contains a size with zero width and height.

Access functions:

QSize minimumSize() const
void setMinimumSize(const QSize &)
void setMinimumSize(int minw, int minh)

See also minimumWidth, minimumHeight, maximumSize, and sizeIncrement.

pub unsafe fn set_minimum_size_2a(&self, minw: c_int, minh: c_int)[src]

This property holds the widget's minimum size

Calls C++ function: void QWidget::setMinimumSize(int minw, int minh).

C++ documentation:

This property holds the widget's minimum size

The widget cannot be resized to a smaller size than the minimum widget size. The widget's size is forced to the minimum size if the current size is smaller.

The minimum size set by this function will override the minimum size defined by QLayout. In order to unset the minimum size, use a value of QSize(0, 0).

By default, this property contains a size with zero width and height.

Access functions:

QSize minimumSize() const
void setMinimumSize(const QSize &)
void setMinimumSize(int minw, int minh)

See also minimumWidth, minimumHeight, maximumSize, and sizeIncrement.

pub unsafe fn set_minimum_width(&self, minw: c_int)[src]

This property holds the widget's minimum width in pixels

Calls C++ function: void QWidget::setMinimumWidth(int minw).

C++ documentation:

This property holds the widget's minimum width in pixels

This property corresponds to the width held by the minimumSize property.

By default, this property has a value of 0.

Access functions:

int minimumWidth() const
void setMinimumWidth(int minw)

See also minimumSize and minimumHeight.

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

This property holds whether mouse tracking is enabled for the widget

Calls C++ function: void QWidget::setMouseTracking(bool enable).

C++ documentation:

This property holds whether mouse tracking is enabled for the widget

If mouse tracking is disabled (the default), the widget only receives mouse move events when at least one mouse button is pressed while the mouse is being moved.

If mouse tracking is enabled, the widget receives mouse move events even if no buttons are pressed.

Access functions:

bool hasMouseTracking() const
void setMouseTracking(bool enable)

See also mouseMoveEvent().

pub unsafe fn set_palette(&self, arg1: impl CastInto<Ref<QPalette>>)[src]

This property holds the widget's palette

Calls C++ function: void QWidget::setPalette(const QPalette& arg1).

C++ documentation:

This property holds the widget's palette

This property describes the widget's palette. The palette is used by the widget's style when rendering standard components, and is available as a means to ensure that custom widgets can maintain consistency with the native platform's look and feel. It's common that different platforms, or different styles, have different palettes.

When you assign a new palette to a widget, the color roles from this palette are combined with the widget's default palette to form the widget's final palette. The palette entry for the widget's background role is used to fill the widget's background (see QWidget::autoFillBackground), and the foreground role initializes QPainter's pen.

The default depends on the system environment. QApplication maintains a system/theme palette which serves as a default for all widgets. There may also be special palette defaults for certain types of widgets (e.g., on Windows XP and Vista, all classes that derive from QMenuBar have a special default palette). You can also define default palettes for widgets yourself by passing a custom palette and the name of a widget to QApplication::setPalette(). Finally, the style always has the option of polishing the palette as it's assigned (see QStyle::polish()).

QWidget propagates explicit palette roles from parent to child. If you assign a brush or color to a specific role on a palette and assign that palette to a widget, that role will propagate to all the widget's children, overriding any system defaults for that role. Note that palettes by default don't propagate to windows (see isWindow()) unless the Qt::WA_WindowPropagation attribute is enabled.

QWidget's palette propagation is similar to its font propagation.

The current style, which is used to render the content of all standard Qt widgets, is free to choose colors and brushes from the widget palette, or in some cases, to ignore the palette (partially, or completely). In particular, certain styles like GTK style, Mac style, Windows XP, and Vista style, depend on third party APIs to render the content of widgets, and these styles typically do not follow the palette. Because of this, assigning roles to a widget's palette is not guaranteed to change the appearance of the widget. Instead, you may choose to apply a styleSheet. You can refer to our Knowledge Base article here for more information.

Warning: Do not use this function in conjunction with Qt Style Sheets. When using style sheets, the palette of a widget can be customized using the "color", "background-color", "selection-color", "selection-background-color" and "alternate-background-color".

Access functions:

const QPalette &palette() const
void setPalette(const QPalette &)

See also QApplication::palette() and QWidget::font().

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

Sets the parent of the widget to parent, and resets the window flags. The widget is moved to position (0, 0) in its new parent.

Calls C++ function: void QWidget::setParent(QWidget* parent).

C++ documentation:

Sets the parent of the widget to parent, and resets the window flags. The widget is moved to position (0, 0) in its new parent.

If the new parent widget is in a different window, the reparented widget and its children are appended to the end of the tab chain of the new parent widget, in the same internal order as before. If one of the moved widgets had keyboard focus, setParent() calls clearFocus() for that widget.

If the new parent widget is in the same window as the old parent, setting the parent doesn't change the tab order or keyboard focus.

If the "new" parent widget is the old parent widget, this function does nothing.

Note: The widget becomes invisible as part of changing its parent, even if it was previously visible. You must call show() to make the widget visible again.

Warning: It is very unlikely that you will ever need this function. If you have a widget that changes its content dynamically, it is far easier to use QStackedWidget.

See also setWindowFlags().

pub unsafe fn set_parent_2a(
    &self,
    parent: impl CastInto<Ptr<QWidget>>,
    f: QFlags<WindowType>
)
[src]

This is an overloaded function.

Calls C++ function: void QWidget::setParent(QWidget* parent, QFlags<Qt::WindowType> f).

C++ documentation:

This is an overloaded function.

This function also takes widget flags, f as an argument.

pub unsafe fn set_shortcut_auto_repeat_2a(&self, id: c_int, enable: bool)[src]

If enable is true, auto repeat of the shortcut with the given id is enabled; otherwise it is disabled.

Calls C++ function: void QWidget::setShortcutAutoRepeat(int id, bool enable = …).

C++ documentation:

If enable is true, auto repeat of the shortcut with the given id is enabled; otherwise it is disabled.

This function was introduced in Qt 4.2.

See also grabShortcut() and releaseShortcut().

pub unsafe fn set_shortcut_auto_repeat_1a(&self, id: c_int)[src]

If enable is true, auto repeat of the shortcut with the given id is enabled; otherwise it is disabled.

Calls C++ function: void QWidget::setShortcutAutoRepeat(int id).

C++ documentation:

If enable is true, auto repeat of the shortcut with the given id is enabled; otherwise it is disabled.

This function was introduced in Qt 4.2.

See also grabShortcut() and releaseShortcut().

pub unsafe fn set_shortcut_enabled_2a(&self, id: c_int, enable: bool)[src]

If enable is true, the shortcut with the given id is enabled; otherwise the shortcut is disabled.

Calls C++ function: void QWidget::setShortcutEnabled(int id, bool enable = …).

C++ documentation:

If enable is true, the shortcut with the given id is enabled; otherwise the shortcut is disabled.

Warning: You should not normally need to use this function since Qt's shortcut system enables/disables shortcuts automatically as widgets become hidden/visible and gain or lose focus. It is best to use QAction or QShortcut to handle shortcuts, since they are easier to use than this low-level function.

See also grabShortcut() and releaseShortcut().

pub unsafe fn set_shortcut_enabled_1a(&self, id: c_int)[src]

If enable is true, the shortcut with the given id is enabled; otherwise the shortcut is disabled.

Calls C++ function: void QWidget::setShortcutEnabled(int id).

C++ documentation:

If enable is true, the shortcut with the given id is enabled; otherwise the shortcut is disabled.

Warning: You should not normally need to use this function since Qt's shortcut system enables/disables shortcuts automatically as widgets become hidden/visible and gain or lose focus. It is best to use QAction or QShortcut to handle shortcuts, since they are easier to use than this low-level function.

See also grabShortcut() and releaseShortcut().

pub unsafe fn set_size_increment_1a(&self, arg1: impl CastInto<Ref<QSize>>)[src]

This property holds the size increment of the widget

Calls C++ function: void QWidget::setSizeIncrement(const QSize& arg1).

C++ documentation:

This property holds the size increment of the widget

When the user resizes the window, the size will move in steps of sizeIncrement().width() pixels horizontally and sizeIncrement.height() pixels vertically, with baseSize() as the basis. Preferred widget sizes are for non-negative integers i and j:

width = baseSize().width() + i sizeIncrement().width(); height = baseSize().height() + j sizeIncrement().height();

Note that while you can set the size increment for all widgets, it only affects windows.

By default, this property contains a size with zero width and height.

Warning: The size increment has no effect under Windows, and may be disregarded by the window manager on X11.

Access functions:

QSize sizeIncrement() const
void setSizeIncrement(const QSize &)
void setSizeIncrement(int w, int h)

See also size, minimumSize, and maximumSize.

pub unsafe fn set_size_increment_2a(&self, w: c_int, h: c_int)[src]

This property holds the size increment of the widget

Calls C++ function: void QWidget::setSizeIncrement(int w, int h).

C++ documentation:

This property holds the size increment of the widget

When the user resizes the window, the size will move in steps of sizeIncrement().width() pixels horizontally and sizeIncrement.height() pixels vertically, with baseSize() as the basis. Preferred widget sizes are for non-negative integers i and j:

width = baseSize().width() + i sizeIncrement().width(); height = baseSize().height() + j sizeIncrement().height();

Note that while you can set the size increment for all widgets, it only affects windows.

By default, this property contains a size with zero width and height.

Warning: The size increment has no effect under Windows, and may be disregarded by the window manager on X11.

Access functions:

QSize sizeIncrement() const
void setSizeIncrement(const QSize &)
void setSizeIncrement(int w, int h)

See also size, minimumSize, and maximumSize.

pub unsafe fn set_size_policy_1a(&self, arg1: impl CastInto<Ref<QSizePolicy>>)[src]

This property holds the default layout behavior of the widget

Calls C++ function: void QWidget::setSizePolicy(QSizePolicy arg1).

C++ documentation:

This property holds the default layout behavior of the widget

If there is a QLayout that manages this widget's children, the size policy specified by that layout is used. If there is no such QLayout, the result of this function is used.

The default policy is Preferred/Preferred, which means that the widget can be freely resized, but prefers to be the size sizeHint() returns. Button-like widgets set the size policy to specify that they may stretch horizontally, but are fixed vertically. The same applies to lineedit controls (such as QLineEdit, QSpinBox or an editable QComboBox) and other horizontally orientated widgets (such as QProgressBar). QToolButton's are normally square, so they allow growth in both directions. Widgets that support different directions (such as QSlider, QScrollBar or QHeader) specify stretching in the respective direction only. Widgets that can provide scroll bars (usually subclasses of QScrollArea) tend to specify that they can use additional space, and that they can make do with less than sizeHint().

Access functions:

QSizePolicy sizePolicy() const
void setSizePolicy(QSizePolicy)
void setSizePolicy(QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical)

See also sizeHint(), QLayout, QSizePolicy, and updateGeometry().

pub unsafe fn set_size_policy_2a(&self, horizontal: Policy, vertical: Policy)[src]

This property holds the default layout behavior of the widget

Calls C++ function: void QWidget::setSizePolicy(QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical).

C++ documentation:

This property holds the default layout behavior of the widget

If there is a QLayout that manages this widget's children, the size policy specified by that layout is used. If there is no such QLayout, the result of this function is used.

The default policy is Preferred/Preferred, which means that the widget can be freely resized, but prefers to be the size sizeHint() returns. Button-like widgets set the size policy to specify that they may stretch horizontally, but are fixed vertically. The same applies to lineedit controls (such as QLineEdit, QSpinBox or an editable QComboBox) and other horizontally orientated widgets (such as QProgressBar). QToolButton's are normally square, so they allow growth in both directions. Widgets that support different directions (such as QSlider, QScrollBar or QHeader) specify stretching in the respective direction only. Widgets that can provide scroll bars (usually subclasses of QScrollArea) tend to specify that they can use additional space, and that they can make do with less than sizeHint().

Access functions:

QSizePolicy sizePolicy() const
void setSizePolicy(QSizePolicy)
void setSizePolicy(QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical)

See also sizeHint(), QLayout, QSizePolicy, and updateGeometry().

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

This property holds the widget's status tip

Calls C++ function: void QWidget::setStatusTip(const QString& arg1).

C++ documentation:

This property holds the widget's status tip

By default, this property contains an empty string.

Access functions:

QString statusTip() const
void setStatusTip(const QString &)

See also toolTip and whatsThis.

pub unsafe fn set_style(&self, arg1: impl CastInto<Ptr<QStyle>>)[src]

Sets the widget's GUI style to style. The ownership of the style object is not transferred.

Calls C++ function: void QWidget::setStyle(QStyle* arg1).

C++ documentation:

Sets the widget's GUI style to style. The ownership of the style object is not transferred.

If no style is set, the widget uses the application's style, QApplication::style() instead.

Setting a widget's style has no effect on existing or future child widgets.

Warning: This function is particularly useful for demonstration purposes, where you want to show Qt's styling capabilities. Real applications should avoid it and use one consistent GUI style instead.

Warning: Qt style sheets are currently not supported for custom QStyle subclasses. We plan to address this in some future release.

See also style(), QStyle, QApplication::style(), and QApplication::setStyle().

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

This property holds the widget's style sheet

Calls C++ function: [slot] void QWidget::setStyleSheet(const QString& styleSheet).

C++ documentation:

This property holds the widget's style sheet

The style sheet contains a textual description of customizations to the widget's style, as described in the Qt Style Sheets document.

Since Qt 4.5, Qt style sheets fully supports macOS.

Warning: Qt style sheets are currently not supported for custom QStyle subclasses. We plan to address this in some future release.

This property was introduced in Qt 4.2.

Access functions:

QString styleSheet() const
void setStyleSheet(const QString &styleSheet)

See also setStyle(), QApplication::styleSheet, and Qt Style Sheets.

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

This property holds whether tablet tracking is enabled for the widget

Calls C++ function: void QWidget::setTabletTracking(bool enable).

C++ documentation:

This property holds whether tablet tracking is enabled for the widget

If tablet tracking is disabled (the default), the widget only receives tablet move events when the stylus is in contact with the tablet, or at least one stylus button is pressed, while the stylus is being moved.

If tablet tracking is enabled, the widget receives tablet move events even while hovering in proximity. This is useful for monitoring position as well as the auxiliary properties such as rotation and tilt, and providing feedback in the UI.

This property was introduced in Qt 5.9.

Access functions:

bool hasTabletTracking() const
void setTabletTracking(bool enable)

See also tabletEvent().

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

This property holds the widget's tooltip

Calls C++ function: void QWidget::setToolTip(const QString& arg1).

C++ documentation:

This property holds the widget's tooltip

Note that by default tooltips are only shown for widgets that are children of the active window. You can change this behavior by setting the attribute Qt::WA_AlwaysShowToolTips on the window, not on the widget with the tooltip.

If you want to control a tooltip's behavior, you can intercept the event() function and catch the QEvent::ToolTip event (e.g., if you want to customize the area for which the tooltip should be shown).

By default, this property contains an empty string.

Access functions:

QString toolTip() const
void setToolTip(const QString &)

See also QToolTip, statusTip, and whatsThis.

pub unsafe fn set_tool_tip_duration(&self, msec: c_int)[src]

This property holds the widget's tooltip duration

Calls C++ function: void QWidget::setToolTipDuration(int msec).

C++ documentation:

This property holds the widget's tooltip duration

Specifies how long time the tooltip will be displayed, in milliseconds. If the value is -1 (default) the duration is calculated depending on the length of the tooltip.

This property was introduced in Qt 5.2.

Access functions:

int toolTipDuration() const
void setToolTipDuration(int msec)

See also toolTip.

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

This property holds whether updates are enabled

Calls C++ function: void QWidget::setUpdatesEnabled(bool enable).

C++ documentation:

This property holds whether updates are enabled

An updates enabled widget receives paint events and has a system background; a disabled widget does not. This also implies that calling update() and repaint() has no effect if updates are disabled.

By default, this property is true.

setUpdatesEnabled() is normally used to disable updates for a short period of time, for instance to avoid screen flicker during large changes. In Qt, widgets normally do not generate screen flicker, but on X11 the server might erase regions on the screen when widgets get hidden before they can be replaced by other widgets. Disabling updates solves this.

Example:

setUpdatesEnabled(false); bigVisualChanges(); setUpdatesEnabled(true);

Disabling a widget implicitly disables all its children. Enabling a widget enables all child widgets except top-level widgets or those that have been explicitly disabled. Re-enabling updates implicitly calls update() on the widget.

Access functions:

bool updatesEnabled() const
void setUpdatesEnabled(bool enable)

See also paintEvent().

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

This property holds whether the widget is visible

Calls C++ function: virtual [slot] void QWidget::setVisible(bool visible).

C++ documentation:

This property holds whether the widget is visible

Calling setVisible(true) or show() sets the widget to visible status if all its parent widgets up to the window are visible. If an ancestor is not visible, the widget won't become visible until all its ancestors are shown. If its size or position has changed, Qt guarantees that a widget gets move and resize events just before it is shown. If the widget has not been resized yet, Qt will adjust the widget's size to a useful default using adjustSize().

Calling setVisible(false) or hide() hides a widget explicitly. An explicitly hidden widget will never become visible, even if all its ancestors become visible, unless you show it.

A widget receives show and hide events when its visibility status changes. Between a hide and a show event, there is no need to waste CPU cycles preparing or displaying information to the user. A video application, for example, might simply stop generating new frames.

A widget that happens to be obscured by other windows on the screen is considered to be visible. The same applies to iconified windows and windows that exist on another virtual desktop (on platforms that support this concept). A widget receives spontaneous show and hide events when its mapping status is changed by the window system, e.g. a spontaneous hide event when the user minimizes the window, and a spontaneous show event when the window is restored again.

You almost never have to reimplement the setVisible() function. If you need to change some settings before a widget is shown, use showEvent() instead. If you need to do some delayed initialization use the Polish event delivered to the event() function.

Access functions:

bool isVisible() const
virtual void setVisible(bool visible)

See also show(), hide(), isHidden(), isVisibleTo(), isMinimized(), showEvent(), and hideEvent().

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

This property holds the widget's What's This help text.

Calls C++ function: void QWidget::setWhatsThis(const QString& arg1).

C++ documentation:

This property holds the widget's What's This help text.

By default, this property contains an empty string.

Access functions:

QString whatsThis() const
void setWhatsThis(const QString &)

See also QWhatsThis, QWidget::toolTip, and QWidget::statusTip.

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

This property holds the file path associated with a widget

Calls C++ function: void QWidget::setWindowFilePath(const QString& filePath).

C++ documentation:

This property holds the file path associated with a widget

This property only makes sense for windows. It associates a file path with a window. If you set the file path, but have not set the window title, Qt sets the window title to the file name of the specified path, obtained using QFileInfo::fileName().

If the window title is set at any point, then the window title takes precedence and will be shown instead of the file path string.

Additionally, on macOS, this has an added benefit that it sets the proxy icon for the window, assuming that the file path exists.

If no file path is set, this property contains an empty string.

By default, this property contains an empty string.

This property was introduced in Qt 4.4.

Access functions:

QString windowFilePath() const
void setWindowFilePath(const QString &filePath)

See also windowTitle and windowIcon.

pub unsafe fn set_window_flag_2a(&self, arg1: WindowType, on: bool)[src]

Sets the window flag flag on this widget if on is true; otherwise clears the flag.

Calls C++ function: void QWidget::setWindowFlag(Qt::WindowType arg1, bool on = …).

C++ documentation:

Sets the window flag flag on this widget if on is true; otherwise clears the flag.

This function was introduced in Qt 5.9.

See also setWindowFlags(), windowFlags(), and windowType().

pub unsafe fn set_window_flag_1a(&self, arg1: WindowType)[src]

Sets the window flag flag on this widget if on is true; otherwise clears the flag.

Calls C++ function: void QWidget::setWindowFlag(Qt::WindowType arg1).

C++ documentation:

Sets the window flag flag on this widget if on is true; otherwise clears the flag.

This function was introduced in Qt 5.9.

See also setWindowFlags(), windowFlags(), and windowType().

pub unsafe fn set_window_flags(&self, type_: QFlags<WindowType>)[src]

Window flags are a combination of a type (e.g. Qt::Dialog) and zero or more hints to the window system (e.g. Qt::FramelessWindowHint).

Calls C++ function: void QWidget::setWindowFlags(QFlags<Qt::WindowType> type).

C++ documentation:

Window flags are a combination of a type (e.g. Qt::Dialog) and zero or more hints to the window system (e.g. Qt::FramelessWindowHint).

If the widget had type Qt::Widget or Qt::SubWindow and becomes a window (Qt::Window, Qt::Dialog, etc.), it is put at position (0, 0) on the desktop. If the widget is a window and becomes a Qt::Widget or Qt::SubWindow, it is put at position (0, 0) relative to its parent widget.

Note: This function calls setParent() when changing the flags for a window, causing the widget to be hidden. You must call show() to make the widget visible again..

Access functions:

Qt::WindowFlags windowFlags() const
void setWindowFlags(Qt::WindowFlags type)

See also windowType(), setWindowFlag(), and Window Flags Example.

pub unsafe fn set_window_icon(&self, icon: impl CastInto<Ref<QIcon>>)[src]

This property holds the widget's icon

Calls C++ function: void QWidget::setWindowIcon(const QIcon& icon).

C++ documentation:

This property holds the widget's icon

This property only makes sense for windows. If no icon has been set, windowIcon() returns the application icon (QApplication::windowIcon()).

Access functions:

QIcon windowIcon() const
void setWindowIcon(const QIcon &icon)

Notifier signal:

void windowIconChanged(const QIcon &icon)

See also windowTitle.

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

This property holds the text to be displayed on the icon of a minimized window

Calls C++ function: void QWidget::setWindowIconText(const QString& arg1).

C++ documentation:

This property holds the text to be displayed on the icon of a minimized window

This property only makes sense for windows. If no icon text has been set, this accessor returns an empty string. It is only implemented on the X11 platform, and only certain window managers use this window property.

This property is deprecated.

Access functions:

QString windowIconText() const
void setWindowIconText(const QString &)

Notifier signal:

void windowIconTextChanged(const QString &iconText)

See also windowIcon and windowTitle.

Member Function Documentation

pub unsafe fn set_window_modality(&self, window_modality: WindowModality)[src]

This property holds which windows are blocked by the modal widget

Calls C++ function: void QWidget::setWindowModality(Qt::WindowModality windowModality).

C++ documentation:

This property holds which windows are blocked by the modal widget

This property only makes sense for windows. A modal widget prevents widgets in other windows from getting input. The value of this property controls which windows are blocked when the widget is visible. Changing this property while the window is visible has no effect; you must hide() the widget first, then show() it again.

By default, this property is Qt::NonModal.

This property was introduced in Qt 4.1.

Access functions:

Qt::WindowModality windowModality() const
void setWindowModality(Qt::WindowModality windowModality)

See also isWindow(), QWidget::modal, and QDialog.

pub unsafe fn set_window_modified(&self, arg1: bool)[src]

This property holds whether the document shown in the window has unsaved changes

Calls C++ function: [slot] void QWidget::setWindowModified(bool arg1).

C++ documentation:

This property holds whether the document shown in the window has unsaved changes

A modified window is a window whose content has changed but has not been saved to disk. This flag will have different effects varied by the platform. On macOS the close button will have a modified look; on other platforms, the window title will have an '*' (asterisk).

The window title must contain a "[*]" placeholder, which indicates where the '*' should appear. Normally, it should appear right after the file name (e.g., "document1.txt[*] - Text Editor"). If the window isn't modified, the placeholder is simply removed.

Note that if a widget is set as modified, all its ancestors will also be set as modified. However, if you call setWindowModified(false) on a widget, this will not propagate to its parent because other children of the parent might have been modified.

Access functions:

bool isWindowModified() const
void setWindowModified(bool)

See also windowTitle, Application Example, SDI Example, and MDI Example.

pub unsafe fn set_window_opacity(&self, level: c_double)[src]

This property holds the level of opacity for the window.

Calls C++ function: void QWidget::setWindowOpacity(double level).

C++ documentation:

This property holds the level of opacity for the window.

The valid range of opacity is from 1.0 (completely opaque) to 0.0 (completely transparent).

By default the value of this property is 1.0.

This feature is available on Embedded Linux, macOS, Windows, and X11 platforms that support the Composite extension.

Note: On X11 you need to have a composite manager running, and the X11 specific _NET_WM_WINDOW_OPACITY atom needs to be supported by the window manager you are using.

Warning: Changing this property from opaque to transparent might issue a paint event that needs to be processed before the window is displayed correctly. This affects mainly the use of QPixmap::grabWindow(). Also note that semi-transparent windows update and resize significantly slower than opaque windows.

Access functions:

qreal windowOpacity() const
void setWindowOpacity(qreal level)

See also setMask().

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

Sets the window's role to role. This only makes sense for windows on X11.

Calls C++ function: void QWidget::setWindowRole(const QString& arg1).

C++ documentation:

Sets the window's role to role. This only makes sense for windows on X11.

See also windowRole().

pub unsafe fn set_window_state(&self, state: QFlags<WindowState>)[src]

Sets the window state to windowState. The window state is a OR'ed combination of Qt::WindowState: Qt::WindowMinimized, Qt::WindowMaximized, Qt::WindowFullScreen, and Qt::WindowActive.

Calls C++ function: void QWidget::setWindowState(QFlags<Qt::WindowState> state).

C++ documentation:

Sets the window state to windowState. The window state is a OR'ed combination of Qt::WindowState: Qt::WindowMinimized, Qt::WindowMaximized, Qt::WindowFullScreen, and Qt::WindowActive.

If the window is not visible (i.e. isVisible() returns false), the window state will take effect when show() is called. For visible windows, the change is immediate. For example, to toggle between full-screen and normal mode, use the following code:

w->setWindowState(w->windowState() ^ Qt::WindowFullScreen);

In order to restore and activate a minimized window (while preserving its maximized and/or full-screen state), use the following:

w->setWindowState((w->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);

Calling this function will hide the widget. You must call show() to make the widget visible again.

Note: On some window systems Qt::WindowActive is not immediate, and may be ignored in certain cases.

When the window state changes, the widget receives a changeEvent() of type QEvent::WindowStateChange.

See also Qt::WindowState and windowState().

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

This property holds the window title (caption)

Calls C++ function: [slot] void QWidget::setWindowTitle(const QString& arg1).

C++ documentation:

This property holds the window title (caption)

This property only makes sense for top-level widgets, such as windows and dialogs. If no caption has been set, the title is based of the windowFilePath. If neither of these is set, then the title is an empty string.

If you use the windowModified mechanism, the window title must contain a "[*]" placeholder, which indicates where the '*' should appear. Normally, it should appear right after the file name (e.g., "document1.txt[*] - Text Editor"). If the windowModified property is false (the default), the placeholder is simply removed.

On some desktop platforms (including Windows and Unix), the application name (from QGuiApplication::applicationDisplayName) is added at the end of the window title, if set. This is done by the QPA plugin, so it is shown to the user, but isn't part of the windowTitle string.

Access functions:

QString windowTitle() const
void setWindowTitle(const QString &)

Notifier signal:

void windowTitleChanged(const QString &title)

See also windowIcon, windowModified, and windowFilePath.

pub unsafe fn show(&self)[src]

Shows the widget and its child widgets.

Calls C++ function: [slot] void QWidget::show().

C++ documentation:

Shows the widget and its child widgets.

This is equivalent to calling showFullScreen(), showMaximized(), or setVisible(true), depending on the platform's default behavior for the window flags.

See also raise(), showEvent(), hide(), setVisible(), showMinimized(), showMaximized(), showNormal(), isVisible(), and windowFlags().

pub unsafe fn show_full_screen(&self)[src]

Shows the widget in full-screen mode.

Calls C++ function: [slot] void QWidget::showFullScreen().

C++ documentation:

Shows the widget in full-screen mode.

Calling this function only affects windows.

To return from full-screen mode, call showNormal().

Full-screen mode works fine under Windows, but has certain problems under X. These problems are due to limitations of the ICCCM protocol that specifies the communication between X11 clients and the window manager. ICCCM simply does not understand the concept of non-decorated full-screen windows. Therefore, the best we can do is to request a borderless window and place and resize it to fill the entire screen. Depending on the window manager, this may or may not work. The borderless window is requested using MOTIF hints, which are at least partially supported by virtually all modern window managers.

An alternative would be to bypass the window manager entirely and create a window with the Qt::X11BypassWindowManagerHint flag. This has other severe problems though, like totally broken keyboard focus and very strange effects on desktop changes or when the user raises other windows.

X11 window managers that follow modern post-ICCCM specifications support full-screen mode properly.

See also showNormal(), showMaximized(), show(), hide(), and isVisible().

pub unsafe fn show_maximized(&self)[src]

Shows the widget maximized.

Calls C++ function: [slot] void QWidget::showMaximized().

C++ documentation:

Shows the widget maximized.

Calling this function only affects windows.

On X11, this function may not work properly with certain window managers. See the Window Geometry documentation for an explanation.

See also setWindowState(), showNormal(), showMinimized(), show(), hide(), and isVisible().

pub unsafe fn show_minimized(&self)[src]

Shows the widget minimized, as an icon.

Calls C++ function: [slot] void QWidget::showMinimized().

C++ documentation:

Shows the widget minimized, as an icon.

Calling this function only affects windows.

See also showNormal(), showMaximized(), show(), hide(), isVisible(), and isMinimized().

pub unsafe fn show_normal(&self)[src]

Restores the widget after it has been maximized or minimized.

Calls C++ function: [slot] void QWidget::showNormal().

C++ documentation:

Restores the widget after it has been maximized or minimized.

Calling this function only affects windows.

See also setWindowState(), showMinimized(), showMaximized(), show(), hide(), and isVisible().

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

This property holds the size of the widget excluding any window frame

Calls C++ function: QSize QWidget::size() const.

C++ documentation:

This property holds the size of the widget excluding any window frame

If the widget is visible when it is being resized, it receives a resize event (resizeEvent()) immediately. If the widget is not currently visible, it is guaranteed to receive an event before it is shown.

The size is adjusted if it lies outside the range defined by minimumSize() and maximumSize().

By default, this property contains a value that depends on the user's platform and screen geometry.

Warning: Calling resize() or setGeometry() inside resizeEvent() can lead to infinite recursion.

Note: Setting the size to QSize(0, 0) will cause the widget to not appear on screen. This also applies to windows.

Access functions:

QSize size() const
void resize(int w, int h)
void resize(const QSize &)

See also pos, geometry, minimumSize, maximumSize, resizeEvent(), and adjustSize().

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

This property holds the recommended size for the widget

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

C++ documentation:

This property holds the recommended size for the widget

If the value of this property is an invalid size, no size is recommended.

The default implementation of sizeHint() returns an invalid size if there is no layout for this widget, and returns the layout's preferred size otherwise.

Access functions:

virtual QSize sizeHint() const

See also QSize::isValid(), minimumSizeHint(), sizePolicy(), setMinimumSize(), and updateGeometry().

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

This property holds the size increment of the widget

Calls C++ function: QSize QWidget::sizeIncrement() const.

C++ documentation:

This property holds the size increment of the widget

When the user resizes the window, the size will move in steps of sizeIncrement().width() pixels horizontally and sizeIncrement.height() pixels vertically, with baseSize() as the basis. Preferred widget sizes are for non-negative integers i and j:

width = baseSize().width() + i sizeIncrement().width(); height = baseSize().height() + j sizeIncrement().height();

Note that while you can set the size increment for all widgets, it only affects windows.

By default, this property contains a size with zero width and height.

Warning: The size increment has no effect under Windows, and may be disregarded by the window manager on X11.

Access functions:

QSize sizeIncrement() const
void setSizeIncrement(const QSize &)
void setSizeIncrement(int w, int h)

See also size, minimumSize, and maximumSize.

pub unsafe fn size_policy(&self) -> CppBox<QSizePolicy>[src]

This property holds the default layout behavior of the widget

Calls C++ function: QSizePolicy QWidget::sizePolicy() const.

C++ documentation:

This property holds the default layout behavior of the widget

If there is a QLayout that manages this widget's children, the size policy specified by that layout is used. If there is no such QLayout, the result of this function is used.

The default policy is Preferred/Preferred, which means that the widget can be freely resized, but prefers to be the size sizeHint() returns. Button-like widgets set the size policy to specify that they may stretch horizontally, but are fixed vertically. The same applies to lineedit controls (such as QLineEdit, QSpinBox or an editable QComboBox) and other horizontally orientated widgets (such as QProgressBar). QToolButton's are normally square, so they allow growth in both directions. Widgets that support different directions (such as QSlider, QScrollBar or QHeader) specify stretching in the respective direction only. Widgets that can provide scroll bars (usually subclasses of QScrollArea) tend to specify that they can use additional space, and that they can make do with less than sizeHint().

Access functions:

QSizePolicy sizePolicy() const
void setSizePolicy(QSizePolicy)
void setSizePolicy(QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical)

See also sizeHint(), QLayout, QSizePolicy, and updateGeometry().

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

Places the widget under w in the parent widget's stack.

Calls C++ function: void QWidget::stackUnder(QWidget* arg1).

C++ documentation:

Places the widget under w in the parent widget's stack.

To make this work, the widget itself and w must be siblings.

See also raise() and lower().

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

This property holds the widget's status tip

Calls C++ function: QString QWidget::statusTip() const.

C++ documentation:

This property holds the widget's status tip

By default, this property contains an empty string.

Access functions:

QString statusTip() const
void setStatusTip(const QString &)

See also toolTip and whatsThis.

pub unsafe fn style(&self) -> QPtr<QStyle>[src]

See also QWidget::setStyle(), QApplication::setStyle(), and QApplication::style().

Calls C++ function: QStyle* QWidget::style() const.

C++ documentation:

See also QWidget::setStyle(), QApplication::setStyle(), and QApplication::style().

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

This property holds the widget's style sheet

Calls C++ function: QString QWidget::styleSheet() const.

C++ documentation:

This property holds the widget's style sheet

The style sheet contains a textual description of customizations to the widget's style, as described in the Qt Style Sheets document.

Since Qt 4.5, Qt style sheets fully supports macOS.

Warning: Qt style sheets are currently not supported for custom QStyle subclasses. We plan to address this in some future release.

This property was introduced in Qt 4.2.

Access functions:

QString styleSheet() const
void setStyleSheet(const QString &styleSheet)

See also setStyle(), QApplication::styleSheet, and Qt Style Sheets.

pub unsafe fn test_attribute(&self, arg1: WidgetAttribute) -> bool[src]

Returns true if attribute attribute is set on this widget; otherwise returns false.

Calls C++ function: bool QWidget::testAttribute(Qt::WidgetAttribute arg1) const.

C++ documentation:

Returns true if attribute attribute is set on this widget; otherwise returns false.

See also setAttribute().

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

This property holds the widget's tooltip

Calls C++ function: QString QWidget::toolTip() const.

C++ documentation:

This property holds the widget's tooltip

Note that by default tooltips are only shown for widgets that are children of the active window. You can change this behavior by setting the attribute Qt::WA_AlwaysShowToolTips on the window, not on the widget with the tooltip.

If you want to control a tooltip's behavior, you can intercept the event() function and catch the QEvent::ToolTip event (e.g., if you want to customize the area for which the tooltip should be shown).

By default, this property contains an empty string.

Access functions:

QString toolTip() const
void setToolTip(const QString &)

See also QToolTip, statusTip, and whatsThis.

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

This property holds the widget's tooltip duration

Calls C++ function: int QWidget::toolTipDuration() const.

C++ documentation:

This property holds the widget's tooltip duration

Specifies how long time the tooltip will be displayed, in milliseconds. If the value is -1 (default) the duration is calculated depending on the length of the tooltip.

This property was introduced in Qt 5.2.

Access functions:

int toolTipDuration() const
void setToolTipDuration(int msec)

See also toolTip.

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

Use window() instead.

Calls C++ function: QWidget* QWidget::topLevelWidget() const.

C++ documentation:

Use window() instead.

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

Returns true if the widget is under the mouse cursor; otherwise returns false.

Calls C++ function: bool QWidget::underMouse() const.

C++ documentation:

Returns true if the widget is under the mouse cursor; otherwise returns false.

This value is not updated properly during drag and drop operations.

See also enterEvent() and leaveEvent().

pub unsafe fn ungrab_gesture(&self, type_: GestureType)[src]

Unsubscribes the widget from a given gesture type

Calls C++ function: void QWidget::ungrabGesture(Qt::GestureType type).

C++ documentation:

Unsubscribes the widget from a given gesture type

This function was introduced in Qt 4.6.

See also grabGesture() and QGestureEvent.

pub unsafe fn unset_cursor(&self)[src]

This property holds the cursor shape for this widget

Calls C++ function: void QWidget::unsetCursor().

C++ documentation:

This property holds the cursor shape for this widget

The mouse cursor will assume this shape when it's over this widget. See the list of predefined cursor objects for a range of useful shapes.

An editor widget might use an I-beam cursor:

setCursor(Qt::IBeamCursor);

If no cursor has been set, or after a call to unsetCursor(), the parent's cursor is used.

By default, this property contains a cursor with the Qt::ArrowCursor shape.

Some underlying window implementations will reset the cursor if it leaves a widget even if the mouse is grabbed. If you want to have a cursor set for all widgets, even when outside the window, consider QApplication::setOverrideCursor().

Access functions:

QCursor cursor() const
void setCursor(const QCursor &)
void unsetCursor()

See also QApplication::setOverrideCursor().

pub unsafe fn unset_layout_direction(&self)[src]

This property holds the layout direction for this widget

Calls C++ function: void QWidget::unsetLayoutDirection().

C++ documentation:

This property holds the layout direction for this widget

By default, this property is set to Qt::LeftToRight.

When the layout direction is set on a widget, it will propagate to the widget's children, but not to a child that is a window and not to a child for which setLayoutDirection() has been explicitly called. Also, child widgets added after setLayoutDirection() has been called for the parent do not inherit the parent's layout direction.

This method no longer affects text layout direction since Qt 4.7.

Access functions:

Qt::LayoutDirection layoutDirection() const
void setLayoutDirection(Qt::LayoutDirection direction)
void unsetLayoutDirection()

See also QApplication::layoutDirection.

pub unsafe fn unset_locale(&self)[src]

This property holds the widget's locale

Calls C++ function: void QWidget::unsetLocale().

C++ documentation:

This property holds the widget's locale

As long as no special locale has been set, this is either the parent's locale or (if this widget is a top level widget), the default locale.

If the widget displays dates or numbers, these should be formatted using the widget's locale.

This property was introduced in Qt 4.3.

Access functions:

QLocale locale() const
void setLocale(const QLocale &locale)
void unsetLocale()

See also QLocale and QLocale::setDefault().

pub unsafe fn update(&self)[src]

Updates the widget unless updates are disabled or the widget is hidden.

Calls C++ function: [slot] void QWidget::update().

C++ documentation:

Updates the widget unless updates are disabled or the widget is hidden.

This function does not cause an immediate repaint; instead it schedules a paint event for processing when Qt returns to the main event loop. This permits Qt to optimize for more speed and less flicker than a call to repaint() does.

Calling update() several times normally results in just one paintEvent() call.

Qt normally erases the widget's area before the paintEvent() call. If the Qt::WA_OpaquePaintEvent widget attribute is set, the widget is responsible for painting all its pixels with an opaque color.

See also repaint(), paintEvent(), setUpdatesEnabled(), and Analog Clock Example.

pub unsafe fn update_4_int(&self, x: c_int, y: c_int, w: c_int, h: c_int)[src]

This is an overloaded function.

Calls C++ function: void QWidget::update(int x, int y, int w, int h).

C++ documentation:

This is an overloaded function.

This version updates a rectangle (x, y, w, h) inside the widget.

pub unsafe fn update_q_rect(&self, arg1: impl CastInto<Ref<QRect>>)[src]

This is an overloaded function.

Calls C++ function: void QWidget::update(const QRect& arg1).

C++ documentation:

This is an overloaded function.

This version updates a rectangle rect inside the widget.

pub unsafe fn update_q_region(&self, arg1: impl CastInto<Ref<QRegion>>)[src]

This is an overloaded function.

Calls C++ function: void QWidget::update(const QRegion& arg1).

C++ documentation:

This is an overloaded function.

This version repaints a region rgn inside the widget.

pub unsafe fn update_geometry(&self)[src]

Notifies the layout system that this widget has changed and may need to change geometry.

Calls C++ function: void QWidget::updateGeometry().

C++ documentation:

Notifies the layout system that this widget has changed and may need to change geometry.

Call this function if the sizeHint() or sizePolicy() have changed.

For explicitly hidden widgets, updateGeometry() is a no-op. The layout system will be notified as soon as the widget is shown.

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

This property holds whether updates are enabled

Calls C++ function: bool QWidget::updatesEnabled() const.

C++ documentation:

This property holds whether updates are enabled

An updates enabled widget receives paint events and has a system background; a disabled widget does not. This also implies that calling update() and repaint() has no effect if updates are disabled.

By default, this property is true.

setUpdatesEnabled() is normally used to disable updates for a short period of time, for instance to avoid screen flicker during large changes. In Qt, widgets normally do not generate screen flicker, but on X11 the server might erase regions on the screen when widgets get hidden before they can be replaced by other widgets. Disabling updates solves this.

Example:

setUpdatesEnabled(false); bigVisualChanges(); setUpdatesEnabled(true);

Disabling a widget implicitly disables all its children. Enabling a widget enables all child widgets except top-level widgets or those that have been explicitly disabled. Re-enabling updates implicitly calls update() on the widget.

Access functions:

bool updatesEnabled() const
void setUpdatesEnabled(bool enable)

See also paintEvent().

pub unsafe fn visible_region(&self) -> CppBox<QRegion>[src]

Returns the unobscured region where paint events can occur.

Calls C++ function: QRegion QWidget::visibleRegion() const.

C++ documentation:

Returns the unobscured region where paint events can occur.

For visible widgets, this is an approximation of the area not covered by other widgets; otherwise, this is an empty region.

The repaint() function calls this function if necessary, so in general you do not need to call it.

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

This property holds the widget's What's This help text.

Calls C++ function: QString QWidget::whatsThis() const.

C++ documentation:

This property holds the widget's What's This help text.

By default, this property contains an empty string.

Access functions:

QString whatsThis() const
void setWhatsThis(const QString &)

See also QWhatsThis, QWidget::toolTip, and QWidget::statusTip.

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

This property holds the width of the widget excluding any window frame

Calls C++ function: int QWidget::width() const.

C++ documentation:

This property holds the width of the widget excluding any window frame

See the Window Geometry documentation for an overview of geometry issues with windows.

Note: Do not use this function to find the width of a screen on a multiple screen desktop. Read this note for details.

By default, this property contains a value that depends on the user's platform and screen geometry.

Access functions:

int width() const

See also geometry, height, and size.

pub unsafe fn win_id(&self) -> c_ulonglong[src]

Returns the window system identifier of the widget.

Calls C++ function: unsigned long long QWidget::winId() const.

C++ documentation:

Returns the window system identifier of the widget.

Portable in principle, but if you use it you are probably about to do something non-portable. Be careful.

If a widget is non-native (alien) and winId() is invoked on it, that widget will be provided a native handle.

This value may change at run-time. An event with type QEvent::WinIdChange will be sent to the widget following a change in window system identifier.

See also find().

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

Returns the window for this widget, i.e. the next ancestor widget that has (or could have) a window-system frame.

Calls C++ function: QWidget* QWidget::window() const.

C++ documentation:

Returns the window for this widget, i.e. the next ancestor widget that has (or could have) a window-system frame.

If the widget is a window, the widget itself is returned.

Typical usage is changing the window title:

aWidget->window()->setWindowTitle("New Window Title");

See also isWindow().

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

This property holds the file path associated with a widget

Calls C++ function: QString QWidget::windowFilePath() const.

C++ documentation:

This property holds the file path associated with a widget

This property only makes sense for windows. It associates a file path with a window. If you set the file path, but have not set the window title, Qt sets the window title to the file name of the specified path, obtained using QFileInfo::fileName().

If the window title is set at any point, then the window title takes precedence and will be shown instead of the file path string.

Additionally, on macOS, this has an added benefit that it sets the proxy icon for the window, assuming that the file path exists.

If no file path is set, this property contains an empty string.

By default, this property contains an empty string.

This property was introduced in Qt 4.4.

Access functions:

QString windowFilePath() const
void setWindowFilePath(const QString &filePath)

See also windowTitle and windowIcon.

pub unsafe fn window_flags(&self) -> QFlags<WindowType>[src]

Window flags are a combination of a type (e.g. Qt::Dialog) and zero or more hints to the window system (e.g. Qt::FramelessWindowHint).

Calls C++ function: QFlags<Qt::WindowType> QWidget::windowFlags() const.

C++ documentation:

Window flags are a combination of a type (e.g. Qt::Dialog) and zero or more hints to the window system (e.g. Qt::FramelessWindowHint).

If the widget had type Qt::Widget or Qt::SubWindow and becomes a window (Qt::Window, Qt::Dialog, etc.), it is put at position (0, 0) on the desktop. If the widget is a window and becomes a Qt::Widget or Qt::SubWindow, it is put at position (0, 0) relative to its parent widget.

Note: This function calls setParent() when changing the flags for a window, causing the widget to be hidden. You must call show() to make the widget visible again..

Access functions:

Qt::WindowFlags windowFlags() const
void setWindowFlags(Qt::WindowFlags type)

See also windowType(), setWindowFlag(), and Window Flags Example.

pub unsafe fn window_handle(&self) -> QPtr<QWindow>[src]

If this is a native widget, return the associated QWindow. Otherwise return null.

Calls C++ function: QWindow* QWidget::windowHandle() const.

C++ documentation:

If this is a native widget, return the associated QWindow. Otherwise return null.

Native widgets include toplevel widgets, QGLWidget, and child widgets on which winId() was called.

This function was introduced in Qt 5.0.

See also winId().

pub unsafe fn window_icon(&self) -> CppBox<QIcon>[src]

This property holds the widget's icon

Calls C++ function: QIcon QWidget::windowIcon() const.

C++ documentation:

This property holds the widget's icon

This property only makes sense for windows. If no icon has been set, windowIcon() returns the application icon (QApplication::windowIcon()).

Access functions:

QIcon windowIcon() const
void setWindowIcon(const QIcon &icon)

Notifier signal:

void windowIconChanged(const QIcon &icon)

See also windowTitle.

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

This property holds the text to be displayed on the icon of a minimized window

Calls C++ function: QString QWidget::windowIconText() const.

C++ documentation:

This property holds the text to be displayed on the icon of a minimized window

This property only makes sense for windows. If no icon text has been set, this accessor returns an empty string. It is only implemented on the X11 platform, and only certain window managers use this window property.

This property is deprecated.

Access functions:

QString windowIconText() const
void setWindowIconText(const QString &)

Notifier signal:

void windowIconTextChanged(const QString &iconText)

See also windowIcon and windowTitle.

Member Function Documentation

pub unsafe fn window_modality(&self) -> WindowModality[src]

This property holds which windows are blocked by the modal widget

Calls C++ function: Qt::WindowModality QWidget::windowModality() const.

C++ documentation:

This property holds which windows are blocked by the modal widget

This property only makes sense for windows. A modal widget prevents widgets in other windows from getting input. The value of this property controls which windows are blocked when the widget is visible. Changing this property while the window is visible has no effect; you must hide() the widget first, then show() it again.

By default, this property is Qt::NonModal.

This property was introduced in Qt 4.1.

Access functions:

Qt::WindowModality windowModality() const
void setWindowModality(Qt::WindowModality windowModality)

See also isWindow(), QWidget::modal, and QDialog.

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

This property holds the level of opacity for the window.

Calls C++ function: double QWidget::windowOpacity() const.

C++ documentation:

This property holds the level of opacity for the window.

The valid range of opacity is from 1.0 (completely opaque) to 0.0 (completely transparent).

By default the value of this property is 1.0.

This feature is available on Embedded Linux, macOS, Windows, and X11 platforms that support the Composite extension.

Note: On X11 you need to have a composite manager running, and the X11 specific _NET_WM_WINDOW_OPACITY atom needs to be supported by the window manager you are using.

Warning: Changing this property from opaque to transparent might issue a paint event that needs to be processed before the window is displayed correctly. This affects mainly the use of QPixmap::grabWindow(). Also note that semi-transparent windows update and resize significantly slower than opaque windows.

Access functions:

qreal windowOpacity() const
void setWindowOpacity(qreal level)

See also setMask().

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

Returns the window's role, or an empty string.

Calls C++ function: QString QWidget::windowRole() const.

C++ documentation:

Returns the window's role, or an empty string.

See also setWindowRole(), windowIcon, and windowTitle.

pub unsafe fn window_state(&self) -> QFlags<WindowState>[src]

Returns the current window state. The window state is a OR'ed combination of Qt::WindowState: Qt::WindowMinimized, Qt::WindowMaximized, Qt::WindowFullScreen, and Qt::WindowActive.

Calls C++ function: QFlags<Qt::WindowState> QWidget::windowState() const.

C++ documentation:

Returns the current window state. The window state is a OR'ed combination of Qt::WindowState: Qt::WindowMinimized, Qt::WindowMaximized, Qt::WindowFullScreen, and Qt::WindowActive.

See also Qt::WindowState and setWindowState().

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

This property holds the window title (caption)

Calls C++ function: QString QWidget::windowTitle() const.

C++ documentation:

This property holds the window title (caption)

This property only makes sense for top-level widgets, such as windows and dialogs. If no caption has been set, the title is based of the windowFilePath. If neither of these is set, then the title is an empty string.

If you use the windowModified mechanism, the window title must contain a "[*]" placeholder, which indicates where the '*' should appear. Normally, it should appear right after the file name (e.g., "document1.txt[*] - Text Editor"). If the windowModified property is false (the default), the placeholder is simply removed.

On some desktop platforms (including Windows and Unix), the application name (from QGuiApplication::applicationDisplayName) is added at the end of the window title, if set. This is done by the QPA plugin, so it is shown to the user, but isn't part of the windowTitle string.

Access functions:

QString windowTitle() const
void setWindowTitle(const QString &)

Notifier signal:

void windowTitleChanged(const QString &title)

See also windowIcon, windowModified, and windowFilePath.

pub unsafe fn window_type(&self) -> WindowType[src]

Returns the window type of this widget. This is identical to windowFlags() & Qt::WindowType_Mask.

Calls C++ function: Qt::WindowType QWidget::windowType() const.

C++ documentation:

Returns the window type of this widget. This is identical to windowFlags() & Qt::WindowType_Mask.

See also windowFlags.

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

This property holds the x coordinate of the widget relative to its parent including any window frame

Calls C++ function: int QWidget::x() const.

C++ documentation:

This property holds the x coordinate of the widget relative to its parent including any window frame

See the Window Geometry documentation for an overview of geometry issues with windows.

By default, this property has a value of 0.

Access functions:

int x() const

See also frameGeometry, y, and pos.

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

This property holds the y coordinate of the widget relative to its parent and including any window frame

Calls C++ function: int QWidget::y() const.

C++ documentation:

This property holds the y coordinate of the widget relative to its parent and including any window frame

See the Window Geometry documentation for an overview of geometry issues with windows.

By default, this property has a value of 0.

Access functions:

int y() const

See also frameGeometry, x, and pos.

Trait Implementations

impl CppDeletable for QComboBox[src]

unsafe fn delete(&self)[src]

Destroys the combobox.

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

C++ documentation:

Destroys the combobox.

impl Deref for QComboBox[src]

type Target = QWidget

The resulting type after dereferencing.

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

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

impl DynamicCast<QComboBox> for QWidget[src]

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

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

impl DynamicCast<QComboBox> for QObject[src]

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

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

impl DynamicCast<QComboBox> for QPaintDevice[src]

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

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

impl DynamicCast<QFontComboBox> for QComboBox[src]

unsafe fn dynamic_cast(ptr: Ptr<QComboBox>) -> Ptr<QFontComboBox>[src]

Calls C++ function: QFontComboBox* dynamic_cast<QFontComboBox*>(QComboBox* ptr).

impl StaticDowncast<QComboBox> for QWidget[src]

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

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

impl StaticDowncast<QComboBox> for QObject[src]

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

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

impl StaticDowncast<QComboBox> for QPaintDevice[src]

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

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

impl StaticDowncast<QFontComboBox> for QComboBox[src]

unsafe fn static_downcast(ptr: Ptr<QComboBox>) -> Ptr<QFontComboBox>[src]

Calls C++ function: QFontComboBox* static_cast<QFontComboBox*>(QComboBox* ptr).

impl StaticUpcast<QComboBox> for QFontComboBox[src]

unsafe fn static_upcast(ptr: Ptr<QFontComboBox>) -> Ptr<QComboBox>[src]

Calls C++ function: QComboBox* static_cast<QComboBox*>(QFontComboBox* ptr).

impl StaticUpcast<QObject> for QComboBox[src]

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

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

impl StaticUpcast<QPaintDevice> for QComboBox[src]

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

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

impl StaticUpcast<QWidget> for QComboBox[src]

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

Calls C++ function: QWidget* static_cast<QWidget*>(QComboBox* 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.