Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tools:qt [2022/08/03 04:24] – [Update] darron | tools:qt [2022/08/03 05:01] (current) – [Install] darron | ||
---|---|---|---|
Line 1: | Line 1: | ||
====Qt==== | ====Qt==== | ||
+ | |||
+ | How to get up and running using Qt on Linux. | ||
===Environment=== | ===Environment=== | ||
Line 22: | Line 24: | ||
==Qt5== | ==Qt5== | ||
- | __Base__ | + | __Creator__ |
< | < | ||
apt install qtcreator | apt install qtcreator | ||
- | apt install qtbase5-dev | ||
</ | </ | ||
+ | __Base__ | ||
+ | < | ||
+ | apt install qtbase5-dev | ||
+ | </ | ||
__Serial__ | __Serial__ | ||
Line 33: | Line 38: | ||
apt install qt5serialport-examples libqt5serialport5-dev | apt install qt5serialport-examples libqt5serialport5-dev | ||
</ | </ | ||
+ | |||
+ | __Strip__ | ||
+ | |||
+ | Due to a problem with WSL1 the Qt5 core library file needs to be stripped. | ||
+ | |||
+ | < | ||
+ | strip --remove-section=.note.ABI-tag / | ||
+ | </ | ||
+ | |||
+ | ==Qt6== | ||
+ | |||
+ | __Base__ | ||
+ | < | ||
+ | apt install qt6-base-dev | ||
+ | </ | ||
+ | |||
+ | __Strip__ | ||
+ | < | ||
+ | strip --remove-section=.note.ABI-tag / | ||
+ | </ | ||
+ | |||
+ | ===Demo=== | ||
+ | |||
+ | QT Creator is used to create project files and edit source code. | ||
+ | |||
+ | < | ||
+ | qtcreator | ||
+ | </ | ||
+ | |||
+ | Follow this guide to create a simple project. | ||
+ | |||
+ | < | ||
+ | Create Project... | ||
+ | Application (Qt) | ||
+ | Qt Console Application | ||
+ | Name: QApp | ||
+ | Build system: qmake | ||
+ | Language: < | ||
+ | Kit Selection: Desktop | ||
+ | </ | ||
+ | |||
+ | __main.cpp__ | ||
+ | |||
+ | This is clearly not a good example of a Qt application, | ||
+ | < | ||
+ | #include < | ||
+ | #include < | ||
+ | |||
+ | int | ||
+ | main(int argc, char **argv) | ||
+ | { | ||
+ | QCoreApplication App(argc, argv); | ||
+ | |||
+ | std::cout << "Hello World!" | ||
+ | |||
+ | return 0; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Qt5 make is used to create a working `Makefile' | ||
+ | |||
+ | < | ||
+ | qmake | ||
+ | make | ||
+ | ./QApp | ||
+ | Hello World! | ||
+ | </ | ||
+ | |||
+ | To build for Qt6, use qmake6 instead of qmake above. | ||
+ |