QLineEdit 编辑框左侧添加小图标
作者:互联网
QAction *searchAction = new QAction(ui->lineEdit);
searchAction->setIcon(QIcon(":/image/user.png"));
ui->lineEdit->addAction(searchAction,QLineEdit::LeadingPosition );//编辑框左侧
//QLineEdit::TrailingPosition 在右侧
备注:不知道原理,但是亲测可行
标签:searchAction,QAction,ui,QLineEdit,lineEdit,编辑框,小图标 来源: https://www.cnblogs.com/hhy-2216/p/15921403.html