이 페이지에서

QStyleOptionComboBox Class

QStyleOptionComboBox 클래스는 콤보박스를 그리는 데 필요한 매개변수를 정의하는 데 사용됩니다. 더 보기...

헤더: #include <QStyleOptionComboBox>
CMake: find_package(Qt6 REQUIRED COMPONENTS Widgets)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: QT += widgets
상속: QStyleOptionComplex

공개 유형

enum StyleOptionType { Type }
enum StyleOptionVersion { Version }

공개 함수

QStyleOptionComboBox()
QStyleOptionComboBox(const QStyleOptionComboBox &other)
QStyleOptionComboBox &operator=(const QStyleOptionComboBox &)

공개 변수

QIcon currentIcon
QString currentText
bool editable
bool frame
QSize iconSize
QRect popupRect
Qt::Alignment textAlignment

상세 설명

QStyleOptionButton QStyle 함수가 를 그리는 데 필요한 모든 정보를 포함합니다. QComboBox

성능상의 이유로 멤버 함수는 거의 없으며, 멤버 변수에 대한 액세스는 직접적으로 이루어집니다(즉, . 또는 -> 연산자를 사용). 이로 인해 구조체를 사용하기 쉬우며, 이러한 구조체가 단순히 스타일 함수가 사용하는 매개변일 뿐임을 강조합니다.

QStyleOption, QStyleOptionComplex, QComboBox도 참조하십시오 .

멤버 유형 문서

enum QStyleOptionComboBox::StyleOptionType

이 열거형은 스타일 옵션의 유형에 대한 정보를 담는 데 사용되며, 각 ` QStyleOption ` 하위 클래스에 대해 정의됩니다.

상수상수명설명
QStyleOptionComboBox::TypeSO_ComboBox제공된 스타일 옵션의 유형(이 클래스의 경우SO_ComboBox ).

이 유형은 QStyleOption, 그 하위 클래스 및 qstyleoption_cast()에서 스타일 옵션의 유형을 결정하기 위해 내부적으로 사용됩니다. 일반적으로 사용자 정의 QStyleOption 하위 클래스와 사용자 정의 스타일을 만들려는 경우가 아니라면 이 부분에 대해 걱정할 필요가 없습니다.

StyleOptionVersion도 참조하십시오 .

enum QStyleOptionComboBox::StyleOptionVersion

이 열거형은 스타일 옵션의 버전에 대한 정보를 담기 위해 사용되며, 각 QStyleOption 하위 클래스에 대해 정의됩니다.

상수상수상수값
QStyleOptionComboBox::Version12

이 버전은 QStyleOption 의 하위 클래스에서 호환성을 깨지 않고 확장을 구현하는 데 사용됩니다. qstyleoption_cast()를 사용하는 경우, 일반적으로 이 값을 확인할 필요가 없습니다.

StyleOptionType도 참조하십시오 .

멤버 함수 문서

QStyleOptionComboBox::QStyleOptionComboBox()

QStyleOptionComboBox를 생성하고, 멤버 변수들을 기본값으로 초기화합니다.

QStyleOptionComboBox::QStyleOptionComboBox(const QStyleOptionComboBox &other)

other 스타일 옵션의 복사본을 생성합니다.

[noexcept default] QStyleOptionComboBox &QStyleOptionComboBox::operator=(const QStyleOptionComboBox &)

other 를 이 QStyleOptionComboBox 인스턴스에 복사-할당합니다.

멤버 변수 문서

QIcon QStyleOptionComboBox::currentIcon

이 변수는 콤보 박스의 현재 항목에 해당하는 아이콘을 저장합니다.

기본값은 빈 아이콘, 즉 픽스맵이나 파일 이름이 모두 없는 아이콘입니다.

QString QStyleOptionComboBox::currentText

이 변수는 콤보 박스의 현재 항목에 대한 텍스트를 저장합니다.

기본값은 빈 문자열입니다.

bool QStyleOptionComboBox::editable

이 변수는 콤보박스가 편집 가능한지 여부를 나타냅니다.

기본값은 false입니다

QComboBox::isEditable()도 참조하십시오 .

bool QStyleOptionComboBox::frame

이 변수는 콤보 박스에 테두리가 있는지 여부를 나타냅니다.

기본값은 true입니다.

QSize QStyleOptionComboBox::iconSize

이 변수는 콤보 박스의 현재 항목에 대한 아이콘 크기를 저장합니다.

기본값은 QSize(-1, -1), 즉 유효하지 않은 크기입니다.

QRect QStyleOptionComboBox::popupRect

이 변수는 콤보박스의 팝업 사각형을 저장합니다.

기본값은 null 사각형, 즉 너비와 높이가 모두 0으로 설정된 사각형입니다.

이 변수는 현재 사용되지 않습니다. 안심하고 무시하셔도 됩니다.

QStyle::SC_ComboBoxListBoxPopup도 참조하십시오 .

Qt::Alignment QStyleOptionComboBox::textAlignment

이 변수는 콤보 박스 내 현재 텍스트의 정렬 방식을 저장합니다.

기본값은 Qt::AlignLeft | Qt::AlignVCenter 입니다.

© 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.