PDA

View Full Version : QToolButton Icon without Border?



Nfrancisj
25th June 2019, 23:58
Heyoo!

I'm trying to set my QToolButton Style to ToolButtonIconOnly, but nothing happens.
What am I forgetting?

In the attached image, My button has the border- which I'd like to remove. I would like it to look like the icons just to the right of it. Is my Line 7 not correct?


try:
if c.toolTip().startswith("Flipbook this viewer"):
print c.toolButtonStyle()
snapshotToolButton = QtWidgets.QToolButton()
snapshotToolButton.setBaseSize(16,16)
snapshotToolButton.setIcon(QtWidgets.QIcon("C:/Users/nfran/.nuke/icons/cameraIcon.png"))
snapshotToolButton.setToolButtonStyle(QtCore.Qt.To olButtonIconOnly)
snapshotToolButton.setToolTip("Take Snapshot")
c.parentWidget().layout().insertWidget(0,snapshotT oolButton)
return c

except: pass

13167

Nfrancisj
27th June 2019, 00:09
got it.
Decided to use StyleSheet


snapshotToolButton.setStyleSheet("#SnapShotButton {border : none;}")