Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. How to create a QPixmap from a NSImage or CGImageRef
Forum Updated to NodeBB v4.3 + New Features

How to create a QPixmap from a NSImage or CGImageRef

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
macosiconsqt6
3 Posts 2 Posters 712 Views 1 Watching
  • 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.
  • jrpatJ Offline
    jrpatJ Offline
    jrpat
    wrote on last edited by jrpat
    #1

    I'm trying to do the same thing as this post: How to use SF Symbols dynamically with QIcon::fromTheme()?

    The suggestion in that post – going from NSImage → CGImageRef → QPixmap – seemed like an option, but QtMac::fromCGImageRef is now obsolete, and this blog post says there is no replacement.

    Does anyone have a way to get a QPixmap from an NSImage in Qt6?

    Thanks!

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

      Hi and welcome to devnet,

      You can check the sources of the QtMac module to see how it is done. These helper functions were not overly complex.

      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
      0
      • jrpatJ Offline
        jrpatJ Offline
        jrpat
        wrote on last edited by jrpat
        #3

        The relevant helper function is qt_mac_toQImage. Then QPixmap::fromImage can be used to get a QPixmap (example).

        1 Reply Last reply
        0

        • Login

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