В прошлом посте говоря "Все вызовы теперь одинаковы" я несколько слукавил. Всё-таки есть в этом зоопарке версий некоторая несовместимость вызов которой просто так не унифицировать. Эти моменты вынесены в отдельный модуль 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
Kevin Warsh, a New Chair of the Federal Reserve
Trump has announced Kevin Warsh as his nomination for the next chair of the Federal Reserve, selecting a candidate who has been an outspoken critic of the US central bank.
The move ends months of speculation about who the president would pick to replace Jerome Powell, as he waged an extraordinary campaign to influence policymaking at the Fed by repeatedly calling for interest rate cuts. Powell’s second term as chair is due to end in May.
Writing on his Truth Social platform, Trump said: “I have known Kevin for a long period of time, and have no doubt that he will go down as one of the GREAT Fed Chairmen, maybe the best. On top of everything else, he is ‘central casting’, and he will never let you down.”
Warsh, 55, a former Federal Reserve governor who has deep ties to Wall Street, had previously interviewed for the job of chair in 2017 when the role went to Powell, whose term ends in May. Trump’s pick will have to be confirmed by the Senate.
Mark Carney, the Canadian prime minister and former governor of the Bank of England, said in a social media post that Warsh is “a fantastic choice to lead the world’s most important central bank at this crucial time”.
The dollar strengthened early on Friday after it was reported that Warsh was expected to be Trump’s choice, but then eased back after the nomination. Gold fell by 4.8% to $5,132 an ounce. Wall Street opened slightly lower.
Warsh has warned about inflation risks in the US in the past, but has also echoed Trump’s critique of the Fed for being too slow to cut interest rates.
High interest rates can alleviate inflation at the risk of upping unemployment. Rates are currently at a range of 3.5% to 3.75%, which most economists at the Fed currently see as neutral to prices and unemployment.
Since resigning from the central bank in 2011 over its post-financial crisis stimulus package, Warsh has criticised it publicly on multiple occasions.
In April last year, he issued a stinging attack, saying the institution’s central bankers should not be treated as “pampered princes” and it too regularly “opines on matters outside its remit” which has led to “systemic errors” in its main role of trying to keep prices stable.
Warsh has been a longtime critic of the ultra-loose monetary policy pursued by the Fed since the financial crisis, including the central bank’s expanded balance sheet.
He had previously been seen as a monetary policy hawk, but appears to have aligned himself with the White House’s push for lower borrowing costs.
#chair#federal#reserve#trump#carney
📱American Оbserver - Stay up to date on all important events
🇺🇸
Federal Reserve Chair Jerome Powell Faces a Stiff Challenge
Justice department opens investigation into Jerome Powell as Trump ramps up campaign against Federal Reserve.
The independence and credibility of America’s central bank is under threat after the Department of Justice opened a criminal investigation into Federal Reserve chair Jerome, knocking the US dollar.
In a startling development, US prosecutors have launched a criminal investigation into Powell over a $2.5bn renovation of the Federal Reserve’s headquarters, and into his testimony about the project to the Senate banking committee in June last year.
The move is a dramatic escalation in the long-simmering tensions between the Fed and the Trump White House, with the US president repeatedly rubbishing Powell for not cutting interest rates more quickly.
After news of the investigation broke last night, Powell came out fighting, insisting that he had been threatened with criminal charges because the Fed had set interest rates “based on our best assessment of what will serve the public, rather than following the preferences of the president”.
#federal#reserve#chair#powell#investigation
📱American Оbserver - Stay up to date on all important events
🇺🇸