c++ qt自定义按钮
所需库:#include <QPushButton>1.定义普通按钮QPushButton* closeBtn = new QPushButton(this);2.为按钮调整大小,位置:closeBtn->setGeometry(30, 0, 32, 32);参1:x位置参2:y位置参3:宽参4:高3.从样式表加载图片:前提先从.qrc文件加载保存closeBtn->setStyleSheet("background-image:url(
原创
2021-10-24 13:54:16 ·
507 阅读 ·
1 评论