В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
Dua of Prophet Sulaiman
رَبِّ أَوْزِعْنِي أَنْ أَشْكُرَ نِعْمَتَكَ الَّتِي أَنْعَمْتَ عَلَيَّ وَعَلَى وَالِدَيَّ
Lord, enable me to be thankful for the blessings You have granted me and my parents ... (Quran 27:19 and 46:15)
#Quran
@muslimss
@English_speakers
https://datascienceplus.com/analyzing-the-bible-and-the-quran-using-spark/
Analyzing the #Bible and the #Quran using #Spark
Most of the data out there are unstructured, and Spark is an excellent tool for analyzing this type of data. Here, we will analyze the Bible and the Quran. We will see the distribution of words, the most common words in both scriptures and the average frequency. This could also be scaled to find the most common words and distribution of all words on the Internet. The books have been retrieved from Project Gutenberg. The Bible can be downloaded from here and the Quran from here.
According to Al-Quran, Surah Ar-Rahman (55:19-23), Allah Almighty presents a powerful and miraculous sign of His creation:
He released two seas, meeting side by side. Between them is a barrier, so they do not mix. So which of the favors of your Lord will you deny?
In these verses, Allah highlights His supreme authority and wisdom. The reference is to two bodies of water — saltwater and freshwater — that meet but do not mix, remaining separate due to a divine barrier. This natural phenomenon, which scientists have now confirmed, is a profound example of Allah’s control over the natural world. Despite their proximity, the two waters retain their distinct properties, showcasing the perfect balance and system designed by the Creator.
#Miracle of the #Quran
The Quran was revealed over 1400 years ago, long before modern science understood this phenomenon. The concept of two seas meeting without mixing is something that early humans would have had no scientific means to explain. However, this fact has been witnessed in places like the Mediterranean Sea and the Atlantic Ocean, as well as at river mouths where freshwater meets saltwater. These verses from Surah Ar-Rahman serve as a miraculous scientific truth that confirms the divine knowledge in the Quran, as such occurrences were unknown to humans at the time of revelation.
This miracle demonstrates that the Quran is not just a religious text, but also a source of knowledge beyond human capacity. It contains signs that have been confirmed by modern scientific discoveries, proving its authenticity for generations.
#Hadeeth and the Understanding of Nature
The Quran’s miraculous signs are supported by several teachings in the Hadith (the sayings and actions of the Prophet Muhammad, peace be upon him). The Prophet (PBUH) emphasized reflection on the natural world as a way to understand the power and wisdom of Allah. He encouraged believers to observe the universe as a sign of Allah’s existence, greatness, and mercy.
For instance, in one hadith, the Prophet (PBUH) said
:
"Verily, in the creation of the heavens and the earth, and in the alternation of the night and the day, there are indeed signs for men of understanding.
(Sahih Muslim)
This emphasizes that everything in the natural world — from the vastness of the cosmos to the interaction of rivers and seas — is a sign of #Allah’s greatness. The separation of the seas is not just a scientific reality, but a reflection of Allah’s control over every element of creation.
#Challenging Other #Religions
#Islam, through the Quran and Hadith, presents a clear and rational understanding of the world that aligns with both spiritual insight and scientific discovery. Other religions, such as Hinduism, Christianity, and Judaism, do not offer such precise and scientifically verifiable details in their scriptures. While they contain teachings about faith and morality, no other religious scripture provides such detailed descriptions of natural phenomena that can be later confirmed by science, as is the case with the Quran.
Why Deny the Truth?
The repeated question, "So which of the favors of your Lord will you deny?" is a reminder to humanity that all the signs of Allah’s existence and mercy are evident, yet many people continue to deny or ignore them. These verses challenge the deniers of faith by presenting clear, undeniable evidence of Allah’s creation and control over the universe.
In conclusion, this verse from Surah Ar-Rahman, alongside many other Quranic miracles, serves as a testament to the truth of Islam and the divine nature of the Quran. It stands as a proof for both believers and skeptics, showing that no other religion can provide such clear and scientifically proven signs of divine wisdom and knowledge. The separation of the seas is just one of many miracles in the Quran that continue to be confirmed by modern discoveries, making it clear that the Quran is the ultimate source of truth.
Thanks for your kindly time