Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to Load methods dynamically using Qt..!



  • Hi,

    I need to develop an application for my POS device,at first the user will select the modules that he want to use at the begining of the application the application should load with the methods or functionality that was entred as by the user requirement.
    Ex:-Our Pos contains various I/O moduels such as LCD,KeyPad,Printer etc..,
    At the begining of application the user enters LCD and Printer then the application should call only the methods that contians the code regarding these two modules.

    So please guide me how to develop the application and suggest me which Qt classes should i go through.Our Pos device works on Linux OS and the Qt version that i am using is 4.7.4.

    Thanks in advance,
    Rohith.G


  • Lifetime Qt Champion

    Sounds like you want to load some parts of your application when they are needed.
    In this case you could implement those parts as shared libraries and load them manually using QLibrary (http://doc.qt.io/qt-4.8/qlibrary.html) at run-time.
    Another possibility is to use Qt plug-ins: http://doc.qt.io/qt-4.8/plugins-howto.html



  • Hi jsulm,

    Thanks for replying,is it possible to provide any sample code for the methods that you have suggested above..?

    Thanks & Regards,
    Rohith.G


  • Lifetime Qt Champion

    Check the links I provided - there are some examples. Maybe Qt examples provide more code.