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

What are the development skills of Qt

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 explains "what are the development skills of Qt". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the development skills of Qt".

Many people ask which Qt embedded platform to use, the unified answer here (current time node 2018): imx6+335x is relatively stable, high performance, use RK3288 RK3399, if cheap, use Quanzhi H3, play with raspberry pie orange pie.

For a large piece of comment code, it is recommended to use # if 0 # endif to include the code block instead of selecting the code and then all / /. The next time you want to open this code, you need to cancel it again. If you use # if 0, you just need to change 0 to 1, which is much more efficient.

There are many ways to package and release Qt. Qt5 later provides a packaging tool windeployqt (macdeployqt on linux for linuxdeployqt,mac), which makes it easy to package applications, but it is not a panacea when you use it. Sometimes you package more files that do not have dependencies, and sometimes you forget to package some plug-ins, especially if you use qml, and you cannot recognize third-party libraries, such as programs that rely on ffmpeg. Then the corresponding library needs to be copied on its own, and the ultimate way is to copy your executable files to the bin directory under the Qt installation directory, and then package the whole, removing the unlikely dependent components one by one until they are working properly.

In the animation in Qt, the underlying QElapsedTimer timer is used to complete the processing, such as generating some data that specifies the rule algorithm, and then processing the attributes.

When drawing a circle with no background color and only border color, you can use a 360-degree arc instead, and the effect is exactly the same.

QRect rect (- radius,-radius, radius * 2, radius * 2); / / the following two methods choose one of the two, actually drawing a 360-degree arc = drawing a circle without background painter- > drawArc (rect, 0360 * 16); painter- > drawEllipse (rect)

Do not look at the d pointer very mysteriously, in fact, it defines a private class in the class implementation file, which is used to store local variables. I personally suggest that when doing some small projects, it is not necessary to introduce this mechanism, which will reduce the readability of the code. increase complexity, beginners will look very confused after accepting the project.

Many people in the painting, set the brush that you can only set a monotonous color, in fact, QPen can also set brush, so flexibility does not know how many times, for example, set QPen brush, you can use a variety of gradients, such as painting gradient color progress bar and text, etc., instead of a monotonous color.

Many controls come with viewport, such as QTextEdit/QTableWidget/QScrollArea. Sometimes it doesn't work when dealing with these controls directly, so you need to set their viewport (). For example, to set the background of the scroll bar area to be transparent, you need to use scrollArea- > viewport ()-> setStyleSheet ("background-color:transparent;") instead of scrollArea- > setStyleSheet ("QScrollArea {background-color:transparent;}").

Sometimes the mouse tracking setMouseTracking is set to true. If there are other controls on the form, the MouseMove of the parent class cannot recognize the mouse movement event of the parent class when the mouse is moved over other controls. In this case, you need to use the HoverMove event. You need to set setAttribute (Qt::WA_Hover, true) first.

Qt encapsulated QDateTime date-time class is very powerful, it can convert string and date-time, millisecond and date-time, and 1970 seconds and date-time, etc.

QDateTime dateTime;QString dateTime_str = dateTime.currentDateTime (). ToString ("yyyy-MM-dd hh:mm:ss"); / / convert from a string to milliseconds (full year, month, day, hour, minute and second) datetime.fromString ("2011-09-10 12 toString 07 toString 541", "yyyy-MM-dd hh:mm:ss:zzz"). ToMSecsSinceEpoch () / / convert from string to second (full year, month, day, minute and second is required) datetime.fromString ("2011-09-10 12 toTime_t", "yyyy-MM-dd hh:mm:ss:zzz"). ToTime_t (); / / from millisecond to datetime.fromMSecsSinceEpoch (1315193829218). ToString ("yyyy-MM-dd hh:mm:ss:zzz") Datetime.fromTime_t (1315193829) .toString ("yyyy-MM-dd hh:mm:ss [: zzz]"); thank you for reading, the above is the content of "what are the development skills of Qt". After the study of this article, I believe you have a deeper understanding of what the development skills of Qt have, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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