QAction *searchAction = new QAction(ui->lineEdit);
searchAction->setIcon(QIcon(":/image/user.png"));
ui->lineEdit->addAction(searchAction,QLineEdit::LeadingPosition );//编辑框左侧
//QLineEdit::TrailingPosition 在右侧
备注:不知道原理,但是亲测可行
2023-11-16 16:26:04
QAction *searchAction = new QAction(ui->lineEdit);
searchAction->setIcon(QIcon(":/image/user.png"));
ui->lineEdit->addAction(searchAction,QLineEdit::LeadingPosition );//编辑框左侧
//QLineEdit::TrailingPosition 在右侧
备注:不知道原理,但是亲测可行
下一篇:UI和后台参数传递规则