Home > Mobile > Questions about QLabel icon on the left is a dot
Questions about QLabel icon on the left is a dot
Time:04-23
Everybody, excuse me if QLabel left is dot, how to make dots centered relative to the words on the right side? The code is as follows: M_labelTip1=new QLabel (" do not... ", this); M_labelTip1 - & gt; SetAlignment (Qt: : AlignLeft); M_labelTip1 - & gt; SetStyleSheet QLabel (" {background - image: url (:/res/sets/point. The PNG);" Background - position: top left; "" Background - origin: content; "" Background - repeat: no - repeat; "" "Border - the radius: 0 px; border:none; Color: # 003 da6; The font: 14 px "" SimHei" "; } "); Screenshots are as follows:
CodePudding user response:
Two ways, one is in two label, put a dot to put a word; The second is overloaded QWidget, painting herself on the paintEvent dot and text