In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to achieve dashboard interaction with Qt. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
I. Preface
Echart is a report view JS plug-in developed by the Baidu R & D team, which is very powerful and is the most powerful domestic work I have ever used. I remember that four or five years ago, it was used in qt, and the browser control used at that time was webkit. Because the version after 5.6 no longer supports webkit, while switching to the webengine kernel, many people can not compile normally after downloading and using it. Today, I specially take the time to do a webengine version to support both webkit and webengine. In webkit, JS is executed using webView- > page ()-> mainFrame ()-> evaluateJavaScript (js), while webengine uses webView- > page ()-> runJavaScript (js). In terms of execution efficiency, webengine throws webkit several blocks. When dragging the slider to dynamically set the value, webengine occupies only 1% of CPU, while webkit reaches 7%. Horror! No wonder webkit is gradually abandoned by qt, webengine is just a little bit more memory usage.
Second, the first step of the code idea: prepare the web page file ```C++ ECharts
Step 2: prepare the JS function
Function setGaugeValue (value) {var option = {tooltip: {formatter: "{a} {b}: {c}%"}, toolbox: {feature: {restore: {}, saveAsImage: {}, series: [{name: 'business metrics', type: 'gauge' Detail: {formatter:' {value}%'}, data: [{value: value, name: 'completion rate'}]}
Step 3: data interaction
Void Widget::on_horizontalSlider_valueChanged (int value) {QString js = QString ("setGaugeValue (% 1)") .arg (value); # ifdef webkit webView- > page ()-> mainFrame ()-> evaluateJavaScript (js); # else webView- > page ()-> runJavaScript (js); # endif} III.
This is the end of the article on "how to achieve dashboard interaction in Qt". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.