# qt-map-py
A simple widget written in QML in python that lets you ask for a psecific point
on a map from commandline (cli), like zenity does. It displays a map, and double
clicking on the map causes the window to close and the coordinates to be printed
on stdout;
![](./screenshot.png)
## Usage
Build the app:
```sh
make build
```
Run it:
```sh
./dist/qt-map-py/qt-map-py # start centered in Poznań
./dist/qt-map-py/qt-map-py 33.66195 -95.55362 # start centered at given lat / lon
./dist/qt-map-py/qt-map-py 33.66195 -95.55362 --die # start centered at given lat / lon and close the window once the location is selected (otherwise each location is printed in a new line to stdout)
```
## Troubleshooting
If the app doesn't start, it might mean it's been compiled using different glibc version. Try rebuilding the app.
If the app cannot be rebuilt, and you get this error during build:
```
Traceback (most recent call last):
File "/usr/bin/pyinstaller", line 33, in < module >
sys.exit(load_entry_point('pyinstaller==4.2', 'console_scripts', 'pyinstaller')())
File "/usr/lib/python3.9/site-packages/PyInstaller/__main__.py", line 114, in run
run_build(pyi_config, spec_file, **vars(args))
File "/usr/lib/python3.9/site-packages/PyInstaller/__main__.py", line 65, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/usr/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 725, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "/usr/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 672, in build
exec(code, spec_namespace)
File "/home/kuba/projects/personal/qt-map-py/qt-map-py.spec", line 6, in < module >
a = Analysis(['main.py'],
File "/usr/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 242, in __init__
self.__postinit__()
File "/usr/lib/python3.9/site-packages/PyInstaller/building/datastruct.py", line 160, in __postinit__
self.assemble()
File "/usr/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 438, in assemble
ctypes_binaries = scan_code_for_ctypes(co)
File "/usr/lib/python3.9/site-packages/PyInstaller/depend/utils.py", line 145, in scan_code_for_ctypes
binaries = _resolveCtypesImports(binaries)
File "/usr/lib/python3.9/site-packages/PyInstaller/depend/utils.py", line 319, in _resolveCtypesImports
load_ldconfig_cache()
File "/usr/lib/python3.9/site-packages/PyInstaller/depend/utils.py", line 402, in load_ldconfig_cache
path = m.groups()[-1]
AttributeError: 'NoneType' object has no attribute 'groups'
```
You may have to rebuild `pyinstaller` . Go to Add/Remove Software, find
`pyinstaller` , click on it and choose "build".