Results 1 to 2 of 2

Thread: How to use plugins in Qt?

  1. #1
    Join Date
    Feb 2010
    Posts
    68
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to use plugins in Qt?

    Hello there.

    I am real newbie here and I'm not experienced in Unix-like systems. I'm using Windows and Qt 4.6.2. I'd like to use an algorithm to encrypt logins and passwords to mailboxes (to make simple p2m client) and i thought AES algorithm will be a good choice. I've found such a plugin:
    http://delta.affinix.com/qca/
    ...downloaded the source but don't know how to "merge" it with my Qt installation, and how to use it after that.

    1. Is it a good choice? I mean both: the algorithm and the plugin.
    2. How to use plugins for Qt? Please, just don't beat me too hard.

    Michal (PL, 17 y.o.)

  2. #2
    Join Date
    Nov 2007
    Posts
    89
    Thanked 21 Times in 18 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to use plugins in Qt?

    After compiled it you should put the supplied crypto.prf.in inside your %QTDIR%/makespec/features (rename it to crypto.prf). Then in your .pro file just add CONFIG += crypto.
    You should also prepend definitions for QCA_INCDIR/QCA_LIBDIR in the file, and maybe you will have make some changes. See mine for an example (I use it on windows with msvc2008).

    Otherwise, you can also add manually in your .pro file the variables:
    INCLUDEPATH = "/path/to/qca/include"
    LIBS = "/path/to/qca/lib/qca.lib" # Or whatever is called the library.

    My crypto.prf (I added a condition for release build):
    Qt Code:
    1. QCA_INCDIR = "C:\QCA\2.0.2\x64\include"
    2. QCA_LIBDIR = "C:\QCA\2.0.2\x64\lib"
    3.  
    4. # NOTE: any changes made to this file need to be tracked in qcm/qca.qcm
    5.  
    6. CONFIG *= qt
    7.  
    8. # if we are including crypto.prf from the qca tree (and not utilizing it as
    9. # an installed qmake CONFIG feature), then point to the tree. this allows our
    10. # qca tree apps to build before qca itself is installed.
    11. exists($$PWD/qca.pro) {
    12. QCA_INCDIR = $$PWD/include
    13. QCA_LIBDIR = $$PWD/lib
    14. }
    15.  
    16. LINKAGE =
    17.  
    18. # on mac, if qca was built as a framework, link against it
    19. mac: {
    20. framework_dir = $$QCA_LIBDIR
    21. exists($$framework_dir/qca.framework) {
    22. #QMAKE_FRAMEWORKPATH *= $$framework_dir
    23. LIBS += -F$$framework_dir
    24. INCLUDEPATH += $$framework_dir/qca.framework/Headers
    25. LINKAGE = -framework qca
    26. }
    27. }
    28.  
    29. # else, link normally
    30. isEmpty(LINKAGE) {
    31. INCLUDEPATH += $$QCA_INCDIR/QtCrypto
    32. LIBS += -L$$QCA_LIBDIR
    33. LINKAGE = -lqca
    34. CONFIG(debug, debug|release) {
    35. windows:LINKAGE = -lqcad
    36. mac:LINKAGE = -lqca_debug
    37. }
    38. CONFIG(release, debug|release) {
    39. windows:LINKAGE = -lqca
    40. mac:LINKAGE = -lqca
    41. }
    42. }
    43.  
    44. LIBS += $$LINKAGE
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Qt plugins
    By THA in forum Qt Programming
    Replies: 2
    Last Post: 19th November 2009, 11:33
  2. Qt plugins / dll help
    By deca5423 in forum Installation and Deployment
    Replies: 2
    Last Post: 17th June 2009, 19:02
  3. 3D Plugins
    By synack in forum Qt Programming
    Replies: 2
    Last Post: 9th March 2009, 12:26
  4. Qt4 Plugins How-to
    By Chaid in forum Qt Programming
    Replies: 4
    Last Post: 8th July 2006, 08:32
  5. Plugins
    By Michiel in forum General Programming
    Replies: 3
    Last Post: 25th March 2006, 12:37

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.