Category Archives: QT

Building QT 6.6.2 for Windows and Android

I installed MS Visual Studio, Android Studio and the following tools:

cmake-3.24.2-windows-x86_64
nasm-2.15.05
ninja-win
Python35
Strawberry
VulkanSDK
x86_64-12.2.0-release-win32-seh-rt_v10-rev0

and built QT for Windows with the following commands:

(more…)

Unification of Win32 and UWP

Looks like QT6 does not support UWP:

During this year’s Microsoft Build conference Microsoft announced the
unification of Win32 and UWP for their IoT offering. In general, it
looks like Microsoft is stepping away from their strict stance about the
usage of UWP technology and the Windows Store. Getting a classic Windows
application into the Windows Store is much easier nowadays and will be
even simpler in the future. Microsoft’s new direction in their IoT
offering will bring more “classic Windows development” into the IoT
world and there will be no need for a dedicated UWP port.

Compiling a single C++ source file in QT Creator

My QT Creator builds an Android app with the following command:

"D:\dev\tools\cmake-3.24.2-windows-x86_64\bin\cmake.exe" --build D:/dev/repos/tradeclient/src/build-TradeClient-Android_Qt_6_5_2_arm64_v8a_debug_Clang_arm64_v8a-Debug --target all

I simply started Windows Command Prompt and was able to run the following commands:

set PATH=%PATH%;C:\Qt\qtcreator-10.0.2\bin\jom
cd D:\dev\repos\tradeclient\src\build-TradeClient-Android_Qt_6_5_2_arm64_v8a_debug_Clang_arm64_v8a-Debug
"D:\dev\tools\cmake-3.24.2-windows-x86_64\bin\cmake.exe" --build . --target BotFactory.cpp.o
"D:\dev\tools\cmake-3.24.2-windows-x86_64\bin\cmake.exe" --build . --target ExchangeModel.cpp.o > my.txt 2>&1
"D:\dev\tools\cmake-3.24.2-windows-x86_64\bin\cmake.exe" --build . --target Bots/ShortBot.cpp.o > my2.txt 2>&1

Building QT6.5.2 for X11 on Ubuntu 22.04

In addition to the packages installed while building QT6.4 I installed the following packages required for X11:

sudo apt install libfontconfig1-dev libfreetype6-dev libx11-dev libx11-xcb-dev \
  libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev \
  libxcb-cursor-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev \
  libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev \
  libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-util-dev \
  libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev

And configured QT with dynamic linking:

export MY_INSTALL_PATH=/home/def/libs/QT6.5d
export QT_SRC_PATH=/home/def/repos/qt-everywhere-src-6.5.2

${QT_SRC_PATH}/configure -prefix $MY_INSTALL_PATH -DQT_NO_EXCEPTIONS=1 -debug-and-release -force-debug-info -opensource -confirm-license \
  -c++std c++20 -openssl-linked \
  -skip qt3d -skip qt5compat -skip qtactiveqt -skip qtcharts -skip qtcoap -skip qtconnectivity \
  -skip qtdatavis3d -skip qtdoc -skip qtlottie -skip qtmqtt -skip qtnetworkauth -skip qtopcua \
  -skip qtserialport -skip qtpositioning -skip qtquicktimeline -skip qtquick3d -skip qtremoteobjects \
  -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtvirtualkeyboard \
  -skip qtwebchannel -skip qtwebengine -skip qtwebview -skip qtquick3dphysics -skip qtspeech -skip qtlocation \
  -skip qthttpserver
(more…)

Building QT6.4 for Windows with Vulkan support

Installed Vulkan SDK and built QT6.4.2 for windows with the following script:

set PATH=C:\WINDOWS\system32;C:\WINDOWS

"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvarsall.bat" amd64

set MY_DRIVE=D:

%MY_DRIVE%
mkdir \dev\build\qt
cd \dev\build\qt
       
set "CMAKE_ROOT=%MY_DRIVE%\dev\tools\cmake-3.24.2-windows-x86_64\bin"
set "NINJA_ROOT=%MY_DRIVE%\dev\tools\ninja-win"
set "PERL_ROOT=%MY_DRIVE%\dev\tools\Strawberry\perl\bin"
set "PYTHON_ROOT=%MY_DRIVE%\dev\tools\Python35"
set VULKAN_SDK=%MY_DRIVE%/dev/tools/VulkanSDK/1.3.239.0
(more…)

Black screen on starting QT Android app

I noticed this about five years ago and hoped that it had passed away, but a few days ago a user reported the following:

(more…)

Building QT6.4.2 for MacOS and iOS

Build QT for MacOS separately in Debug and Release configuration:

tar xf qt-everywhere-src-6.4.2.tar.xz
cd ~/build/qt
export MY_QT_SRC_DIR=~/repos/qt-everywhere-src-6.4.2
export MY_MODE=release
#export MY_MODE=debug

export MY_INSTALL_PATH=~/libs/QT6.4/${MY_MODE}/MacOs
${MY_QT_SRC_DIR}/configure -prefix $MY_INSTALL_PATH -c++std c++20 -opensource -confirm-license \
  -static -static-runtime -${MY_MODE} -force-debug-info \
  -no-openssl -securetransport -DQT_NO_EXCEPTIONS=1 \
  -skip qt3d -skip qt5compat -skip qtactiveqt -skip qtcharts -skip qtcoap -skip qtconnectivity \
  -skip qtdatavis3d -skip qtdoc -skip qtlottie -skip qtmqtt -skip qtnetworkauth -skip qtopcua \
  -skip qtserialport -skip qtpositioning -skip qtquicktimeline -skip qtquick3d -skip qtremoteobjects \
  -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtvirtualkeyboard -skip qtwayland \
  -skip qtwebchannel -skip qtwebengine -skip qtwebview -skip qtquick3dphysics -skip qtspeech -skip qtlocation \
  -skip qthttpserver \
  -- -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \
  && cmake --build . --parallel \
  && cmake --install .
(more…)

Touch target size on Android

Probably QT “Fusion” is not an appropriate style for Android apps, because its buttons height is not enough:

(more…)

QT has Translation Rules for Plurals

For example, there is the following content in qt-everywhere-src-6.4.1\qttranslations\translations\linguist_ru.ts:

<message numerus="yes">
    <source>Dropped %n message(s) which had no ID.</source>
    <translation>
        <numerusform>Удалено %n сообщение, у которого не было ID.</numerusform>
        <numerusform>Удалено %n сообщения, у которых не было ID.</numerusform>
        <numerusform>Удалено %n сообщений, у которых не было ID.</numerusform>
    </translation>
</message>
(more…)

Building QT6.4.1 for Android on Windows

Build QT6.4.1 for Windows and then build it for Android as follows:

set MY_DRIVE=D:

cd %MY_DRIVE%\dev\build\qta
%MY_DRIVE%
     
set "CMAKE_ROOT=%MY_DRIVE%\dev\tools\cmake-3.24.2-windows-x86_64\bin"
set "NINJA_ROOT=%MY_DRIVE%\dev\tools\ninja-win"
set "PERL_ROOT=%MY_DRIVE%\dev\tools\Strawberry\perl\bin"
set "MINGW_ROOT=%MY_DRIVE%\dev\tools\x86_64-12.2.0-release-win32-seh-rt_v10-rev0\mingw64\bin"
set "PYTHON_ROOT=%MY_DRIVE%\dev\tools\Python35"
set "JDK_ROOT=C:\Program Files\Android\Android Studio\jre\bin"
             
set PATH=C:\WINDOWS\system32;C:\WINDOWS
set PATH=%CMAKE_ROOT%;%PATH%
set PATH=%NINJA_ROOT%;%PATH%
set PATH=%MINGW_ROOT%;%PATH%
set PATH=%PERL_ROOT%;%PATH%
set PATH=%PYTHON_ROOT%;%PATH%
set PATH=%JDK_ROOT%;%PATH%
(more…)