Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved How to set windows icon - close?

    General and Desktop
    3
    3
    74
    Loading More Posts
    • 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
      TomNow99 last edited by

      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 Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        @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 Reply Quote 1
        • sierdzio
          sierdzio Moderators last edited by

          @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 Reply Quote 1
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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 Reply Quote 3
            • First post
              Last post