@ChrisBrownfans2020 · Post #3562 · 15.06.2025 г., 18:17
📈#ChrisBrown’s “Holy Blindfold” becomes one of his biggest streaming debuts. It received 1,274,313 streams in its accumulative day of tracking on Spotify.
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
Пребарај: #chrisbrown
@ChrisBrownfans2020 · Post #3562 · 15.06.2025 г., 18:17
📈#ChrisBrown’s “Holy Blindfold” becomes one of his biggest streaming debuts. It received 1,274,313 streams in its accumulative day of tracking on Spotify.
Hashtags
@ChrisBrownfans2020 · Post #3409 · 26.10.2024 г., 22:34
📈#ChrisBrown’s “Residuals” has now surpassed 40 Million Spotify streams! @chrisbrown where’s the music video? 🤔
Hashtags
@ChrisBrownfans2020 · Post #3391 · 07.10.2024 г., 15:12
📈#ChrisBrown’s “Residuals” has moved up to #60 on Billboard Radio Songs charts.
Hashtags
@ChrisBrownfans2020 · Post #3326 · 22.07.2024 г., 23:29
📈#ChrisBrown’s ‘11:11’ has just reached 700 Million Spotify streams 🎉
Hashtags
@ChrisBrownfans2020 · Post #3241 · 09.06.2024 г., 03:44
5 years ago today, Chris Brown released “No Guidance” featuring Drake #ChrisBrown
Hashtags
@ChrisBrownfans2020 · Post #3206 · 14.05.2024 г., 14:33
📈#ChrisBrown’s ‘11:11’ tour ticks off next month. What song would you like to be the opener? ⬇️
Hashtags
@ChrisBrownfans2020 · Post #3203 · 13.05.2024 г., 03:46
📈#ChrisBrown’s ‘Delusional’ and ‘Residuals’ have both now surpassed 5 Million streams on Spotify.
Hashtags
@ChrisBrownfans2020 · Post #3131 · 05.03.2024 г., 05:34
📈🚨#ChrisBrown’s ‘11:11 Tour’ is upon us!! Billboards are being placed across multiple Arenas in USA displaying 11:11
Hashtags
@ChrisBrownfans2020 · Post #3099 · 27.01.2024 г., 23:14
#ChrisBrown’s ‘Angel Numbers / Ten Toes’ has surpassed 70 Million streams on Spotify.
Hashtags
@ChrisBrownfans2020 · Post #3086 · 09.01.2024 г., 23:53
#ChrisBrown’s ‘Angel Numbers / Ten Toes’ has reached 50 Million Spotify streams 🎉
Hashtags
@ChrisBrownfans2020 · Post #3059 · 13.12.2023 г., 02:15
🚨Kanye West and Ty Dolla Sign will release their album ‘Vultures’ this Friday. #ChrisBrown on Track 5.
Hashtags
@ChrisBrownfans2020 · Post #3543 · 27.03.2025 г., 14:05
🚨 Chris Brown just announced his Stadium World Tour, "Breezy Bowl XX," in celebration of his 20th career anniversary. The tour will take place in Europe and North America, featuring special guests Summer Walker and Bryson Tiller. #Chrisbrown#breezybowl
Hashtags