Модуль 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
📢 The Weekly Wrap – 22 November 2024
1️⃣ PSA: #SGBudget2024 December Benefits Are On The Way! 📢📢📢
We are nearing the end of the year - check out what you’re eligible for under #SGBudget2024 in December – Assurance Package Cash, MediSave Bonus, Retirement Savings Bonus!
🔗 Check your eligibility at govbenefits.gov.sg
2️⃣PAU-liament Round-up! 🎥🎥🎥
Want to stay informed on the latest discussions in Parliament but short on time? We’ve got the solution!
Catch up on the latest updates with the PAU-liament round-up! https://www.instagram.com/reel/DCnoWa_NZef/?igsh=MXV2OXpldnY5Z3hqbw==
3️⃣The Landlady Singer Returns! 🎶🎶🎶
Get ready to be entertained! ‘The Landlady Singer Returns’ brings laughter, music and heart to you every Tuesday at 8pm on Channel 8.
You can also catch the first 4 episodes at go.gov.sg/thelandladysingerreturns
The CPF Special Account will be closed for members aged 55 and above in early 2025. What can you do to continue earning higher long-term interest rate? Find out ⬆️#SGBudget2024
Infographic: MOM with CPF Board
#SGBudget2024 Enjoy energy savings and lower utility bills! Claim your vouchers from 15 Apr 2024. As part of the enhanced Climate-Friendly Households Programme, the vouchers can be used to purchase 10 types of energy- and water-efficient household products. More info at go.gov.sg/climatevouchers
#SGBudget2024 To support businesses to build competencies in waste management, we have partnered training providers to introduce the course. This can help to improve resource efficiency, lower costs, and enhance corporate social responsibility. More info at go.gov.sg/zero-waste-manager-course
#SGBudget2024 From 1 Jan 2026, paints sold in Singapore intended for application on the interior of buildings will be required to have no formaldehyde. Minimising formaldehyde improves indoor air quality and is part of our ongoing efforts to safeguard public health. More info at www.nea.gov.sg/year-of-public-hygiene
📢 Exciting news from #SGBudget2024: Together with MOE, SkillsFuture Singapore is stepping up support for mid-career Singaporeans with the new SkillsFuture Level-Up Programme 🚀
Discover how you can reskill and upskill to stay relevant in this changing economy.
For more information, check out
go.gov.sg/Budget24-SFLPTG🔍
#SGBudget2024 Look forward to more food options at new hawker centres opening soon at Anchorvale Village, Punggol Coast and Woodleigh Village! More info at go.gov.sg/nea-cos-2024#OurHawkerCentres
#ICYMI DPM and Finance Minister Lawrence Wong delivered the #SGBudget2024 which introduced new measures to safeguard Singapore’s peace and security. This includes establishing a new National Cybersecurity Command Centre and Future Energy Fund.
Find out more ⬆️ or visit www.singaporebudget.gov.sg.
Infographics: MOF
#ICYMI#SGBudget2024The Government will strengthen support for seniors and their retirement needs. This includes boosting the Mahjulah Package, raising the CPF Enhanced Retirement Sum and enhancing the Age Well SG programme.
Full details ⬆️ or visit www.singaporebudget.gov.sg.
Infographics: MOF