Модуль Qt․py это не просто текстовый модуль, его компоненты генерируются на лету в зависимости от ситуации.
Поэтому ваша любимая IDE не сможет качественно сообразить автокомплиты под этот модуль.
Решение здесь более чем очевидно, надо сделать stubs-файлы. Это файлы с расширением .pyi, описывающие содержимое модуля но не имеющие рабочего кода.
Ну что, готовы потратить пару месяцев своей жизни чтобы описать все классы Qt и их методы? 😭
Расслабьтесь, за вас это уже сделали добрые люди.
Спасибо Fredrik Averpil !
Качаем здесь ⬇️
https://github.com/fredrikaverpil/Qt.py/tree/stubs/stubs/Qt
Не думаю что стоит устанавливать Qt․py из этого репозитория. Он там не обновляется. Так что забираем только файлы .pyi.
За актуальность этих файлов тоже не ручаюсь, но большинство методов там имеются.
Установка:
🔸 Вариант 1:
- находим куда установлен сам модуль Qt․py, это будет одинокий файл который так и называется Qt․py
- кидаем директорию рядом с ним (если есть доступ на запись). Должно получиться так:
📁 site-packages\
📄 Qt.py
📁 Qt\
...
🔸 Вариант 2
- копируем директорию Qt куда угодно
- пробиваем путь к ней в настройках энвайронмента в переменную PATH так, чтобы путь был ДО директории Qt.
Закинуть можно и в свою домашнюю директорию. Если скопируете сюда:
~/stubs/Qt
То переменную пишем так
export PATH=~/stubs:${PATH}
После этого IDE должна распарсить stubs-файлы и автокомплиты появятся 😎
#qt#libs#tricks
Other than firefighters and medics, the first people that went to help are local citizens everywhere from the city bringing food and their own supplies. However, to the #HKGov took all the credits. They called the cops to drive those volunteers away and the “Care Team” from the government takes pictures in front of those supplies that belongs to the volunteers. This is awfully disgusting.
#HongKongFire#宏福苑大火
Bamboo becomes the Scapegoat this time!
Everyone #HongKongers expected the #HKGov would find a scapegoat way before the fire was put out. What surprising was that this time it wasn’t a person, but the bamboo.
The “Mandatory Inspection Scheme” in Hong Kong, initiated by the government is the very reason that caused this tragedy.
To put it short:
1 - Government requires home owners to remake the buildings wall.
2 - Pro-Beijing & construction agencies infiltrated Home Owners Corporation.
3 - Hire construction companies with extremely high price.
4 - all materials and workers not meeting safety standards are purchased from China.
5 - $$ goes to China.
#HongKongFire#宏福苑大火
#英文#港聞
Several #HongKongers returned to Hong Kong from UK got arrested for getting their MPF (Mandatory Provident Fund).
This is just an excuse for the #HKGov to punish #HongKongers for immigrating to the UK. The #UKGov must take action!
🍎保留一點真相、一些堅持:
https://t.me/appledailyhk26
🍎蘋果報料熱線: @Appledailyhk_bot
🍎蘋民不蘋則鳴!2.0
https://t.me/hkerappledaily2