Qt-Quick 介绍
Qt-Quick 介紹
- 1 簡介
- 2 優缺點
- 3 資料匯總
- 3.1 書籍
- 3.2 網站
- 3.3 博客
- 4 示例
- 5 作品
- 參考
1 簡介
2 優缺點
widgets 只能由CPU渲染,不能利用 opengl 加速。而 qml 則可以。
在桌面平臺,大家的CPU往往性能過剩,widgets 還是滿足需求的。
在嵌入式平臺,很多低端設備甚至都沒有圖形加速器,或不支持opengl,只能用widgets
在移動端平臺,沒有gpu加速可能就會“不絲滑”,手感不好。所以用 qml 會有更好的體驗
我在做一個demo, UVC Camera上來一幀顯示一幀, 實際上在QOpenGLWidget的paintEvent里刷幀(沒使用OpenGL) 照樣很占CPU, 我認為一定要用paintGL
互聯網,順手就行,性能不用考慮
嵌入式電子設備、物聯網,必須是c/c++才行。關鍵代碼只能是C,C++都用不了 …
使用 QML 語言進行 Qt 應用程序開發可以將界面開發和邏輯控制分開,提高應用的開發周期和靈活性;另外對于多媒體應用非常重要的一點是,基于 QML/Qt Quick 的應用程序可以直接調用 GPU 進行加速,這大大提高了多媒體應用在嵌入式系統環境下的處理效率和資源占用
性能
https://www.toradex.com/zh-cn/blog/qian-ru-shilinux-ji-yuqml-kai-faqt-multimedia-ying-yong
3 資料匯總
3.1 書籍
3.2 網站
3.3 博客
- qt開源社區yafeilinux
- foruok的Quick 系列
- 一去二三里的細說 QML
- 鬼谷子com的深入解析QML引擎
- 朝聞道qml
4 示例
https://support.crosscontrol.com/kb/qtquick-qml-programming
In this article, one approach will be presented how signals in the Data Engine can be connected to QML components. Signal values can either be presented in the GUI for a user or be updated through user input with the GUI.
Goal:
- Set signal value from GUI (qml) and send the value to the Data Engine
- Read value from Data Engine and view it in the GUI (qml)
Achieved by: - Write a C++ backend to handle communication with Data Engine
- Class with Q Properties defines the signals
- QML-binds to properties in the signal class handler
The following structure will be used for both projects to achieve the previously mentioned goal:
Viewer - The Viewer is what the user will see and interact with. It is written with QML and property bindings will be used to bind certain component properties. It communicates with the backend parts Data Engine Control or Data Engine Signal.
Data Engine Signal
- Defines the signals which should be used by the application. Signals are created as properties which the Viewer can bind to. The name of the signals must follow a specific pattern for the current implementation. Will be presented further on in the article.
Data Engine Control
- A central piece for this project and the backend. It handles the communication with the Data Engine through the sapcore interface or by receiving data from the observer. It is also responsible to update signals defined as properties in Data Engine Signal.
Observer
- Receives data from the sapcore interface, such as subscribe result or data for updated signals. Pushes the information to the Data Engine Control which then handles the received data. It’s a part of the Data Engine Control.
Receiver
Signal updates are received from the Observer which is a part of the Data Engine Control. Once a new value arrives, the ID will be checked in one of the used dictionaries to find the corresponding signal name. Once found, it will use the signal handle previously set during the initialization to update the correct property in Data Engine Signal. The property is updated using the WRITE method associated to the signal, which will trigger the GUI to read the new value thanks to the notify signal.
Sender
When Data Engine Signals emits the signal to send data, the slot connected to the signal will be activated, in this case sendToServer(value,name). The method needs to get the ID associated with the name of the signal, this is done by reading the name paired with the key value ID. Once the ID is known, it is just a matter to set the value using the SAP method SetValue(id,value) available in the sapcore-library.
5 作品
記錄開源Qt/Qml 作品鏈接
參考
1、
2、怎么看 widgets 與 qml 未來的發展
3、QOpenGLWidget 繪圖選擇paintEvent還是 paintGL,兩者有什么區別嗎?都能開啟硬件加速嗎?
4、學 Qt-widget 還是 Qt-quick?求大佬指教
5、i.mx6q 移植Qt5.9.1(完美支持opengl、Qt quick2、QML)
6、QML移植到ARM
7、移植Qt5.6到imx6系列處理器移植過程說明–支持qml
8、嵌入式Linux基于QML開發QT Multimedia應用
9、顯著改善了Qt Quick 和 QML之性能,尤其在ARM平臺上之Linux。QML引擎,Qt Quick 圖形,Qt QML編譯器,Qt Quick 控件,相對于5.6,有些方面的性能提高了數倍。
10、Template:FriendlyCoreRK3399QtDev/zh
11、Qt Quick 之 QML 與 C++ 混合編程詳解
12、Introduction to Qt Quick for C++ Developers
總結
以上是生活随笔為你收集整理的Qt-Quick 介绍的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: serialplot虚拟串口示波器使用方
- 下一篇: InnoDB ReplicaSet