Модуль 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
2019 Chinese University of Hong Kong (CUHK) Siege Timeline:
- Nov 11-12: Police initiate action by entering CUHK campus, sparking clashes.
- Nov 12: Police deploy tear gas, rubber bullets, and bean bag rounds; clashes last for hours, with dozens injured.
- Nov 12 (Evening): University president Rocky Tuan mediates; police agree to withdraw, but tensions persist.
- Nov 13: Aftermath continues as campus calms, becoming a symbol of the protests.
- Police Brutality Details: According to Amnesty International and Human Rights Watch reports, police used excessive force, including close-range rubber bullet shots causing eye injuries, beatings of detainees, and indiscriminate tear gas affecting students and non-protesters.
#HongKongProtests#2019HongKong
Timeline of Chow Tsz-lok's Death:
- Nov 3, 2019 (Evening): Protests in Tseung Kwan O escalate; police deploy tear gas.
- Nov 4, 2019 (Around 1 AM): Chow falls from 3rd floor of Sheung Tak Estate car park, suffers severe injuries; reports claim police were present at the parking lot at the time.
- Car park fence is 1.3m tall, making accidental fall unlikely for an adult, raising suspicions.
- Chow had severe head injuries but no other broken bones; critics claim this proves he was unconscious before the fall.
- Nov 4, 2019: Ambulance delayed due to roadblocks, with reports claiming police cars blocked the way; Chow admitted to hospital in coma.
- Nov 8, 2019 (Morning): Chow pronounced dead at age 22 from cardiac arrest.
- Jan 2021: Coroner's inquest did not rule accidental death, but exact cause of fall undetermined; critics allege the judge misled the jury multiple times that it was an accident.
- A tragic symbol of Hong Kong's 2019 protests—remembering the call for justice.
#ChowTszLok#HongKongProtests
Legal expert Johannes Chan Man-mun explains the permanent nature of the "interim" injunction in Hong Kong's protest case, with no avenue for appeal to the Court of Final Appeal. Chan criticizes the court's decision to deny intervention, highlighting the challenges in challenging the ban. He emphasizes the undermining of human rights and suggests legislative action instead of relying on court injunctions. Human rights concerns persist in Hong Kong. #HongKongProtests#LegalRuling#HumanRights