QStyleOptionComboBox Class

QStyleOptionComboBox 클래스는 콤보박스를 그리기 위한 매개변수를 설명하는 데 사용됩니다. 더 보기...

Header: #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)

공용 변수

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 하위 클래스마다 정의됩니다.

Constant설명
QStyleOptionComboBox::TypeSO_ComboBox제공되는 스타일 옵션의 유형입니다(이 클래스의 경우SO_ComboBox ).

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

StyleOptionVersion참조하세요 .

enum QStyleOptionComboBox::StyleOptionVersion

이 열거형은 스타일 옵션의 버전에 대한 정보를 저장하는 데 사용되며 각 QStyleOption 서브클래스에 대해 정의됩니다.

Constant설명
QStyleOptionComboBox::Version12

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

StyleOptionType참조하세요 .

멤버 함수 문서

QStyleOptionComboBox::QStyleOptionComboBox()

멤버 변수를 기본값으로 초기화하여 Q스타일 옵션 콤보박스를 생성합니다.

QStyleOptionComboBox::QStyleOptionComboBox(const QStyleOptionComboBox &other)

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

멤버 변수 문서

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

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

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

이 변수는 현재 사용되지 않습니다. 무시해도 됩니다.

QStyle::SC_ComboBoxListBoxPopup참조하세요 .

Qt::Alignment QStyleOptionComboBox::textAlignment

이 변수는 콤보 상자에서 현재 텍스트의 정렬을 유지합니다.

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

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