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

Резултати

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

Пребарај: #biolab

当前筛选 #biolab清除筛选
BadVolf

@BadvolfNews · Post #756 · 01.08.2023 г., 04:24

🦠Nothing to see here.Illegal chinese biolab containing bioengineered mice and infectious agents including HIV and herpes discovered in California ⚗The makeshift lab contained roughly 30 refrigerators and freezers — some of which were non-operational — as well as incubators, medical testing supplies, and hundreds of mice. Several disease samples tested from the lab included infectious agents like herpes, coronavirus, E. Coli, and malaria. 🧑🏻‍🔬Wang Zhaolin, a representative of the company operating the lab, Prestige Biotech, told investigators that the mice inside the warehouse had been genetically engineered to catch and spread the COVID-19 virus. 🩸Fresno County Public Health staff also observed blood, tissue and other bodily fluid samples and serums; and thousands of vials of unlabeled fluids and suspected biological material. medical devices that appeared to have been created on-site, such as COVID-19 and pregnancy tests, were also discovered. #biolab#Covid19 Share and subscribe to American Majority

BadVolf

@BadvolfNews · Post #49 · 04.05.2022 г., 13:47

🧪🇺🇸Records Reveal Safety Lapses and Violations at U.S. Biosafety Laboratories that Conduct Research on Dangerous Agents and Toxins 🐒Mishaps, human errors, animal escapes, improper and defective personal protective equipment, facility equipment failures and containment failures continue to occur at some of the United States’ most secure and regulated high-containment biosafety laboratories. 🦠The report explains that one of the exposures resulted in an illness of one worker after exposure to Coxiella Burnetii. “The source of the infection was attributed to contact with infected animals in the performance of the worker’s duties. The worker received medical treatment and fully recovered from the illness." 🧨These documents uncover a pattern of serious safety issues in biolabs here on U.S. soil. And, given these issues here at home, one can imagine the safety issues of labs the U.S. funds abroad. #biolab#bioweapon Please share and subscribe: @american_majority

BadVolf

@BadvolfNews · Post #292 · 09.09.2022 г., 08:24

🇺🇸🇺🇦🦠Another US-linked biolab was found in liberated Rubezhnoye The "Farmbiotest" laboratory was found in a building in the city polyclinic. As it turns out, they tested "medicines" on local residents under the guise of safe research. Locals were invited to participate in drug trials for a fee, and meals at the expense of the company. Everything seemed to be legal in appearance, until the "volunteers" began to die one by one. It became clear that the company conducting the "research" was interested in patients with cardiovascular diseases, coronavirus and children with congenital anomalies (medical staff took screenings from newborn infants). American medical documentation was found in the building as well. All the evedences point to the fact that tests of subspecies of bioweapons were conducted in Rubezhnoye under the guise of legal research. #Ukraine#Pentagon#biolab#bioweapon Share and subscribe: @american_majority

BadVolf

@BadvolfNews · Post #83 · 19.05.2022 г., 15:11

🇺🇸Actually, that is a really interesting video. Remember how during Senate testimony, Biden and Obama official Victoria Nuland admitted there were biological research labs in Ukraine? Victoria Nuland told Senator Marco Rubio: “Ukraine has biological research facilities which we are now quite concerned Russian troops, Russian forces may be seeking to gain control of.” Nuland said so under oath. Why didn’t Victoria "cookies of freedom" Nuland just say there aren’t any bioweapons? Hint: there are bioweapons. If she would have lied, she would go to jail. So just look, what we have. Here's another document we got from our whistleblower. Read it carefully. So there's a reason why Blinken literally stops her from visiting Russia and answering their questions. Ms. Nuland needs to be questioned again, but this time by a Special Counsel and under the penalty of perjury. Russia and China want their questions to be answered too! #Ukraine#bioweapon#biolab#Nuland Share and subsribe @american_majority

BadVolf

@BadvolfNews · Post #547 · 01.03.2023 г., 13:45

🇺🇸Take a look inside a US top secret bioweapons laboratory... Journalists began sounding the alarm over the existence and development of bioweapons by the US government as long as 3 years ago... From toxic fleas to deseased mosquitos, and these are just the experiments that have been declassified to the public. 💥 Since then, the Pentagon has been funding numerous biolabs around the world, some too dangerous to host on home soil, and others involved in specific genome research of people who live in the area. #Bioweapons#biolab#biothreat Share and subscribe to American Majority

BadVolf

@BadvolfNews · Post #195 · 10.07.2022 г., 19:58

🇺🇸🇺🇦🇷🇺Russian MoD presented the data on the health condition of the surrendered Ukrainian servicemen. 🦠The data show the presence of antibodies to contagious disease agents. The results are as follows: 33% of the examined servicemen had had hepatitis A, over 4% had renal syndrome fever and 20% had West Nile fever. The figures are significantly higher than the statistical average. Considering an active research of these diseases by the Pentagon within the Ukrainian projects, Russian MoD believes that servicemen of the Armed Forces of Ukraine (AFU) were involved as volunteers in experiments to assess the tolerance of dangerous infectious diseases. High concentrations of antibiotics, including sulphonyl amides and fluoroquinolones, have been detected in their blood as well. This fact may indicate preventive use of antibiotics and preparation of servicemen for operating in conditions of biological contamination, such as cholera agent and others. #bioweapon#biolab#Pentagon#Ukraine#war @american_majority

The New Southerner

@american_majority · Post #121 · 25.05.2022 г., 20:17

⚡BREAKING⚡ 🇺🇸🇺🇦Nuland-Pyatt Tape Removed From YouTube After 8 Years The smoking gun proving U.S. involvement in the 2014 coup in Kiev has been removed from YouTube after eight years, Consortium news reported. The removal of a video happend just a few days later after the American majority channel published another leaked letter from Nuland's office and this proves its authenticity. It was the most complete version of the leaked conversation between then Assistant Secretary of State Victoria Nuland and Geoffrey Pyatt, the then U.S. ambassador to Ukraine, in which the two discuss who will make up the new government weeks before democratically-elected Ukrainian President Viktor Yanukovych was overthrown in a violent coup on Feb. 21, 2014. The U.S. State Department never denied the authenticity of the video, and even issued an apology to the European Union after Nuland is heard on the tape saying, “Fuck the E.U.” SMELL THE PANIC #Ukraine#bioweapon#biolab#Nuland#leak Share and subsribe @american_majority

BadVolf

@BadvolfNews · Post #97 · 25.05.2022 г., 20:00

⚡BREAKING⚡ 🇺🇸🇺🇦Nuland-Pyatt Tape Removed From YouTube After 8 Years The smoking gun proving U.S. involvement in the 2014 coup in Kiev has been removed from YouTube after eight years, Consortium news reported. The removal of a video happend just a few days later after the American majority channel published another leaked letter from Nuland's office and this proves its authenticity. It was the most complete version of the leaked conversation between then Assistant Secretary of State Victoria Nuland and Geoffrey Pyatt, the then U.S. ambassador to Ukraine, in which the two discuss who will make up the new government weeks before democratically-elected Ukrainian President Viktor Yanukovych was overthrown in a violent coup on Feb. 21, 2014. The U.S. State Department never denied the authenticity of the video, and even issued an apology to the European Union after Nuland is heard on the tape saying, “Fuck the E.U.” SMELL THE PANIC #Ukraine#bioweapon#biolab#Nuland#leak Share and subsribe @american_majority