Results 1 to 2 of 2

Thread: QToolButton Icon without Border?

  1. #1
    Join Date
    Feb 2016
    Location
    Venice, California
    Posts
    82
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default QToolButton Icon without Border?

    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?

    Qt Code:
    1. try:
    2. if c.toolTip().startswith("Flipbook this viewer"):
    3. print c.toolButtonStyle()
    4. snapshotToolButton = QtWidgets.QToolButton()
    5. snapshotToolButton.setBaseSize(16,16)
    6. snapshotToolButton.setIcon(QtWidgets.QIcon("C:/Users/nfran/.nuke/icons/cameraIcon.png"))
    7. snapshotToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly)
    8. snapshotToolButton.setToolTip("Take Snapshot")
    9. c.parentWidget().layout().insertWidget(0,snapshotToolButton)
    10. return c
    11.  
    12. except: pass
    To copy to clipboard, switch view to plain text mode 

    cameraIcon.jpg

  2. #2
    Join Date
    Feb 2016
    Location
    Venice, California
    Posts
    82
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QToolButton Icon without Border?

    got it.
    Decided to use StyleSheet

    Qt Code:
    1. snapshotToolButton.setStyleSheet("#SnapShotButton {border : none;}")
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Align text and icon of QToolButton on center
    By bibhukalyana in forum Qt Programming
    Replies: 7
    Last Post: 24th November 2014, 12:46
  2. QtoolButton icon change on focus
    By Charvi in forum Qt Programming
    Replies: 1
    Last Post: 30th August 2012, 13:00
  3. QToolButton icon did not appear
    By mismael85 in forum Qt Programming
    Replies: 4
    Last Post: 24th March 2008, 18:13
  4. QToolButton icon not updated in overflow menu
    By pabakertx in forum Qt Programming
    Replies: 2
    Last Post: 26th September 2007, 13:48
  5. QToolButton will not display its icon
    By JimBrown in forum Qt Programming
    Replies: 6
    Last Post: 9th March 2007, 18:54

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.