В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль QtCompat (compatibility). Там не так много функций но они довольно полезны.
Этот модуль содержит унификаци модуля shiboken2, функций loadUi, translate и несколько переименованных функций классов или изменённую сигнатуру аргументов и возвращаемых значений. Это единственное исключение из правила когда вам потребуется где-то изменить свой код кроме импортов и этот код не похож на обычный код PySide2.
Например, в PyQt4 и PySide есть метод
QHeaderView.setResizeMode
Для PyQt5 и PySide2 они были благополучно переименованы в
QHeaderView.setSectionResizeMode
Чтобы применить этот метод следует использовать такой код
from Qt import QtCompath
header = self.horizontalHeader()
QtCompat.QHeaderView.setSectionResizeMode(header, QtWidgets.QHeaderView.Fixed)
Унификация загрузки UI файлов:
# PySide2
from PySide2.QtUiTools import QUiLoader
loader = QUiLoader()
widget = loader.load(ui_file)
# PyQt5
from PyQt5 import uic
widget = uic.loadUi(ui_file)
# Qt.py
from Qt import QtCompat
widget = QtCompat.loadUi(ui_file)
Хорошо что таких моментов не много и их легко запомнить.
Полный список можно посмотреть в таблице.
#qt#tricks
🚨 Public announcements 🚨
We’re excited to announce a *TikTok Challenge* to showcase your creativity and skills! 🎥
Theme: Highlight the features and benefits of our *Passenger Online Booking* service.
How to Participate:
1️⃣ Create an engaging TikTok video in *Amharic, English, Afaan Oromo, Af Somali, Afar*.
2️⃣ Include the Online Booking requirements is *National ID* in your video.
3️⃣ Be creative, original, and fun!
Deadline: Submit your video by Monday, February 17, 2025.
🎉 Prize:
The winner will receive a *cash bonus* and *special recognition* for their outstanding creativity!
Join the content creators' group by scanning the QR code to submit your videos. We can’t wait to see your creations!
#EthioDjiboutiRailway#ComingSoon#TravelMadeEasy#StayTuned#DigitalEthiopia#Fayda
🌟 FROM ADDIS TO SILICON VALLEY: YOUNG ETHIOPIANS BUILDING THE FUTURE!
የአዲስ አበባ ወደ ሲሊኮን ቫሊ፡ የኢትዮጵያ ወጣቶች ወደፊቱን እየገነቡ ነው!
Your country is not your obstacle - it's your SUPERPOWER! 💪
ሀገርህ መሰናክል አይደለም - ሱፐር ኃይልህ ነው!
🏆 REAL SUCCESS STORIES:
💰BETHLEHEM TILAHUN ALEMU | ብርሀን ጥላሁን ዓለሙ
• Founded soleRebels (footwear company) at 25
• $10M+ revenue, exports to 50+ countries
• Made from recycled tires + traditional weaving
• Featured in Forbes, Times Magazine
• "I turned our grandmother's craft into global brand!"
🎵TEDDY AFRO & MUSIC EMPIRE | ቴዎድሮስ ካሳሁን
• Albums sold 2M+ copies worldwide
• Concert revenues $500K+ per show
• African music ambassador to the world
• Started from Addis Ababa streets
🌱AGRITECH REVOLUTION:
• 2030 Vision: Digital farming apps
• EthioSIS: Soil mapping technology (government project)
• Young farmers earning 300% more using smartphones
• Export potential: $2B+ organic coffee market
👩💼WOMEN ENTREPRENEURS:
• Maya Haile-Mariam: Tech startup $5M valuation
• Selamawit Chekol: Fashion brand expanding to USA
• Martha Tilahun: Food processing empire
💡YOUR ADVANTAGES AS ETHIOPIAN:
✅ Ancient culture = unique design aesthetics
✅ Coffee heritage = premium brand story
✅ 13-month calendar = exclusive time management apps
✅ Multilingual (80+ languages) = translation services
✅ High altitude = athletic training programs
✅ History (3000+ years) = educational content gold mine
🚀START TOMORROW - 3 SIMPLE STEPS:
📱 STEP 1: DIGITAL PRESENCE
• Create Instagram/TikTok showcasing Ethiopian culture
• Use trending hashtags: #EthiopianTradition#AfricanInnovation
• Post daily content in English + Amharic
💰 STEP 2: MONETIZE YOUR KNOWLEDGE
• Teach Amharic online (Italki, Preply): $15-25/hour
• Sell handmade crafts on Etsy: $20-200+ per item
• Create YouTube cooking channel: Ethiopian cuisine going viral!
🌍 STEP 3: THINK GLOBAL
• Partner with diaspora communities (2M+ Ethiopians worldwide)
• Export coffee/spices through e-commerce
• Offer virtual Ethiopian cultural experiences
📞RESOURCES TO START:
• IceAddis: Startup incubator in Addis Ababa
• Ethiopia Commodity Exchange: Connect with coffee buyers
• Women in Tech Ethiopia: Female entrepreneurs network
• TechnoServe: Business development programs
💎GOLDEN RULE:
"Every problem in Ethiopia = business opportunity for smart youth!"
🔥MOTIVATIONAL CLOSE:
Your ancestors built Lalibela without cranes. You can build digital empires with just a smartphone!
The world needs what Ethiopia has. Your job is to package it beautifully and sell it globally! 🌍✨
የአባቶችህ ላሊበላን ክሬን ሳይጠቀሙ ገነቡት። አንተ ስማርትፎን ብቻ ተጠቅመህ ዲጂታል ግዛቶችን መገንባት ትችላለህ!
✨ Expert-reviewed content | Verified by Ethiopian business & tech specialists
#EthiopianEntrepreneurs#StartupEthiopia#DigitalEthiopia#AfricanInnovation#ኢትዮጵያ#BusinessSuccess🇪🇹💰🚀
💻 FROM ANCIENT SCRIPTS TO DIGITAL CODE: ETHIOPIA'S TECH TAKEOVER
💻 ከጥንታዊ ጽሑፍ እስከ ዲጂታል ኮድ: የኢትዮጵያ ቴክኖሎጂ መቆጣጠር
🔥 КОГДА 3000-ЛЕТНЯЯ ЦИВИЛИЗАЦИЯ ВСТРЕЧАЕТ SILICON VALLEY!
Ethiopian youth aren't just consuming technology - they're CREATING it! 💫
🌟 DIGITAL ETHIOPIA RISING:
🏙️ ADDIS ABABA = AFRICA'S SILICON VALLEY:
- Tech hubs sprouting faster than coffee plants
- Young developers coding the future of Africa
- From ancient Ge'ez script to programming languages!
💡 ETHIOPIAN TECH STARTUPS CHANGING THE GAME:
🚀Ride - Ethiopia's answer to Uber, built for African roads
🚀ZayRide - Local mobility solutions that actually work
🚀Deliver Addis - Food delivery revolutionizing Ethiopian dining
🚀EthSwitch - Fintech making banking accessible to everyone
🚀Gebeya - Training Africa's next generation of developers
🚀iCog Labs - AI and robotics putting Ethiopia on the tech map
📊 THE NUMBERS DON'T LIE:
✨ 50%+ youth population = MASSIVE tech potential
✨ Growing internet penetration = Digital revolution in motion
✨ Government support for tech initiatives = Infrastructure backing innovation
✨ Ancient problem-solving culture + Modern tools = Unstoppable combination
🎯 YOUNG ETHIOPIAN DEVELOPERS SAY:
*"Our ancestors built Lalibela without blueprints - we build apps without limits!"*
*"ቅድመ አያቶቻችን ላሊበላን ያለ ንድፍ ገንብተዋል - እኛ ያለ ገደብ መተግበሪያዎችን እንገነባለን!"*
🔋 THE DIGITAL SWAG:
- Coding in multiple languages (including Amharic interfaces!)
- Building solutions for African problems
- Connecting rural Ethiopia to global markets
- Making ancient wisdom accessible through modern tech
🚀 PLOT TWIST:
While Silicon Valley talks about "disruption," Ethiopia has been disrupting expectations for millennia!
💪 THE FUTURE IS BEING WRITTEN:
In Ethiopian coffee shops, young developers are coding solutions that will change Africa forever!
*From coffee ceremonies to coding ceremonies - the grind never stops* ☕💻
#DigitalEthiopia#የኢትዮጵያቴክኖሎጂ#EthiopianTech#AfricaTech#TechStartups#DigitalRevolution#EthiopianInnovation#TechHub#ኢትዮጵያላይፍ#FutureIsEthiopian