码迷,mamicode.com
首页 > 其他好文 > 详细

Qt代码

时间:2018-10-15 23:07:11      阅读:207      评论:0      收藏:0      [点我收藏+]

标签:com   echo   tab   字体大小   abstract   login   focus   order   test   

ui->LoginPushButton->setStyleSheet(//正常状态样式
"QPushButton{"
"background-color:rgba(100,25,50,30);"//背景色(也可以设置图片)
"border-style:outset;" //边框样式(inset/outset)
"border-width:4px;" //边框宽度像素
"border-radius:10px;" //边框圆角半径像素
"border-color:rgba(255,255,255,30);" //边框颜色
"font:bold 20px;" //字体,字体大小
"color:rgba(0,0,0,100);" //字体颜色
"padding:6px;" //填衬
"}"
//鼠标按下样式
"QPushButton:pressed{"
"background-color:rgba(1,55,50,20);"
"border-color:rgba(25,25,255,30);"
"border-style:inset;"
"color:rgba(100,0,100,100);"
"}"
//鼠标悬停样式
"QPushButton:hover{"
"background-color:rgba(100,255,100,100);"
//"border-color:rgba(0, 0, 0, 0);"
"color:rgba(0,0,0,200);"
"}");

ui->UserComboBox->setStyleSheet("QComboBox{border:1px solid gray;background: rgba(255, 255, 255, 10);font:20px;height:30px;}"
//"QComboBox {border: 1px solid gray;border-radius: 3px;padding: 1px 2px 1px 2px;background: rgb(46,98,118);height:20px;}"
//"QComboBox:editable{background:red;}"
//"QComboBox QAbstractItemView{border: 0px;outline:0px;selection-background-color: red;height:100px;background: rgb(100,58,80);font:22px;color:white;}"
//"QComboBox QAbstractItemView::item{height:50px;width:200px;}"
//"QComboBox QAbstractItemView::item:selected{background-color: red;}"
"QComboBox::down-arrow{image:url(:/images/icon/arrow.png);}"
"QComboBox::down-arrow:hover {image:url(:/images/icon/arrow.png);}"
"QComboBox::down-arrow:pressed {border-image: url(:/images/icon/arrow.png);}"
"QComboBox::drop-down {subcontrol-origin: padding;subcontrol-position: top right;width: 20px;border-left-width: 1px;border-left-color: darkgray;border-left-style: solid;border-top-right-radius: 3px;border-bottom-right-radius: 3px;}"
//"QComboBox::drop-down{border:0px;}"
);

//ui->PwdLineEdit->setStyleSheet("QLineEdit{background-color: rgb(255, 255, 255);font:20px;}");
ui->PwdLineEdit->setStyleSheet("QLineEdit{background-color:rgba(255,250,255,10);height:25px;}QLineEdit:focus{background-color: rgba(255,255,255,10)}");
connect(ui->LoginPushButton, &QPushButton::clicked, this, &LoginDialog::on_pushButton_clicked);

ui->UserComboBox->setEditable(true);//设置为可编辑状态
//QIcon onlineIcon("icon/test.ico");
QIcon onlineIcon;
ui->UserComboBox->addItem(onlineIcon, "admin"); //添加图片给超级用户
ui->PwdLineEdit->setEchoMode(QLineEdit::Password); //密码设置为*/

Qt代码

标签:com   echo   tab   字体大小   abstract   login   focus   order   test   

原文地址:https://www.cnblogs.com/527722032zfl/p/9794870.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!