AbstractStylableControls QML Type
스타일을 지정할 수 있는 컨트롤 유형이 포함된 추상 기본 유형입니다. 더 보기...
| Import Statement: | import Qt.labs.StyleKit |
| Inherited By: | AbstractStyle, Style, StyleVariation, and Theme |
속성
- abstractButton : ControlStyle
- applicationWindow : ControlStyle
- button : ControlStyle
- checkBox : ControlStyle
- comboBox : ControlStyle
- control : ControlStyle
- flatButton : ControlStyle
- frame : ControlStyle
- groupBox : ControlStyle
- itemDelegate : ControlStyle
- label : ControlStyle
- page : ControlStyle
- pane : ControlStyle
- popup : ControlStyle
- progressBar : ControlStyle
- radioButton : ControlStyle
- scrollBar : ControlStyle
- scrollIndicator : ControlStyle
- scrollView : ControlStyle
- slider : ControlStyle
- spinBox : ControlStyle
- switchControl : ControlStyle
- tabBar : ControlStyle
- tabButton : ControlStyle
- textArea : ControlStyle
- textField : ControlStyle
- textInput : ControlStyle
- toolBar : ControlStyle
- toolButton : ControlStyle
- toolSeparator : ControlStyle
상세 설명
AbstractControls는 추상적인 기본 유형입니다. 여기에는 Style, Theme, 또는 StyleVariation 로 스타일을 지정할 수 있는 각 컨트롤 유형에 대한 ControlStyle 이 포함됩니다.
컨트롤 유형은 기본 유형에 설정된 속성이 더 구체적인 유형으로 전파되는 계층 구조를 형성합니다. 예를 들어 abstractButton.background.radius 에 반지름 4를 할당하면 button, checkBox, radioButton 와 같은 모든 버튼 유형이 반지름 4를 갖게 됩니다.
이 페이지의 스니펫은 각 컨트롤 유형의 스타일을 지정하는 데 사용할 수 있는 몇 가지 주요 프로퍼티를 보여 주지만, 모든 것을 설명하지는 않습니다. ControlStyle 및 DelegateStyle 문서에 설명된 대로 다른 많은 속성을 사용할 수 있습니다. 실제로는 fallback style 에서 이미 합리적인 기본값을 제공하기 때문에 일부 프로퍼티는 생략할 수도 있습니다. 즉, 스니펫 중 하나에서 프로퍼티를 제거하면 대신 폴백 스타일에서 읽히기 때문에 실제로 모양에 영향을 미치지 않을 수 있습니다.
참고: Qt.labs 모듈의 유형은 향후 버전에서 호환성을 보장하지 않습니다.
속성 문서
abstractButton : ControlStyle
Button, CheckBox, RadioButton, Switch 을 포함한 모든 버튼형 컨트롤의 스타일링을 위한 그룹화된 속성입니다. 설정되지 않은 프로퍼티는 control 로 돌아갑니다.
abstractButton.background.radius: 4 // all buttons get a radius of 4 checkBox.indicator.radius: 2 // except check boxes, which get a radius of 2
컨트롤유형도 참조하십시오 .
applicationWindow : ControlStyle
스타일링을 위한 그룹화된 속성 ApplicationWindow.
설정되지 않은 속성은 control 으로 돌아갑니다.
applicationWindow 을 사용하여 창의 배경색을 설정합니다:
light: Theme {
applicationWindow.background.color: "#f0f0f0"
}
dark: Theme {
applicationWindow.background.color: "#404040"
}참고: 애플리케이션에서 Window가 아닌 ApplicationWindow 을 사용해야 적용됩니다.
button : ControlStyle
스타일링을 위한 그룹화된 속성 Button.
설정되지 않은 속성은 abstractButton 으로 돌아갑니다.
button { background { implicitWidth: 120 implicitHeight: 40 shadow { opacity: 0.6 color: "gray" verticalOffset: 2 horizontalOffset: 2 } color: "cornflowerblue" gradient: Gradient { // The gradient is drawn on top of the 'background.color', so // we use semi-transparent stops to give the button some shading // while letting the base color show through. This makes it easier // to change the color, but keep the shading, in the hovered state below. GradientStop { position: 0.0; color: Qt.alpha("black", 0.0)} GradientStop { position: 1.0; color: Qt.alpha("black", 0.2)} } } text.color: "white" hovered.background.color: "royalblue" pressed.background.scale: 0.95 }
checkBox : ControlStyle
스타일링을 위한 그룹화된 속성 CheckBox.
설정되지 않은 속성은 abstractButton 으로 돌아갑니다.
checkBox { // Hide the button background; show only the indicator and text background.visible: false indicator { color: "white" border.color: "darkslategray" foreground { color: "transparent" image.source: "qrc:/qt-project.org/imports/QtQuick/Controls/Basic/images/check.png" image.color: palette.accent // Hide the checkmark when the checkbox is not checked visible: false } } // Show the checkmark when the checkbox is checked checked.indicator.foreground.visible: true }
comboBox : ControlStyle
스타일링을 위한 그룹화된 속성 ComboBox.
설정되지 않은 속성은 control 으로 돌아갑니다.
comboBox { text.alignment: Qt.AlignHCenter | Qt.AlignVCenter background.topLeftRadius: 4 background.topRightRadius: 4 indicator { // Show only the dropdown arrow, not the indicator background color: "transparent" border.width: 0 foreground { image.source: "qrc:/qt-project.org/imports/QtQuick/Controls/Basic/images/drop-indicator.png" image.color: "black" } } }
control : ControlStyle
모든 컨트롤의 스타일을 지정하기 위한 그룹화된 속성입니다.
control 는 컨트롤 계층 구조의 기본 유형이며 여기에 설정된 속성은 다른 모든 컨트롤 유형에 대한 기본값으로 사용됩니다. 예를 들어 control.implicitWidth: 200 을 설정하면 버튼, 스크롤 표시기 및 기타 모든 컨트롤을 포함한 모든 컨트롤의 너비가 200픽셀이 됩니다. 또한 호버 효과 및 기타 상태 기반 동작을 포함하여 스타일 계층 구조의 상위 수준에서 상속된 모든 값( Theme 의 경우 Style, Style 의 경우 fallbackStyle )을 재정의합니다. control 은 드물게 사용하고 가능하면 abstractButton 또는 pane 과 같은 보다 구체적인 기본 유형을 선호하세요.
control { padding: 8 background.radius: 4 }
flatButton : ControlStyle
플랫 버튼(일반 상태에서 배경이 보이지 않는 버튼) 스타일링을 위한 그룹화된 속성입니다. Button.flat 이 true 으로 설정된 경우 스타일링은 Button 에 적용됩니다.
설정되지 않은 속성은 abstractButton 로 돌아갑니다.
flatButton { // Hide background normally, show on hover background.visible: false hovered.background.visible: true }
frame : ControlStyle
스타일링을 위한 그룹화된 속성 Frame.
설정되지 않은 속성은 pane 으로 돌아갑니다.
frame { background { color: "#fafafa" border.color: "#d0d0d0" radius: 4 } }
groupBox : ControlStyle
스타일링을 위한 그룹화된 속성 GroupBox.
설정되지 않은 속성은 frame 으로 돌아갑니다.
groupBox { // A group box is a container for other controls, so we give it some // padding to avoid the child controls to be too close to the border padding: 20 // Move the label to the right, to match the radius of the background text.leftPadding: 6 text.color: "darkslategray" background { // Move the frame down, below the text label topMargin: 30 radius: 6 color: "#f8f8f8" border.color: "#d0d0d0" } }
itemDelegate : ControlStyle
스타일링을 위한 그룹화된 속성 ItemDelegate.
설정되지 않은 속성은 control 로 되돌아갑니다.
참고: Qt Quick Controls 에서 ItemDelegate 은 AbstractButton 에서 상속됩니다. 그러나 StyleKit 에서 itemDelegate 은 abstractButton 이 아닌 control 으로 되돌아갑니다. 왜냐하면 델리게이트는 일반적으로 버튼과 스타일이 매우 다르기 때문입니다(플랫, 테두리 또는 그림자 없음 등).
itemDelegate { text.alignment: Qt.AlignVCenter | Qt.AlignLeft background { radius: 0 color: "white" border.width: 0 } hovered.background.color: "#f0f0f0" }
label : ControlStyle
스타일링을 위한 그룹화된 속성 Label.
설정되지 않은 속성은 control 으로 돌아갑니다.
light: Theme {
// Labels typically have no background, so set background.visible to false.
// Alternatively, hiding the background for labels can be done once for all
// themes by setting Style.label.background.visible: false.
label.background.visible: false
label.text.color: "black"
}
dark: Theme {
label.background.visible: false
label.text.color: "white"
}page : ControlStyle
스타일링을 위한 그룹화된 속성 Page.
설정되지 않은 속성은 pane 으로 돌아갑니다.
page { background { color: "white" border.width: 0 } }
pane : ControlStyle
스타일링을 위한 그룹화된 속성 Pane.
설정되지 않은 속성은 control 으로 돌아갑니다.
pane { background { implicitWidth: 200 implicitHeight: 200 color: "white" } }
popup : ControlStyle
스타일링을 위한 그룹화된 속성 Popup.
설정되지 않은 속성은 control 으로 돌아갑니다.
popup { background { color: "white" border.width: 1 border.color: "darkslategray" radius: 4 } }
progressBar : ControlStyle
스타일링용 그룹화된 속성 ProgressBar. 진행률 표시줄의 경우 홈은 표시기를 통해 스타일이 지정되고 진행률 트랙은 표시기의 포그라운드를 통해 스타일이 지정됩니다.
설정되지 않은 속성은 control.
progressBar {
// Hide the background; show only the progress bar
background.visible: false
indicator {
implicitWidth: 150
implicitHeight: 8
radius: 4
color: "#e0e0e0"
foreground {
// Set margins to add some space between the progress track and the groove
margins: 2
color: palette.accent
radius: 4
}
}
}StyleKit 는 진행률 표시줄의 불확정 애니메이션 스타일을 지정하는 전용 프로퍼티를 제공하지 않습니다. 애니메이션을 변경하려면 대신 사용자 지정 표시기 전경 delegate 을 구현해야 합니다:
progressBar { indicator { implicitWidth: 150 implicitHeight: 8 foreground { delegate: StyledItem { // Draw a pulsating progress track when in indeterminate mode, and a normal track otherwise width: control.indeterminate ? parent.width : parent.width * control.visualPosition height: parent.height opacity: control.indeterminate ? 0.1 : 1.0 SequentialAnimation on opacity { running: control.indeterminate loops: Animation.Infinite NumberAnimation { from: 0.1; to: 1.0; duration: 500; easing.type: Easing.InOutQuad } NumberAnimation { from: 1.0; to: 0.1; duration: 500; easing.type: Easing.InOutQuad } } } } } }
radioButton : ControlStyle
스타일링을 위한 그룹화된 속성 RadioButton.
설정되지 않은 속성은 abstractButton 으로 돌아갑니다.
radioButton { // Hide the button background; show only the indicator and text background.visible: false indicator { // Make the indicator circular radius: 255 foreground { // The foreground circle is what shows the checked state, so we make // it a bit smaller than the outer circle by setting margins margins: 4 radius: 255 // Hide the foreground circle when the radio button is not checked visible: false } } // Show the foreground circle when the radio button is checked checked.indicator.foreground.visible: true }
scrollBar : ControlStyle
스타일링을 위한 그룹화된 속성 ScrollBar. 스크롤 막대의 경우 홈은 표시기를 통해 스타일이 지정되고 핸들은 표시기의 포그라운드를 통해 스타일이 지정됩니다.
설정되지 않은 속성은 control 로 돌아갑니다.
scrollBar { padding: 0 background { // For scroll bars, we typically don't want a background, only a // draggable indicator and a groove. visible: false // Note: even if the background is hidden, its implicit size is still used to // determine the overall size of the scroll bar. So we set implicitHeight equal to // the height of the indicator, to make it appear on the side of, and not on top // of, the content area in a ScrollView. For a horizontal scroll bar, on the other // hand, the width is automatically set by the view to match its own width. implicitHeight: 10 } indicator { radius: 255 // For horizontal scroll bars, we only set the height. The width is set by the // view to be the relative size of the view's content that is currently visible. implicitHeight: 10 color: "#c0c0c0" foreground.visible: false } vertical { // Override properties for vertical scroll bars if needed. // For vertical indicators, we only set width. The height is set by the // view to be the relative size of the view's content that is currently visible. indicator.implicitWidth: 10 background.implicitWidth: 10 } }
scrollIndicator : ControlStyle
스타일링을 위한 그룹화된 속성 ScrollIndicator.
설정되지 않은 속성은 control 으로 돌아갑니다.
scrollIndicator { // For scroll indicators, we typically don't want a background, only a // sliding indicator background.visible: false indicator { // For horizontal indicators, we only set the height. The width is set by the // view to be the relative size of the view's content that is currently visible. implicitHeight: 5 border.width: 0 color: "cornflowerblue" // The indicator is so simple that it doesn't need a foreground foreground.visible: false } vertical { // Override properties for vertical scroll indicators if needed indicator.color: "violet" // For vertical indicators, we only set width. The height is set by the // view to be the relative size of the view's content that is currently visible. indicator.implicitWidth: 5 } }
scrollView : ControlStyle
스타일 지정을 위한 그룹화된 속성 ScrollView.
ScrollView 자체에는 스타일을 지정할 시각적 델리게이트가 없습니다. 스크롤 막대는 scrollBar 속성을 통해 개별적으로 스타일을 지정할 수 있습니다. 하지만 padding 을 사용하여 스크롤 막대와 콘텐츠 영역 사이의 공간을 제어할 수 있습니다.
설정되지 않은 속성은 control 로 돌아갑니다.
scrollView { // Add some space between the scroll bars and the content area padding: 2 // For the sake of the example, style the scroll bars in a ScrollView // differently from the default scroll bars by using a StyleVariation. variations: StyleVariation { scrollBar.indicator.color: "cornflowerblue" } }
slider : ControlStyle
스타일링용 그룹화된 속성 Slider. 슬라이더 막대의 경우 홈은 표시기를 통해 스타일이 지정되고 진행률 트랙은 표시기의 포그라운드를 통해 스타일이 지정됩니다. 설정되지 않은 속성은 control 로 돌아갑니다.
slider { background.visible: false indicator { // The groove of the slider should fill out the entire width of // the control, which we achieve by setting implicitWidth to Style.Stretch. implicitWidth: Style.Stretch implicitHeight: 8 radius: 255 color: "#e0e0e0" foreground { radius: 255 color: palette.accent } } handle { implicitWidth: 24 implicitHeight: 24 radius: 255 color: "white" border.color: "#c0c0c0" } vertical { // if needed, you can override properties for vertical sliders } }
spinBox : ControlStyle
스타일링을 위한 그룹화된 속성 SpinBox.
설정되지 않은 속성은 control 로 돌아갑니다.
spinBox { // Center the text between the up/down buttons text.alignment: Qt.AlignHCenter | Qt.AlignVCenter indicator { color: "transparent" border.width: 0 foreground { image.source: "qrc:/qt-project.org/imports/QtQuick/Controls/Basic/images/arrow-indicator.png" image.color: "black" alignment: Qt.AlignCenter } // Place the down and up buttons on the left and right side of the control down { alignment: Qt.AlignLeft foreground.rotation: 90 } up { alignment: Qt.AlignRight foreground.rotation: -90 } } }
참고: 현재 위쪽 및 아래쪽 버튼은 컨트롤의 왼쪽 또는 오른쪽에만 배치할 수 있으며 서로 위에 배치할 수는 없습니다.
switchControl : ControlStyle
스타일링을 위한 그룹화된 속성 Switch.
설정되지 않은 속성은 abstractButton 으로 돌아갑니다.
switchControl { // For a switch control, we typically don't want a background, only an indicator with a handle background.visible: false indicator { radius: 12 foreground { // Add some space between the indicator and the foreground track margins: 2 radius: 12 // The foreground track should only be visible when the switch is checked visible: false } } checked.indicator.foreground.visible: true handle { // Add some space between the handle and the indicator leftMargin: 2 rightMargin: 2 implicitWidth: 20 implicitHeight: 20 radius: 255 color: "white" } }
tabBar : ControlStyle
스타일링을 위한 그룹화된 속성 TabBar.
설정되지 않은 속성은 pane 으로 돌아갑니다.
tabBar { padding: 0 spacing: -1 // let tab buttons overlap slightly background { color: "white" border.width: 0 } }
tabButton : ControlStyle
스타일링을 위한 그룹화된 속성 TabButton.
설정되지 않은 속성은 abstractButton 으로 돌아갑니다.
tabButton { background { radius: 0 topLeftRadius: 4 topRightRadius: 4 color: "#e8e8e8" } checked.background.color: "white" }
textArea : ControlStyle
스타일링을 위한 그룹화된 속성 TextArea.
설정되지 않은 속성은 textInput 으로 돌아갑니다.
textArea { // Add some space between the text and the border of the text area padding: 8 text.color: "black" background { color: "white" border.color: "#c0c0c0" } focused.background.border.color: palette.accent }
textField : ControlStyle
스타일링을 위한 그룹화된 속성 TextField.
설정되지 않은 속성은 textInput 으로 돌아갑니다.
textField { // Add some space between the text and the border of the text field padding: 8 text.alignment: Qt.AlignVCenter background { implicitWidth: 150 color: "white" border.color: "#c0c0c0" } focused.background.border.color: palette.accent }
textInput : ControlStyle
TextField 및 TextArea 을 포함한 모든 텍스트 입력 컨트롤의 스타일을 지정하기 위한 그룹화된 속성입니다.
설정되지 않은 프로퍼티는 control 로 돌아갑니다.
textInput { // Add some space between the text and the border of the text input padding: 8 text.color: "black" background { color: "white" border.width: 1 border.color: "#c0c0c0" } }
toolBar : ControlStyle
스타일링을 위한 그룹화된 속성 ToolBar.
설정되지 않은 속성은 pane 으로 돌아갑니다.
toolBar { spacing: 2 background { radius: 0 implicitHeight: 40 border.width: 1 } }
toolButton : ControlStyle
스타일링을 위한 그룹화된 속성 ToolButton.
설정되지 않은 속성은 abstractButton 으로 돌아갑니다.
toolButton { background.radius: 0 }
toolSeparator : ControlStyle
스타일링을 위한 그룹화된 속성 ToolSeparator.
설정되지 않은 속성은 control 으로 돌아갑니다.
toolSeparator { background.visible: false indicator { implicitWidth: 30 implicitHeight: 1 border.width: 0 color: "#c0c0c0" foreground.visible: false } vertical { // Override properties for vertical tool separators if needed. // Note: Qt Quick Controls automatically swaps the width and height // for vertical tool separators, so avoid doing that here. } }
© 2026 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.