В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
🚀BIG ANNOUNCEMENT!
🚀
Bitcoin💸 just achieved a monumental milestone, breaking the 💵1 trillion market cap! 🎉📈 With the continuous surge in ATH🔝 (All-Time High) values every day, we can't help but capitalize on this golden opportunity.
📆 SAVE THE DATE: THIS SUNDAY
⌛️Time : 17:00 PM (GMT)
🚀 Pump Target: At least 700%
💰Duration: The pump is expected to last for days.
This isn't just a pump; it's a chance to ride the wave of success in the booming crypto market.
Turn on your notifications and join us on Sunday for an epic pump that could bring massive profits.
Let's make this one for the record books! 💸#BitcoinPump#CryptoSuccess
Got any Questions? @RobertMillercrypto
🔥 Mastercard, Citigroup, and JPMorgan Chase join forces to pilot shared ledger technology for Tokenized Assets settlement processes, with the goal of enhancing speed and security in cross-border transactions. This collaboration could transform the financial sector by enabling diverse asset types to settle on a unified platform.⭐️🌐
#Cryptoassets
#Cryptosuccess
#Blockchainrevolution
🎉SLEX Exchange HITS Top-50 on CoinPaprika! 🚀
💫SLEX Exchange made it into the Top-50 among over 300 cryptocurrency exchanges on CoinPaprika! This achievement highlights our dedication to providing top-notch trading services and robust security.
🤝Thank you to SLEX community for your trust and support. This achievement is as much yours as it is ours!❤️
🔗Check out our ranking: SLEX on CoinPaprika
🦾Come aboard SLEX - wheee crypto and commodity trading meet innovative features. Grow and profit with us! ☄️
#SLEX#Top50#CoinPaprika#CryptoSuccess
Website| Telegram | Reddit | Facebook | Instagram | Medium | Linkedin | Twitter
🚨Crypto Trading Guide for Beginners🚨
Ready to master crypto trading? Join Ekta Mourya from FXStreet as she breaks down how to stop gambling and start building wealth with a structured plan! 💥
Key Insights:
- Stop guessing, understand market cycles 📉
- Avoid 3 common mistakes beginners make ❌
- Use the Crypto Fear & Greed Index to your advantage 🤑
- Top-down analysis with simple tools like RSI & Moving Averages 📊
Start trading like a pro today.
Watch now! 👉https://www.youtube.com/watch?v=R8aAPHvHiKU
#CryptoTradingGuide#BitcoinForBeginners#FXStreet#CryptoSuccess#SmartMoneyConcepts
🚨Crypto Trading Guide for Beginners🚨
Ready to master crypto trading? Join Ekta Mourya from FXStreet as she breaks down how to stop gambling and start building wealth with a structured plan! 💥
Key Insights:
- Stop guessing, understand market cycles 📉
- Avoid 3 common mistakes beginners make ❌
- Use the Crypto Fear & Greed Index to your advantage 🤑
- Top-down analysis with simple tools like RSI & Moving Averages 📊
Start trading like a pro today.
Watch now! 👉https://www.youtube.com/watch?v=R8aAPHvHiKU
#CryptoTradingGuide#BitcoinForBeginners#FXStreet#CryptoSuccess#SmartMoneyConcepts