Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize Qt Adaptive stretching

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to achieve Qt adaptive stretching". In daily operation, I believe many people have doubts about how to achieve Qt adaptive stretching. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts of "how to achieve Qt adaptive stretching". Next, please follow the editor to study!

I. Preface

People who have used echart will encounter a problem, even if _ window.onresize = echart.resize is written in the code, it is only horizontally adaptively stretching to fill the page, and the vertical direction will not change unless you specify a height, which is more depressing, why is echart itself not adaptive? According to reason, it should not be ah, is it very difficult to achieve? All right, forget about this. There are a lot of solutions to this problem, and there are also this problem in Qt browser controls. In order to solve this problem, I think of two strategies: one is that the program itself detects the size change, and then resets the height and loads it into the web page; the other is that the js function sets the corresponding width and height. When is it executed, that is, when the interface size of the program changes, the two methods are compared. The final choice of the latter, because the effect is better, it is executed asynchronously, and there is no need to reload the web page. The method of reloading the web page every time the height changes has been used in early works, and it looks stupid.

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

Fourth, related code / / set window size changes echarts automatic stretch fill, this method can only stretch horizontally list height (); webView- > page ()-> runJavaScript (js); # endif}} so far, on the "Qt adaptive stretching how to achieve" the end of the study, I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report