A method, apparatus, device, and storage medium for constructing a QT interface hierarchy.

By creating an initial framework interface and obtaining the target display layer, the QT interface hierarchy management is simplified, solving the problem of cumbersome interface hierarchy management in existing technologies and improving the efficiency of interface management.

CN116339734BActive Publication Date: 2025-10-31BEI DOU ZHI LIAN KE JI YOU XIAN GONG SI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310335553.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-29
Publication Date
2025-10-31
Estimated Expiration
2043-03-29

AI Technical Summary

Technical Problem

In existing technologies, QT interface hierarchy management is cumbersome, requiring frequent calls to control methods to manage the interface hierarchy, resulting in tedious operations.

Method used

The framework interface is created and initialized by responding to the framework interface creation command. The human-computer interaction interface display command is detected, the target display layer is obtained, and human-computer interaction interface control objects are created for the parent window component based on the target framework interface and added to the target display layer.

Benefits of technology

It simplifies the interface hierarchy management process and improves the efficiency and convenience of interface management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116339734B_ABST
    Figure CN116339734B_ABST
Patent Text Reader

Abstract

This invention provides a method, apparatus, device, and storage medium for constructing a QT interface hierarchy, comprising: responding to a framework interface creation instruction, creating an initialization framework interface according to the framework interface creation instruction; if a human-computer interaction interface display instruction is detected, obtaining the target display layer of the human-computer interaction interface according to the human-computer interaction interface display instruction; obtaining the target framework interface in the initialization framework interface according to the target display layer, and creating human-computer interaction interface control objects for the parent window component based on the target framework interface; and adding the human-computer interaction interface control objects to the target display layer of the human-computer interaction interface. This method simplifies interface hierarchy management by creating an initialization framework interface, obtaining the target framework interface in the initialization framework interface according to the target display layer, and creating human-computer interaction interface control objects based on the target framework interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer software technology, and in particular to a method, apparatus, device, and storage medium for constructing a QT interface hierarchy. Background Technology

[0002] With the rapid development of user interface applications, Qt, as a cross-platform software development framework, has been widely used. Furthermore, with the rapid advancement of computer software technology, software interfaces are becoming increasingly numerous and their display logic increasingly complex; however, Qt lacks built-in interface hierarchy management logic.

[0003] Currently, there are four methods for controlling the interface hierarchy using QT.

[0004] The first method involves calling the `raise()` method of `QWidget` to raise `QWidget` to the top level of its parent class.

[0005] The second method: Lower the QWidget to the lowest level of its parent class by calling the QWidget's lower() method.

[0006] The third method: Descend the QWidget to the lower level of the parameter by calling the QWidget's stackUnder(QWidget*) method.

[0007] The fourth method: Call the QWidget's setWindowFlags(Qt::WindowType, bool on=true) method and pass in the parameter Qt::WindowStayOnTopHint.

[0008] The above four methods will become invalid after the original interface is displayed when other QWidgets are added to their parent class. This means that the above methods of calling QT to control the interface hierarchy must be used every time the interface is displayed, which is quite cumbersome. Summary of the Invention

[0009] This invention provides a method, apparatus, device, and storage medium for constructing QT interface layers, aiming to solve the problem of cumbersome interface layer management in the prior art.

[0010] In a first aspect, embodiments of the present invention provide a method for constructing a QT interface hierarchy, comprising:

[0011] In response to the framework interface creation instruction, an initialization framework interface is created according to the framework interface creation instruction;

[0012] If a human-computer interaction interface display command is detected, the target display layer of the human-computer interaction interface is obtained according to the human-computer interaction interface display command.

[0013] The target frame interface in the initialization frame interface is obtained according to the target display layer, and a human-computer interaction interface control object is created for the parent window component based on the target frame interface.

[0014] Add the human-computer interaction interface control object to the target display layer of the human-computer interaction interface.

[0015] Secondly, embodiments of the present invention provide a QT interface hierarchy construction apparatus, comprising:

[0016] The first creation unit is used to respond to the framework interface creation instruction and create an initialization framework interface according to the framework interface creation instruction;

[0017] The acquisition unit is used to acquire the target display layer of the human-computer interaction interface according to the human-computer interaction interface display instruction if a human-computer interaction interface display instruction is detected.

[0018] The second creation unit is used to obtain the target frame interface in the initialization frame interface according to the target display layer, and create human-computer interaction interface control objects for the parent window component based on the target frame interface.

[0019] The adding unit is used to add the human-computer interaction interface control object to the target display layer of the human-computer interaction interface.

[0020] Thirdly, embodiments of the present invention provide a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the QT interface hierarchy construction method described in the first aspect.

[0021] Fourthly, embodiments of the present invention also provide a computer-readable storage medium, wherein the storage medium stores a computer program, the computer program including program instructions, and the program instructions, when executed by a processor, can implement the QT interface hierarchy construction method described in the first aspect.

[0022] This invention provides a method, apparatus, device, and storage medium for constructing a QT interface hierarchy, comprising: responding to a framework interface creation instruction, creating an initialization framework interface according to the framework interface creation instruction; if a human-computer interaction interface display instruction is detected, obtaining a target display layer of the human-computer interaction interface according to the human-computer interaction interface display instruction; obtaining a target framework interface in the initialization framework interface according to the target display layer, and creating a human-computer interaction interface control object as a parent window component based on the target framework interface; and adding the human-computer interaction interface control object to the target display layer of the human-computer interaction interface. This method simplifies interface hierarchy management by creating an initialization framework interface, obtaining the target framework interface in the initialization framework interface according to the target display layer, and creating a human-computer interaction interface control object based on the target framework interface. Attached Figure Description

[0023] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 A flowchart illustrating the QT interface hierarchy construction method provided in this embodiment of the invention;

[0025] Figure 2 A schematic block diagram of a QT interface hierarchy construction device provided in an embodiment of the present invention;

[0026] Figure 3 A schematic block diagram of a computer device provided for an embodiment of the present invention. Detailed Implementation

[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0028] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0029] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0030] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0031] This invention is a technical solution implemented by a computer program. Based on the QT development platform (QT is a cross-platform C++ graphical user interface application framework developed by Nokia. It provides application developers with all the functionality needed to create state-of-the-art graphical user interfaces. QT is fully object-oriented, easily extensible, and allows true component programming), it uses object-oriented C++ classes to build user interfaces (UI) for electronic devices with interactive interfaces, such as applications in a car dashboard, thereby providing users with a better visual experience.

[0032] Please see Figure 1 , Figure 1 This is a flowchart illustrating the QT interface hierarchy construction method provided in an embodiment of the present invention. The QT interface hierarchy construction method is applied to an electronic device with a human-computer interaction interface. The method executes an application installed on the electronic device with the human-computer interaction interface.

[0033] like Figure 1 As shown, the method includes steps S110 to S140.

[0034] S110. In response to the framework interface creation instruction, create an initialization framework interface according to the framework interface creation instruction.

[0035] In this embodiment, when constructing the human-computer interaction interface of an application on an electronic device, the electronic device detects a framework interface creation instruction and executes the framework interface creation instruction in response to it. It then initializes and creates multiple framework interfaces according to the framework interface creation instruction. More specifically, the multiple framework interfaces include at least two framework interfaces, and the initialization framework interface is built through the association relationship of the multiple framework interfaces so as to subsequently create human-computer interaction interface control objects.

[0036] In one embodiment, step S110 includes:

[0037] Obtain the total number of frames corresponding to the frame interface creation instruction;

[0038] Based on the total number of layers of the framework interface, a corresponding number of framework interfaces are created sequentially from the bottom layer to the top layer to obtain the initial framework interface;

[0039] In the initialization frame interface, the frame interface located at the upper layer in each pair of adjacent frame interfaces takes the frame interface located at the lower layer as its parent window component.

[0040] In this embodiment, before creating the initialization framework interface, the framework interface creation instruction must be obtained to determine the total number of framework interface layers corresponding to the instruction. Then, based on the total number of framework interface layers, a corresponding number of framework interfaces are created sequentially from the bottom layer to the top layer, thus obtaining the constructed initialization framework interface. Furthermore, in the initialization framework interface, the upper layer interface is created based on the lower layer interface as its parent window component.

[0041] For example, if the total number of frame interface layers corresponding to the frame interface creation instruction is 3, then the frame interface in the initialization frame interface is set with a first frame interface, a second frame interface, and a third frame interface in sequence from the bottom layer to the top layer. Specifically, the first frame interface is created through the frame interface creation instruction; the first frame interface is obtained, and a second frame interface is created for the parent window component based on the first frame interface; the second frame interface is obtained, and a third frame interface is created for the parent window component based on the second frame interface.

[0042] In one embodiment, the step of creating a corresponding number of frame interfaces sequentially from the bottom to the top based on the total number of frame interface layers to obtain the initial frame interface includes:

[0043] If it is determined that the total number of layers of the frame interface is greater than 1, then in response to the first frame interface creation sub-instruction, the first frame interface is created accordingly based on the first frame interface creation sub-instruction;

[0044] In response to the sub-instruction for creating the i-th frame interface, the i-th frame interface is created based on the sub-instruction for creating the i-th frame interface; wherein, the initial value of i is 2, and the value range of i is [2, N], and N represents the total number of layers of the frame interface;

[0045] Construct the association relationship between the i-th frame interface and the (i-1)-th frame interface as the parent window component;

[0046] Increment i by 1 to update the value of i;

[0047] If it is determined that i does not exceed N, then return to the step of creating the i-th frame interface in response to the i-th frame interface creation sub-instruction and creating the i-th frame interface based on the i-th frame interface creation sub-instruction;

[0048] If it is determined that i exceeds N, then obtain the first frame interface to the Nth frame interface and assemble the initialization frame interface.

[0049] In this embodiment, the framework interface creation instruction includes multiple framework interface creation sub-instructions, and creates a corresponding number of framework interfaces in sequence based on the total number of framework interface layers.

[0050] For example, when the total number of frames is determined to be 3, meaning the total number of frames is greater than 1, in response to the first frame interface creation sub-instruction, a first window component object is created based on the first frame interface creation sub-instruction as the first frame interface; and in response to the second frame interface creation sub-instruction, a second frame interface is created based on the second frame interface creation sub-instruction; wherein, the second frame interface is created with the first frame interface as the parent window component; at this time, the number of frames does not exceed the total number of frames, so more frames will be added, thereby executing the response to the third frame interface creation sub-instruction, creating a third frame interface based on the third frame interface creation sub-instruction, wherein, the third frame interface is created with the second frame interface as the parent window component. At this time, the number of frames equals the total number of frames, so the first to third frame interfaces are obtained and combined to form the initial frame interface.

[0051] In one embodiment, step S110 is followed by:

[0052] The total number of frames in the initialization framework interface and the interface name information of each frame interface are displayed.

[0053] In this embodiment, after obtaining the total number of framework interface layers corresponding to the framework interface creation instruction, and after initializing the framework interface based on the total number of framework interface layers, the interface name corresponding to each framework interface in the total number of framework interface layers is obtained and displayed intuitively in a list form for user query.

[0054] S120. If a human-computer interaction interface display command is detected, the target display layer of the human-computer interaction interface is obtained according to the human-computer interaction interface display command.

[0055] In this embodiment, after the initialization framework interface is built, when the application of the electronic device detects the human-computer interaction interface display instruction, it obtains the target display layer of the human-computer interaction interface according to the human-computer interaction interface display instruction, thereby locating the display position of the human-computer interaction interface, so that the corresponding framework interface can be called to create interface control objects for the parent window component according to the target display layer of the human-computer interaction interface.

[0056] In one embodiment, step S120 includes:

[0057] If the total number of display layers corresponding to the human-computer interaction interface display instruction is less than or equal to the total number of layers of the frame interface, then the target display layer is obtained according to the human-computer interaction interface display instruction.

[0058] If the total number of display layers corresponding to the human-computer interaction interface display instruction is greater than the total number of layers of the framework interface, then the initial framework interface is updated based on the total number of display layers corresponding to the human-computer interaction interface display instruction, and the target display layer is obtained according to the human-computer interaction interface display instruction.

[0059] In this embodiment, to better construct the initialization framework interface, it can be flexibly updated. This is achieved by determining whether the total number of display layers corresponding to the human-computer interaction interface display command is greater than the total number of layers in the framework interface; if so, the initialization framework interface is updated. Specifically, if the total number of display layers corresponding to the human-computer interaction interface display command is less than or equal to the total number of layers in the framework interface, the target display layer is obtained based on the total number of display layers corresponding to the human-computer interaction interface display command; if the total number of display layers corresponding to the human-computer interaction interface display command is greater than the total number of layers in the framework interface, the initialization framework interface is updated based on the total number of display layers corresponding to the human-computer interaction interface display command, and the target display layer is obtained based on the total number of display layers corresponding to the human-computer interaction interface display command. This ensures that the total number of display layers corresponding to the human-computer interaction interface display command is equal to the total number of layers in the framework interface, thus achieving the update of the initialization framework interface.

[0060] In one embodiment, updating the initialization framework interface based on the total number of display layers corresponding to the human-computer interaction interface display command includes:

[0061] Obtain the first difference between the total number of display layers corresponding to the human-computer interaction interface display instructions and the total number of layers of the framework interface;

[0062] Based on the first difference, the same number of frame interfaces are added sequentially from the bottom layer to the top layer.

[0063] In this embodiment, if the total number of display layers corresponding to the human-computer interaction interface display command exceeds the total number of frame interface layers, then based on the first difference between the total number of display layers corresponding to the human-computer interaction interface display command and the total number of frame interface layers, a number of frame interfaces are added sequentially from the bottom layer to the top layer, with the same number of differences as the first difference, to update the initial frame interface. For example, when the total number of display layers corresponding to the human-computer interaction interface display command is 4, and the total number of frame interface layers is 3, the difference between the two is 1. Therefore, a window component object is created with the third frame interface as the parent window component as the fourth frame interface, thereby updating the first, second, and third frame interfaces to a new initial frame interface composed of the first, second, third, and fourth frame interfaces.

[0064] S130. Obtain the target frame interface in the initialization frame interface according to the target display layer, and create a human-computer interaction interface control object for the parent window component based on the target frame interface.

[0065] In this embodiment, after the initial framework interface is built, it is only necessary to create a human-computer interaction interface control object as the parent window component based on the target framework interface corresponding to the location where the human-computer interaction interface of the application in the electronic device is to be displayed (i.e., the target display layer), thereby simplifying hierarchical management. For example, if the target display layer of the human-computer interaction interface is the top layer, then a first human-computer interaction interface control object is created based on the first target framework interface as the parent window component. The human-computer interaction interface control object includes visual interface elements such as buttons, images, text boxes, tabs, toolbars, and status bars.

[0066] In one embodiment, step S130 includes:

[0067] Obtain the first index of the target display layer, and calculate the second index of the frame interface based on the first index of the target display layer according to the preset calculation strategy;

[0068] The target frame interface in the initialization frame interface is obtained according to the second sequence number of the frame interface.

[0069] The calculation formula for the preset calculation strategy is m = N + 1 - j; where m represents the second sequence number of the frame interface, j represents the first sequence number of the target display layer, and N represents the total number of layers of the frame interface.

[0070] In this embodiment, to obtain the target frame interface, the first sequence number of the target display layer is first obtained, and the second sequence number of the frame interface is obtained by adding 1 to the total number of frame interface layers and subtracting the first sequence number of the target display layer through a preset calculation strategy. Then, the target frame interface corresponding to it in the initialized frame interface is obtained based on the second sequence number of the frame interface. The human-computer interaction interface control object on the first sequence number of the target display layer and the target frame interface on the second sequence number of the frame interface have a mirror-symmetric mapping relationship.

[0071] S140. Add the human-computer interaction interface control object to the target display layer of the human-computer interaction interface.

[0072] In this embodiment, the target frame interface in the initialization frame interface is obtained through the target display layer, and a human-computer interaction interface control object is created for the parent window component based on the target frame interface. Then, the human-computer interaction interface control object is obtained and added to the target display layer of the human-computer interaction interface, so that the human-computer interaction interface control object created with the target frame interface can be added to the corresponding target display layer. The human-computer interaction interface control object includes visual interface elements such as buttons, pictures, text boxes, tabs, toolbars, and status bars.

[0073] This method simplifies interface hierarchy management by creating an initialization framework interface, obtaining the target framework interface from the initialization framework interface based on the target display layer, and creating human-computer interaction interface control objects based on the target framework interface.

[0074] This invention also provides a QT interface hierarchy construction apparatus, which is used to execute any embodiment of the aforementioned QT interface hierarchy construction method. Specifically, please refer to... Figure 2 , Figure 2 This is a schematic block diagram of a QT interface hierarchy construction device provided in an embodiment of the present invention. This QT interface hierarchy construction device can be configured in an electronic device with a human-computer interaction interface.

[0075] like Figure 2 As shown, the QT interface hierarchy construction device 100 includes: a first creation unit 110, an acquisition unit 120, a second creation unit 130, and an addition unit 140.

[0076] The first creation unit 110 is used to respond to the framework interface creation instruction and create an initialization framework interface according to the framework interface creation instruction.

[0077] In this embodiment, when constructing the human-computer interaction interface of an application on an electronic device, the electronic device detects a framework interface creation instruction and executes the framework interface creation instruction in response to it. It then initializes and creates multiple framework interfaces according to the framework interface creation instruction. More specifically, the multiple framework interfaces include at least two framework interfaces, and the initialization framework interface is built through the association relationship of the multiple framework interfaces so as to subsequently create human-computer interaction interface control objects.

[0078] In one embodiment, the first creation unit 110 includes:

[0079] Obtain the total number of frames corresponding to the frame interface creation instruction;

[0080] Based on the total number of layers of the framework interface, a corresponding number of framework interfaces are created sequentially from the bottom layer to the top layer to obtain the initial framework interface;

[0081] In the initialization frame interface, the frame interface located at the upper layer in each pair of adjacent frame interfaces takes the frame interface located at the lower layer as its parent window component.

[0082] In this embodiment, before creating the initialization framework interface, the framework interface creation instruction must be obtained to determine the total number of framework interface layers corresponding to the instruction. Then, based on the total number of framework interface layers, a corresponding number of framework interfaces are created sequentially from the bottom layer to the top layer, thus obtaining the constructed initialization framework interface. Furthermore, in the initialization framework interface, the upper layer interface is created based on the lower layer interface as its parent window component.

[0083] For example, if the total number of frame interface layers corresponding to the frame interface creation instruction is 3, then the frame interface in the initialization frame interface is set with a first frame interface, a second frame interface, and a third frame interface in sequence from the bottom layer to the top layer. Specifically, the first frame interface is created through the frame interface creation instruction; the first frame interface is obtained, and a second frame interface is created for the parent window component based on the first frame interface; the second frame interface is obtained, and a third frame interface is created for the parent window component based on the second frame interface.

[0084] In one embodiment, the step of creating a corresponding number of frame interfaces sequentially from the bottom to the top based on the total number of frame interface layers to obtain the initial frame interface includes:

[0085] If it is determined that the total number of layers of the frame interface is greater than 1, then in response to the first frame interface creation sub-instruction, the first frame interface is created accordingly based on the first frame interface creation sub-instruction;

[0086] In response to the sub-instruction for creating the i-th frame interface, the i-th frame interface is created based on the sub-instruction for creating the i-th frame interface; wherein, the initial value of i is 2, and the value range of i is [2, N], and N represents the total number of layers of the frame interface;

[0087] Construct the association relationship between the i-th frame interface and the (i-1)-th frame interface as the parent window component;

[0088] Increment i by 1 to update the value of i;

[0089] If it is determined that i does not exceed N, then return to the step of creating the i-th frame interface in response to the i-th frame interface creation sub-instruction and creating the i-th frame interface based on the i-th frame interface creation sub-instruction;

[0090] If it is determined that i exceeds N, then obtain the first frame interface to the Nth frame interface and assemble the initialization frame interface.

[0091] In this embodiment, the framework interface creation instruction includes multiple framework interface creation sub-instructions, and creates a corresponding number of framework interfaces in sequence based on the total number of framework interface layers.

[0092] For example, when the total number of frames is determined to be 3, meaning the total number of frames is greater than 1, in response to the first frame interface creation sub-instruction, a first window component object is created based on the first frame interface creation sub-instruction as the first frame interface; and in response to the second frame interface creation sub-instruction, a second frame interface is created based on the second frame interface creation sub-instruction; wherein, the second frame interface is created with the first frame interface as the parent window component; at this time, the number of frames does not exceed the total number of frames, so more frames will be added, thereby executing the response to the third frame interface creation sub-instruction, creating a third frame interface based on the third frame interface creation sub-instruction, wherein, the third frame interface is created with the second frame interface as the parent window component. At this time, the number of frames equals the total number of frames, so the first to third frame interfaces are obtained and combined to form the initial frame interface.

[0093] In one embodiment, the first creation unit 110 is followed by:

[0094] The total number of frames in the initialization framework interface and the interface name information of each frame interface are displayed.

[0095] In this embodiment, after obtaining the total number of framework interface layers corresponding to the framework interface creation instruction, and after initializing the framework interface based on the total number of framework interface layers, the interface name corresponding to each framework interface in the total number of framework interface layers is obtained and displayed intuitively in a list form for user query.

[0096] The acquisition unit 120 is used to acquire the target display layer of the human-computer interaction interface according to the human-computer interaction interface display instruction if a human-computer interaction interface display instruction is detected.

[0097] In this embodiment, after the initialization framework interface is built, when the application of the electronic device detects the human-computer interaction interface display instruction, it obtains the target display layer of the human-computer interaction interface according to the human-computer interaction interface display instruction, thereby locating the display position of the human-computer interaction interface, so that the corresponding framework interface can be called to create interface control objects for the parent window component according to the target display layer of the human-computer interaction interface.

[0098] In one embodiment, the acquisition unit 120 includes:

[0099] If the total number of display layers corresponding to the human-computer interaction interface display instruction is less than or equal to the total number of layers of the frame interface, then the target display layer is obtained according to the human-computer interaction interface display instruction.

[0100] If the total number of display layers corresponding to the human-computer interaction interface display instruction is greater than the total number of layers of the framework interface, then the initial framework interface is updated based on the total number of display layers corresponding to the human-computer interaction interface display instruction, and the target display layer is obtained according to the human-computer interaction interface display instruction.

[0101] In this embodiment, to better construct the initialization framework interface, it can be flexibly updated. This is achieved by determining whether the total number of display layers corresponding to the human-computer interaction interface display command is greater than the total number of layers in the framework interface; if so, the initialization framework interface is updated. Specifically, if the total number of display layers corresponding to the human-computer interaction interface display command is less than or equal to the total number of layers in the framework interface, the target display layer is obtained based on the total number of display layers corresponding to the human-computer interaction interface display command; if the total number of display layers corresponding to the human-computer interaction interface display command is greater than the total number of layers in the framework interface, the initialization framework interface is updated based on the total number of display layers corresponding to the human-computer interaction interface display command, and the target display layer is obtained based on the total number of display layers corresponding to the human-computer interaction interface display command. This ensures that the total number of display layers corresponding to the human-computer interaction interface display command is equal to the total number of layers in the framework interface, thus achieving the update of the initialization framework interface.

[0102] In one embodiment, updating the initialization framework interface based on the total number of display layers corresponding to the human-computer interaction interface display command includes:

[0103] Obtain the first difference between the total number of display layers corresponding to the human-computer interaction interface display instructions and the total number of layers of the framework interface;

[0104] Based on the first difference, the same number of frame interfaces are added sequentially from the bottom layer to the top layer.

[0105] In this embodiment, if the total number of display layers corresponding to the human-computer interaction interface display command exceeds the total number of frame interface layers, then based on the first difference between the total number of display layers corresponding to the human-computer interaction interface display command and the total number of frame interface layers, a number of frame interfaces are added sequentially from the bottom layer to the top layer, with the same number of differences as the first difference, to update the initial frame interface. For example, when the total number of display layers corresponding to the human-computer interaction interface display command is 4, and the total number of frame interface layers is 3, the difference between the two is 1. Therefore, a window component object is created with the third frame interface as the parent window component as the fourth frame interface, thereby updating the first, second, and third frame interfaces to a new initial frame interface composed of the first, second, third, and fourth frame interfaces.

[0106] The second creation unit 130 is used to obtain the target frame interface in the initialization frame interface according to the target display layer, and create a human-computer interaction interface control object for the parent window component based on the target frame interface.

[0107] In this embodiment, after the initial framework interface is built, it is only necessary to create a human-computer interaction interface control object as the parent window component based on the target framework interface corresponding to the location where the human-computer interaction interface of the application in the electronic device is to be displayed (i.e., the target display layer), thereby simplifying hierarchical management. For example, if the target display layer of the human-computer interaction interface is the top layer, then a first human-computer interaction interface control object is created based on the first target framework interface as the parent window component. The human-computer interaction interface control object includes visual interface elements such as buttons, images, text boxes, tabs, toolbars, and status bars.

[0108] In one embodiment, the second creation unit 130 includes:

[0109] Obtain the first index of the target display layer, and calculate the second index of the frame interface based on the first index of the target display layer according to the preset calculation strategy;

[0110] The target frame interface in the initialization frame interface is obtained according to the second sequence number of the frame interface.

[0111] The calculation formula for the preset calculation strategy is m = N + 1 - j; where m represents the second sequence number of the frame interface, j represents the first sequence number of the target display layer, and N represents the total number of layers of the frame interface.

[0112] In this embodiment, to obtain the target frame interface, the first sequence number of the target display layer is first obtained, and the second sequence number of the frame interface is obtained by adding 1 to the total number of frame interface layers and subtracting the first sequence number of the target display layer through a preset calculation strategy. Then, the target frame interface corresponding to it in the initialized frame interface is obtained based on the second sequence number of the frame interface. The human-computer interaction interface control object on the first sequence number of the target display layer and the target frame interface on the second sequence number of the frame interface have a mirror-symmetric mapping relationship.

[0113] The adding unit 140 is used to add the human-computer interaction interface control object to the target display layer of the human-computer interaction interface.

[0114] In this embodiment, the target frame interface in the initialization frame interface is obtained through the target display layer, and a human-computer interaction interface control object is created for the parent window component based on the target frame interface. Then, the human-computer interaction interface control object is obtained and added to the target display layer of the human-computer interaction interface, so that the human-computer interaction interface control object created with the target frame interface can be added to the corresponding target display layer. The human-computer interaction interface control object includes visual interface elements such as buttons, pictures, text boxes, tabs, toolbars, and status bars.

[0115] The device simplifies interface hierarchy management by creating an initialization framework interface, obtaining the target framework interface in the initialization framework interface according to the target display layer, and creating human-computer interaction interface control objects based on the target framework interface.

[0116] The aforementioned QT interface hierarchy construction device can be implemented as a computer program, which can be used in, for example... Figure 3 It runs on the computer device shown.

[0117] Please see Figure 3 , Figure 3 This is a schematic block diagram of a computer device provided in an embodiment of the present invention. The computer device 500 is a server, which can be a standalone server or a server cluster composed of multiple servers.

[0118] See Figure 3 The computer device 500 includes a processor 502, a memory, and a network interface 505 connected via a system bus 501. The memory may include a non-volatile storage medium 503 and internal memory 504.

[0119] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, it causes the processor 502 to execute the QT interface hierarchy construction method.

[0120] The processor 502 provides computing and control capabilities to support the operation of the entire computer device 500.

[0121] The internal memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute the QT interface hierarchy construction method.

[0122] This network interface 505 is used for network communication, such as providing data transmission. Those skilled in the art will understand that... Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the computer device 500 to which the present invention is applied. The specific computer device 500 may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0123] The processor 502 is used to run a computer program 5032 stored in a memory to implement the QT interface hierarchy construction method disclosed in this embodiment of the invention.

[0124] Those skilled in the art will understand that Figure 3 The embodiments of the computer device shown do not constitute a limitation on the specific configuration of the computer device. In other embodiments, the computer device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements. For example, in some embodiments, the computer device may include only memory and a processor. In such embodiments, the structure and function of the memory and processor are different from those shown. Figure 3 The embodiments shown are consistent and will not be described again here.

[0125] It should be understood that, in this embodiment of the invention, the processor 502 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0126] In another embodiment of the present invention, a computer-readable storage medium is provided. This computer-readable storage medium may be a non-volatile computer-readable storage medium. The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the QT interface hierarchy construction method disclosed in this embodiment of the present invention.

[0127] Those skilled in the art will readily understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention.

[0128] In the embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Units with the same function may be grouped into one unit. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, or it may be an electrical, mechanical, or other form of connection.

[0129] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention, depending on actual needs.

[0130] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0131] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks.

[0132] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for constructing a QT interface hierarchy, characterized in that, include: In response to the framework interface creation instruction, an initialization framework interface is created according to the framework interface creation instruction; If a human-computer interaction interface display command is detected, the target display layer of the human-computer interaction interface is obtained according to the human-computer interaction interface display command. The target frame interface in the initialization frame interface is obtained according to the target display layer, and a human-computer interaction interface control object is created for the parent window component based on the target frame interface. Add the human-computer interaction interface control object to the target display layer of the human-computer interaction interface; If a human-computer interaction interface display command is detected, the target display layer of the human-computer interaction interface is obtained according to the human-computer interaction interface display command. The method further includes: If the total number of display layers corresponding to the human-computer interaction interface display instruction is less than or equal to the total number of layers of the frame interface, then the target display layer is obtained according to the human-computer interaction interface display instruction. If the total number of display layers corresponding to the human-computer interaction interface display instruction is greater than the total number of frame interface layers, then the initial frame interface is updated based on the total number of display layers corresponding to the human-computer interaction interface display instruction, and the target display layer is obtained according to the human-computer interaction interface display instruction. Updating the initialization framework interface based on the total number of display layers corresponding to the human-computer interaction interface display command includes: Obtain the first difference between the total number of display layers corresponding to the human-computer interaction interface display instructions and the total number of layers of the framework interface; Based on the first difference, the same number of frame interfaces are added sequentially from the bottom layer to the top layer.

2. The QT interface hierarchy construction method according to claim 1, characterized in that, The step of creating an initialization framework interface according to the framework interface creation instructions includes: Obtain the total number of frames corresponding to the frame interface creation instruction; Based on the total number of frames in the frame interface, a corresponding number of frames are created sequentially from the bottom to the top to obtain the initial frame interface; wherein, in each pair of adjacent frames in the initial frame interface, the frame interface located on the top layer takes the frame interface located on the bottom layer as its parent window component.

3. The QT interface hierarchy construction method according to claim 2, characterized in that, The process of creating a corresponding number of frame interfaces from bottom to top based on the total number of frame interfaces to obtain the initial frame interface includes: If it is determined that the total number of layers of the frame interface is greater than 1, then in response to the first frame interface creation sub-instruction, the first frame interface is created accordingly based on the first frame interface creation sub-instruction; In response to the sub-instruction for creating the i-th frame interface, the i-th frame interface is created based on the sub-instruction for creating the i-th frame interface; wherein, the initial value of i is 2, and the value range of i is [2, N], and N represents the total number of layers of the frame interface; Construct the association relationship between the i-th frame interface and the (i-1)-th frame interface as the parent window component; Increment i by 1 to update the value of i; If it is determined that i does not exceed N, then return to the step of creating the i-th frame interface in response to the i-th frame interface creation sub-instruction and creating the i-th frame interface based on the i-th frame interface creation sub-instruction; If it is determined that i exceeds N, then obtain the first frame interface to the Nth frame interface and form the initialization frame interface.

4. The QT interface hierarchy construction method according to claim 2, characterized in that, After responding to the framework interface creation instruction and creating an initialization framework interface according to the framework interface creation instruction, the method further includes: The total number of frames in the initialization framework interface and the interface name information of each frame interface are displayed.

5. The QT interface hierarchy construction method according to claim 1, characterized in that, The step of obtaining the target frame interface in the initialization frame interface according to the target display layer includes: Obtain the first index of the target display layer, and calculate the second index of the frame interface based on the first index of the target display layer according to the preset calculation strategy; The target frame interface in the initialization frame interface is obtained according to the second sequence number of the frame interface. The calculation formula for the preset calculation strategy is m = N + 1 - j; where m represents the second sequence number of the frame interface, j represents the first sequence number of the target display layer, and N represents the total number of layers of the frame interface.

6. A QT interface hierarchy construction device, characterized in that, include: The first creation unit is used to respond to the framework interface creation instruction and create an initialization framework interface according to the framework interface creation instruction; The acquisition unit is used to acquire the target display layer of the human-computer interaction interface according to the human-computer interaction interface display instruction if a human-computer interaction interface display instruction is detected. The second creation unit is used to obtain the target frame interface in the initialization frame interface according to the target display layer, and create human-computer interaction interface control objects for the parent window component based on the target frame interface. An adding unit is used to add the human-computer interaction interface control object to the target display layer of the human-computer interaction interface. The acquisition unit is also used for: If the total number of display layers corresponding to the human-computer interaction interface display instruction is less than or equal to the total number of layers of the frame interface, then the target display layer is obtained according to the human-computer interaction interface display instruction. If the total number of display layers corresponding to the human-computer interaction interface display instruction is greater than the total number of frame interface layers, then the initial frame interface is updated based on the total number of display layers corresponding to the human-computer interaction interface display instruction, and the target display layer is obtained according to the human-computer interaction interface display instruction. Updating the initialization framework interface based on the total number of display layers corresponding to the human-computer interaction interface display command includes: Obtain the first difference between the total number of display layers corresponding to the human-computer interaction interface display instructions and the total number of layers of the framework interface; Based on the first difference, the same number of frame interfaces are added sequentially from the bottom layer to the top layer.

7. A computer device, characterized in that, The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the QT interface hierarchy construction method as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which includes program instructions that, when executed by a processor, can implement the QT interface hierarchy construction method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Qt interface integration method and device

    CN114356435A

  • Application UI interface construction method and device, equipment and medium

    CN115826967A