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

Пребарај: #earningscalls

当前筛选 #earningscalls清除筛选
🦅 [ perspective ix ]

@perspectiveix · Post #1986 · 01.05.2020 г., 15:30

📰 Tech, Media, and Business News Headlines—Day 1 👉#Intel unveils 10th-gen desktop CPUs, including 5.3GHz flagship (link) 👉#Zoom admits it doesn't have 300M DAUs, quietly correcting the claim in its original blog post to 300M “daily Zoom meeting participants (link) 👉#Telegram postpones the launch of its TON blockchain for a second time, pushing the go-live date to April 2021, and offers to return $1.2B to investors (link) 👉 Andreessen Horowitz raises $515M for its second fund dedicated to #cryptocurrency and #blockchain investments and holdings (link) 👉#Apple Q2: $58.3B revenue, up 1% YoY; $44.9B from products, $13.35B from services; net income of $11.25B (link) 👉#Amazon Q1: $75.5B revenue, up 26% YoY; net income of $2.5B, down from $3.6B in Q1 2019; $10.2B from AWS revenue, up from $7.7B YoY (link) 👉#Twitter Q1: sales up 3% YoY to $808M; net loss of $8M due to COVID-19; mDAUs hit a record 166M, up 24% YoY (link) #️⃣#EarningsCalls 📰@iXDaily via @PerspectiveIX 💌Weekly Newsletter.

🦅 [ perspective ix ]

@perspectiveix · Post #1995 · 07.05.2020 г., 15:32

Tech, Media, and Business News Headlines—Day 6 👉#France is using #AI to check whether people are wearing masks on public transport (link) 👉#Facebook's Oversight Board, who will focus on challenging content issues, such as hate speech and harassment, announces its first 20 members out of a total of 40 (link) 👉 Comedy Central, MTV, Nickelodeon, and more Viacom channels coming to #YouTubeTV (link) 👉#Zoom acquires #Keybase to get end-to-end encryption expertise (link) 👉 Liberty’s Virgin Media and Telefonica’s O2 to merge in the UK in $39B deal (link) 👉#Square Q1: revenue of $1.38B, up 44% YoY; net loss of $106M, up $68M YoY (link) 👉#Square reports $528M in Q1 revenues from its Cash App, with $306M coming from #Bitcoin transactions, exceeding the app's fiat revenue of $222M for the first time (link) 👉#PayPal Q1: misses estimates with revenue of $4.62B, up 13% YoY; net income of $84M, down from $667M YoY (link) 👉#Shopify Q1: revenue of $470M, up 47% YoY; gross merchandise volume of $17.4B, up 46% YoY (link) #️⃣#EarningsCalls 📰@iXDaily by @PerspectiveIX 💌Weekly Newsletter.

🦅 [ perspective ix ]

@perspectiveix · Post #1994 · 06.05.2020 г., 20:53

Tech, Media, and Business News Headlines—Day 5 👉#Apple will host a virtual #WWDC this year — starts on 22 June (link) 👉#Twitter tests a warning message that tells users to rethink offensive replies (link) 👉#Twitter rolls out changes to threaded conversations following tests in its prototype app, #twttr (link) 👉#Airbnb cuts 1,900 jobs, around 25% of its global workforce (link) 👉#Bitcoin is set for ‘Halving’ this month (link) 👉 Leaked videos show #Lenovo’s first gaming #smartphone (link) 👉#Android 11’s public beta to launch with 3 June via live stream (link) 👉#Google’s #Stadia controller will finally work wirelessly with computers starting this week (link) 👉#Microsoft launches #SurfaceBook 3 (link) and #SurfaceHeadphones 2 (link) 👉#Microsoft offers $100,000 to hack its custom Linux OS (link) 👉#Uber lays off 14% of its workforce in COVID-19-related cost-cutting (link) 👉#Pinterest Q1: revenue of $272M, vs. $270M est., up 35% YoY; user base grew to 367M MAUs, up 26% YoY (link) 👉#EA Q4: revenues of $1.39B, beating expectations of $1.19B, up 12% YoY (link) #️⃣#EarningsCalls 📰@iXDaily by @PerspectiveIX 💌Weekly Newsletter.