Category Archives: QT

Building QT6.4 on Ubuntu 22.04

I installed required packages:

sudo apt install build-essential
sudo apt install libx11-dev
sudo apt install ninja-build
sudo apt install openssl libssl-dev
sudo apt install libmd4c-dev libmd4c-html0-dev
sudo apt install pkg-config
sudo apt install mesa-utils libglu1-mesa-dev freeglut3-dev mesa-common-dev
sudo apt install libglew-dev libglfw3-dev libglm-dev
sudo apt install libao-dev libmpg123-dev
(more…)

Building QT6.4 with qttranslation module for Windows

I was able to successfully build QT6.4 for Windows with skipped qttranslation and qttools modules. But if I do not skip them and configure QT as follows:

"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvarsall.bat" amd64
    
set "CMAKE_ROOT=C:\dev\PFiles\cmake-3.24.0-rc4-windows-x86_64\bin"
set "NINJA_ROOT=C:\dev\PFiles\ninja-win"
set "PERL_ROOT=C:\dev\PFiles\Strawberry\perl\bin"
    
set PATH=%CMAKE_ROOT%;%PATH%
set PATH=%NINJA_ROOT%;%PATH%
set PATH=%PERL_ROOT%;%PATH%
set PATH=C:\dev\PFiles\Python35;%PATH%
    
rem Check if the tools are in PATH
where perl.exe
where python.exe
where cmake.exe
where ninja.exe
    
set MY_QT_SRC_DIR=C:\dev\repos\qt-everywhere-src-6.4.0
set "MY_INSTALL_PATH=C:/dev/libs/Qt6.4/windows"
set CL=/MP

%MY_QT_SRC_DIR%\configure.bat -prefix %MY_INSTALL_PATH% -DQT_NO_EXCEPTIONS=1 -debug-and-release -force-debug-info -platform win32-msvc -opensource -confirm-license ^
  -c++std c++20 -static -static-runtime -I "C:/Program Files/OpenSSL/include" -L "C:/Program Files/OpenSSL/lib" -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 qtwayland ^
  -skip qtwebchannel -skip qtwebengine -skip qtwebview -skip qtquick3dphysics -skip qtspeech
(more…)

Building QT6.4 with OpenSSL for Windows – iteration #1

I build it with similar commands as I used before for Building QT 6.3.1 with OpenSSL for Windows. The only difference was that I added -static-runtime option and skipped qtquick3dphysics and qtspeech modules:

"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvarsall.bat" amd64
   
set "CMAKE_ROOT=C:\dev\PFiles\cmake-3.24.0-rc4-windows-x86_64\bin"
set "NINJA_ROOT=C:\dev\PFiles\ninja-win"
set "PERL_ROOT=C:\dev\PFiles\Strawberry\perl\bin"
   
set PATH=%CMAKE_ROOT%;%PATH%
set PATH=%NINJA_ROOT%;%PATH%
set PATH=%PERL_ROOT%;%PATH%
set PATH=C:\dev\PFiles\Python35;%PATH%
   
rem Check if the tools are in PATH
where perl.exe
where python.exe
where cmake.exe
where ninja.exe
   
set "MY_INSTALL_PATH=C:/dev/libs/Qt6.4/windows"
set CL=/MP
 
configure.bat -prefix %MY_INSTALL_PATH% -DQT_NO_EXCEPTIONS=1 -debug-and-release -force-debug-info -platform win32-msvc -opensource -confirm-license ^
-c++std c++20 -static -static-runtime -I "C:/Program Files/OpenSSL/include" -L "C:/Program Files/OpenSSL/lib" -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 qtwayland ^
  -skip qtwebchannel -skip qtwebengine -skip qtwebview -skip qttools -skip qttranslations -skip qtquick3dphysics -skip qtspeech
(more…)

Using std::shared_ptr in QML

QT is developed by an alien civilization that hate humans. They can’t make std::shared_ptr work in QML since 2014:

(more…)

QT signal performance significantly degrades when the number of the connections grow.

In my previous post I compared the performance of a single QT connection with the performance of a notification mechanism based on virtual functions.

In this post I’ll demonstrate how the performance of QT signals degrade when the number of the connections grow. Briefly saying a QT signal becomes 57 times slower than a virtual function.

Below I described my experimentations and provided the full source code.

(more…)

QT signal is ten times slower than a virtual function

I defined a QT Object that contains an integer value and uses QT signal along with awl::Observable based on virtual functions to notify the subscribers when the value changes:

#include "Awl/Observable.h"

#include <QObject>

namespace test
{
    class NotifyValueChanged
    {
    public:

        virtual void onValueChanged() = 0;
    };
    
    class ValueObject : 
        public QObject,
        public awl::Observable<NotifyValueChanged>
    {
        Q_OBJECT

    public:

        Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged)

        void notifyValueChanged()
        {
            Notify(&NotifyValueChanged::onValueChanged);
        }

    signals:

        void valueChanged();

(more…)

QObject::sender() is a slow function

I did not expect that its share of CPU usage in my app is 12.15%:

Why does it iterate over some collection? Isn’t there only one sender in a thread?

(more…)

Building QT 6.3.1 with OpenSSL for Windows

After various experimentation I was able to build QT 6.3.1 with OpenSSL for Windows with the following steps:

Extract archives with Bash:

tar -xzf ../distrib/openssl-1.1.1q.tar.gz
tar -xf ../distrib/qt-everywhere-src-6.3.1.tar.xz

Building OpenSSL 1.1.1q

Run the following commands with x64 Native Tools Command Prompt for VS 2022:

set PATH=%PATH%;C:\dev\PFiles\Strawberry\perl\bin
set PATH=%PATH%;C:\dev\PFiles\nasm-2.15.05
perl Configure VC-WIN64A
(more…)

Experimentation with OpenSSL and QT configuration on Windows

Building OpenSSL 1.1.1q with custom installation directory

Run the following commands with x64 Native Tools Command Prompt for VS 2022:

set PATH=%PATH%;C:\dev\PFiles\Strawberry\perl\bin
set PATH=%PATH%;C:\dev\PFiles\nasm-2.15.05
set MY_INSTALL_DIR=C:/dev/libs/OpenSSL
perl Configure VC-WIN64A --prefix="%MY_INSTALL_DIR%" --openssldir="%MY_INSTALL_DIR%"
(more…)

My experimentation with QML Repeater

I was able to define a Repeater that displays cryptocurrency market orders:

(more…)