//设置按钮样式</span>
pushButton=new QPushButton(this);
pushButton->setGeometry(65,370,130,66); //位置和大小
pushButton->setFocusPolicy(Qt::NoFocus); //不聚焦在此按钮上
connect(pushButton,SIGNAL(clicked()),this,SLOT(pushButton_clicked())); //绑定事件
pushButton->setStyleSheet("QPushButton{border-image: url(:/new/prefix2/pushbutton1/asj.bmp);}" //设置效果
"QPushButton:hover{border-image: url(:/new/prefix2/pushbutton1/asj1.bmp);}" //鼠标放在上面的效果
"QPushButton:pressed{border-image: url(:/new/prefix2/pushbutton1/asj1.bmp);}"); //按下去的效果
QT 图片按钮
最新推荐文章于 2024-07-14 21:50:34 发布