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

Резултати

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

Пребарај: #eucommission

当前筛选 #eucommission清除筛选
AI & Law

@ai_and_law · Post #17 · 06.06.2023 г., 07:04

Transparency in AI-generated content: EU Commissioner calls for labeling EU Commissioner Vera Jourova has highlighted the importance of clearly identifying content that is generated or significantly influenced by AI systems. The proposal to label AI-generated content serves multiple purposes: protecting consumer rights, promoting accountability, and enabling individuals to distinguish between human-created and AI-generated information. The European Commission wants tech companies like Google, Facebook and TikTok to start labeling content created by artificial intelligence without waiting for digital laws to come into effect. As AI becomes more prevalent in content creation, legal concerns arise regarding authenticity, accountability, and the potential for misinformation. By introducing labeling requirements, the EU aims to provide legal clarity, allowing consumers and authorities to better navigate the digital landscape while holding AI systems accountable for the information they generate. While the EU takes a proactive stance in regulating AI-generated content, the implications extend beyond its borders. As AI transcends geographical boundaries, the need for transparent labeling practices becomes crucial on a global scale. International collaboration in developing standardized guidelines can enhance consistency and protect users' rights across jurisdictions. #artificialintelligence#AI#Law#EUCommission

AI & Law

@ai_and_law · Post #348 · 09.07.2024 г., 07:04

European Commission's AI Codes of Practice: A Self-Regulation Concern? According to Euractiv, the European Commission plans to let AI model providers draft codes of practice for compliance with the AI Act, with civil society organizations consulted during the process. This approach has sparked concerns about industry self-regulation, as these codes will serve as compliance measures for general-purpose AI models until harmonized standards are set. The Commission may grant EU-wide validity to these codes through an implementing act. Some civil society members worry this could enable Big Tech to essentially write their own rules. The AI Act's language on stakeholder participation in drafting these codes is ambiguous. The Commission has stated that an upcoming call for expressions of interest will clarify how various stakeholders, including civil society, will be involved. However, specifics are still lacking. An external firm will be hired to manage the drafting process, including stakeholder engagement and weekly working group meetings. The AI Office will oversee the process but will primarily focus on approving the final codes. #AIRegulation#EUCommission#AICodes#AIAct#Compliance

AI & Law

@ai_and_law · Post #55 · 13.07.2023 г., 11:20

Spain takes the lead inshaping EU's AI regulations Spain has assumed the rotating presidency of the EU Council of Ministers and is gearing up to make a significant impact on the future of artificial intelligence regulations in the European Union. As part of their digital priorities, Spain aims to reach a political agreement on the AI Act. In preparation for upcoming negotiations with the EU Council, Parliament, and Commission, Spain has shared its position on key aspects of the Act: 1️⃣ Defining AI: Spain is considering different options, including sticking with the Council's text, aligning with the Parliament's position, or awaiting the OECD's (Organisation for Economic Co-operation and Development) guidance. 2️⃣ Classification of High-Risk Applications: Spain is exploring various possibilities, such as adopting the Parliament's version without the notification of competent authorities, or refining it with binding self-assessment criteria for AI providers. 3️⃣ Addressing Critical Concepts: Spain is examining whether the AI Act is the appropriate framework to address concepts like democracy, the rule of law, and sustainability. 4️⃣ Clarity in Terminology: Spain is assessing the potential introduction of the term 'deployer' to minimize confusion and ensure clear roles and responsibilities within the AI ecosystem. These discussions will inform the trilogue negotiations scheduled for 18 July, where representatives from the Council, Parliament, and Commission will work towards a consensus on the AI Act. #SpainPresidency#AIAgenda#EURegulations#AIAct#AIRegulations#EUCouncil#EUCommission#EUParliament#Trilogue