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 input method V2018 by Qt

2025-03-31 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 input method V2018 by Qt". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "Qt how to implement the input method V2018"!

I. functional features

The input method framework of Qt system layer is not adopted, and the input switching mechanism is created.

Pure QWidget writing, support any target platform (pro-test windows, linux, embedded linux, etc.), support any Qt version (pro-test Qt4.6.0 to Qt5.11.2), support any compiler (pro-test mingw, gcc, msvc, etc.), support any control input, including web page input controls.

Call is very convenient, pri file call form, as long as it can be changed to include the file, for example, pro file to write include ($PWD/inputnew/inputnew.pri).

The interface is clear and simple, and the UI is beautiful and friendly, which is very suitable for touching devices.

Support physical keyboard input + mouse click input + touch input.

The input of controls such as text boxes in a web page in a browser embedded in the Qt program.

Mini mode, the interface size is set at will, and the layout is used to use any resolution.

Pure numeric keypad mode, free control pop-up complete input method panel and numeric keyboard panel, only need to set properties for the control. For example, ui- > txt- > setProperty ("flag", "number")

The control needs to display the input method and does not need to display the input method. When some controls do not need the pop-up input method, you only need to set the property noinput to true for the controls that do not need the pop-up input method. For example, ui- > txt- > setProperty ("noinput", true)

Adaptive screen size, when the pop-up position of the input method is at the bottom of the control, and automatically adjust the position when it exceeds the right or bottom of the desktop.

The function of pressing the pressed key repeatedly for more than 500 milliseconds is realized. For example, press the backspace key for a long time and delete it constantly.

Shift key toggles the input method, ESC key hides the input method, the space selects the first Chinese character, and enter selects the input pinyin. Consistent with Sogou Input's handling.

English, Chinese, numeric letters, upper and lower case, special characters are free to switch.

Support single spelling and double spelling phrase input, online most only support a single Chinese character input. Intelligent paging algorithm, you can turn the page to view Chinese character phrases.

It comes with 5 skin colors by default, which can be switched at will, and users can also customize the skin with QSS.

Font files can be large or small, providing mini font size only 120KB, convenient storage space tight hardware, full version font 25MB.

Optional Google kernel input method engine, font file 1MB, does not rely on the database, low resource consumption and high efficiency. Support fuzzy pinyin, such as nh= Hello.

Optional windows proprietary version, support external program input, such as input to notepad, QQ chat window, etc.

The number of lines of the entire input method code is about 1000 lines, which is very small and will not burden the program to increase its size.

The code structure is extremely clear, detailed comments, very easy to read and understand, but also can modify and expand custom requirements.

Second, the effect picture

At this point, I believe you have a deeper understanding of "Qt how to achieve the input method V2018". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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