简体   繁体   中英

QtQuick QML SQL C++

I need to run an algorithm in Qt on data that originates from two different sources:

1- UART ( raw transducer data) 2- variables a user inputs into a gui

The result is then output to the gui for the user to see

Gameplan: - User inputs variables via a gui (written in qml - i actually have no choice on this) - The qml creates a database of all variables, then - Invokes C++ routines for collecting raw data over a UART , saves it to a file, - the C++ module opens up the database and extracts variables needed , opens the file reads in the data, runs the algorithm using both, calculates the answer and writes it to the database, - program then jumps back to QML where, later, the QML will go into the database to extract that answer and display it.

If you see a flaw already please let me know before I spend hours finding out this wont work. If it is plausible.....

FOUR QUESTIONS: (1) who should run the UART - C++ or QML? anyone knows pros /cons? The raw data will have to be post processed so i'm thinking it will need file saving (I'm thinking UART is a C++ thing)

(2) I need to create a database from user input variables from QML - any one have examples of this?

(3) - the QML must do a Q_INVOKABLE to the C++ routines (to run the algorithm) . I've already run a test program to prove I can do that so not too worried though if anyone has any other examples I'd love to see how others do this.

(4) BOTH the QML and the C++ need to access (read and write) the database created in (2).
Is this doable? If so...anyone have any examples of QML and C++ sharing the same database, any code, videos, anything? Should I keep opening and closing the database or is there a way to open it and have some pointer or something be passed around. I can't find anything about QML accepting or passing a pointer.

Thanks Dubs

(using ARM® Cortex™-A9 embedded linux qt)

对于SQL和QML Q_INVOKABLE请参考此答案 ;对于UART,请使用C ++并从QML调用它。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM