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

Пребарај: #trumpsisi

当前筛选 #trumpsisi清除筛选
Red Nile

@rednile12 · Post #10846 · 22.01.2026 г., 17:40

🇪🇹 Nile Negotiations: Ethiopia’s Sovereignty Is Not on the Table Thank you, #SolomonMarkos🙏 🔗[email protected] https://m.facebook.com/story.php?story_fbid=pfbid0pFtuSJfcDvSUqkmGvpY7GDHkoarhXcsZE28sdRHRdnWdzkEuGffbN293GWF15mDel&id=1120295988&sfnsn=mo&mibextid=RUbZ1f Your intervention in the #RedNile comments is principled, direct, and unapologetically Ethiopian. It articulates what many externally driven “mediation” efforts try to obscure: Ethiopia’s sovereignty and national interests are not negotiable. At the heart of your position is a clear red line: “#Ethiopia Never Ever Compromise Its #Sovereignty and #National#Interests.” This must be the starting point of any discussion on the Nile—not the outcome. 🧠 Why This Position Is Strategically Strong 🔹Sovereignty first, not last Ethiopia is a rights-holder, not a “risk factor.” Any process that treats Ethiopia as a problem to be managed is illegitimate from the outset. 🔹Colonial treaties are null Insisting on the CFA framework restores African legal continuity and rejects agreements imposed when Ethiopia was excluded. 🔹No monopoly mediation Including the AU, Russia, China, and regional actors prevents Nile negotiations from being captured by a single power acting in Egypt’s favor. 🔹Development is non-negotiable Abay waters are tied to electricity, agriculture, and industrialization. Ethiopia retains the sovereign right to build future dams beyond GERD. 🔹The real issue is mismanagement, not scarcity Egypt’s irrigation of water-intensive crops reframes the crisis as one of policy waste, not upstream injustice. 🔹Responsible, not submissive Humanitarian flexibility during droughts projects cooperation without surrendering control—a smart counter to propaganda. 🔹GERD is Ethiopian-owned Fully domestically funded, GERD is insulated from donor leverage and external coercion. ⚠️ Tactical Challenges (Not Principle Flaws) ▪️ A 50%+ water share must be framed carefully using hydrology, population, and contribution data to avoid diplomatic deadlock. ▪️ Multiple mediators require clear role definitions to avoid paralysis. ▪️ A Nile-wide enforcement body will face resistance—but that resistance exposes the real imbalance in the system. These are communication and strategy issues, not weaknesses in Ethiopia’s position. 🔴 RedNile Media Position: The Only Legitimate Basis for Negotiation Any Nile process that claims legitimacy must be grounded in the following: 1️⃣Balanced mediation – No US monopoly 2️⃣All riparians included – The Nile belongs to all its peoples 3️⃣CFA only – Colonial treaties are invalid 4️⃣Ethiopia’s fair share – Not less than 50%+, with full rights to future development If a binding framework is ever discussed, it must also include: ▪️ A Nile Water Management Commission overseeing all dams and diversions—including Egypt’s Toshka Canal ▪️ Formal acknowledgment of Egypt’s excessive water use and export-oriented irrigation practices ♦️Bottom line: Ethiopia is not negotiating permission to exist, develop, or light its cities. The Nile question is about justice, sovereignty, and post-colonial reality—not appeasement. 🇪🇹💧 — RedNile Media🌊🧭 📡@rednile12 Geopolitics | Multipolarity | Sovereignty | Strategic Reality #GERD#NileDispute#GazaPeace#TrumpSisi