Category: C++ VC

Qt pushbutton set icon and text 0

Qt pushbutton set icon and text

Hits: 0 Use the system’s own [API] ui->pushButton->setIconSize(QSize(32,32)); ui->pushButton->setIcon(QIcon(":/images/Setting.png")); ui->pushButton->setText(QString::fromLocal8Bit( "System Settings" )); ui->pushButton->setStyleSheet("QPushButton{border:1px solid blue;background:white;}" "QPushButton:hover{border:0px;background:blue;}" "QPushButton:pressed{border:0px;background:red;}"); Unable to set distance between icon and text. If you want the icon to be displayed...