Difference between revisions of "Qt6 Interface"

From Lazarus wiki
Jump to navigationJump to search
(clarify availability on Linux)
(fixed my errror)
Line 6: Line 6:
  
 
===Linux===
 
===Linux===
Most current short term Linux distros have a suitable Qt6 in their standard repositories, but LTS ones like Debian Bullseye, Ubuntu 20.04 and RedHat's EL do not. It is sometimes possible to install from other repos or as kits from Qt themselves but it might be a bit of a task.
+
Most current short term Linux distros have a suitable Qt6 in their standard repositories, but LTS ones like Debian Bullseye and Ubuntu 20.04 do not. It is sometimes possible to install from other repos or as kits from Qt themselves but it might be a bit of a task.
  
 
Further, until Lazarus 2.4 is released and makes it into your Distribution of choice, you must build libQt6Pas on your own, or download pre-built (all care, no responsibility) packages for some platforms from 'Releases' of [https://github.com/davidbannon/libqt6pas/ this GitHub page].
 
Further, until Lazarus 2.4 is released and makes it into your Distribution of choice, you must build libQt6Pas on your own, or download pre-built (all care, no responsibility) packages for some platforms from 'Releases' of [https://github.com/davidbannon/libqt6pas/ this GitHub page].

Revision as of 23:51, 20 November 2022

Template:Qt6 Interface

Qt logo 2013.svg

This article applies to Qt6 widgetset only.

See also: Multiplatform Programming Guide

Introduction

This interface is based on Qt 6 (Qt 6.2.x LTS). For documentation, fixes and download, go to Qt Project (Installers at download 6.2.4). Lazarus with Qt6 interface (qt6-lcl) can be used on Windows 32/64, Linux x32/x64/arm, macOS x64 (Cocoa). Qt6 widgetsets will be available in Lazarus from 2.4 stable release. Currently you can use it from trunk.

Linux

Most current short term Linux distros have a suitable Qt6 in their standard repositories, but LTS ones like Debian Bullseye and Ubuntu 20.04 do not. It is sometimes possible to install from other repos or as kits from Qt themselves but it might be a bit of a task.

Further, until Lazarus 2.4 is released and makes it into your Distribution of choice, you must build libQt6Pas on your own, or download pre-built (all care, no responsibility) packages for some platforms from 'Releases' of this GitHub page.

Troubleshooting on compiling on Linux

If you don't download libQt6Pas library, FPC will give the error on compiling your Qt6 app, something about "cannot link to library Qt6Pas". This means it cannot find the "libQt6Pas.so" file. So you need to unpack the original files from GitHub and make the sym-link "libQt6Pas.so" in the folder of "fpc" binary.

Then FPC again can show the compilation error, but now about the concrete library name, something like "cannot find libQt6Pas.so.6.2". If you see this, just create the additional sym-link, again in the fodler of "fpc" binary.

Then FPC must go over libQt6Pas step, but it can fail and tell it cannot find Qt6 libraries. If you see such errors, just install Qt6 (version 6.2 LTS) from your OS distro packages.

Troubleshooting on running the Linux app

If you compile the app OK, but cannot run the binary, try to run it again from the Terminal. You may see errors about missing .so files. To fix it, unpack libQt6Pas.so* files from GitHub page to e.g. ~/qt6pas. Then open file "~/.bashrc" (I assume OS uses Bash) and add there:

LD_LIBRARY_PATH=~/qt6pas
export LD_LIBRARY_PATH

Create additional symlink(s) there too, if the error tells about concrete filename like "libQt6Pas.so.1.0.2".

Do log-out and log-in. Now Qt6 binary must find all .so files.