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

Резултати

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

Пребарај: #comedy

当前筛选 #comedy清除筛选
Latest Movies 🎬

@movie · Post #1812 · 26.03.2026 г., 06:30

🎬 Bitter Christmas 🎞Movie Info Bitter Christmas (Spanish: Amarga Navidad) is a 2026 Spanish tragicomedy film written and directed by Pedro Almodóvar. It stars Bárbara Lennie and Leonardo Sbaraglia alongside Aitana Sánchez-Gijón, Victoria Luengo, Patrick Criado, Milena Smit, and Quim Gutiérrez. It incorporates elements of autofiction. 📝️Synopsis: After her mother dies, director of commercials Elsa immerses herself in work to cope. When migraine forces her to take a break, she decides to travel to Lanzarote in the 2004 Constitution Day's long weekend with her friend Patricia while her boyfriend (stripper and fireman Bonifacio) stays in Madrid. To resume creative writing, she vampirises the personal miseries of her📝️ 😀Genre: #Comedy😆 🗣Language: Spanish 🌍Country: Spain 🇪🇸 🗓Release Date: 20 March 2026 ⏳Running time: 111 minutes ©️Source: Wikipedia ✅Free encyclopedia & fair use ➡️ChannelMovie.t.me

Hashtags

Latest Movies 🎬

@movie · Post #1810 · 25.03.2026 г., 06:30

🎬 Preschool 🎞Movie Info Preschool is a 2026 American comedy film directed by and starring Josh Duhamel from a script by Richard D’ovidio. The film has an ensemble cast also featuring Michael Socha, Antonia Thomas, Charity Wakefield, Fenella Woolgar and James Cosmo. 📝️Synopsis: Two fathers become engaged in a battle to try and enroll their children into a desirable preschool. 😀Genre: #Comedy😆 🗣Language: English 🌍Country: United States 🇺🇸 🗓Release Date: March 17, 2026 ⏳Running time: 104 minutes ©️Source: Wikipedia ✅Free encyclopedia & fair use ➡️ChannelMovie.t.me

Hashtags

Latest Movies 🎬

@movie · Post #1800 · 20.03.2026 г., 06:30

🎬 Pizza Movie 🎞Movie Info Pizza Movie is a 2026 American comedy film written and directed by Brian McElhaney and Nick Kocher. It stars Gaten Matarazzo, Sean Giambrone, Lulu Wilson, Jack Martin, Peyton Elizabeth Lee, Marcus Scribner, Caleb Hearon, Sarah Sherman, Justin Cooley, and Daniel Radcliffe. 📝️Synopsis: Two college roommates take some special drugs called "M.I.N.T.S." and experience a terrifying, hallucinogenic high. The only way to counteract the drug is to eat pizza. They must navigate through the high in order to get the pizza delivered by a drone. 😀Genre: #Comedy😆 🗣Language: English 🌍Country: United States 🇺🇸 🗓Release Date: April 3, 2026 ⏳Running time: 92 minutes ©️Source: Wikipedia ✅Free encyclopedia & fair use ➡️ChannelMovie.t.me

Hashtags

Latest Movies 🎬

@movie · Post #1793 · 16.03.2026 г., 13:30

🎬 Welcome to Lapland 🎞Movie Info Welcome to Lapland (Spanish: Lapönia) is a Spanish comedy film directed by David Serrano and written by Cristina Clemente and Marc Angelet based on their own play Lapònia. It stars Natalia Verbeke, Julián López, Ángela Cervantes, and Vebjørn Enger. 📝️Synopsis: Nuria, a resident in Lapland with her husband Olavi and her daughter, invites her sister Mónica, her brother-in-law and her nephew to a Christmas stay in Rovaniemi. Havoc ensues when Nuria's daughter tells her cousin that Father Christmas does not exist, triggering family strife and the resurfacing of buried secrets. 😀Genre: #Comedy😆 🗣Language: Spanish 🌍Country: Spain 🇪🇸 🗓Release Date: 1 April 2026 ⏳Running time: ---- ©️Source: Wikipedia ✅Free encyclopedia & fair use ➡️ChannelMovie.t.me

Hashtags

Latest Movies 🎬

@movie · Post #1776 · 06.03.2026 г., 13:30

🎬 K-Pops! 🎞Movie Info K-Pops! is a 2024 American family comedy film directed and produced by musician Anderson .Paak (in his directorial debut), who also wrote the screenplay with Khaila Amazan. .Paak stars in the film alongside Jee Young Han, Jonnie "Dumbfoundead" Park (who also produced), Soul Rasheed, and Yvette Nicole Brown. 📝️Synopsis: A Los Angeles musician hoping to revive his career moves to South Korea to join a K-pop band and compete in a televised music contest. He soon discovers that his long-lost son is poised to become a K-pop superstar. While initially clinging to his son for another shot at fame, he decides to prioritize his role as father as the📝️ 😀Genre: #Comedy😆 🗣Language: English, Korean 🌍Country: United States 🇺🇸 🗓Release Date: February 27, 2026 ⏳Running time: 114 minutes ©️Source: Wikipedia ✅Free encyclopedia & fair use ➡️ChannelMovie.t.me

Hashtags

Latest Movies 🎬

@movie · Post #1773 · 03.03.2026 г., 13:30

🎬 The Napa Boys 🎞Movie Info The Napa Boys is a 2025 American comedy film directed by Nick Corirossi and co-written by Corirossi and Armen Weitzman, who also star. The film premiered in the Midnight Madness section of the 2025 Toronto International Film Festival. Magnolia Pictures later acquired U.S. distribution rights. 📝️Synopsis: Presented as The Napa Boys 4: The Sommelier's Amulet, the film follows a trio of wine-obsessed characters who go on an adventure through California's wine country. They start with a high-stakes wine competition, and a series of escalating absurd set-pieces. 😀Genre: #Comedy😆 🗣Language: English 🌍Country: United States 🇺🇸 🗓Release Date: February 27, 2026 ⏳Running time: 92 minutes ©️Source: Wikipedia ✅Free encyclopedia & fair use ➡️ChannelMovie.t.me

Hashtags

Latest Movies 🎬

@movie · Post #1678 · 05.12.2025 г., 13:30

🎬 Oh. What. Fun. 🎞Movie Info Oh. What. Fun. is an 2025 American Christmas comedy film directed by Michael Showalter, and written by Chandler Baker and Showalter. It stars Michelle Pfeiffer, Felicity Jones, Chloë Grace Moretz, Denis Leary, Dominic Sessa, with Jason Schwartzman, Eva Longoria, and, Joan Chen. It was released on December 3, 2025 on Amazon Prime Video. 📝️Synopsis: Claire Clauster makes the Christmas magic happen every year for her family but her children and grandchildren don’t realize the effort it takes until she goes missing. The title is a reference to the lyrics of "Jingle Bells" by James Lord Pierpont: "Oh what fun it is to ride in a one-horse open sleigh". The last name Clauster is a📝️ 😀Genre: #Comedy😆 🗣Language: English 🌍Country: United States 🇺🇸 🗓Release Date: December 3, 2025 ⏳Running time: 108 minutes ©️Source: Wikipedia ✅Free encyclopedia & fair use ➡️ChannelMovie.t.me

Hashtags

Latest Movies 🎬

@movie · Post #1615 · 06.11.2025 г., 13:30

🎬 Leo & Lou 🎞Movie Info Leo & Lou is a 2025 comedy film directed by Carlos Solano starring Isak Férriz and Julia Sulleiro. 📝️Synopsis: The plot follows Lou, an orphan mute girl fleeing a shelter in order to attend a fishing competition, and Leo, a down-and-outer man, as the latter picks Lou up hitchhiking thinking about returning her home, as they embark on a fun adventure instead. 😀Genre: #Comedy😆 🗣Language: Spanish 🌍Country: Spain 🇪🇸, United Kingdom 🇬🇧, Romania 🇷🇴 🗓Release Date: 7 November 2025 ⏳Running time: ---- ©️Source: Wikipedia ✅Free encyclopedia & fair use ➡️ChannelMovie.t.me

Hashtags

Latest Movies 🎬

@movie · Post #1610 · 05.11.2025 г., 06:30

🎬 Pet Peeves 🎞Movie Info Pet Peeves (Spanish: Pequeños calvarios) is a 2025 ensemble comedy film directed by Javier Polo from a screenplay by David Pascual, Enric Pardo, and Guillermo Guerrero. It straddles black and surreal comedy. Its cast includes Andrea Duro, Enrique Arce, Vito Sanz, Marta Belenguer, Pablo Molinero, Arturo Valls, and Berta Vázquez, among others. 📝️Synopsis: The plot consists of standalone stories making fun of absurd misfortunes stitched together by the story of clockmaker Carlo. 😀Genre: #Comedy😆 🗣Language: Spanish 🌍Country: Spain 🇪🇸, Mexico 🇲🇽 🗓Release Date: 24 October 2025 ⏳Running time: ---- ©️Source: Wikipedia ✅Free encyclopedia & fair use ➡️ChannelMovie.t.me

Hashtags

Latest Movies 🎬

@movie · Post #1596 · 31.10.2025 г., 06:30

🎬 The Dinner 🎞Movie Info The Dinner (Spanish: La cena) is a 2025 comedy film directed by Manuel Gómez Pereira from a screenplay co-written with Joaquín Oristrell and Yolanda García Serrano based on a play by José Luis Alonso de Santos. The plot follows a young lieutenant (Mario Casas), and a conscientious maître d'hôtel (Alberto San Juan) as they try to organize a banquet at Madrid's Hotel Palace for a clique of Francoist generals just weeks after the end of the Spanish Civil War. 📝️Synopsis: Weeks after the end of the Spanish Civil War, lieutenant Santiago Medina arrives in the Hotel Palace of Madrid, then operating as a hospital for wounded, asking the maître Genaro Palazón to prepare a banquet at the hotel for Francisco Franco and his generals. 😀Genre: #Comedy😆 🗣Language: Spanish 🌍Country: Spain 🇪🇸, France 🇫🇷 🗓Release Date: 17 October 2025 ⏳Running time: ---- ©️Source: Wikipedia ✅Free encyclopedia & fair use ➡️ChannelMovie.t.me

Hashtags

Latest Movies 🎬

@movie · Post #1586 · 27.10.2025 г., 13:30

🎬 One More Shot 🎞Movie Info One More Shot is a 2025 Australian time-loop comedy directed by Nicholas Clifford and written by Alice Foulcher and Gregory Erdstein. The film stars Emily Browning. 📝️Synopsis: Minnie Vernon is in her mid 30s on New Year's Eve of 1999. A hospital anaesthesiologist, she inadvertantly discovers that her ex-fiancé Cameron, who she had split from after many years, is there for his child's birth. Shocked, as at the time he did not want kids, he points out that Minnie's sleeping with her former university boyfriend Joe is📝️ 😀Genre: #Comedy😆 🗣Language: English 🌍Country: Australia 🇦🇺 🗓Release Date: October 12, 2025 ⏳Running time: 91 minutes ©️Source: Wikipedia ✅Free encyclopedia & fair use ➡️ChannelMovie.t.me

Hashtags

Latest Movies 🎬

@movie · Post #1573 · 23.10.2025 г., 10:30

🎬 The Last Viking 🎞Movie Info The Last Viking (Danish: Den sidste viking) is a 2025 black comedy film written and directed by Anders Thomas Jensen. It stars Nikolaj Lie Kaas and Mads Mikkelsen. The film had its world premiere out of competition at the 82nd Venice International Film Festival on 30 August 2025. It received a theatrical release in Denmark on 9 October 2025. 📝️Synopsis: While serving a 15-year prison sentence for bank robbery, Anker entrusts his brother, Manfred, to bury the heist money for safekeeping. Upon his release, Anker is frustrated to find that Manfred has since developed dissociative identity disorder and cannot recall where he hid the money. 😀Genre: #Comedy😆 🗣Language: Danish, Swedish 🌍Country: Denmark 🇩🇰, Sweden 🇸🇪 🗓Release Date: 9 October 2025 ⏳Running time: 116 minutes ©️Source: Wikipedia ✅Free encyclopedia & fair use ➡️ChannelMovie.t.me

Hashtags

123•••5•••10•••15•••20•••25•••30•••35•••40•••45•••50•••5253
ПретходнаСтраница 1 од 53Следна