В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
⛳International Golf Day on 15 June
📍 Marriott International Corporation is holding its annual International Charity Golf Day in Bali. This year's event will be held on 15 June at the National Golf Club in Nusa Dua.
🏌️♀️ Everyone can join this elite and expensive game, not only through participation in tournaments, but also during the evening programme, which the organisers announce as a kind of networking.
🎷 The festive evening will take place at the Westin Resort Nusa Dua at 18:30 the same day. Everyone is welcome to attend. The dinner will feature a buffet of international cuisine with beer, wine and soft drinks. In addition, guests can expect door prizes, auctions, and an entertainment programme with live music.
@BaliNews
#wheretogo#events#NusaDua
🎾Tennis in Bali: Nusa Dua opens clubhouse for ATP level tournaments
📍 The Bali Golf and Racket Club has opened in Nusa Dua, ready to host ATP tournaments in the future. It is the newest sports complex located in the heart of one of Bali's most prestigious resort areas, The Nusa Dua, which is famous for its five-star hotels and unique infrastructure.
🏆 The club was the first of its kind on the entire island. With its appearance, Bali acquires the status of not only a paradise island, but also a center for international tennis tournaments and sports tourism.
@BaliNews
#goodnews#sport#NusaDua
🎶TGIF 2025 music festival will return to Bali in May
The event promises to be one of the highlights of the music season in Bali.
📆 May 24-25
📍 At a new venue in Port of Benoa
ℹ️ In addition to concerts and live music, guests can expect food courts from local businesses, photo zones, interactive entertainment and relaxation areas. Parking and shuttles to shuttle guests are available for convenience.
🎫 Tickets are on sale now: one-day, two-day and VIP packages are available on the official website from Rp 150.000.
#events#festivals#wheretogo#NusaDua@BaliNews
🛎The first Waldorf Astoria hotel opens in Bali: second attempt
📰 The Hilton hotel group is expanding its presence in Bali. Waldorf Astoria Bali will be located between the Hilton and Kempinski hotels in Nusa Dua, 14.5 km from Ngurah Rai International Airport. The hotel is scheduled to open in late 2027.
🏨 Waldorf Astoria Bali will include 71 spacious villas and 68 guest suites, as well as the standard infrastructure for a chain hotel — restaurants, a spa, a fitness center, children's entertainment, and event rooms.
ℹ️ Waldorf Astoria had already announced the opening of its hotel in Bali in 2014. At that time, the location was chosen near Pandawa Beach in the south of the island. The opening was planned for 2027, but something went wrong. The massive concrete unfinished building can still be seen on the cliff to the left of the entrance to Pandawa Beach.
#places#realestate#development#NusaDua@BaliNews
🚤New Bali water taxi service launches for tourists
📰 A new marine transportation service, Bali Marine Water Taxi, has been launched in the popular resort area of Benoa (Nusa Dua) in Bali.
📍 The tourist cab service connects the seaports of Tanjung Benoa, Serangan and Pedungan (South Denpasar).
35 minutes. That’s all it takes. No traffic, no stress - just ocean views and open horizons. Uluwatu is calling.
👍 This is just one of the many sea routes Bali plans to develop in the coming months.
@BaliNews
#goodnews#places#services#transport#tourism#NusaDua
🛣Details about the construction of a district road in Bukit
District authorities are set to solve the road issue in Uluwatu by laying a new district road.
Construction of the first section from Siligita village to Sawangan in Nusa Dua district has already started.
The original idea was to extend the toll road, which now runs from the airport to Nusa Dua, all the way to Uluwatu.
Right now, traffic on the main road jl. Uluwatu is difficult because it is both a hub of commerce and the main thoroughfare of the area, used by everyone from locals to construction vehicles and tour buses.
The land acquisition budget for 2024 will be $16 million, with the next one already promised to increase to $19 million.
According to an insider in Bali's land office, all consideration of new housing development in the green zone on Bukit is now halted just in time for the land acquisition for the new roads.
@BaliNews
#roads#roads#authorities#Bukit#Uluwatu#NusaDua