1.搜索样式示例

  1. QAction* searchAction = new QAction(ui->lineEdit);
  2. searchAction->setIcon(QIcon(":/search.png"));
  3. ui->lineEdit->addAction(searchAction, QLineEdit::TrailingPosition);
  4. ui->lineEdit->setStyleSheet("border:none; border-bottom: 1px solid rgb(180, 199, 219);");

效果图:
image.png