CN106843528B - A kind of keyword reminding method improving Qt exploitation environment - Google Patents

A kind of keyword reminding method improving Qt exploitation environment Download PDF

Info

Publication number
CN106843528B
CN106843528B CN201710059729.XA CN201710059729A CN106843528B CN 106843528 B CN106843528 B CN 106843528B CN 201710059729 A CN201710059729 A CN 201710059729A CN 106843528 B CN106843528 B CN 106843528B
Authority
CN
China
Prior art keywords
auto
complete
keyword
request
list
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710059729.XA
Other languages
Chinese (zh)
Other versions
CN106843528A (en
Inventor
王卓妮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Kernel System Integration Co Ltd
Original Assignee
Nanjing Kernel System Integration Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Kernel System Integration Co Ltd filed Critical Nanjing Kernel System Integration Co Ltd
Priority to CN201710059729.XA priority Critical patent/CN106843528B/en
Publication of CN106843528A publication Critical patent/CN106843528A/en
Application granted granted Critical
Publication of CN106843528B publication Critical patent/CN106843528B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • G06F3/0233Character input methods
    • G06F3/0237Character input methods using prediction or retrieval techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms

Abstract

The present invention relates to field of software development, are based particularly on the exploitation of Qt text editing, specifically a kind of keyword reminding method for improving QT exploitation environment.It includes enabling request auto-complete timer;Into request auto-complete step;Into auto-complete step;Show auto-complete list;It chooses the data of auto-complete list and completion is in the position that user input, completion auto-complete and etc..The present invention can dynamically establish antistop list in memory, be updated after each end of input of user, assist user's input process, mitigate the memory to numerous words, improve input efficiency;And antistop list can be carried out to pinpoint highlighted coloring, while realizing and being prompted in real time in the cursor position of input.

Description

A kind of keyword reminding method improving Qt exploitation environment
Technical field:
The present invention relates to field of software development, are based particularly on the exploitation of Qt text editing, specifically a kind of improvement QT Develop the keyword reminding method of environment.
Background technique:
Qt is cross-platform application program and UI frame, including cross-platform class libraries, Integrated Development Tool and cross-platform IDE, Disposable development and application program is only needed, without source code is rewritten, can be disposed across different desktops and embedded OS These application programs.
In software development process, user often when inputting some word, only remembers the first half of word, only It can stop and go for word again;Or when inputting certain method names, the character length of word is very long, if using every time Place input again and again, not only waste unnecessary energy, also result in working efficiency and substantially reduce.At this time can Wish, if when input, it is only necessary to input preceding several letters of word, or the initial of the several words of input, just Corresponding candidate list prompt can be automatically carried out, what user to be done is only the selection needs from candidate queue, then Can auto-complete in the position of input, it is thus unnecessary to go to remember many variable names, method name etc..
Summary of the invention:
The technical problem to be solved by the present invention is to input word or method name in Qt exploitation environment for the prior art When exist fritter away energy, the disadvantages such as working efficiency is low, a kind of keyword reminding method of improvement Qt exploitation environment is provided.
The technical scheme adopted by the invention to solve the technical problem is that: a kind of keyword prompt improving Qt exploitation environment Method, it is characterised in that: include the following steps,
Step 1: detection has key pressing events;
Step 2: entering key pressing events and handle function;
Step 3: judging whether current file is read-only and content changes, and contain printable ASCII word in key Symbol;
If so, carrying out step 4;If not, terminating;
Step 4: judging whether character is letter, number or underscore;
If so, carrying out step 5;If not, terminating;
Step 5: judging whether auto-complete is carrying out;
If not, carrying out step 6;If so, terminating;
Step 6: enabling request auto-complete timer;
Step 7: entering request auto-complete step;
Step 8: entering auto-complete step;
Step 9: display auto-complete list;
Step 10: choosing the data of auto-complete list and completion is in the position that user inputs, complete auto-complete.
Further, in step 3, when keyboard inputs, detect that current file content has occurred that variation, into Enter grammer and highlight step comprising following steps: automatically extracting current file content by row, every row is packaged into one Block, sequence save;Then to block list traversal, symbol extraction is carried out to each block, the symbol extracted is put into symbol Number table tokens;Then the tokens list of generation is traversed again, by each symbol of traversal according to presetting pattern The text formatting of symbol is set.
Further, step 7 request auto-complete step the following steps are included:
S1: request auto-complete timer expiry signal;
S2: enter auto-complete timer expiry and handle function;
S3: stop request auto-complete timer;
S4: judge whether auto-complete really carries out;
If not, entering step S5;If so, terminating;
S5: judge whether the text for being still located at triggering;
If so, entering step S6;If not, terminating;
S6: the request of auto-complete is issued;
Preferably, the auto-complete timer clock period is 500ms.
Further, the auto-complete step following steps of step 8:
S11: auto-complete request is received;
S12: judge whether current editing machine supports auto-complete;
If so, entering step S13;If not, terminating;
S13: judge whether to meet auto-complete condition;
If so, entering step S14;If not, terminating;
S14: auto-complete segment is collected;
Preferably, it in step S14 when collecting auto-complete segment, is looked for three positions: firstly, finding coding language Say Keyword List;Secondly, being found in the customized macro, variable name of user and statement;Finally, in software default and user It is found in customized completion segment.
It is highly preferred that code speech Keyword List is int, double or float.
The present invention has the following beneficial effects: due to taking above-mentioned technical proposal
A kind of keyword reminding method improving Qt exploitation environment of the present invention, can dynamically establish in memory Antistop list is updated after each end of input of user, assists user's input process, mitigates the memory to numerous words, Improve input efficiency;And antistop list can be carried out to pinpoint highlighted coloring, while being realized in real time in the cursor position of input It is prompted.
Detailed description of the invention:
Fig. 1 is a kind of flow diagram for improving Qt and developing the keyword reminding method of environment of the present invention;
Fig. 2 is the structural schematic diagram of code editor of the present invention;
Fig. 3 is the flow diagram that grammer of the present invention highlights step;
Fig. 4 is the flow diagram of request auto-complete step of the present invention;
Fig. 5 is the flow diagram of auto-complete of the present invention.
Specific embodiment:
Below in conjunction with attached drawing, the content of the present invention will be further explained.
As shown in Figure 1, Figure 2, shown in Fig. 4 and Fig. 5, a kind of keyword prompt side improving Qt exploitation environment of the present invention Method, for assisting user to input keyword in Qt exploitation environment, which comprises the following steps:
Step 1: detection has key pressing events;
When there is keyboard to press, the keyword reminding method that Qt develops environment can be improved described in automatic trigger;
Step 2: entering key pressing events and handle function;
Step 3: judging whether current file is read-only and content changes, and contain printable ASCII word in key Symbol;
If being editable, while content changes and in key containing can if so, i.e. file is not a reading mode The ascii character of printing then carries out step 4;
If not, if i.e. file is a reading mode, be not editable perhaps editable but without content change or Editable simultaneously has content change but does not contain printable ascii character, then terminates;
In Fig. 2, the high-level code editing machine in the present invention includes text editor and syntax analyzer, and the text is compiled Collecting device includes text input module, segment collector, text highlighter and editing machine setup module, and the syntax analyzer includes Code completion device, grammer highlighter, lexical analyzer and class diagram generator;Wherein, code completion device can input user Information is matched and is automatically prompted, i.e., if there are some word, such as MyApplication in current document, when User is inputted again after the part of the word, such as Mya, then can show that the possibility of Mya beginning is used at corresponding cursor automatically The word list arrived, to be selected for user;Grammer highlighter can be to keyword, the custom variable etc. being related in programming It is subject to color, convenient for distinguishing, the content by category which can first call lexical analyzer to input user is extracted;Morphology Analyzer carries out analysis and symbol extraction to every row content of text;Class diagram generator is for extracting between user-defined class and class Relationship, form an inheritance tree, such as the relationship of MyItem Similar integral can be checked by left side inheritance tree, be conducive to User is helped quickly to be analyzed.The keyword reminding method of the present invention for improving Qt exploitation environment is by lexical analyzer Dynamic forms original word table to the content scanning of input and extracts type using syntax analyzer to original word table analysis Name, variable name, method name form different antistop lists, and call drawing engine, carry out pinpointing highlighted coloring to antistop list; Simultaneously check keyboard input time interval, be more than given threshold, trigger the extraction module of character string, to user input content into Row is minimum to be extracted, and is called KMP matching algorithm, is matched to the character string extracted with antistop list, and successful match column are returned Table is prompted in the cursor position of input in real time;It is defeated every time in user by dynamically establishing antistop list in memory It is updated after entering, assists user's input process, mitigate the memory to numerous words, improve input efficiency.
As shown in figure 3, in step 3, when keyboard input, detect that current file content has occurred that variation, Step is highlighted into grammer comprising following steps: automatically extracting current file content by row, every row is packaged into one Block (block), each block save every row content of text, and sequence saves;Then to block list traversal, to each Block, which carries out symbol extraction, such as a=3 int after lexical analyzer analyzes this journey text with lexical analyzer, to be extracted Keyword " int ", variable name " a ", operator "=", constant " 3 ", boundary's symbol ";", the symbol extracted is put into symbol table tokens; Then the tokens list of generation is traversed again, by each symbol of traversal according to the text of presetting pattern setting symbol This format.
Step 4: judging whether character is letter, number or underscore;
If so, carrying out step 5;If not, terminating;
Step 3 and step 4 are mainly used for ignoring non-alphabetical, nonnumeric and non-underscore character input, avoid because not Meeting character key entry causes method excessively frequently to be called.
Step 5: judging whether auto-complete is carrying out;
If not, carrying out step 6;If so, terminating;
After detection input meets condition, judge to request whether auto-complete timer has worked, if worked, Then terminate, i.e., this process terminates automatically, to avoid causing method to be frequently called because input is too fast, making efficiency instead It reduces.
Step 6: enabling request auto-complete timer;
If auto-complete timer is not working, start request auto-complete timer, when auto-complete timer After the clock period (500ms) arrives, again to local carry out condition judgement is inputted, if mouse or file status change, This completion work meaning has disappeared.
Step 7: entering request auto-complete step;
As shown in figure 4, after enabling request auto-complete timer, into request auto-complete step comprising following Step:
S1: request auto-complete timer expiry signal;
S2: enter auto-complete timer expiry and handle function;
S3: stop request auto-complete timer;
S4: judge whether auto-complete really carries out;
If not, entering step S5;If so, terminating;
S5: judge whether the text for being still located at triggering;
If so, entering step S6;If not, terminating;
S6: the request of auto-complete is issued.
Step 8: entering auto-complete step;
As shown in figure 5, after receiving auto-complete request, into auto-complete step comprising:
S11: auto-complete request is received;
S12: judge whether current editing machine supports auto-complete;
If so, entering step S13;If not, terminating;
S13: judge whether to meet auto-complete condition;
If so, entering step S14;If not, terminating;
S14: auto-complete segment is collected;
It when collecting auto-complete segment, is mainly looked for three positions: firstly, finding code speech key column Table, such as int, double or float etc.;Secondly, being found in the customized macro, variable name of user and statement;Finally, It is found in software default and the customized completion segment of user.
Step 9: display auto-complete list;
After character match caused by three positions in the input character extracted and step S14, by successful match Result summarize, and user input position show auto-complete list.
Step 10: completing auto-complete;
After step 9 completion list display, user can carry out switching up and down by directionkeys, choose some list number According to it is rear and press carriage return, automatically by the Supplementing Data chosen in the position that user inputs.
A kind of keyword reminding method improving Qt exploitation environment of the present invention is by moving after said one process Antistop list is established to state in memory, is updated after each end of input of user, and user's input process, mitigation pair are assisted The memory of numerous words improves input efficiency.
The above description is only an embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (6)

1. a kind of keyword reminding method for improving Qt exploitation environment, it is characterised in that: include the following steps,
Step 1: detection has key pressing events;
Step 2: entering key pressing events and handle function;
Step 3: judging whether current file is read-only and content changes, and contain printable ascii character in key;
If so, carrying out step 4;If not, terminating;
Step 4: judging whether character is letter, number or underscore;
If so, carrying out step 5;If not, terminating;
Step 5: judging whether auto-complete is carrying out;
If not, carrying out step 6;If so, terminating;
Step 6: enabling request auto-complete timer;
Step 7: entering request auto-complete step;
Step 8: entering auto-complete step;
Step 9: display auto-complete list;
Step 10: choosing the data of auto-complete list and completion is in the position that user inputs, complete auto-complete;
Wherein, step 7 request auto-complete step the following steps are included:
S1: request auto-complete timer expiry signal;
S2: enter auto-complete timer expiry and handle function;
S3: stop request auto-complete timer;
S4: judge whether auto-complete really carries out;
If not, entering step S5;If so, terminating;
S5: judge whether the text for being still located at triggering;
If so, entering step S6;If not, terminating;
S6: the request of auto-complete is issued.
2. the keyword reminding method according to claim 1 for improving Qt exploitation environment, it is characterised in that: in step 3, It when keyboard input, detects that current file content has occurred that variation, highlights step into grammer comprising following step It is rapid: automatically to extract current file content by row, every row is packaged into a block, and sequence saves;Then block is arranged Table traversal carries out symbol extraction to each block, and the symbol extracted is put into symbol table tokens;Then again to generation Tokens list is traversed, by each symbol of traversal according to the text formatting of presetting pattern setting symbol.
3. the keyword reminding method according to claim 1 for improving Qt exploitation environment, it is characterised in that: auto-complete is fixed When the device clock cycle be 500ms.
4. it is according to claim 1 improve Qt exploitation environment keyword reminding method, it is characterised in that: step 8 from Dynamic completion step following steps:
S11: auto-complete request is received;
S12: judge whether current editing machine supports auto-complete;
If so, entering step S13;If not, terminating;
S13: judge whether to meet auto-complete condition;
If so, entering step S14;If not, terminating;
S14: auto-complete segment is collected.
5. the keyword reminding method according to claim 4 for improving Qt exploitation environment, it is characterised in that: in step S14 It when collecting auto-complete segment, is looked for three positions: firstly, finding code speech Keyword List;Secondly, in user It is found in customized macro, variable name and statement;Finally, being found in software default and the customized completion segment of user.
6. the keyword reminding method according to claim 5 for improving Qt exploitation environment, it is characterised in that: code speech closes Key word list is int, double or float.
CN201710059729.XA 2017-01-24 2017-01-24 A kind of keyword reminding method improving Qt exploitation environment Active CN106843528B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710059729.XA CN106843528B (en) 2017-01-24 2017-01-24 A kind of keyword reminding method improving Qt exploitation environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710059729.XA CN106843528B (en) 2017-01-24 2017-01-24 A kind of keyword reminding method improving Qt exploitation environment

Publications (2)

Publication Number Publication Date
CN106843528A CN106843528A (en) 2017-06-13
CN106843528B true CN106843528B (en) 2019-05-28

Family

ID=59121942

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710059729.XA Active CN106843528B (en) 2017-01-24 2017-01-24 A kind of keyword reminding method improving Qt exploitation environment

Country Status (1)

Country Link
CN (1) CN106843528B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1560767A (en) * 2004-02-24 2005-01-05 珠海市汉易通信息科技有限公司 Automatic fully adding method for word input
CN101763216A (en) * 2009-12-28 2010-06-30 山东大学 Hand input method for Linux operational system
CN103123628A (en) * 2011-11-21 2013-05-29 腾讯科技(深圳)有限公司 Searching method and system for geographical location
CN103379217A (en) * 2012-04-28 2013-10-30 阿里巴巴集团控股有限公司 Method, device and sever for automatically complementing input contents in handheld device
CN104267829A (en) * 2014-10-16 2015-01-07 浪潮软件集团有限公司 Input method based on embedded QT

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1560767A (en) * 2004-02-24 2005-01-05 珠海市汉易通信息科技有限公司 Automatic fully adding method for word input
CN101763216A (en) * 2009-12-28 2010-06-30 山东大学 Hand input method for Linux operational system
CN103123628A (en) * 2011-11-21 2013-05-29 腾讯科技(深圳)有限公司 Searching method and system for geographical location
CN103379217A (en) * 2012-04-28 2013-10-30 阿里巴巴集团控股有限公司 Method, device and sever for automatically complementing input contents in handheld device
CN104267829A (en) * 2014-10-16 2015-01-07 浪潮软件集团有限公司 Input method based on embedded QT

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
基于Ajax 的自动补全检索框模型研究;余肖生等;《情报科学》;20110331;第29卷(第3期);第436-439页
基于Javascript 的校园社交网络系统的研究与开发;刘国东等;《电脑知识与技术》;20140430;第10卷(第11期);正文第2.1-2.2节
基于Linux下Qt/E的中文拼音输入法设计;何火胜等;《科技与创新》;20140105(第1期);第140-141页
基于QT 的跨平台虚拟键盘设计与实现;杜晓东等;《微型机与应用》;20150910;第34卷(第17期);第18-20、25页
基于Qt/E的嵌入式Linux中文输入法的设计与实现;陈晓雷等;《郑州轻工业学院学报(自然科学版)》;20091231;第24卷(第6期);第5-8页
基于嵌入式Linux和Qt4的中文输入法的实现与改进;章坚武等;《电子器件》;20100620;第33卷(第3期);正文第3节

Also Published As

Publication number Publication date
CN106843528A (en) 2017-06-13

Similar Documents

Publication Publication Date Title
CN101398758B (en) Detection method of code copy
CN107832229A (en) A kind of system testing case automatic generating method based on NLP
CN104317589B (en) A kind of code automatic generation method and device for being used to load dynamic link library
CN104240701A (en) Method for controlling washing machine to work through voice of Chinese natural person
CA2996736C (en) Automated document analysis comprising company name recognition
CN105117159B (en) A kind of character processing method and terminal
CN102937864A (en) Method and device for determining selected texts on touch terminals
CN112882408B (en) Online editing method and device for ST text language
CN101493727A (en) Natural participle and mixing input by statement input method
CN106202013B (en) A kind of implementation method of webpage version EXCEL
CN102541843A (en) Device and method for improving mechanical translation quality
CN105389303B (en) A kind of automatic fusion method of heterologous corpus
CN106843528B (en) A kind of keyword reminding method improving Qt exploitation environment
CN103838458B (en) Mobile terminal and control method of input method of mobile terminal
US20060143555A1 (en) Apparatus and method for extracting information from a formatted document
CN113419721A (en) Web-based expression editing method, device, equipment and storage medium
CN104731766A (en) Alphabetic writing lexicon establishing method, alphabetic writing lexicon establishing device, inputting method and inputting system
CN107239264A (en) The generation method and device of code prompt message
CN109344385B (en) Natural language processing method, device, computer equipment and storage medium
JP5181502B2 (en) Character processing apparatus, character processing method and program
CN113360766A (en) Java method name recommendation method based on seq2seq model
CN106293776B (en) A kind of electric system EMTPE auxiliary compiling system
CN101727200A (en) Processing method and device based on input behavior
CN112540682A (en) Intelligent translation input method based on machine translation result
CN104641367A (en) Formatting module, system and method for formatting an electronic character sequence

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant