Results 1 to 6 of 6

Thread: Plugins support Help!

  1. #1
    Join Date
    Mar 2006
    Posts
    10
    Thanks
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Plugins support Help!

    Hello!

    I'm writing a book collection manager now (qt4) and want to know how to do the plugins support for different file formats.

    Docs from Qt I've read but didn't understand cause I have no practice in creating plugins.

    Could anyone show me the code examples (plugandpaint example I saw)

    Thanks!

  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: Plugins support Help!

    What kind of plugin functionality do you need? Could you give more details? Did you try anything on your own? What problems did occur?

  3. #3
    Join Date
    Apr 2006
    Location
    San Francisco, CA
    Posts
    186
    Thanks
    55
    Thanked 12 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Plugins support Help!

    Have you read the plugin howto page yet?
    http://doc.trolltech.com/4.1/plugins-howto.html
    Software Engineer



  4. #4
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Plugins support Help!

    Creating plugins is quite simple if you know what you want to do, and, as always with Qt the docs are quite complete.

    Qt plugin system is based on interfaces. They are defined in header files of your app, contain only pure virtual function and use the Q_DECLARE_INTERFACE macro to correctly "register" into Meta Object system.

    Plugins are centered around a class that inherits from QObject and interfaces that need to be implemented. The Q_INTERFACES macro is used to declare which interfaces are used.
    The Q_EXPORT_PLUGIN2 macro infor the Meta Object system about which class has to be considered as root component, (it probably creates a static pointer but I've not looked to deep into that)...

    Loading such plugins simply need to create a QPluginLoader with the name of the plugin you want to load. the instance() function return a pointer to the root component of the loaded plugin. This QObject can be casted to interfaces thanks to the macros you used and these interfaces can then be used as if they had been created in the app...

    If you want a more concrete examples of plugins and that plug and paint examples doesn't satisfy you, check out Edyuk sources.
    Current Qt projects : QCodeEdit, RotiDeCode

  5. #5
    Join Date
    Mar 2006
    Posts
    10
    Thanks
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Plugins support Help!

    I want my future plugins to do following:
    -parse files
    - return title and etc...

  6. #6
    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: Plugins support Help!

    But did you already try anything? Have you read the plugin howto?

Similar Threads

  1. how to correctly compile threads support?
    By srhlefty in forum Installation and Deployment
    Replies: 9
    Last Post: 25th June 2006, 19:15
  2. 64-bit support in Windows?
    By jamos in forum Qt Programming
    Replies: 1
    Last Post: 12th May 2006, 16:29
  3. Problem building Qt4.1.0 with thread support on windows XP
    By pavithra in forum Installation and Deployment
    Replies: 1
    Last Post: 1st April 2006, 11:35
  4. Arthur Plugins demos and designer
    By antonio.r.tome in forum Installation and Deployment
    Replies: 4
    Last Post: 21st March 2006, 14:01
  5. Plugins as small application
    By blackliteon in forum Qt Programming
    Replies: 4
    Last Post: 12th January 2006, 09:39

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.