After updating Manjaro recently, I noticed Qt 5.15 has a new deprecation warning:

QML Connections:
Implicitly defined onFoo properties in Connections are deprecated.
Use this syntax instead: function onFoo(<arguments>) { ... }

This warning shows up 20-50 times when testing a widget. It’s rather annoying, as it drowns out the useful warnings.

According to the commit that added the warning, the syntax change is to remove some “magic” that figured out which variables are the signal parameters. It is being done for the ability to compile this type of QML code into C++, which is a good reason despite the headache.

So why can’t we just implement the new function onFoo() {} format in Connections? Well it is not supported in Qt 5.12.

Distros using Qt 5.12 are:

I can’t drop support for most LTS distros. Hell, Kubuntu 20.04 is only a few months old.

The only way I’ve found to hide these warnings, is to use the logging rule QT_LOGGING_RULES="*.warning=false". That hides all warnings however, including the useful ones.

Fortunately David Edmundson sent a patch to add a new logging category. The category will be qt.qml.connections. So I imagine I’ll need to use QT_LOGGING_RULES="qt.qml.connections.warning=false" to hide those warnings.

Unfortunately, I’ll be stuck living with these spam-like warnings until Qt 5.15.1, which is scheduled to be released in August 2020.

More discussion can be found on StackOverflow.

Update: KDE Plasma has a workaround to hide them using QLoggingCategory::installFilter:

After a night’s sleep, I thought about trying to build qtdeclarative from source, then installing it to /usr/local/... use LD_PRELOAD=... plasmoidviewer.

First things first is to download the qtdeclarative project. It’s pretty large, so just do a shallow copy of the 5.15 branch.

mkdir -p ~/Code/qt
cd ~/Code/qt
git clone --branch 5.15 --depth 1
cd qtdeclarative

Looks like there’s a, so we’ll use qmake to generate the Makefiles. Then run make to compile the code.


make only uses 1 CPU core. We can use make -j4 to use 4 cores. Don’t use make -j. It spins up far too many threads… as I found out the hard way. It wasn’t the CPU that slowed things down though. After 5 mins of slowly switching to tty2 (Ctrl+Alt+F2) and running htop, it seemed my 8Gb RAM + 10Gb Swap was full.

Anyways, as make -j4 chugged along, I ran into a vulkan.h not found error. So I installed those headers by searching for and installing the package.

pacman -Ss vulkan
pacman -S vulkan-headers

The build finally completed. Now it’s time to figure out which .so file the qqmlconnections.cpp code belongs to.

Looks like the .so generated will be similar to, so searching for that finds:


Awesome! Lets copy those to /usr/local/lib. On second thought, installing to /usr/local/lib might break all Qt Apps, including KDE Plasma. Instead lets try to localize the usage of our by using a tool I just remembered, the LD_PRELOAD=.../ environment variable. LD_PRELOAD is used by tools like MangoHUD to overload a library.

Lets try it!

LD_PRELOAD=~/Code/qt/qtdeclarative/lib/ \
    QT_LOGGING_RULES="qt.qml.connections.warning=false" \
    plasmoidviewer -a org.kde.plasma.digitalclock

Unfortunately we get an error.

plasmoidviewer: symbol lookup error: /usr/lib/ undefined symbol: _ZN12QQmlMetaType13propertyCacheEPK11QMetaObjecti, version Qt_5_PRIVATE_API

It looks like it’s trying to access a function in, but since /usr/lib/ has an older version it does not work. Luckily, is part of qtdeclarative too. We just need to also preload the other lib/*.so files.

A quick google finds a StackOverflow solution on preloading an entire folder of .so files. We just need to use the LD_LIBRARY_PATH environment variable instead!

LD_LIBRARY_PATH=~/Code/qt/qtdeclarative/lib/ \
    QT_LOGGING_RULES="qt.qml.connections.warning=false" \
    plasmoidviewer -a org.kde.plasma.digitalclock

It runs! And there’s no more “onFoo” warnings!

As a final note, I should point out that the qdeclarative folder is over 1.3 Gb after building, while the lib folder is just 20 Mb. I recommend copying the lib folder and renaming it ~/Code/qt/qdeclarative-build-lib. Then delete the 1.3 Gb qdeclarative folder.

This was a rather fun dive into Qt. The temporary (2 month) solution was much more difficult to accomplish than I first thought, but it’s satisfying to know a solution exists.

Yes… I know I could have used qt5-declarative-git from the AUR.