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

Пребарај: #zapadnoye

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

@druschbaFm_en · Post #52561 · 26.03.2025 г., 07:58

⚡️ 🇷🇺 🇺🇦⚔️ Ukraine Fronts on the Morning of 26 March⚡️ 🔴#Sumy Direction: 🔴In #Sudzha Sector, to the west on Ukrainian lands, for a RFAF presence at #Vladimirovka evidence is still missing (1st blue arrow on map). 🟡 For #Veselovka, the battle continues (1st black arrow). 🟡 In #Zhuravka as well. 🟡#Basovka is at best 50% RFAF controlled. 🟡#Novenkoye, is Russian controlled (1st red arrow). 🟡 In #Kursk region, according to unconfirmed reports, the 'Sudza Gas Transmission Point' is under RFAF control and the battle for the nearby border checkpoint continues (4th black arrow). 🟡#Gogolevka remains under full AFU control (2nd blue arrow). Contrary reports are unproven. 🟡#Melovoy came under the control of Russian troops, which advanced further westwards towards #Oleshnya (2nd red arrow). 🟡#Oleshnya, #Guyevo and #Gornal remain under AFU control for now. 🔴In #KrasnayaYaruga Sector, the AFU 8th Special Forces Regiment and 'Aidar' Nationalists failed to take #Popovka (5th black arrow). Over the past day, the AFU razed the village to the ground with artillery and drones. 🟡 In #Demidovka, nearby to the southeast, Small AFU groups enter periodically, uncapable to take the village (6th black arrow). 🟡 At #Grafovka, lull. 🟡 West of #Prilesye, the AFU have been driven out from Russian territory. 🗺 All on Map 1 🔴 In #Kharkov Direction, positional battles continue In the areas of #Lipsy and #​​Volchansk. A large number of drones, artillery and aircraft are used. 🔴#Svatovo Front: 🔴 In #Kupyansk Sector, north of the city, Russian forces created a new bridgehead between #Kamenka and #Krasnoye1st. In the area of #​​Dvurechnaya, the battles continue, as well as on the #Zapadnoye - #Kalinovo line. 🔴 In #Borovaya, #Liman and #Seversk Sectors, without major changes. 🔴#ChasovYar Direction: 🔴In #ChasovYar Sector, heavy urban battles continue in 'Shevchenko Microdistrict' in the southern part of the city. To the south, fighting in the area of #Stupochki. 🔴In #Toretsk Sector, the RFAF continue attempts to take the city, increasing the pressure in its north. 🔴#Pokrovsk Direction: 🔴 On the right Flank, far to the east, Russian troops attack southwest of #Aleksandropol and try to straighten the front. 🔴 South of the City and on the left Flank, no changes. 🔴#Komar Direction: 🔴In #Konstantinopol Sector, the battle for the same named village continues. 🟡 Southeast of #Razliv, the RFAF advanced on a broad front, extending the zone of control in an area up to 4 km wide and up to 2.05 km deep, approaching the settlement located southwest of #Konstantinopol. 🔴 In #Komar Sector, Russian forces repulsed AFU counterattacks in the areas of the #Vesyoloye and #VolnoyePole settlements. 🔴#Zaporozhye Direction: 🔴In #Orekhov Section, the situation based on confirmed and evidenced data has improved for the RFAF: 🟡 In #Shcherbaki, the AFU lost full control. 🟡 In nearby #MalyeShcherbakito the west, the RFAF have advanced. The AFU still hold positions in its far northeast. 🟡 In #Stepovoye's, further west, there are heavy fights in the village. 🎬 Video 1 🗺 Map 2 🟡 In #Lobkovoye, the the RFAF advanced northwards. About 50% of the village came under Russian control. 🗺 Map 2 🟡 #​​Pyatikhatki, came under full RFAF control yesterday. 🗺 Map 2 🔴 In #Kherson Direction, no changes. 💥#OldRussia: 🔵 In #Belgorod Region, civil objects in #Politodelsky, #Kazinka, #Shebekino, #Tishanka and #Bessonovka came under AFU attack. 💥#RestUkraine: 🔵 The RFAF targeted AFU facilities and militants in #Zaporozhye, #Nikolayev and #Dnepropetrovsk, as well as in #Sumy, #Poltava and #Cherkassy regions. 🟡 In #KrivoyRog, more than 15 explosions occurred overnight. 🎬 Video 2 🎞 Vids Source 1; Source 2; 🗺 Maps @olegtsarov; @creamy_caprice 📋 Sources: CC; Tsarov; ⚡️2M; 🇺🇦Fiend;😼Kotenok 🕰As of 26 Mar 2025; 06:41 GMT+3;📃25 Mar 📱 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