Using QCA with Qt5 -- How?
-
wrote on 6 Apr 2022, 03:54 last edited by
I'm trying to upgrade one of my applications from GTK+ 2 to Qt5 (because GTK 3 doesn't bear thinking about). One of the last major hurdles involves PGP/GPG encryption.
I'm running Debian testing, and libqca2 comes with it, so I don't need to build the library from scratch. What I do need to know, however, are these:
- The documentation says to use "#include <QtCrypto>", which makes sense, except that it doesn't work. I get "QtCrypto: No such file or directory". How do I get past this?
- What do I put in the .pro file in the "QT +=" line? I've tried "crypto", "qtcrypto", "qca", "qca2" and others, but nothing works. I can't find anything in the documentation that covers this.
- Are there any other tricks I should know?
Thanks,
.....Ron
-
wrote on 6 Apr 2022, 05:07 last edited by ChrisW67 4 Jun 2022, 05:21
Are you using the system Qt5 bundle?
Do you have these installed particularly the -dev package (from here)
bookworm (libs): 2.3.4-1 Binary packages: libqca-qt5-2, libqca-qt5-2-dev, libqca-qt5-2-plugins, libqca2-doc, qca-qt5-2-utils
-
Are you using the system Qt5 bundle?
Do you have these installed particularly the -dev package (from here)
bookworm (libs): 2.3.4-1 Binary packages: libqca-qt5-2, libqca-qt5-2-dev, libqca-qt5-2-plugins, libqca2-doc, qca-qt5-2-utils
-
@ChrisW67 Yes, thanks, I have all of those. The -doc package seems to be a bit bare-bones, but I think I can sort it out. I just need to know what to #include and how to compile stuff.
@rjmx You should check where the QCA header files are installed. Maybe you will need to set INCLUDEPATH in your pro file or include the header files using some subfolders like:
#include <somefolder/QtCrypto>
-
wrote on 6 Apr 2022, 16:32 last edited by
Thanks. I was hoping to avoid that, but it seems necessary. With autoconf, you can use pkg-config to get past that, but Qt doesn't seem to have that facility.
It was complicated by the fact that the locate system in my Debian box can't locate QtCrypto, even though I know it's there.
Anyway, it turns out that I need#include <Qca-qt5/QtCrypto/QtCrypto>
Ugly, but it works.
Now the only thing I need is what to put in the .pro file in the QT+= line. Any ideas?
-
Thanks. I was hoping to avoid that, but it seems necessary. With autoconf, you can use pkg-config to get past that, but Qt doesn't seem to have that facility.
It was complicated by the fact that the locate system in my Debian box can't locate QtCrypto, even though I know it's there.
Anyway, it turns out that I need#include <Qca-qt5/QtCrypto/QtCrypto>
Ugly, but it works.
Now the only thing I need is what to put in the .pro file in the QT+= line. Any ideas?
@rjmx said in Using QCA with Qt5 -- How?:
but Qt doesn't seem to have that facility.
Since Qt is a c++ library I would be surprised if there is a pkg-config c++ whatever.
You most likely mean the build system. For cmake see FindPkgConfig.cmake for qmake e.g. here: https://forum.qt.io/post/699604 -
wrote on 6 Apr 2022, 19:50 last edited by
Thanks! I didn't know about that one. This is my first Qt project (and my first c++ project in a long time).
1/7