helloSystem / QKeySequenceOverride

Override the QKeySequence::toString() function in Qt to represent keyboard shortcuts with graphical symbols
2 stars 2 forks source link

QKeySequenceOverride

image

This repo contains a tiny bit (~30 lines) of C++ code which compiles to a .so file to dynamically override the QKeySequence::toString() function in Qt to represent shortcuts with graphical symbols similar to the Mac.

Instructions

On FreeBSD:

cd QKeySequenceOverride
mkdir build
./build.sh
env LD_PRELOAD=$(readlink -f build/libQKeySequenceOverride.so.1.0.0) menubar

LD_PRELOAD

The heart of this trick involves using LD_PRELOAD. For an explanation of this powerful feature of the dynamic linker, check out this writeup.

For more advanced LD_PRELOAD tricks check this out.

Credits

https://github.com/heavyimage/OverrideQtSplashscreen/