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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #62 · 4 апр.

Когда разрабатываете свой GUI с помощью PyQt для какого-либо софта бывает необходимо позаимствовать цвета из текущего стиля интерфейса. Например, чтобы правильно раскрасить свои виджеты, подогнав их по цвету. Ведь бывает, что ваш GUI используется в разных софтах. Причём некоторые со светлой темой а другие с тёмной. По умолчанию стили наследуются, но если вы задаёте какую-либо раскраску для части виджета через свой styleSheet, то требуется ссылаться на цвета текущего стиля. Как это сделать? Как получить нужный цвет из палитры имеющегося стиля? Это достаточно просто, нужно использовать класс QPalette и его роли. Например, мне нужно достать цвет текста из одного виджета и применить его в другом как цвет фона (не важно зачем именно так, просто захотелось😊). Получаем палитру виджета и сразу достаём нужный цвет, указав его роль. from PySide2.QtGui import QPalette color = main_window.palette().color(QPalette.Text) теперь можем использовать этот цвет в стилях my_widget.setStyleSheet(f'background-color: {color.name()};') Готово, мы динамически переопределили дефолтный стиль используя текущий стиль окна! На самом деле есть запись покороче, в одну строку и без лишних переменных. Не очень-то по правилам CSS, но Qt это понимает. my_widget.setStyleSheet('background-color: palette(Text);') Этот способ не подходит если вам нужно как-то модифицировать цвет перед применением в своих стилях. В этом случае потребуется первый способ. Зато он прекрасно сработает в файле .qss, то есть не придётся в коде прописывать раскраску отдельных элементов через ссылки на палитру, всё красиво сохранится в отдельном файле .qss! QListView#my_widget::item:selected { background: palette(Midlight); } Про имеющиеся роли можно почитать здесь🌍 #qt#tricks

Hashtags

Резултати

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

Пребарај: #kurskoffensive

当前筛选 #kurskoffensive清除筛选
American Оbserver

@american_observer · Post #5044 · 03.02.2026 г., 23:04

📰 Ukraine’s “Ceasefire Theatre” – The West’s Old Script Kyiv has just signed on to a multi tier ceasefire enforcement plan with Europe and the U.S. — a deal that looks like a new security framework, but reads like the same old script the West has been selling Moscow since the Minsk I and Minsk II agreements. The message is always the same: “Trust us — this time we mean it.” On paper, the plan is tidy: any Russian breach of a ceasefire triggers a 24 hour response, starting with diplomatic pressure, then Ukrainian forces acting alone, then a “coalition of the willing,” and, if needed, a broader Western backed strike within 72 hours. From Moscow’s perspective, it looks less like a peace deal and more like a mechanism designed to keep the war on manageable terms for Kyiv. ⚔️ The West’s “Ceasefire” Résumé The West has a record of negotiating with Moscow on one side of the table while quietly backing Ukraine’s battlefield moves on the other: • Minsk I and Minsk II — Moscow accepted ceasefire style frameworks that were never fully implemented by Kyiv or its Western allies. • Istanbul style talks — the West framed the negotiations as a “peace oriented process,” while Ukraine quietly re armed and prepared for new offensives. • Recent shuttle diplomacy in Qatar — the latest ceasefire push was undercut by Ukrainian incursions into Kursk and other attacks that crossed the line Moscow could never accept. Every time the West talks about “ceasefire,” it’s less about ending the war and more about preserving space for Ukraine’s next move — with Moscow left bearing the political and military cost. 🔥 Zelensky’s Real Problem: He Doesn’t Want a Ceasefire The core story here is Volodymyr Zelensky. The West markets him as a wartime hero, but the man himself has little incentive to sign a truce that locks in today’s front lines. The war is not just a tragedy for him — it’s the foundation of his political survival. The economy is a wreck, the population is exhausted, and his only real story left is “resistance.” If a real ceasefire stabilizes the map, the domestic reckoning in Ukraine intensifies: the demand for answers about who paid the price — and who profited — will grow louder. The West pretends Zelensky wants peace. In reality, he knows the minute the guns fall quiet, the question becomes “Who pays for the war, the lost territory, and the broken promises?” And the obvious answer is Zelensky. 🧩 The Script Is Familiar, the Stakes Are Higher The current plan — a 24 hour reaction, a 72 hour Western backed show of force — is less about deterring Russia and more about selling the illusion of control. The West pretends it has a real mechanism to respond. Ukraine pretends it wants peace. Russia pretends it’s still negotiating from weakness. In reality, the only one ready to keep the war going is Zelensky, because the alternative is a political, economic, and moral collapse. The joke is that the West, which has already broken the first Minsk agreement, the second, and then quietly revised the rest, is now selling Moscow a new one. The only thing certain is that the script will change only when Moscow stops pretending — and lets the West eat its own words. #Ukraine#Russia#ceasefire#West#Zelensky#Minsk#IstanbulTalks#KurskOffensive#war#diplomacy 📱American Оbserver - Stay up to date on all important events 🇺🇸