77 lines
1.6 KiB
Markdown
77 lines
1.6 KiB
Markdown
|
|
Cross-platform library for handling system-wide shortcuts in Qt applications.
|
||
|
|
|
||
|
|
[](http://192.168.46.100:4080/jessequ/qxtglobalshortcut)
|
||
|
|
|
||
|
|
[API Reference](https://codedocs.xyz/hluk/qxtglobalshortcut/classQxtGlobalShortcut.html)
|
||
|
|
|
||
|
|
This code was originally part of [Qtx](https://bitbucket.org/libqxt/libqxt/wiki/Home) which is no longer maintained.
|
||
|
|
|
||
|
|
# Supported Platforms
|
||
|
|
|
||
|
|
- Windows
|
||
|
|
- OS X
|
||
|
|
- Linux/X11
|
||
|
|
|
||
|
|
# Requirements
|
||
|
|
|
||
|
|
- Compiler with C++11 support
|
||
|
|
- Qt 6 or Qt 5
|
||
|
|
- CMake 3.0.0 and later
|
||
|
|
|
||
|
|
# Build
|
||
|
|
|
||
|
|
To build the library without installation run:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
mkdir build
|
||
|
|
cd build
|
||
|
|
cmake -S .. -DCMAKE_PREFIX_PATH:PATH=~/Qt/6.9.0/gcc_64
|
||
|
|
make
|
||
|
|
```
|
||
|
|
|
||
|
|
To build and install run:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
mkdir build
|
||
|
|
cd build
|
||
|
|
cmake -S .. -DCMAKE_PREFIX_PATH:PATH=~/Qt/6.9.0/gcc_64 -DCMAKE_INSTALL_PREFIX=/usr/local
|
||
|
|
make
|
||
|
|
sudo make install
|
||
|
|
```
|
||
|
|
|
||
|
|
To build static library run:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
mkdir build
|
||
|
|
cd build
|
||
|
|
cmake -S .. -DCMAKE_PREFIX_PATH:PATH=~/Qt/6.9.0/gcc_64 -DQXTGLOBALSHORTCUT_STATIC=ON
|
||
|
|
make
|
||
|
|
|
||
|
|
```
|
||
|
|
|
||
|
|
# Use the Library
|
||
|
|
|
||
|
|
Directory "example" contains simple CMake project which uses the installed library.
|
||
|
|
|
||
|
|
To compile and run the example:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
mkdir build
|
||
|
|
cd build
|
||
|
|
mkdir example
|
||
|
|
cd example
|
||
|
|
cmake -S ../../example -DCMAKE_PREFIX_PATH:PATH=~/Qt/6.9.0/gcc_64
|
||
|
|
make
|
||
|
|
./qxtglobalshortcut_test
|
||
|
|
```
|
||
|
|
|
||
|
|
If `cmake` prints error that it cannot find package for the library you have to specify
|
||
|
|
it's install path. E.g.
|
||
|
|
|
||
|
|
```bash
|
||
|
|
qxtglobalshortcut_DIR=/usr/local/lib/cmake/qxtglobalshortcut cmake .
|
||
|
|
```
|
||
|
|
|
||
|
|
Alternatively you can add the path to `CMAKE_PREFIX_PATH` environment variable.
|
||
|
|
|