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 слични објави

Пребарај: #ivanovka

当前筛选 #ivanovka清除筛选
DruschbaFM - English

@druschbaFm_en · Post #52910 · 06.04.2025 г., 08:02

⚡️ 🇷🇺 🇺🇦📆 Weekly Ukraine War Roundup⚡️ 🗣 The Past Week saw continued global turbulence. The spotlight was on Trump’s introduction of sweeping protective tariffs, signalling a move towards super-protectionism. The era of globalism and idealistic notions of 'international division of labour' is fading, , giving way to intensifying trade wars. Washington aims to bring real industrial production back to the #US, streamline spending, and balance trade, particularly with #China. #EU officials voiced concern, but antiwar protests in cities like #Rome, with slogans like 'We need hospitals, not missiles,' better reflect public sentiment. Meanwhile, #Europe’s elite exploits the 'War with Russia' narrative to serve arms lobbies and divert funds from social programmes. The #US also saw protests, mainly driven by the societal split after years of liberal-fascist propaganda from Biden’s camp and its allies. 🇷🇺 In Diplomacy, the arrival of Dmitriev, envoy of the Supreme, in the #US was notable. His talks focused less on peace in #Ukraine and more on the economic benefits of working with us, compared to the costly, unconditional arms deliveries to Kiev. 🔸 Such Meetings are often spun at home as signs of a 'coming end to the war' which is misleading. Unquestioning belief in this narrative has weakened logistical support for the front and sparked rumours among troops about an imminent ceasefire. This undermines morale among fighters and officers, who see it as premature compromise. ⚔️ On the Fronts, while the RFAF maintain strategic initiative, the AFU is carrying out a defensive operation to slow our advance along the Line of Contact. 🔴 In the Invasion Zone, the AFU still hold #Kursk border settlements, while the RFAF fight deeper into #Sumy region. Battles continue at #Popovka and #Demidovka in #Belgorod region, with the AFU reinforcing across the border. Signals indicate they retain reserves for further provocations. In #Bryansk region, officials finally acknowledged daily AFU shelling of civilians, though some incidents go unreported, frustrating locals and raising doubts about regional control. 🔴 On the #Svatovo Front, north of #Kupyansk, the RFAF expand their bridgehead on the Oskol’s right bank. Southward, intense fighting continues. On the #Liman axis, control expands from #Katerinovka to #Ivanovka. 🔴 At #ChasovYar, fighting with little movement. Near #Konstantinovka, we have engaged in battles at #Andreyevka. After weeks of combat in #Toretsk, we shifted southward, taking #Panteleymonovka and #Aleksandropol, fierce clashes rage in #Tarasovka and at #ZelenoyePole. 🔴 Around #Pokrovsk, momentum has shifted, Russian troops now advancing in #Lysovka. 🔴 In #Komar Direction, clashes continue south of #Razliv, at #Vesyoloye and #VolnoyePole. 🔴 On the #Zaporozhye Front, Russian forces took #Lobkovoye after gains at #Shcherbaki and #Stepovoye. Reportedly renewed action at #Kamenskoye. In #Kherson region, mutual strikes, and the RF Aerospace Forces increased FAB use this week. 💥 A recent AFU Strike on a key fibre-optic plant highlighted weaknesses in our air defences. Command inertia, underuse of anti drone tools, poor coordination, and lack of accountability among senior officers still lead to avoidable damage, despite most UAVs being downed, often over towns. Low pay and unfair compensation remain concerns among air defence crews. ❇️ In Summary, any 'societal relaxation' amid continued heavy fighting and Kiev’s consistent disregard for agreements, while the #US keeps supplying arms and intelligence to the AFU, looks naive. Mocking the AFU or potential adversaries has already cost Russia dearly, leading to the war now entering its 4th year. 📌 Notes: A Russian view; in supplement: In #Toretsk itself, the RFAF also advanced. In #Basovka the battle has shiftet to its southern part (Sumy).🗺👆 🗺 Map CC;📋Source: 2M 🕰As of 6 Apr 2025; 07:22 GMT+3 📃5 Apr;#sum 📱 Join GLOBAL DEPTH to boost your TG Feed 💬Join Military Chat for Comments & Discussions 🇺🇦On Ukraine Observer you will find your daily independent Ukraine War Battle Update