In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to realize the dashboard with Qt". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to implement the dashboard with Qt".
I. Preface
Dashboards are commonly used in many systems related to the Internet of things and cars. In fact, the most intuitive one is the automobile dashboard, which used to be mainly a mechanical instrument, but now it has been gradually changed into an intelligent instrument with a screen operating system. This aesthetic and expansive functionality is greatly enhanced. On the operating system, in addition to basic instrument instructions, you can also listen to songs, navigate and answer the phone. This should also be a major trend in the development of the automotive field at present. Qt has also made a 3D studio design in this respect, which allows artists to design effect drawings directly, set up some animation effects, and so on. It can be said that in recent years, Qt company is also constantly seeking new development, exploring new opportunities, and finding new growth points and breakthroughs.
It is very convenient to use Qt to develop dashboard controls, no matter using widget painter or qml, especially qml, the built-in animation effects are very suitable for such applications. This time, we do not discuss how to use qt to develop dashboards, but directly use echart built-in dashboard controls. I do not know that a file as small as echart can have so many effects, even dashboards. This is very shocking. The use of the dashboard is very detailed on the official website, and the difficulty in combining with Qt may lie in how to interact. In Qt, both webkit and webengine provide runJavaScript or evaluateJavaScript function classes to execute js functions. You only need to write the corresponding js file function in the html file to trigger execution directly. For example, if you set the angle of the dashboard here is setGaugeValue (value), you only need to pass the runJavaScript or evaluateJavaScript parameter to setGaugeValue (88). You only need to change the parameters of setGaugeValue dynamically according to the value of the scroll bar or slider on the interface.
II. Functional features
At the same time, support flicker point map, migration map, area map, dashboard and so on.
You can set various colors such as title, prompt, background color, text color, line color, area color, and so on.
You can set the name, value, longitude and latitude collection of the city.
You can set the magnification of the map and whether the mouse wheel is allowed to zoom.
Built-in world map, national map, provincial map, regional map, can be accurate to the county, all maps are used offline.
Built-in provincial and municipal json data file to js file function, if there is a data update self-conversion, support a single file conversion and one-click conversion of all files.
Built-in function to obtain all the names and longitude and latitude information sets of the region from json files or js files, which can be used to display the information obtained by this method.
Depending on the browser component to display the map, the provided demo supports webkit, webengine and ie to load web pages.
Strong expansibility, you can add a variety of exquisite echarts components according to the gourd painting ladle to make a great effect.
The built-in dashboard components provide interactive functionality, and the corresponding code is included in the demo demo.
The function interface is friendly and unified, and it is easy to use, just one class.
Support any Qt version, any system, any compiler.
Third, effect picture
4. Related code QString Echarts::newChartGauge (const QString & title, int value) {QStringList body; body
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.