ChatCrawlersearch across public Telegram Open the app
Q

Qt for Python (PySide/Shiboken)

сообщение · 2021-06-25 13:36 UTC
I
Replymessage unavailable
Ok, I saw the video suggested by @cmaureir and actually he said setContextProperty will be deprecated then removed. I know the point of @Keithel about global vars. But I have not yet found a solution in my use case, except to use qmlRegisterSingletonInstance instead of setContextProperty. May be I use a wrong pattern, but in my HMI applications I use a single main class (C++ or python) exported as Context property. That class collect data via serial connection to device and handle the state machine for business logic. So, I can't create a new instance for each QML page. QML page needs to access class properties to show data and send command (slots). The alternative way could be use my main class as unexported, and then export other gateway classes as "Registered Type", but in this case I need to implements a sort of communication between QML exported classes and the main one. What about a better practice?

All messages on 25 June 2021 · Whole feed · оригинал в Telegram

Open in Telegram Каталог площадок Искать в ChatCrawler

A snapshot of an open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · What we do not do · Remove a page · Catalog