Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tools:qt [2022/08/03 04:26] – [Install] darrontools: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 20: Line 22:
 ===Install=== ===Install===
  
 +==Qt5==
 +
 +__Creator__
 <code> <code>
 apt install qtcreator apt install qtcreator
 </code> </code>
- 
-==Qt5== 
  
 __Base__ __Base__
Line 35: Line 38:
 apt install qt5serialport-examples libqt5serialport5-dev apt install qt5serialport-examples libqt5serialport5-dev
 </code> </code>
 +
 +__Strip__
 +
 +Due to a problem with WSL1 the Qt5 core library file needs to be stripped.
 +
 +<code>
 +strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
 +</code>
 +
 +==Qt6==
 +
 +__Base__
 +<code>
 +apt install qt6-base-dev
 +</code>
 +
 +__Strip__
 +<code>
 +strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt6Core.so.6
 +</code>
 +
 +===Demo===
 +
 +QT Creator is used to create project files and edit source code.
 +
 +<code>
 +qtcreator
 +</code>
 +
 +Follow this guide to create a simple project.
 +
 +<code>
 +Create Project...
 +  Application (Qt)
 +    Qt Console Application
 +      Name: QApp
 +      Build system: qmake
 +      Language: <none>
 +      Kit Selection: Desktop
 +</code>
 +
 +__main.cpp__
 +
 +This is clearly not a good example of a Qt application, but this code is just a demo.
 +<code>
 +#include <QCoreApplication>
 +#include <iostream>
 +
 +int
 +main(int argc, char **argv)
 +{
 +        QCoreApplication App(argc, argv);
 +
 +        std::cout << "Hello World!" << std::endl;
 +
 +        return 0;
 +}
 +</code>
 +
 +Qt5 make is used to create a working `Makefile' which is used to build the application.
 +
 +<code>
 +qmake
 +make
 +./QApp
 +Hello World!
 +</code>
 +
 +To build for Qt6, use qmake6 instead of qmake above.
 +