Control QML Type

A user interface control. More...

Properties

Detailed Description

Control is the base type of user interface controls.

Note: Types in the Qt.labs module are not guaranteed to remain compatible in future versions.

Property Documentation

[read-only] availableHeight : real

This property holds the height available after deducting vertical padding.

See also padding, topPadding, and bottomPadding.


[read-only] availableWidth : real

This property holds the width available after deducting horizontal padding.

See also padding, leftPadding, and rightPadding.


background : Item

This property holds the background item.

Note: If the background item has no explicit size specified, it automatically follows the control's size. In most cases, there is no need to specify width or height for a background item.


bottomPadding : real

This property holds the bottom padding.

See also padding, topPadding, and availableHeight.


contentItem : Item

This property holds the visual content item.

Note: The content item is automatically resized inside the padding of the control.


[read-only] focusReason : enumeration

This property holds the reason of the last focus change.

Note: This property does not indicate whether the control has active focus, but the reason why the control either gained or lost focus.

ConstantDescription
Qt.MouseFocusReasonA mouse action occurred.
Qt.TabFocusReasonThe Tab key was pressed.
Qt.BacktabFocusReasonA Backtab occurred. The input for this may include the Shift or Control keys; e.g. Shift+Tab.
Qt.ActiveWindowFocusReasonThe window system made this window either active or inactive.
Qt.PopupFocusReasonThe application opened/closed a pop-up that grabbed/released the keyboard focus.
Qt.ShortcutFocusReasonThe user typed a label's buddy shortcut
Qt.MenuBarFocusReasonThe menu bar took focus.
Qt.OtherFocusReasonAnother reason, usually application-specific.

See also Item::activeFocus.


font : font

This property holds the font currently set for the control.

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

The default font depends on the system environment. ApplicationWindow maintains a system/theme font which serves as a default for all controls. There may also be special font defaults for certain types of controls. You can also set the default font for controls by passing a custom font to QGuiApplication::setFont(), before loading the QML. Finally, the font is matched against Qt's font database to find the best match.

Control propagates explicit font properties from parent to children. If you change a specific property on a control's font, that property propagates to all of the control's children, overriding any system defaults for that property.


leftPadding : real

This property holds the left padding.

See also padding, rightPadding, and availableWidth.


locale : Locale

This property holds the locale of the control.

See also mirrored and LayoutMirroring.


[read-only] mirrored : bool

This property holds whether the control is mirrored.

This property is provided for convenience. A control is considered mirrored when its visual layout direction is right-to-left.

See also locale and LayoutMirroring.


padding : real

This property holds the default padding.

See also availableWidth, availableHeight, topPadding, leftPadding, rightPadding, and bottomPadding.


rightPadding : real

This property holds the right padding.

See also padding, leftPadding, and availableWidth.


spacing : real

This property holds the spacing.


topPadding : real

This property holds the top padding.

See also padding, bottomPadding, and availableHeight.


© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.