TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #381 · 23 окт.

Установить свойства виджета в PySide можно не только через соответствующие методы и конструктор класса. Можно их изменять с помощью метода setProperty по имени. btn = QPushButton("Click Me") btn.setProperty("flat", True) Это аналогично вызову btn.setFlat(True) Если указать несуществующее свойство, то оно просто создается btn.setProperty("btnType", "super") Получить его значение можно методом .property(name) btn_type = btn.property("btnType") Когда это может быть полезно? ▫️Можно просто хранить какие то данные в виджете и потом их доставать обратно widget = QWidget() widget.setProperty('my_data', 123) print(widget.property('my_data')) ▫️ Назначая эти свойства разным виджетам можно потом отличить виджеты во время итераци по ним. Например, найти все кнопки со свойством my_data="superbtn". Но ведь вместо кастомного свойства можно использовать objectName, будет тот же результат. Да, но y ObjectName есть ограничение - только строки. ▫️ Если нам потребуется не просто поиск а, например, сортировка по числу, то свойства позволяют нам это сделать. Поддерживается любой тип данных widget.setProperty('my_data', {'Key': 'value'}) widget.setProperty('order', 1) all_widgets.sort(key=w: w.property('order')) Но ведь Python позволяет всё вышеперечисленное сделать простым созданием атрибута у объекта widget.order = 1 widget.my_data = 123 Да, но я думаю что не надо объяснять почему не стоит так делать. К тому же, если у виджета нет свойства то метод .property(name) вернет None, а отсутствующий атрибут выбросит исключение. ▫️ Действительно полезное применение кастомным свойствам - контроль стилей. Здесь атрибутами не обойтись, нужны именно свойства. Дело в том, что в селекторах стилей можно указывать конкретные свойства виджетов на которые следует назначать стиль. Просто запустите этот код from PySide2.QtWidgets import * if __name__ == "__main__": app = QApplication([]) widget = QWidget(minimumWidth=300) layout = QVBoxLayout(widget) btn1 = QPushButton("Action 1") btn2 = QPushButton("Action 2") btn3 = QPushButton("Action 3", flat=True) layout.addWidget(btn1) layout.addWidget(btn2) layout.addWidget(btn3) # добавим кастомное свойство одной кнопке btn1.setProperty("btnType", "super") # добавляем стили widget.setStyleSheet( """ QPushButton[btnType="super"] { background-color: yellow; color: red; } QPushButton[flat="true"] { color: yellow; } """ ) widget.show() app.exec_() С помощью селектора мы избирательно назначили стили на конкретные кнопки. Как получить список всех кастомный свойств? Функция получения списка кастомных свойств отличается от получения дефолтных. def print_widget_dyn_properties(widget): for prop_name in widget.dynamicPropertyNames(): property_name = prop_name.data().decode() property_value = widget.property(property_name) print(f"{property_name}: {property_value}") #tricks#qt

Hashtags

Резултати

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

Пребарај: #uber

当前筛选 #uber清除筛选
СОЛОДИН LIVE

@goodtraders · Post #8986 · 01.04.2025 г., 12:44

#UBER Решил купить эту компанию (без шуток) - UBER долго показывал убытки, но сейчас это выглядит привлекательно: ✅ Компания вышла в устойчивую прибыль. ✅ Оценка оказалась очень низкой - всего P/Е16 и P/S4 ❓ Что скажете? 🤔👇

Hashtags

СОЛОДИН LIVE

@goodtraders · Post #8464 · 09.08.2024 г., 10:14

#UBER 🟢 Uber и китайский гигант электромобилей BYD Company объявили о сотрудничестве с целью создания глобального парка робо-такси. 👉 В рамках партнёрства, Uber планирует добавить более 100000 автомобилей BYD в течение следующих нескольких лет. Расширение будет сосредоточено в Европе, а затем переместится в Латинскую Америку, на Ближний Восток и в Северную Америку. ❓ Ну что, мы видим экспансию китайского автопрома через развитие индустрии робо-такси? 👇

Hashtags

🦅 [ perspective ix ]

@perspectiveix · Post #1755 · 16.03.2019 г., 12:30

✈️Top Travel Apps in Europe for 2018 by Downloads The most downloaded travel category app in Europe for 2018 was Booking with close to 25 million installs. Germany🇩🇪, Great Britain🇬🇧, and France🇫🇷 were the top countries with the most new installs of the app. The full top 10 ranking of travel apps in Europe by downloads for 2018 is above. App download estimates are from Sensor Tower’s Store Intelligence platform. #Uber was the second most installed travel app in Europe last year with more than 21 million downloads. Yandex Navigator, Yandex Taxi, and BlaBlaCar made up the remainder of the top five most installed travel apps in the region. 🚀@PerspectiveIX via SensorTower.

Hashtags

🦅 [ perspective ix ]

@perspectiveix · Post #1584 · 05.10.2018 г., 08:00

​​🚖Half Uber Drivers Don't Make More $10 an Hour After Vehicle Expenses According to a new study by Ridester, the median hourly pay with tip for #Uber drivers in the U.S. is $14.73. That figure includes tips but doesn’t account for expenses like insurance, gas and car depreciation incurred while working. Using Ridester’s low-end estimate of $5 per hour in vehicle costs, drivers would bring in $9.73 per hour and potentially much less. That implies a driver working 40 hours per week would make an annual salary of almost $31,000 before vehicle expenses, and about $20,000 after expenses (but still before taxes). That’s below the poverty threshold for a family of three. It’s also a far cry from the $70,000 to $90,000 Uber once claimed its drivers made in major markets. 🚀@PerspectiveIX via Recode.

Hashtags

🛍 Осенью 2022 года Uber и Nuroзапустят автономную доставку продуктов в Техасе и Калифорнии (США). Компании подписали соглашение сроком на десять лет. Беспилотники Nuro R2 начнут развозить заказы клиентам Uber Eats в городах Хьюстон и Маунтин-Вью. Робокары оснащены 360-градусными и тепловизионными камерами, лидаром и радаром. 🚗 По данным TechCrunch, пользователи не смогут выбрать или узнать способ доставки продуктов. Чтобы забрать заказ, им потребуется ввести код для открытия двери робокара. #Uber#Nuro

Hashtags

🦅 [ perspective ix ]

@perspectiveix · Post #1605 · 15.10.2018 г., 17:00

🚖Uber's First Round On this day (15 October) in 2010, #Uber raised $1.3 million in its first round of financing. Valuation: 2010 → $5 million 2018 → $72 billion #History 🚀@PerspectiveIX

Uber CEO:马斯克不愿合作开发自动驾驶出租车 Uber首席执行官达拉·科斯罗萨西(Dara Khosrowshahi)表示,埃隆·马斯克(Elon Musk)并不愿意让特斯拉(Tesla Inc.)计划推出的自动驾驶出租车(Robotaxi)在Uber的网约车平台上运营。 这意味着Uber未来可能会成为特斯拉的竞争对手。 🗒 标签: #Uber#特斯拉#马斯克

Hi, AI • Noticias sobre la IA

@hiaimediaes · Post #515 · 13.12.2024 г., 23:38

🚕 ¿En qué países operan los Robotaxis y qué tan seguros son? La semana pasada, Uber y WeRidelanzaron taxis autónomos en Abu Dabi. Los Emiratos Árabes Unidos se convirtieron en el primer país fuera de los Estados Unidos donde Uber introdujo taxis sin conductor. Su socio, WeRide, un desarrollador de plataformas de conducción autónoma con sede en Guangzhou, también opera en China y Singapur. Los pasajeros de Uber en Abu Dabi ahora pueden seleccionar la opción de "Transporte Autónomo" para aumentar sus posibilidades de viajar en un taxi sin conductor. El servicio está disponible en áreas clave del emirato y también presta servicio al aeropuerto. Por motivos de seguridad, cada vehículo contará con un operador durante la fase de prueba. Se espera que los taxis completamente autónomos comiencen a operar a finales de 2025. 🚗 ¿Quién más está desarrollando transporte autónomo? Waymo: Pionero en el campo, Waymo ofrece servicios de taxis completamente autónomos en Phoenix y San Francisco, EE. UU., y planea expandirse a Los Ángeles y Austin. Yandex: La empresa rusa ha estado probando robotaxis en Innópolis, Tartaristán, desde 2018. A mediados de 2023, su servicio de robotaxis comenzó a operar en Moscú. Cruise: Un proyecto del fabricante estadounidense General Motors que ha enfrentado presión regulatoria debido a preocupaciones sobre seguridad. Hace unos días, la empresa anunció que cerrará la división, que había costado $10 mil millones desde 2016. Los servicios de taxis autónomos también se han lanzado en China (Didi, Baidu), Corea del Sur (SWM, Sonnet.AI) y Japón. En Europa, un proyecto piloto está en marcha en el Reino Unido. 🚷 ¿Es la IA más segura que los conductores humanos? En 2022, la tasa promedio de accidentes para vehículos autónomos en California superó los 96 incidentes por cada 1,000 vehículos, en comparación con un promedio estatal de menos de 7. Sin embargo, los analistas señalan que la mayoría de los incidentes fueron menores y a menudo causados por conductores humanos impacientes o imprudentes. Además, los servicios de robotaxis tienden a ser más meticulosos al documentar incidentes. La principal ventaja de los vehículos autónomos es que se espera que eliminen el error humano. Según la Administración Nacional de Seguridad del Tráfico en las Carreteras de EE. UU., los errores del conductor son responsables de aproximadamente el 94% de todos los accidentes de tráfico. Más sobre este tema: 🔜¿Cómo luce un taxi volador hoy en día? 🔜Elon Musk presenta el Cybercab, un taxi sin conductor #noticias#Uber#WeRide@hiaimediaes

🦅 [ perspective ix ]

@perspectiveix · Post #1750 · 11.03.2019 г., 11:00

🛴Americans drift from Uber and Lyft, test alternative forms of transportation Americans are exploring alternative methods of transportation. Looking at average daily active users (DAUs) per month over the past 13 months, we’re estimating decreases in active usage for #Uber and #Lyft, while seeing increases in active usage for things like public transportation, bikes and scooters. The above data is for the United States and is a combination of iOS + Google Play apps. Lyft has said its market share in the United States was at about 35% in early 2018, and is now closing in at around 40%. Lyft is losing less average DAUs than Uber, which has in fact grown its percentage of market share in the United States. Read more on Apptopia. 🚀@PerspectiveIX

Hashtags

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