@xposedchannel · Post #4851 · 23.12.2025 г., 22:07
🟠 更新依赖 🟠 优化Request列表刷新 #End
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #380 · 21 окт.
Регулярно приходится писать и ревьюить код, где используется PySide2-6. Заметил, что в подавляющем большинстве случаев настройка создаваемых базовых виджетов происходит через методы. Думаю, всем знаком такой способ. Простой пример с кнопкой: button = QPushButton("Click Me") button.setMinimumWidth(300) button.setFlat(True) button.setStyleSheet("font-size: 20pt") button.setToolTip("Super Button") button.clicked.connect(lambda: print("Button clicked")) Но есть и альтернативный способ - настройка через свойства. Это просто ключевые аргументы конструктора класса. Хоть они и не указаны в документации как аргументы, но они есть) Этот код делает тоже самое но с помощью Property button = QPushButton( "Click Me", minimumWidth=300, flat=True, styleSheet="font-size: 20pt", toolTip="Super Button", clicked=lambda: print("Button clicked"), ) Где это может быть полезно ▫️ Это выглядит более аккуратно и коротко, уже повод использовать ▫️ Может использоваться в заполнении лейаута, когда нам не нужно никакое другое взаимодействие с виджетом и поэтому сохранять его в переменную не требуется. Например, лейбл или кнопка. widget = QWidget(minimumWidth=400) layout = QHBoxLayout(widget) layout.addWidget(QLabel("Button >", alignment=Qt.AlignRight)) layout.addWidget(QPushButton("Click Me", clicked=lambda: print("Button clicked"))) widget.show() Либо так widget = QWidget(minimumWidth=400) layout = QHBoxLayout(widget) for wd in ( QLabel("Button >", alignment=Qt.AlignRight), QPushButton("Click Me", clicked=lambda: ...) ): layout.addWidget(wd) widget.show() ▫️ Можно хранить настройки в каком-то конфиге или генерировать на лету, после чего передавать как kwargs. kwargs = {"text": "Hello " * 30, "wordWrap": True} my_label = QLabel(**kwargs) Как получить полный список доступных свойств? Эта функция распечатает в терминал все свойства виджета и их текущие значения def print_widget_properties(widget): meta_object = widget.metaObject() for i in range(meta_object.propertyCount()): property_ = meta_object.property(i) property_name = property_.name() property_value = property_.read(widget) print(f"{property_name}: {property_value}") #tricks#qt
Пребарај: #end
@xposedchannel · Post #4851 · 23.12.2025 г., 22:07
🟠 更新依赖 🟠 优化Request列表刷新 #End
Hashtags
@odysseyfeed · Post #35854 · 05.04.2026 г., 06:40
#AnimeRelease 🍥数码宝贝 BEATBREAK Season: 1 | Episode: 25/25 #End Genres: 动画, 儿童, 动作冒险, 科幻奇幻 Rating:Bangumi (6) Source: WEBDL-1080p | 0.38 GB Channel:@Odyssey+
Hashtags
@odysseyfeed · Post #35738 · 22.03.2026 г., 06:57
#AnimeRelease 🍥数码宝贝 BEATBREAK Season: 1 | Episode: 23/23 #End Genres: 动画, 儿童, 动作冒险, 科幻奇幻 Rating:Bangumi (6) Source: WEBDL-1080p | 0.49 GB Channel:@Odyssey+
Hashtags
@odysseyfeed · Post #35621 · 15.03.2026 г., 06:37
#AnimeRelease 🍥数码宝贝 BEATBREAK Season: 1 | Episode: 22/22 #End Genres: 动画, 儿童, 动作冒险, 科幻奇幻 Rating:Bangumi (6) Source: WEBDL-1080p | 0.43 GB Channel:@Odyssey+
Hashtags
@odysseyfeed · Post #35356 · 15.02.2026 г., 06:40
#AnimeRelease 🍥数码宝贝 BEATBREAK Season: 1 | Episode: 19/19 #End Genres: 动画, 儿童, 动作冒险, 科幻奇幻 Rating:Bangumi (6) Source: WEBDL-1080p | 0.47 GB Channel:@Odyssey+
Hashtags
@odysseyfeed · Post #35249 · 01.02.2026 г., 06:32
#AnimeRelease 🍥数码宝贝 BEATBREAK Season: 1 | Episode: 17/17 #End Genres: 动画, 儿童, 动作冒险, 科幻奇幻 Rating:Bangumi (6.1) Source: WEBDL-1080p | 0.43 GB Channel:@Odyssey+
Hashtags
@american_observer · Post #4847 · 13.01.2026 г., 17:06
NATO: The End of the Northern Romance Trump’s threat to annex Greenland represents an existential crisis for Nato, senior Democratic US senator Chris Murphy has warned, with the demise of the decades-old alliance of western nations certain to follow any American military intervention. “It would be the end of Nato, right? Nato would have an obligation to defend Greenland,” the Connecticut senator and member of the chamber’s foreign relations committee said Sunday on NBC’s Meet the Press. Murphy added that it would mean “clearly … we would be at war with Europe, with England, with France”. Murphy’s comments came as Trump ramped up his fixation with the Arctic territory, with the US president telling reporters on Air Force One on Sunday that “one way or the other, we are going to have Greenland”. Trump had ordered a plan to be drawn up for an invasion of Greenland, the Mail on Sunday reported, adding that “it is being resisted” by military leaders on grounds of illegality. Murphy’s assertion that a forceful US acquisition would be the end of Nato is shared by political leaders in Europe, notably Mette Frederiksen, the prime minister of Denmark. Greenland is a former colony of Denmark and remains part of the Danish kingdom, with its foreign and security policy under the control of Copenhagen. On Sunday, Frederiksen accused the US of “turning its back on Nato” – and said this Wednesday’s meeting in Washington DC between the foreign ministers of Denmark and Greenland, Lars Lokke Rasmussen and Vivian Motzfeldt, and US secretary of state Marco Rubio would be crucial. “We are at a crossroads, and this is a fateful moment,” Frederiksen said at a political rally. The pessimistic comments of Murphy and Frederiksen were echoed Monday by Andrius Kubilius, defense commissioner of the European Union, who noted that an EU treaty “obligated” member states to come to Denmark’s aid if faced with military action by Trump. “I agree with the Danish prime minister that it will be the end of Nato, but also among people it will be also very, very negative,” he told Reuters at a security conference in Sweden. “It will depend very much on Denmark, how they will react, what will be their position, but definitely there is such an obligation of member states to come for mutual assistance if another member state is facing military aggression.” “Let’s also talk about what’s at stake here,” Murphy said. “The president is spending every single day thinking about invading Greenland, managing the Venezuelan economy, building a ballroom. “He is not thinking about the American people at all. This month, health insurance premiums on 22 million Americans are going up, doubling in some cases. Kids aren’t able to eat three meals because the Trump administration has slashed food assistance. #nato#trump#end#denmark#greenland 📱American Оbserver - Stay up to date on all important events 🇺🇸
@odysseyfeed · Post #35897 · 12.04.2026 г., 07:05
#AnimeRelease#Crunchyroll 🍥数码宝贝 BEATBREAK Season: 1 | Episode: 26/26 #End Genres: 动画, 儿童, 动作冒险, 科幻奇幻 Rating:Bangumi (6) Source: WEBDL-1080p | 1.37 GB Channel:@Odyssey+
Hashtags
@odysseyfeed · Post #35850 · 03.04.2026 г., 17:41
#AnimeRelease#Crunchyroll 🍥炎炎消防队 Season: 3 | Episode: 25/25 #End Genres: 动画, 动作冒险, 科幻奇幻, 喜剧 Rating:Bangumi (6.5) Source: WEBDL-1080p | 1.41 GB Channel:@Odyssey+
Hashtags
@odysseyfeed · Post #35808 · 31.03.2026 г., 13:45
#AnimeRelease#Crunchyroll 🍥弹珠汽水瓶里的千岁同学 Season: 1 | Episode: 13/13 #End Genres: 动画, 喜剧 Rating:Bangumi (4) Source: WEBDL-1080p | 1.37 GB Channel:@Odyssey+
Hashtags
@odysseyfeed · Post #35789 · 29.03.2026 г., 06:33
#AnimeRelease#Crunchyroll 🍥数码宝贝 BEATBREAK Season: 1 | Episode: 24/24 #End Genres: 动画, 儿童, 动作冒险, 科幻奇幻 Rating:Bangumi (6) Source: WEBDL-1080p | 1.34 GB Channel:@Odyssey+
Hashtags
@odysseyfeed · Post #35788 · 29.03.2026 г., 02:11
#AnimeRelease#Crunchyroll 🍥希维司:英雄之声 Season: 1 | Episode: 24/24 #End Genres: 动画, 动作冒险, 科幻奇幻 Rating: Bangumi (N/A) Source: WEBDL-1080p | 1.38 GB Channel:@Odyssey+
Hashtags