Results 1 to 2 of 2

Thread: Error when loading QIcon from plugin resource on mac

  1. #1
    Join Date
    Apr 2008
    Posts
    196
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    1

    Default Error when loading QIcon from plugin resource on mac

    Hi,

    i have several plugins where i call a function to retrieve the plugins icon, for example:
    Qt Code:
    1. QIcon MyPlugin::icon() {
    2. return QIcon(":/images/picture.png");
    3. }
    To copy to clipboard, switch view to plain text mode 

    When i load the plugin in the main application i still get an error:
    Qt Code:
    1. Thread 0 Crashed: Dispatch queue: com.apple.main-thread
    2. 0 libSystem.B.dylib 0x9020e732 __kill + 10
    3. 1 libSystem.B.dylib 0x9020e724 kill$UNIX2003 + 32
    4. 2 libSystem.B.dylib 0x902a198d raise + 26
    5. 3 libSystem.B.dylib 0x902b7a44 abort + 93
    6. 4 QtCore 0x021c79d5 qt_message_output(QtMsgType, char const*) + 149
    7. 5 QtCore 0x021c7b9a qt_message(QtMsgType, char const*, char*) + 186
    8. 6 QtCore 0x021c7cd9 qFatal(char const*, ...) + 25
    9. 7 QtGui 0x0173bc8e qt_pixmap_thread_test() + 94
    10. 8 QtGui 0x0173c747 QPixmap::QPixmap() + 55
    11. 9 QtGui 0x0170f7e5 QPixmapIconEngine::addFile(QString const&, QSize const&, QIcon::Mode, QIcon::State) + 69
    12. 10 QtGui 0x0171013a QIcon::addFile(QString const&, QSize const&, QIcon::Mode, QIcon::State) + 90
    13. 11 QtGui 0x01710373 QIcon::QIcon(QString const&) + 67
    14. 12 MyPlugin.dylib 0x1475bd00 Plugins::MyProject::Formulas::MyPlugin::icon() const + 64
    To copy to clipboard, switch view to plain text mode 

    The funny thing is that it works fine under Linux and Windows.

    Could anybody say me what on Mac is going wrong?

    Thanks in advance

    Best Regards
    NoRulez

  2. #2
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Error when loading QIcon from plugin resource on mac

    Which version of Qt are you using?

    It could just be a bug in Qt. I ran into one related to loading .ico files in Qt Creator, which was introduced with 4.6 release.

    Try a different image format if you can and report it on the qt bug tracker if you can reproduce it in a small test project.

Similar Threads

  1. Loading images from resource files in webkit
    By redserpent7 in forum Qt Programming
    Replies: 1
    Last Post: 21st January 2015, 13:01
  2. Error loading plugin dinamically
    By Zero in forum Qt Programming
    Replies: 2
    Last Post: 23rd January 2010, 23:31
  3. Howto get resource info from QICON?
    By maverick_pol in forum Qt Programming
    Replies: 1
    Last Post: 9th April 2008, 15:25
  4. Loading SVGs in QIcon
    By adam_d in forum Qt Programming
    Replies: 1
    Last Post: 13th October 2007, 13:33
  5. Dynamic resource loading not work in another computer
    By GRUB in forum Installation and Deployment
    Replies: 2
    Last Post: 3rd September 2007, 10:49

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.