TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #175 · 30 окт.

В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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

Hashtags

Резултати

Пронајдени 2 слични објави

Пребарај: #longtermplanreview

当前筛选 #longtermplanreview清除筛选
MND Singapore

@mndsingapore · Post #341 · 10.06.2022 г., 09:45

Besides providing our basic need for shelter, our living environment can also encourage interactions among residents, build a sense of belonging, foster vibrant communities, and promote healthy lifestyles. To meet the growing needs and diverse aspirations of Singaporeans, we need to continuously transform our built environment to accommodate these shifts. For instance, we will pilot assisted living housing options to care for an ageing population. To find out more about our land use plans and strategies, visit the Long-Term Plan Review exhibition: ➡️ Now till 4 August 2022 📍 At the URA Centre ➡️ More info: go.gov.sg/ltprexhibit #LTPR2021#Longtermplanreview#Publichousing

MND Singapore

@mndsingapore · Post #344 · 17.06.2022 г., 11:57

To provide more jobs closer to homes and sustain Singapore’s competitiveness, we will continue to build up our islandwide polycentres and rejuvenate the city centre. Among the initiatives, the city centre will be transformed into a more mixed-use and vibrant precinct, to support the evolving nature and modalities of work, to meet the varied needs of modern lifestyles. We will also introduce a wider range of amenities and lifestyle offerings, as well as more residential options. For more on how we plan our land use to support businesses in adapting their operations to fast-changing economic trends, visit go.gov.sg/ltprexhibit, or visit the Long-Term Plan Review exhibition: ➡️ Now till 27 August 2022 ➡️ At The URA Centre #LTPR2021#longtermplanreview#singaporecity