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

Резултати

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

Пребарај: #tplf

当前筛选 #tplf清除筛选
Addis Standard

@addisstandardeng · Post #21267 · 31.01.2026 г., 18:15

#TPLF welcomes #AU call for restraint, reaffirms commitment to dialogue The Tigray People’s Liberation Front (TPLF) has welcomed a call by the Chairperson of the African Union Commission, Mahmoud Ali Youssouf, urging restraint amid renewed tensions in Ethiopia’s Tigray region, reaffirming that dialogue remains the only viable path to resolving outstanding issues with the federal government. In a letter sent late on Saturday and addressed to the AU Commission Chairperson, the TPLF said it appreciates the African Union’s engagement in support of peace and stability in Ethiopia, noting that it takes “positive note” of the AU’s concern over recent developments in Tigray. The party further expressed its readiness to engage constructively in any dialogue initiative facilitated by the African Union, including through the AU High-Level Panel on Ethiopia, aimed at advancing “peace, confidence-building, and reconciliation.” https://addisstandard.com/tplf-welcomes-au-call-for-restraint-reaffirms-commitment-to-dialogue/

Hashtags

Addis Standard

@addisstandardeng · Post #21623 · 05.03.2026 г., 15:34

News: #Tigray rebels say #Ethiopian troops preparing for war Ethiopian federal authorities are preparing "to wage a war against Tigray," a senior official from this northern regional state told AFP on Wednesday, raising fears of a new conflict. Tigray emerged in 2022 from a two-year war that saw federal forces, backed by militias and the Eritrean army, clash with rebels from the Tigray People's Liberation Front (#TPLF). The TPLF dominated Ethiopian politics for some 30 years before current Prime Minister Abiy Ahmed, a non-Tigrayan, took power in 2018. At least 600,000 people were killed in the conflict, according to estimates from the African Union. A ceasefire held for more than two years, but clashes between federal and Tigrayan forces broke out again in November 2025 and January 2026. Large numbers of federal troops have for several weeks been massed at the Tigray border, where.... https://web.facebook.com/AddisstandardEng/posts/pfbid023a9Gk4wS4Zc9q1exiF73ypsGSrQ1ubLT6Pg7Hv5gRNoJDmMEsv8KpNyvcM73Nq8il

Borkena

@borkena · Post #5214 · 08.11.2025 г., 03:01

TPLF Alleges Federal Gov’t “Carried Out Drone Strike on Tigray Forces” Read more. https://borkena.com/2025/11/07/tplf-alleges-federal-govt-carried-out-drone-strike-on-tigray-forces/#Ethiopia#TPLF#Afar

Addis Standard

@addisstandardeng · Post #21794 · 21.03.2026 г., 10:17

#Op_ed: Ghosts of Governance: Opposition paralysis, failure of political imagination in post-war #Tigray The most dangerous moment for a post-war society is when paralysis becomes normal, “a condition that has gripped Tigray for too long,” writes Getachew Gebrekiros Temare. He argues, “War destroyed infrastructure, displaced millions, and shattered institutions,” yet the deeper crisis remains political. Factionalism within the #TPLF and fragmentation among opposition parties have left society without coherent leadership. Opposition rhetoric often functions as controlled dissent rather than driving meaningful change. He notes, “The cumulative consequences of fragmentation, pseudo-analysis, and political hesitation are now impossible to ignore.” Getachew emphasizes that the solution requires “the emergence of a political movement grounded in public interest rather than personal ambition.” https://addisstandard.com/?p=55998

ПретходнаСтраница 1 од 5Следна