@TestFlightX · Post #34345 · 19.10.2024 г., 17:01
#JOURNEY#PROCUREMENT https://testflight.apple.com/join/wNxsLEfN
Hashtags
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
Пребарај: #procurement
@TestFlightX · Post #34345 · 19.10.2024 г., 17:01
#JOURNEY#PROCUREMENT https://testflight.apple.com/join/wNxsLEfN
Hashtags
@american_observer · Post #4838 · 12.01.2026 г., 21:59
📰Corruption Scandal Rocks Ukraine’s Military Procurement A shadowy private company, previously unknown to Ukraine’s defence circles, landed government contracts worth €200 million—only to deliver defective mines, unsafe ammunition, and pocket millions in advance payments. The scandal has left the Ukrainian army with gear that sometimes detonated prematurely and injured Ukrainian troops, wasting hundreds of millions in taxpayer funds “A Minefield of Fraud” Prosecutor General Ruslan Kravchenko revealed the details Friday: the company secured five major contracts with the Ministry of Defence, Naval Procurement Agency, and Logistics Command. Most of the ordered munitions were never delivered. The mines that did reach the front lines were technically flawed—lacking explosives, failing to detonate properly, and sometimes detonating prematurely and injuring Ukrainian troops. Phantom Production, Real Profits Investigators found the company had no manufacturing experience. Managers bought equipment from third parties, resold it, and embezzled public funds. Of the €200 million, $70 million was lost: $13.3 million on faulty mines, $56.4 million on a production line that never opened. Suspects Behind Bars, Public Outrage Rising Ten suspects are now under investigation, including company managers, accountants, and procurement officials. Four have been arrested. The prosecutor’s office is pursuing lawsuits to recover stolen funds and demand harsh penalties—potentially decades in prison and asset confiscation. Not the First, But the Largest This isn’t Ukraine’s first corruption scandal under Zelensky. Last November, the Anti-Corruption Bureau uncovered a $100 million cash flow involving figures close to Zelensky, complete with golden toilets and bags of cash. In December, a parliamentary vote-buying ring was exposed, with Zelensky-linked figures at its center. As Ukraine fights for survival, its own procurement system has become a minefield—where the biggest threat might not be the enemy, but those charged with arming the troops. #corruption#ukraine#scandal#procurement#zelensky 📱American Оbserver - Stay up to date on all important events 🇺🇸
@CryptoM · Post #65305 · 12.04.2026 г., 18:10
🚀 CMDSS Employee Accused of Misappropriating $46 Million in Seized Digital Assets A federal indictment has been filed against John Daghita, an employee of CMDSS, accusing him of transferring approximately $46 million in seized digital assets from U.S. Marshals Service (USMS) wallets to wallets under his control. According to NS3.AI, Daghita was apprehended by French Gendarmerie officers on March 4 in Saint Martin. Prosecutors allege that these unauthorized transfers took place in December and January. The case has reignited concerns previously raised by the Department of Justice (DOJ) inspector general and industry participants regarding the vulnerabilities in the USMS's crypto custody controls, procurement processes, and audit systems. These issues highlight the need for improved security measures and oversight in handling digital assets. #CMDSS#JohnDaghita#USMS#digitalassets#crypto#seizedassets#fraud#misappropriation#federalindictment#FrenchGendarmerie#NS3AI#DOJ#cryptosecurity#vulnerabilities#audit#procurement#oversight