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,也许高版本已经修复)