@RTenfrancais · Post #80051 · 25.04.2026 г., 14:00
❌Les médias israéliens diffusent des images qui montreraient une nouvelle frappe de #Tsahal contre la centrale nucléaire iranienne de Bouchehr. RT en français • Osez questionner !
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
Пребарај: #tsahal
@RTenfrancais · Post #80051 · 25.04.2026 г., 14:00
❌Les médias israéliens diffusent des images qui montreraient une nouvelle frappe de #Tsahal contre la centrale nucléaire iranienne de Bouchehr. RT en français • Osez questionner !
Hashtags
@kurash_and_Co · Post #959 · 26.03.2026 г., 20:22
🟠Échanges réciproques de frappes : l'escalade se poursuit entre #Tsahal et le Hezbollah Alors qu'Israël et le Hezbollah ne semblent avoir aucune intention ni de faire baisser les tensions ni de mettre fin aux combats, malgré les appels de la communauté internationale, les habitants de la capitale libanaise sont descendus dans la rue. Ils protestent contre l’expulsion de l'ambassadeur d’Iran. Les précisions avec notre envoyé spécial sur place, Igor Kourachenko. RT en français • Osez questionner !
Hashtags
@corrAntoine · Post #621 · 16.03.2026 г., 07:23
⚡️L’offensive israélienne s’élargit au #Liban Les troupes de #Tsahal multiplient les incursions dans le sud du pays. Face à l'urgence, le gouvernement libanais tente d'amorcer une médiation internationale, mais les obstacles restent nombreux. Notre envoyé spécial Antoine Cléraux nous en dit plus sur la situation sur place. RT en français • Osez questionner !
@rt_fra · Post #40762 · 07.05.2026 г., 09:20
⚡️Tsahal-Hezbollah : frappes au Liban Selon un communiqué de presse de l’armée israélienne, #Tsahal a frappé 15 sites du #Hezbollah dans plusieurs zones du Sud-Liban. RT en français • Osez questionner !
Hashtags
@voir_yeux · Post #12555 · 16.04.2026 г., 09:27
🇮🇱🇱🇧 Tsahal a annoncé avoir intercepté un drone lancé depuis le Liban. #drone#liban#tsahal
@corrAntoine · Post #603 · 10.03.2026 г., 21:28
🔴#Tsahal multiplie les ordres d'évacuation sur fond de guerre avec le #Hezbollah libanais Alors que le Sud du #Liban est la cible de frappes israéliennes, les ordres d'évacuation se multiplient dans la région. Pourtant, de nombreux habitants refusent de partir. RT en français • Osez questionner !
Hashtags
@american_observer · Post #5260 · 02.03.2026 г., 00:59
The IDF confirmed the murder of several high-ranking Iranian officials as part of the military operation : - Ali Shamhani: adviser to the supreme head of security, secretary of the defense council, former commander of the CSIR, minister of defense and head of the navy. Responsible for the Iranian nuclear project and weapons development. - Mohammad Pakpur: the commander of the CSIR, former commander of the ground forces, led the brutal repression of the protests and commanded strategic firing positions against Israel. - Saleh Asadi: the chief of intelligence of the general staff Khatam Al-Anbiya, senior intelligence officer of the Iranian military high command, participated in the development of the strategy against the United States and Israel and in the planning of recent attacks. - Mohammad Shirazi: head of the supreme leader's military office since 1989, in charge of communication between senior commanders and Khamenei. - Aziz Naserizadeh: the Minister of defense, former commander of the air force, was responsible for the defense industry, including long-range missiles and weapons for the proxy forces. - Hossein Jabel Aamelian: head of the SPND (organization for innovation and research in defense), responsible for nuclear, biological and chemical weapons programs. - Reza Mosaffari: former head of the SPND, promoted Iran's efforts to create nuclear weapons. #tsahal#murder#iranian#officials#operation 📱American Оbserver - Stay up to date on all important events 🇺🇸