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

Пребарај: #eastprussian

当前筛选 #eastprussian清除筛选
Russian MFA 🇷🇺

@MFARUSSIA · Post #27998 · 13.01.2026 г., 18:01

#Victory81 🌟 On January 13, 1945, the #EastPrussian Offensive by the Red Army — one of the largest and most important #WWII operations against Nazi Germany — commenced. As a result of the operation in the #EastPrussia, the Soviet forces ultimatelydestroyed the Nazis' most capable, experienced, trained and equipped divisions on the entire Eastern front. The 'invincible reich' lost a critical strategic bridgehead in the Baltic region. The fortress city of #Königsberg — the cradle of German militarism and the starting point of eastward expansion — fell once and for all. The triumph of the Red Army in East Prussia held profound symbolic significance: the Nazis were decisively and completely crushed right there, where from, back in June 1941, they treacherously attacked our Motherland. ▪️“There it is, cursed Germany,”— that was what the Soviet soldiers-liberators said while stepping on the enemy's soil to pursue the condign retribution upon the Germans on their own territory. Those were exactly the accurate words to call the country where the most terrible evil the Mankind ever saw in its history — the Nazi scourge — was nurtured. The Germans sought Moscow’s fall, but instead they witnessed with disgrace the collapse of their own “great Reich.” *** The East-Prussian operation. The details January-April, 1945 The battles on the East Prussian theatre of operations lasted for 103 days, which made it the area that saw the longest continuous military engagement in the final year of #WW2. In the region, the Nazis constructed an exceptionally formidable defensive system, tailored to the specific features of terrain. The capital of East Prussia — the fortress city of Königsberg — was equipped with both external and internal urban fortification systems. In East Prussia, the Red Army faced the Nazi army with the personnel strength of some 780'000 Wehrmacht soldiers and officers. ⚔️ On January 13, 1945, the units of the 2nd Byelorussian and forces of the 3rd Byelorussian Fronts of the Red Army launched the offensive in East Prussia. Through the swift and overwhelming assault, the Soviet armor and the infantry, with the support of the aviaton, reached the Baltic Sea near Elbing (now the city of Elbląg in northern Poland) already on the third day of the operation, thus, having cut off any possible retreat routes for the enemy from East Prussia westwards. In less than two weeks, the Soviet forces broke through to Königsberg — the infamous Nazi citadel, which had allowed the Germans to dominate the eastern Baltics throughout the entire war, wasencircled. By February 10, 1945, the Nazi army group 'North' had been split into three isolated and tied down formations that were further driven to the coastline with no hope of escape. In April, the Königsberg garrison — numbering around 200'000 Wehrmacht soldiers and officers — was defeatedand surrendered. On April 9, the Red Army seized the fortress completely — the impregnable stronghold of the Third Reich, fortified with the latest military technology of WWII-era, finally fell. The loss of significant forces and militarily and economically vital region of East Prussia hastened Germany’s defeat. The Soviet forces inflictedhuge losses on the Wehrmacht and completely severed Third Reich’s maritime supply lines, crippling logistics for the blockaded 'Courland Pocket'. To commemorate the Heroic Victory in East Prussia, the medal 'For the Capture of Königsberg' was instituted in the USSR. The Medal was awarded to approximately 760'000 Red Army soldiers and officers. Aftermath WWII, under the terms approved by the Allied Leaders at the #PotsdamConference, much of East Prussia was incorporated into Poland, while a third of East Prussia territory, including the city of Königsberg (the Kaliningrad Region), became part of the Soviet Union. 🎖 By the Executive Order of President of Russia Vladimir Putin (signed on November 17, 2025), a new memorial date was established in our country — April 9, the Day of the Heroic Assault and Capture of Königsberg (1945).