cannot use Qt Xlsx - c++

I have Qt 5.15 Beta-2 in /opt. I've also downloaded from here and built the Qt5::Xlsx module [qmake, sudo make, sudo make install]. Now in /opt/Qt/5.15.0/gcc_64/include there's a directory QtXlsx but it contains only one file QtXlsxDepends. No xlsxdocument.h, xlsxcell.h or anything like that, so Qt Creator says file not found if I try to include them as in here.
the output of the build commands

The sought-for headers are in /opt/Qt/5.15.0/gcc_64/mkspecs/features/include/QtXlsx. So I added target_include_directories(target PRIVATE /opt/Qt/5.15.0/gcc_64/mkspecs/features/include/QtXlsx) to my CMakeLists.txt and the problem went away.

Related

Installing a 3rd party module for Qt 5.5 in OSX

I want to install Qt Xlsx 3rd party module to use with QtCreator on a OSX system. I tried the instructions provided by the official page but I am failing to compile the code.
What I tried,
My Qt project is on directory: /Users/Documents/Qt Projects/Test
So as instructed in the guide, I copy pasted the source code from gitHub to this directory.
Then I navigated to this working directory through Terminal and executed the following code;
qmake
make
make install
But when I run this code (at command qmake, the terminal returns the following error;
-bash: qmake: command not found
Since this method failed, I tried the second method listed on the guide. But I do not understand second point of this given method. The guide says;
Put the source code in any directory you like. For example, 3rdparty:
|-- project.pro
|-- ....
|-- 3rdparty\
| |-- qtxlsx\
| |
And also the 3rd point which reads;
Add following line to your qmake project file:
include(3rdparty/qtxlsx/src/xlsx/qtxlsx.pri)
What is the qmake project file? Is it the Test.pro file in my working directory? How do I install this module? Please explain clearly since I do not have much experience with Qt.
So made it work;
According to the QtXlsx documentation
I just have to add the following lines to my .pro file.
include(3rdparty/qtxlsx/src/xlsx/qtxlsx.pri)
XLSX_NO_LIB
So the directory of your project should look something like this;
<project folder>/3rdparty/qtxlsx

Package Qt5GStreamerQuick-1.0 not found

Did anybody got the luck to know the reason for:
"Project ERROR: Package Qt5GStreamerQuick-1.0 not found".
I have installed: qt-gstreamer-dev package
Not working even after manually adding PKG_CONFIG_LIBDIR:
export PKG_CONFIG_LIBDIR=/home/manojsahu/qt-gstreamer-1.2.0/src/QGst/QtGStreamer-1.0.pc.in
I have also added PKGCONFIG alternatively in .pro file like:
PKGCONFIG += Qt5GStreamerQuick-1.0
PKGCONFIG += QtGStreamer-1.0
Can anybody help to resolve this error.
I am trying to compile example in below mentioned link:
https://github.com/detrout/qt-gstreamer/tree/master/examples/qmlplayer
Thanks, I have got one work around to solve "Project ERROR: Package Qt5GStreamerQuick-1.0 not found".
"Qt5GStreamerQuick-1.0" has dependency with "gstreamer-1".
Download "gstreamer-1.6.3" and perform
make then
make install.
Download the qt-gstreamer code, extract freshly and navigate to extracted folder. In my case it is
cd ~/home/manojsahu/qt-gstreamer-1.2.0/
cmake CMakeLists.txt then
make then
sudo make install
Image of the qmlplayer built
Now the example qmlplayer gets built.
But facing error "Failed to create qtvideosink. Make sure it is installed correctly".
Perhaps It did not installed properly. Any workaround to build completely would be appreciated highly.

Linux/CUPS Qt printing example

I need to use the CUPS API in Qt to detect and install printers. The problem is I can't seem to make Qt detect the cups.h header file.
So far I tried (both with <> and ""):
#include <cups/cups.h>
and
#include </usr/local/include/cups/cups.h>
In the .pro file I also tried adding:
INCLUDEPATH += /usr/local/include/cups
Each time I get "cups/cups.h: no such file or directory". So can anybody provide a minimal example or a HOWTO that shows how to include and use CUPS in a Qt application.
Thanks!
PS: I'am not sure if it's relevant, but I probably should add that I cross compiled Qt for the raspberry Pi.
Install the "libcups2-dev" libraries.
sudo apt-get install libcups2-dev
then search for the library file
find / -type f -name "*.a"
you will get the response with all .a library files with the location
find "libcups.a" file from the list.
example : /home/Desktop/cups-1.7.5/cups/libcups.a
Add the destination file path in your Qt .pro project file
LIBS += "../release/build/arm926/libcups.a"

Compile proftpd and include a library copy inside the installation directory

I do already ask a quiet similar question but in fact I now change my mind.
Id like like to compile proftpd and add a copy of the library it uses to the choosen installation directory.
Let's say I define a prefix in my compilation like:
/usr/local/proftpd
Under this directory I would like to find and use those directories only :
./lib
./usr/lib
./usr/bin
./usr/.....
./etc
./var/log/proftpd
./bin
./sbin
./and others I will not put the whole list
So the idea is after I have all libraries and config file in my main directory I could tar it and send it on another server with the same OS and without installing all the dependencies of protfpd I could use it.
I know it does sound like a windows installer not using shared library but that's in fact exactly what I'm trying to accomplish.
So far I have manage to compile it on AIX using this command line:
./configure --with-modules=mod_tls:mod_sql:mod_sql_mysql:mod_sql_passwd:mod_sftp:mod_sftp_sql --without-getopt --enable-openssl --with-includes=/opt/freeware/include:/opt/freeware/include/mysql/mysql/:/home/poney2/src_proftpd/libmath_header/ --with-libraries=/opt/freeware/lib:/opt/freeware/lib/mysql/mysql/:/home/poney2/src_proftpd/libmath_lib --prefix=/home/poney/proftpd_bin --exec-prefix=/home/poney/proftpd_bin/proftpd
Before trying to ask me why I'm doing so, it's because I have to compile proftpd on IBM AIX with almost all modules and this is not available on the IBM rpm binary repositories.
The use of this LDFLAG
LDFLAGS="-Wl,-blibpath:/a/new/lib/path"
where /a/new/lib/path contains all your library does work with Xlc and Gcc compiler.

Include a (header-only) library in an autotools project

I want to integrate a header-only C++ library in my Autotools project. Since the library uses Autoconf and Automake, I use AC_CONFIG_SUBDIRS in configure.ac and added the library dir to the SUBDIRS = line in Makefile.am.
My question is: how do I prevent the header library from being installed by make install? I'm building a single binary, so my users don't need these headers.
I'd prefer not to tamper with the library, so I can fetch upgrade by just untarring the new version.
Here is an idea.
Move all the third-party libraries you do not want to see installed into a subdirectory called noinst/. So for instance if you want to ship your project with something like Boost, unpack it into the directory noinst/boost/. Use AC_CONFIG_SUBDIRS([noinst/boost]). Inside noinst/Makefile.am, do something like this:
SUBDIRS = boost
# Override Automake's installation targets with the command ":" that does nothing.
install:; #:
install-exec:; #:
install-data:; #:
uninstall:; #:
The effect is that whenever some of the recursive "make install*" or "make uninstall" commands are run from the top-level directory, the recursion will stop in noinst/ and not visit its subdirectories. Other recursive commands (like "make", "make clean" or "make dist") will still recurse into the subdirectories.
You could of course override install: and friends directly into the third-party package, and avoid the extra noinst/ directory. But if you are like me, you don't want to tamper with third-party packages to ease their update.
Also a nice property of the above setup is that if someone goes into noinst/boost/ and decide to run make install, it will work. It just does not occur by default when they install your package.
just came across a similar problem and found the solution in the automake manual:
noinst_HEADERS would be the right variable to use in a directory containing only headers and no associated library or program
Andreas
Don't use SUBDIRS then. The following hack may work:
all-local:
${MAKE} -C thatlib all
Of course it would be best if the library remained in its own directory outside of your project, and you just point to it via CFLAGS/LIBS flags.