简体   繁体   中英

How to “get” an attribute of a QLabel widget

I understand that QLabel attributes such as frameGeometry, pixmap and text can be recovered using their respective commands. But is it possible to get the value of "frame shadow" around each of these label widgets?

I have 3 Labels placed inside a Frame (inside a Window) using qt-designer. I assigned shadows for each of these labels by calling self.label_1.setFrameShadow(QFrame.Raised) or self.label_1.setFrameShadow(QFrame.Plain) within the QMainWindow class. Now I wish to update their shadow attributes after checking to see if one of them is Raised or Plain. The error says that: 'QLabel' object has no attribute 'FrameShadow'. But why so if I was able to set it?

QLabel inherits from QFrame and therefore has an accessor frameShadow() for that property.

Unlike in other frameworks, Qt accessors don't start with get ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM