/*  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

 

+ Recent posts