QT之qss教程-QMenuBar


QMainWindow::separator {
	background:yellow;
	width:10px;
	height:10px;
}

QMainWindow::separator:hover {
	background:red;
}

QMenu {
	/* 背景色 */
	background-color:white;
	
	/* 边框 */
	border:2px solid red;
	
	/* 边框周围距离 */
	margin:24px;
}

QMenu::item {
	/* 背景颜色透明 */
	background-color:transparent;
	
	/* 内边框 */
	padding:20 25 20 20px;
	
	/* 外边框 */
	border:4px solid transparent;
}

/* 选中条目时 */
QMenu::item:selected {
	background-color:#654321;
	border-color:darkblue;
	background:rgba(100,100,100,150);
}

/* 条目被选中时,ui->action_O->setCheckable(true); */
QMenu::icon::checked {
	background:red;
	border:3px inset red;
	position:absolute;
	
	/* 一点位移 */
	top:2px;
	right:2px;
	bottom:4px;
	left:4px;
}

/* 分隔符 */
QMenu::separator {
	height:10px;
	background:lightblue;
	margin-left:10px;
	margin-right:5px;
}

QMenu::indicator {
	width:20px;
	height:20px;
}

/* non-exclusive indicator = check box style indicator (see QActionGroup::setExclusive) */
QMenu::indicator:non-exclusive:unchecked {
    image: url(:/images/checkbox_unchecked.png);
}

QMenu::indicator:non-exclusive:unchecked:selected {
    image: url(:/images/checkbox_unchecked_hover.png);
}

QMenu::indicator:non-exclusive:checked {
    image: url(:/images/checkbox_checked.png);
}

QMenu::indicator:non-exclusive:checked:selected {
    image: url(:/images/checkbox_checked_hover.png);
}

/* exclusive indicator = radio button style indicator (see QActionGroup::setExclusive) */
QMenu::indicator:exclusive:unchecked {
    image: url(:/images/radiobutton_unchecked.png);
}

QMenu::indicator:exclusive:unchecked:selected {
    image: url(:/images/radiobutton_unchecked_hover.png);
}

QMenu::indicator:exclusive:checked {
    image: url(:/images/radiobutton_checked.png);
}

QMenu::indicator:exclusive:checked:selected {
    image: url(:/images/radiobutton_checked_hover.png);
}

/* 菜单栏 */
QMenuBar {
	background-color:qlineargradient(x1:0, y1:0, x2:0, y2:1,stop:0 lightgray, stop:1 darkgray);
}

QMenuBar::item {
	/* 条目之间的距离 */
	spacing:50px;
	
	/* 条目内边框 */
	padding:10 50px;
	
	/* 背景颜色 */
	background:transparent;
	
	/* 倒角 */
	border-radius:4px;
}


你可能感兴趣的:(Linux,QT,QSS)