Qt中QToolButton和QPushButton按钮去掉边框、去掉背景、指定图标和设置鼠标悬浮小手

Qt中QToolButton和QPushButton按钮去掉边框、去掉背景、指定图标和设置鼠标悬浮小手

Qt中QToolButton和QPushButton按钮去掉边框、去掉背景、指定图标和设置鼠标悬浮小手
//删除按钮
QToolButton *btnDelete = new QToolButton();
btnDelete->setIcon(QIcon(":/res/1.png");
btnDelete->setToolButtonStyle(Qt::ToolButtonIconOnly);
btnDelete->setStyleSheet("border:none;background: transparent;");
btnDelete->setCursor(QCursor(Qt::PointingHandCursor));

 

原创文章,作者:365开发网,如若转载,请注明出处:https://www.365codes.com/535.html