Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to set windows icon - close?

How to set windows icon - close?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 275 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TomNow99
    wrote on last edited by
    #1

    Hello,

    OS: Win 10

    I would like to setIcon() on my QPushButton. The icon which I would like is a Windows close icon ( red "X" ). I try find something like:

    QIcon::close
    

    but I can't find any defined icons.

    Is there a simple way?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      @TomNow99 said in How to set windows icon - close?:

      Is there a simple way?

      No. You need an image file and Qt does not provide it (it couldn't even if it wanted to, that stuff is copyrighted).

      (Z(:^

      1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        One thing you can try is to use QStyle::standardPixmap with QStyle::SP_TitleBarCloseButton.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        3

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved