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

TGINSIGHT SIMILAR POSTS

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

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

Регулярно приходится писать и ревьюить код, где используется PySide2-6. Заметил, что в подавляющем большинстве случаев настройка создаваемых базовых виджетов происходит через методы. Думаю, всем знаком такой способ. Простой пример с кнопкой: button = QPushButton("Click Me") button.setMinimumWidth(300) button.setFlat(True) button.setStyleSheet("font-size: 20pt") button.setToolTip("Super Button") button.clicked.connect(lambda: print("Button clicked")) Но есть и альтернативный способ - настройка через свойства. Это просто ключевые аргументы конструктора класса. Хоть они и не указаны в документации как аргументы, но они есть) Этот код делает тоже самое но с помощью Property button = QPushButton( "Click Me", minimumWidth=300, flat=True, styleSheet="font-size: 20pt", toolTip="Super Button", clicked=lambda: print("Button clicked"), ) Где это может быть полезно ▫️ Это выглядит более аккуратно и коротко, уже повод использовать ▫️ Может использоваться в заполнении лейаута, когда нам не нужно никакое другое взаимодействие с виджетом и поэтому сохранять его в переменную не требуется. Например, лейбл или кнопка. widget = QWidget(minimumWidth=400) layout = QHBoxLayout(widget) layout.addWidget(QLabel("Button >", alignment=Qt.AlignRight)) layout.addWidget(QPushButton("Click Me", clicked=lambda: print("Button clicked"))) widget.show() Либо так widget = QWidget(minimumWidth=400) layout = QHBoxLayout(widget) for wd in ( QLabel("Button >", alignment=Qt.AlignRight), QPushButton("Click Me", clicked=lambda: ...) ): layout.addWidget(wd) widget.show() ▫️ Можно хранить настройки в каком-то конфиге или генерировать на лету, после чего передавать как kwargs. kwargs = {"text": "Hello " * 30, "wordWrap": True} my_label = QLabel(**kwargs) Как получить полный список доступных свойств? Эта функция распечатает в терминал все свойства виджета и их текущие значения def print_widget_properties(widget): meta_object = widget.metaObject() for i in range(meta_object.propertyCount()): property_ = meta_object.property(i) property_name = property_.name() property_value = property_.read(widget) print(f"{property_name}: {property_value}") #tricks#qt

Hashtags

Резултати

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

Пребарај: #conspiracy

当前筛选 #conspiracy清除筛选
movies & series 🍿

@images · Post #1918 · 22.09.2025 г., 09:40

🍿 The Chair Company: Tim Robinson Turns Office Life Into a Hotbed of Conspiracies 📆Premiere: October 13, 2025 🎭Genre: #Comedy · #Conspiracy ✈️Follow series Tim Robinson, the mastermind behind I Think You Should Leave and Detroiters, is back with a show that feels like a sketch stretched to the max… but with the ambition of an HBO thriller. In The Chair Company, he plays William Ronald Trosper, an office worker who, after a humiliating disaster at work, finds himself unraveling a criminal conspiracy as absurd as it is unsettling. 🤯🪑 The trailer is packed with rapid-fire one-liners, cartoonish facial expressions, and Robinson’s trademark obsession with bleak middle-class workplaces where misery flips into dark comedy. What I love most is how Robinson moves away from the usual “rich people intrigue” à la Succession and instead zeroes in on the mindset of the alienated office drone. That lens on the hopeless everyman feels as necessary as it is hilarious. If you ever thought a chair could be the center of the universe, this show is here to prove it. 🔥

Trump's Ear

@trumpsear_tg · Post #1578 · 30.09.2025 г., 14:03

Top MAGA lackey Kash Patel has made the uncharacteristically bold move of intervening in Donald Trump’s mad and rapidly mounting campaign of vengeance against his political opponents. Trump launched into a vicious Truth Social diatribe Saturday afternoon against former FBI director Christopher Wray, who he slammed for supposedly “LYING” about the presence of bureau personnel in the crowds outside the Capitol Building on Jan. 6. #Trump#conspiracy#FBI 👂More on Trump's Ear ⚠️

Trump's Ear

@trumpsear_tg · Post #1584 · 30.09.2025 г., 23:59

Gavin Newsom naturally couldn’t resist trolling Donald Trump after the 79-year-old president posted an AI-generated video featuring him he shilling for magic “Medbeds.” “Trump is about to shut down the government and rip health care from 20 million Americans. What’s he doing? Posting AI-generated slop about ‘miracle hospital beds’ that cure all illness,” tweeted Newsom, 57. “DONALD TRUMP HAS LOST IT,” he added. #Trump#Newsom#conspiracy 👂More on Trump's Ear ⚠️

Trump's Ear

@trumpsear_tg · Post #1579 · 30.09.2025 г., 14:05

The "Shaman of the Capitol" sued Donald Trump and the World Bank ⚖️🐂🇺🇸 Jacob Chansley, better known as the QAnon Shaman due to his horns, skin and painted face during the storming of the US Congress on January 6, 2021, decided to sue Donald Trump. The same president who pardoned him in January 2025 after 41 months in prison. 🏛📜 Chansley's lawsuit also names other defendants — the US Federal Reserve 🏦, the National Security Agency 🛰, the IMF 💵, the World Bank 🌍, the State of Israel ✡️, Elon Musk's Corporation X 🚀, T-Mobile 📱 and Warner Bros. Studios 🎬. The document itself is 26 pages long, but consists of one paragraph. In it, Chansley demands that only two laws remain in force — the Bill of Rights and the original U.S. Constitution 📖🦅. Unusual items include the idea of issuing a $40 trillion gold coin 🪙 to cover the U.S. national debt. He also claims that Trump personally sent him a letter ✉️ two days after the Capitol was stormed, and the secret services allegedly tried to use his "shamanic abilities" ✨ for contacts "out of this world" 👽. Previously, Chansley was an ardent proponent of the conspiracy theory 🔍 that Trump is fighting an elite group engaged in child sex trafficking. However, he later turned away from the president, accusing him of unwillingness to make public the "Epstein dossier." 📂 #Conspiracy#QAnon 👂More on Trump's Ear ⚠️

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40155 · 21.11.2025 г., 23:01

President John F. Kennedy was assassinated on November 22, 1963. Lee Harvey Oswald was arrested for the crime but was killed two days later by Jack Ruby. Ruby was convicted of murder but died in prison before his retrial. This single act—Ruby killing Oswald—meant there was never a public trial to examine the evidence. This left countless unanswered questions and made it impossible to prove there wasn't a conspiracy. What's your theory? [Read more] @googlefactss #JFK#History#OnThisDay#conspiracy