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

Резултати

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

Пребарај: #peaceagreement

当前筛选 #peaceagreement清除筛选

በደቡብ ጎንደር ዞን ታች ጋይንት በጫካ ሲንቀሳቀስ የቆየው ታጣቂ ቡድን የሰላም ጥሪውን ተቀበለ *************** በአማራ ክልል መንግሥት እና በአማራ ፋኖ ሕዝባዊ ድርጅት (አፋሕድ) መካከል የተደረሰውን አዲስ የሰላም ስምምነት ተከትሎ ራሱን "የገብርየ ክፍለ ጦር" በማለት ሲጠራ የቆየው ታጣቂ ቡድን የሰላም ጥሪውን ተቀብሏል። በአማራ ክልል በደቡብ ጎንደር ዞን ታች ጋይንት ወረዳ፣ በጫካ ሲንቀሳቀስ የቆየው ታጣቂ ቡድኑ፤ የመንግሥትን የሰላም ጥሪ በመቀበል ወደ ሰላማዊ እንቅስቃሴ ተመልሷል። ይህ ውሳኔ በክልሉ ለረጅም ጊዜ የቆየውን የትጥቅ ግጭት በውይይትና በሰላም ለመፍታት የተያዘውን አዲስ አቅጣጫ በተግባር መሬት ያወረደ ትልቅ እርምጃ ሆኖ ተመዝግቧል። ለቡድኑ አባላት በተዘጋጀው የአቀባበል መርሐ ግብር ላይ የደቡብ ጎንደር ዞን የብልፅግና ፓርቲ ቅርንጫፍ ጽሕፈት ቤት ኃላፊ አቶ መንበር ክፈተው፣ የሀገር መከላከያ ሠራዊት ከፍተኛ አመራሮች፣ የዞንና የወረዳ አመራሮች እንዲሁም የአካባቢው ማህበረሰብ መገኘታቸውን የአማራ ኮሙኒኬሽን መረጃ ያመላክታል። #Ethiopia#PeaceAgreement#AmharaRegion#SouthGondor#Peace

Crypto M - Crypto News

@CryptoM · Post #64748 · 09.04.2026 г., 17:55

🚀 U.S. President Donald Trump Anticipates Imminent Peace Agreement with Iran U.S. President Donald Trump has conveyed a positive outlook regarding the potential for a peace agreement with Iran. According to NS3.AI, Trump believes that negotiations are progressing favorably, suggesting that a resolution may be reached soon. This development comes amid ongoing diplomatic efforts to address tensions between the two nations. The President's remarks highlight a significant shift in the geopolitical landscape, with implications for international relations and regional stability. #DonaldTrump#Iran#PeaceAgreement#Diplomacy#InternationalRelations#Geopolitics#MiddleEast#Negotiations#RegionalStability

Crypto M - Crypto News

@CryptoM · Post #65299 · 12.04.2026 г., 15:34

🚀 Iran Expresses Readiness for Regional Peace Agreement Iranian President Ebrahim Raisi has expressed the country's readiness to establish a balanced and fair agreement to ensure lasting peace and security in the region. According to BlockBeats, this statement was made during a phone conversation with Russian President Vladimir Putin on April 12, as reported by Iran's Tasnim News Agency. #Iran#EbrahimRaisi#VladimirPutin#RegionalPeace#Security#PeaceAgreement#IranRussia#BlockBeats#TasnimNews

Crypto M - Crypto News

@CryptoM · Post #64518 · 09.04.2026 г., 05:44

🚀 Middle East Ceasefire Expected to Hold Despite Fragility Jefferies global economist Mohit Kumar has stated that despite the fragility of the Middle East ceasefire agreement, it is expected to hold. According to Odaily, Kumar noted that both parties have reached a point where they desire a ceasefire, as continued conflict would negatively impact both sides. Kumar highlighted that U.S. President Donald Trump is keen on reaching an agreement, as he lacks support from his core base for ongoing warfare. Meanwhile, the Iranian Revolutionary Guard faces challenges due to economic devastation, potentially paving the way for future uprisings. He concluded that given the interests of both parties, the unstable ceasefire is likely to persist. #MiddleEast#Ceasefire#MohitKumar#US#Iran#DonaldTrump#Conflict#RevolutionaryGuard#GlobalEconomics#PeaceAgreement#Odaily

Crypto M - Crypto News

@CryptoM · Post #64768 · 09.04.2026 г., 21:01

🚀 STOCKS | S&P 500 Rises for Seventh Day Amid U.S.-Iran Peace Deal Optimism The S&P 500 extended its gains for the seventh consecutive session, buoyed by growing optimism about a potential long-term peace agreement between the U.S. and Iran. Wall Street Journal (Markets) posted on X, highlighting the positive sentiment among investors as diplomatic efforts continue to progress. The sustained rally in the S&P 500 reflects investor confidence in the potential easing of geopolitical tensions, which could have significant implications for global markets. Analysts suggest that a successful peace deal could lead to increased stability in the region, potentially benefiting various sectors, including energy and defense. As negotiations advance, market participants remain attentive to developments that could influence future market movements. #SP500#USIranPeaceDeal#WallStreet#GeopoliticalTensions#MarketOptimism#EnergySector#DefenseSector#InvestorsConfidence#GlobalMarkets#PeaceAgreement#DiplomaticEfforts

Addis Standard

@addisstandardeng · Post #21764 · 18.03.2026 г., 16:31

Premiering now: The Standard Signal | Ep.14: Tigray on the Brink: Survival, Famine Risks, and the Shadow of Renewed War in Ethiopia. Click here to watch: https://www.youtube.com/watch?v=YDjUomfsWnA Tigray is facing fragile recovery, deepening humanitarian strain, and growing fears of renewed war. In this episode of The Standard Signal, Duke Burbridge shares what he witnessed on the ground — from survival and displacement to aid challenges and famine risks. #StandardSignal#EthiopiaPolitics#ONLF#Ogaden#PeaceAgreement#PoliticalRepression#ShrinkingCivicSpace#ResourcePolitics#OilAndGas#Federalism#DemocracyInEthiopia#HornOfAfrica#Accountability#PoliticalDialogue#Tigray