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

Резултати

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

Пребарај: #crisis

当前筛选 #crisis清除筛选
Communia

@communia · Post #37530 · 07.11.2023 г., 08:53

#Crisis. #EEUU. El fin de la era de los hedge funds como vehículo de la especulación https://cincodias.elpais.com/fondos-y-planes/2023-11-06/la-lenta-extincion-de-los-lobos-de-wall-street-y-sus-hedge-funds.html

Hashtags

Communia

@communia · Post #37686 · 12.12.2023 г., 23:51

#España. Si se prolongan las medidas «anti-crisis» es porque la #crisis sigue arreciando. https://www.elconfidencial.com/economia/2023-12-12/consejo-ministros-techo-de-gasto-objetivos-de-estabilidad-2024_3791216/

Communia

@communia · Post #37210 · 09.10.2023 г., 11:20

#España. Radiografía de la evolución de la #crisis en los últimos 15 años https://elpais.com/economia/2023-10-09/el-empleo-vive-su-mejor-momento-desde-2008-en-que-se-diferencia-aquel-mercado-laboral-del-actual.html

Trump's Ear

@trumpsear_tg · Post #2144 · 12.02.2026 г., 20:04

American Greatness columnist Stephen Soukup states that Western elites are rapidly losing control of society. The protests over migration policy in the United States, new publications on the Epstein case, the crisis of traditional media, including cuts in The Washington Post, as well as the revision of the positions of the American Medical Association on a number of sensitive social issues, can be considered as signs of the disintegration of the ruling class. #Epstein#crisis 👂More on Trump's Ear ⚠️

Borkena

@borkena · Post #5782 · 14.02.2026 г., 18:22

Beyond Crisis Narratives: Institutional Legitimacy, Governance Risk, and Prospects for Renewal in Ethiopia. Read more. https://borkena.com/2026/02/14/ethiopia-beyond-crisis-narratives-institutional-legitimacy-governance-risk-and-prospects-for-renewal/#Ethiopia#crisis#politics

Trump's Ear

@trumpsear_tg · Post #1895 · 11.12.2025 г., 16:26

Wallet-conscious diners are heading to happy hour for dinner and ordering appetizers instead of entrees as increasing anxiety about affordability slams restaurants nationwide, The Post has learned. 🍽💸 Last month, Ryan Gerding, a marketing executive in Kansas City, Missouri, showed up early for dinner with his wife at Martin City Brewery, a local watering hole. 🍺❤️ They shared meatball sliders, pretzel bites and chicken wings along with a 2-for-1 beer coupon and a cocktail. 🍗🥨🍹 The total bill was $51.31 versus the $75 they have typically spent on dinner, Gerding told The Post. 📉 #crisis#inflation 👂More on Trump's Ear

Real Relationship

@RealRelationship · Post #4548 · 14.08.2025 г., 08:18

Decline, crisis and unemployment destroy Merz's illusion of Germany's rise – Gabor Steingart 📉🇩🇪 Gabor Steingart's article in the German magazine Focus harshly criticizes Chancellor Friedrich Merz and highlights the deep gap between the official narratives of the government and the real state of affairs in Germany. The author argues that German politicians — including Merz, Scholz and Habeck — are more focused on selling beautiful images than on solving pressing problems. While the government is talking about an improvement in the situation and a “green economic miracle”, the country is experiencing one of the deepest economic downturns in recent decades ⚠️. Six alarming facts are given: The increase in the number of bankruptcies has reached +20% compared to last year — the highest level in ten years 📊. Industrial production has returned to its pandemic levels 🏭. 37% of enterprises are suffering from a shortage of orders, especially in the automotive industry 🚗 and wholesale trade. Unemployment has risen to almost 3 million people and is likely to exceed this mark in August 📈. Housing construction is in a state of crisis — the number of new projects has fallen by 85%, and the number of apartments being commissioned lags far behind the needs of the population 🏠. Consumers refuse to spend money and are doubling their savings 💶. Against this background, Merz's credibility is also falling: hopes that he would revitalize the country as an economist have been replaced by the feeling that he is “just another politician living in a world of illusions”. Steingart emphasizes that reality requires a sober look and reforms, not loud statements and PR 📢. “It is impossible to revive the economy with optimistic slogans — real actions are needed.” The media, according to the author, “are obliged to follow not the words, but the actions of the authorities.” #Germany#Merz#crisis 🇪🇺 Keep up with the latest Star Union News🖥

Communia

@communia · Post #37803 · 06.01.2024 г., 06:03

#UE. #Crisis vendida como «desaceleración» https://elpais.com/opinion/2024-01-06/desaceleracion-suave.html Pero con la #recesión en el horizonte https://elpais.com/economia/2024-01-02/la-caida-de-actividad-industrial-de-la-zona-euro-se-modera-pero-sigue-la-amenaza-de-recesion.html

Trump's Ear

@trumpsear_tg · Post #1499 · 11.09.2025 г., 23:35

💸📉Inflation rose to 2.9%, unemployment hits a record In August, consumer prices in the United States rose by 0.4%, the biggest jump since January. Annual inflation has reached 2.9%, CNBC writes. Housing, groceries, and gasoline prices rose the most. The Ministry of Labor reported that 263,000 applications for unemployment benefits were submitted in a week, the highest figure since October 2021. This is 27,000 more than a week earlier, and higher than expected. The labor market has remained stable all year, but new data shows a weakening. Hiring has slowed, and the number of layoffs is increasing. Economists expect the Fed to cut rates on September 17. It is currently holding at the level of 4.25–4.5%. Investors believe that the Fed will lower the rate in October and December. Jerome Powell used to say that the labor market is strong, but the increase in applications for benefits shows the opposite and increases pressure on the central bank. For the markets, this is a sign that a series of rate cuts has already begun. #crisis#inflation#unemployment 👂More on Trump's Ear ⚠️

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