Qt中Spinbox,DateTimeEdit等控件样式表:箭头在左右两边QSS代码示例

/*spinbox 抬起样式*/
QDateTimeEdit::up-button,QTimeEdit::up-button,QDoubleSpinBox::up-button,QSpinBox::up-button {subcontrol-origin:border;
    subcontrol-position:right;
    image: url(:/image/add.png);
    width: 20px;
    height: 20px;                
}
QDateTimeEdit::down-button,QTimeEdit::down-button,QDoubleSpinBox::down-button,QSpinBox::down-button {subcontrol-origin:border;
    subcontrol-position:left;
    image: url(:/image/reduce.png);
    width: 20px;
    height: 60px;
}
/*按钮按下样式*/
QDateTimeEdit::up-button:pressed,QTimeEdit::up-button:pressed,QDoubleSpinBox::up-button:pressed,QSpinBox::up-button:pressed{subcontrol-origin:border;
    subcontrol-position:right;
    image: url(:/image/add_click.png);
    width: 20px;
    height: 20px;        
}
 
QDateTimeEdit::down-button:pressed,QTimeEdit::down-button:pressed,QDoubleSpinBox::down-button:pressed,QSpinBox::down-button:pressed{
    subcontrol-position:left;
    image: url(:/image/reduce_click.png);
    width: 20px;
    height: 20px;}
}

你可能感兴趣的:(C++)