QLineEdit {
    background: #f3f3f3;
    background-image: url(:Images/search.svg); /* actual size, e.g. 16x16 */
    background-repeat: no-repeat;
    background-position: left;
    color: #252424;
    font-family: SegoeUI;
    font-size: 12px;
    padding: 2 2 2 20; /* left padding (last number) must be more than the icon's width */
border: 1px solid #dddddd; }
ps:注意要设置
border: 1px solid #dddddd;不然会出现背景图标闪烁(应该是qt的bug,也许高版本已经修复)

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2021-07-03
  • 2021-06-16
  • 2021-11-29
  • 2021-10-17
相关资源
相似解决方案