Results 1 to 20 of 29

Thread: How to add qsvg

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Posts
    25
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy How to add qsvg

    Hi,

    I have an app, which has some .svg files as resources. These get passed to QIcon constructors. When my app is built dynamically, everything works, but I want to build my app statically. When I do that, the icons disappear. Sometimes I get errors from QObject::moveToThread saying that some object not being in the corrent thread (I'm not calling moveToThread), and that my ':/something.svg' files cannot be loaded because Unknown error. I also can't add qsvg to my application, because I get wierd "undefined reference to `qt_plugin_instance_qsvg()'" errors.

    Thanks for any help.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to add qsvg

    You need an SVG icon engine to be present in your application. If you compiled the application statically, you have to import the appropriate static plugin into your application. See the docs about static plugins for more details.

  3. #3
    Join Date
    Jan 2008
    Posts
    25
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to add qsvg

    Thanks for your reply,

    I've read the doc like a thousand times (so if the solution really is there, I have selective vision ). I did add a QT_PLUGIN += qsvg line to my .pro file, and also a Q_IMPORT_PLUGIN(qsvg) above my main(). This is producing the linker error (undefined reference to qt_plugin_instance_qsvg() ). It looks I'm missing something, but I can't figure out what...

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to add qsvg

    Do you have the static plugin compiled?

  5. #5
    Join Date
    Jan 2008
    Posts
    25
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to add qsvg

    Afaik, yes. I have libqsvg4.a, libqsvg.a, libqsvgd.a, and qsvg4.dll in qt/4.3.3/plugins/iconengines

  6. #6
    Join Date
    Jan 2008
    Posts
    25
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to add qsvg

    up .

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to add qsvg

    Do you use QMake binary from static Qt build? That linker error about plugin instance usually appears when you link a normal non-static plugin with your application.

  8. The following user says thank you to jacek for this useful post:

    Aceman2000 (3rd February 2008)

  9. #8
    Join Date
    Jan 2008
    Posts
    25
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to add qsvg

    I have configured Qt with -static -release -no-exceptions.

  10. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to add qsvg

    Do you have more than one Qt version installed?

  11. #10
    Join Date
    Jan 2008
    Posts
    25
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to add qsvg

    No, only 4.3.3, and it's in the default directory, too.

  12. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to add qsvg

    Do you compile your application in the release mode?

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.