/* QcomboBox style */
QComboBox {
border: 1px solid gray; /* Border */
border-radius: 3px; /* Round */
padding: 1px 18px 1px 3px; /* Font fill */
color: #000;
font: normal normal 15px "Microsoft YaHei";
background: transparent;
}
/* After dropping, the entire drop-down form style */
QComboBox QAbstractItemView {
outline: 0px solid gray; /* The virtual frame of the selected item */
border: 1px solid yellow; /* Border of the entire drop-down form */
color: green;
background-color: red; /* Whole drop-down form background color */
selection-background-color: lightgreen; /* The whole drop-down window is selected from the background color of the item */
}
/* Down pull, the entire drop-down window */
QComboBox QAbstractItemView::item {
height: 50px; /* The height of the item (set pcomboBox-> setView (new qlistview ()); after this item works) */
}
/* After dropping, the entire drop-down window crossing each pattern */
QComboBox QAbstractItemView::item:hover {
color: #FFFFFF;
background-color: lightgreen; /* The whole drop-down window crosss the background color of each item */
}
/* After dropping, the entire drop-down window is selected for each pattern. */
QComboBox QAbstractItemView::item:selected {
color: #FFFFFF;
background-color: lightgreen;
}
/* Vertical scroll bar in qcomboBox */
QComboBox QAbstractScrollArea QScrollBar:vertical {
width: 10px;
background-color: #d0d2d4; /* Blank area Gray Green */
}
QComboBox QAbstractScrollArea QScrollBar::handle:vertical {
border-radius: 5px; /* Round */
background: rgb(160,160,160); /* Small square background color dark gray lightblue */
}
QComboBox QAbstractScrollArea QScrollBar::handle:vertical:hover {
background: rgb(90, 91, 93); /* Crossing the small square background color Yellow */
}
/* Set to edit (TRUE) Editable, the style of editing area */
QComboBox:editable {
background: green;
}
/* Set to non-editing (STEDITABLE)! EDITABLE, the whole qComboBox style */
QComboBox:!editable {
background: blue;
}
/* When set to edit Editable, click on the style of the entire QComboBox */
QComboBox:editable:on {
background: green;
}
/* When set to non-editing! Editable, click on the whole qComboBox style. */
QComboBox:!editable:on {
background: blue;
}
/* Set to edit Editable, the drop-down box style */
QComboBox::drop-down:editable {
background: lightblue;
}
/* When set to edit Editable, click the dropped box style. */
QComboBox::drop-down:editable:on {
background: lightgreen;
}
/* Set to non-editing! Editable, drop-down box style */
QComboBox::drop-down:!editable {
background: lightblue;
}
/* When set to non-editing! Editable, click the dropped box style. */
QComboBox::drop-down:!editable:on {
background: lightgreen;
}
/* Click qComboBox */
QComboBox:on {
}
/* Pull-up box pattern */
QComboBox::drop-down {
subcontrol-origin: padding; /* The origin rectangle of the child control in the parent element. If this property is not specified, the default is padding. */
subcontrol-position: top right; /* Down-pull box position (upper right) */
width: 15px; /* Down-pull box width */
border-left-width: 1px; /* Down-pull frame on the left boundary width */
border-left-color: darkgray; /* Down-pull frame on the left line color */
border-left-style: solid; /* The left side of the drop-down frame is a solid line */
border-top-right-radius: 3px; /* Rounded radius of the upper right border line of the drop box (should be consistent with the rounded radius of the entire QCOMBOBOX right on the right side) */
border-bottom-right-radius: 3px; /* Equally */
}/ * Crossing the pull frame pattern * /
QComboBox::drop-down:hover { background: yellow; }
/* Drop the arrow style */
QComboBox::down-arrow {
width: 15px; /* The width of the drop-down arrow (recommended with the width of the drop-down Drop-Down) */
background: transparent; /* Drop the arrow background color */
padding: 0px 0px 0px 0px; /* Upper margins, right inner margins, lower margins, left within and left */
image: url(:/images/combobox_arrow_down.png); }
/* Click to pull the arrow */
QComboBox::down-arrow:on { image: url(:/images/combobox_arrow_up.png); /* Show drop-down arrow */ }
QComboBox::indicator{
background-color:transparent;
selection-background-color:transparent;
color:transparent;
selection-color:transparent;
}
note: QComboBox* pComboBox = new QComboBox(this);
pComboBox->setView(new QListView()); //The drop-down column key can take effect
'개발 > Qt' 카테고리의 다른 글
[Qt] 메시지 박스(QMessageBox) 몇 초 후 자동으로 사라지게 하기 (0) | 2021.11.16 |
---|---|
[PyQt] 파이썬에서 Qt 리소스(Resource) 파일 활용하기 (0) | 2021.11.08 |
[PyQt] 트리 뷰(QTreeView)에 콤보박스(QComboBox) 추가하기 (0) | 2021.11.03 |
[PyQt] QTreeView에서 각 아이템마다 다른 툴팁 설정하기 (0) | 2021.11.01 |
[PyQt] 파일에서 데이터 읽어 테이블로 보여주기(QTableWidget) (0) | 2021.10.30 |