Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to use Qt Embedded without GUI components?
RogueWarrior last edited by
I'm relatively new to the Qt world and I'm interested in using Qt on an embedded Linux SBC (specifically a Technologic Systems 7350) as a "device server," for want of a better term. For example: the SBC would have sensors connected to it such as a temperature sensor. A program would be running on the board to sample the sensor and pass the data through a TCP socket to a GUI app running on a traditional PC/Mac. Now, I'm currently doing this with a nice Qt-based app running on a Mac. The device server app is written in standard C/C++ using standard TCP sockets. That all works. In developing this system, I'm finding that Qt's networking and core features are really nice and robust. The TCP sockets are very forgiving and you get a lot of grunt-work functionality for free. What I would like to do is use Qt Core and Qt Networking on the Linux side. More importantly, I have no need for the GUI/framebuffer features since there is no display hardware.
So, how does one go about cross-compiling a subset of the Qt code?
For development start, i would advise cross-compiling the entire library (minus webkit) this will get you faster to development/test. If your target has limited resources, you can simply copy only the relevant Qt libraries on it.
Once you're done, you can follow this doc http://qt-project.org/doc/qt-4.8/fine-tuning-features.html
This will give you the opportunity to reduce Qt's foot-print.
Don't forget to remove gui in your pro file or just set Qt = core networking.
Hope it helps
tzander last edited by
notice you can configure your Qt without things like webkit and examples and maybe even gui.
But, yeah, its pretty trivial to do, just make sure you only use classes from QtCore and nothing from QtGui.
First suggestion is that you use QCoreApplication, and not QApplication. :)