Development method of software instrument based on Qt framework
Through the software instrument development method based on the Qt framework, the problems of single function and poor cross-platform performance of traditional instruments are solved, and the efficient development and cross-platform adaptability of custom software instruments are achieved to meet the needs of industrial control and equipment monitoring.
Patent Information
- Application Number
- CN202510653538.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-21
- Publication Date
- 2025-09-19
AI Technical Summary
Traditional hardware instruments have single functions and poor flexibility, making it difficult to achieve complex data and remote monitoring. They have poor cross-platform capabilities, low development efficiency, and poor maintainability, making it difficult to adapt to the changing needs of different operating systems and devices.
The software instrument development method based on the Qt framework obtains instrument requirement data, determines component objects, configures control component classes, and calls drawing functions to generate custom software instruments, achieving componentization and cross-platform capabilities.
It realizes cross-platform custom software instrument development, reduces development costs, improves development efficiency, has good cross-platform performance and user interactivity, and adapts to the changing needs of different devices and scenarios.
Smart Images

Figure CN120669978A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method for developing a software instrument based on a Qt framework. Background Art
[0002] Instruments are indispensable measurement and monitoring tools in numerous fields, including industrial automation, scientific research, and process control. Traditional hardware instruments suffer from limited functionality, poor flexibility, and difficulty in implementing complex data and remote monitoring. With the advancement of computer and software technologies, software instruments have replaced hardware instruments in many fields. However, traditional instrument development methods present numerous challenges, including: 1) poor cross-platform compatibility, making seamless porting between different operating systems (Windows, Linux, and macOS difficult; 2) low development efficiency. Common development methods require extensive underlying code implementation for each instrument development, particularly for graphics rendering. Graphics are often drawn using tools like OpenGL and SciDAVis, which are then embedded into the software framework used. However, some tools are often subject to limitations such as payment or open source requirements; 3) poor maintainability. Changes in usage scenarios and monitoring equipment can render existing instruments inoperable, often requiring software code modifications. These changes, coupled with significant demand fluctuations and software technology upgrades, necessitate redevelopment.
[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute prior art known to ordinary technicians in this field. Summary of the Invention
[0004] The present invention provides a development method of a software instrument based on a Qt framework, a storage medium, a computer program product, and an electronic device, which can overcome the defects in the prior art to a certain extent.
[0005] Other features and advantages of the present invention will become apparent from the following detailed description, or may be learned in part by practice of the present invention.
[0006] According to a first aspect of the present invention, there is provided a method for developing a software instrument based on the Qt framework, the method comprising:
[0007] Acquire instrument demand data; wherein the instrument demand data includes: at least one of an instrument application scenario parameter, an instrument internal data monitoring demand parameter, and an instrument internal data control demand parameter;
[0008] Determining component objects of the instrument according to the instrument requirement data; wherein the component objects are used to combine and form a custom software instrument;
[0009] Configure the corresponding control component class according to the type of each component object;
[0010] Calling the parameter setting method corresponding to the control component class to perform object setting on the control component class to realize the target display function;
[0011] Call the drawing function to draw each control component class to obtain the custom software instrument.
[0012] In some exemplary embodiments, calling a drawing function to draw each control component class to obtain a custom software instrument includes:
[0013] Configure the drawing order of each control component class according to the type of component object corresponding to each control component class;
[0014] The drawing function is called to draw each control component class according to the drawing order.
[0015] In some exemplary embodiments, the component object, and / or the control component class corresponding to the component object, is configured with a drawing priority;
[0016] The method further comprises:
[0017] The drawing order of each control component class is configured in combination with the type of each component object, the drawing priority of the component object and / or the control component class corresponding to the component object.
[0018] In some exemplary embodiments, the method further comprises:
[0019] Get the current update parameters;
[0020] The parameter update method is called to update the current display data and / or the current data display range of the custom software instrument according to the current update parameters.
[0021] In some exemplary embodiments, the method further comprises:
[0022] Call the update value display method to update the current display status of the custom software instrument according to the current update parameters.
[0023] In some exemplary embodiments, the method further comprises:
[0024] generating a custom instrument class file for the custom software instrument;
[0025] Create a QWidget interface class at the target location of the graphical user interface, add the custom instrument class file to the project and reference it;
[0026] Improve the QWidget interface class to obtain applicable custom instruments.
[0027] In some exemplary embodiments, the method further comprises:
[0028] Configure the custom instrument name corresponding to the custom instrument.
[0029] In some exemplary embodiments, the control component class includes at least one of: an instrument canvas class, a custom instrument class, a gradient display class, a basic attribute class set, and a display control component class set.
[0030] According to a second aspect of the present invention, a computer program product is provided, on which a computer program is stored. When the computer program is executed by a processor, the computer program implements the above-mentioned method for developing a software instrument based on the Qt framework.
[0031] According to a third aspect of the present invention, there is provided a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the above-mentioned method for developing a software instrument based on the Qt framework.
[0032] According to a fourth aspect of the present invention, there is provided an electronic device, comprising:
[0033] processor; and
[0034] a memory for storing executable instructions of the processor;
[0035] The processor is configured to implement the above-mentioned method for developing software instruments based on the Qt framework by executing the executable instructions.
[0036] The Qt framework-based software instrument development method provided by an embodiment of the present invention determines the application scenario and data display requirements of a custom instrument based on instrument demand data, thereby configuring corresponding component objects. A corresponding control component class is then configured for each component object. These component objects form a custom software instrument, thereby achieving componentization of the instrument structure, reducing development costs and improving development efficiency. Furthermore, the required controls can be freely combined to generate a desired instrument based on the usage scenario and device characteristics. Furthermore, by calling the parameter setting method corresponding to each control component class to set the object of the control component class, and using a drawing function to draw the control component class to obtain the custom software instrument, efficient instrument development is achieved, ensuring that the custom instrument has good cross-platform performance.
[0037] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings are incorporated into and constitute a part of this specification, illustrate embodiments consistent with the present invention, and together with the description, serve to explain the principles of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and it is clear that those skilled in the art can derive other drawings based on these drawings without inventive effort.
[0039] Figure 1 A schematic diagram schematically illustrates a method for developing a software instrument based on a Qt framework according to an exemplary embodiment of the present invention;
[0040] Figure 2 A schematic diagram schematically illustrating the relationship between classes in a display and control component class set according to an exemplary embodiment of the present invention;
[0041] Figure 3 A schematic diagram schematically illustrates an attitude indicator instrument according to an exemplary embodiment of the present invention;
[0042] Figure 4 A schematic diagram schematically illustrating the class relationship of control components of an attitude indicator instrument according to an exemplary embodiment of the present invention;
[0043] Figure 5 A schematic diagram schematically illustrating the class relationship of control components of a height monitoring instrument according to an exemplary embodiment of the present invention;
[0044] Figure 6 A schematic diagram schematically illustrates an exemplary embodiment of a height monitoring instrument of the present invention;
[0045] Figure 7 The figure schematically shows the composition of an electronic device in an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0046] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0047] In addition, the accompanying drawings are merely schematic illustrations of the present invention and are not necessarily drawn to scale. Identical reference numerals in the figures denote identical or similar parts, and thus repetitive descriptions thereof will be omitted. Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0048] In response to the shortcomings and deficiencies of the existing technology, this example implementation provides a method for developing software instruments based on the Qt framework, which does not require support from graphics drawing tools and can customize the combination instrument control to develop suitable software instruments according to the needs of the usage scenario.
[0049] In this example implementation, reference Figure 1 As shown, the development method of the software instrument based on the Qt framework can specifically include the following steps:
[0050] Step S11, acquiring instrument demand data; wherein the instrument demand data includes: at least one of an instrument application scenario parameter, an instrument internal data monitoring demand parameter, and an instrument internal data control demand parameter;
[0051] Step S12, determining the component objects of the instrument according to the instrument requirement data; wherein the component objects are used to combine and form a custom software instrument;
[0052] Step S13, configuring the corresponding control component class according to the type of each component object;
[0053] Step S14, calling the parameter setting method corresponding to the control component class to perform object setting on the control component class to realize the target display function;
[0054] Step S15: calling a drawing function to draw each control component class to obtain a custom software instrument.
[0055] The instrument development method provided by the present invention utilizes the characteristics of Qt to achieve rapid and efficient development of software instruments with good cross-platform performance. By componentizing the components of the instrument, it can effectively reduce development costs and improve development efficiency. According to the usage scenario and device characteristics, the required controls can be freely combined to generate an instrument that meets the requirements. It has the advantages of accurately adapting to changes in data types and ranges, displaying smooth dynamic effects, and strong user interactivity, meeting the growing needs of industrial control, vehicle instrumentation, and equipment monitoring.
[0056] Hereinafter, each step of the method for developing a software instrument based on the Qt framework in this exemplary implementation will be described in more detail with reference to the accompanying drawings and embodiments.
[0057] In step S11 , meter demand data is acquired; wherein the meter demand data includes at least one of: meter application scenario parameters, in-meter data monitoring demand parameters, and in-meter data control demand parameters.
[0058] For example, the user can pre-edit the meter requirement data and generate a corresponding requirement file. In the meter data requirement file, the user can define one or more of the meter application scenario parameters, the meter internal data monitoring requirement parameters, and the meter internal data control requirement parameters.
[0059] For example, using application scenario parameters, you can define the application scenario and function of an instrument. For example, if the function of the custom instrument to be generated is defined as an attitude indicator, the corresponding application scenario is the graphical user interface of a drone control terminal device. Alternatively, if the function of the custom instrument to be generated is defined as an altitude monitoring meter, the corresponding application scenario is the aircraft's interactive interface. Alternatively, if the function of the custom instrument to be generated is defined as a speedometer, the corresponding application scenario is the graphical user interface of the intelligent control terminal device of the unmanned aerial vehicle.
[0060] The data monitoring requirement parameters in the instrument can be used to limit the display method of the data in the instrument, the dynamic display range of the data, etc. under the specified application function.
[0061] Instrument data control requirement parameters can be used to define how users control and operate the data displayed within a custom instrument. For example, users can enter specific data types, such as altitude or angle values, within the instrument's interface. Alternatively, users can dynamically adjust the currently displayed parameter value within the instrument's interface by clicking or sliding controls.
[0062] Alternatively, in some exemplary embodiments, the instrument requirement data may further include a structural diagram or a draft image of a custom instrument, so that corresponding component objects can be configured according to the image.
[0063] In step S12, component objects of the instrument are determined according to the instrument requirement data; wherein the component objects are used to combine and form a custom software instrument.
[0064] For example, a user can create an instrument development task on a terminal device and read the instrument data requirements file. When reading the requirements file, the Qt framework is invoked to configure the custom instrument's multiple component objects based on the instrument's functionality, data display method, data control method, and the data content to be displayed, as specified in the requirements file. These component objects can then be used to construct a complete custom software instrument.
[0065] For example, refer to Figure 3 The component objects corresponding to the attitude indicator instrument shown in the figure can include static objects, dynamic objects, and value objects. Static component objects can include the instrument background and the instrument dial ring. Dynamic object components can include pitch angle objects, pointer objects, and roll angle objects. Value objects can include pitch angle, roll angle, and so on.
[0066] For example, initial templates for various types / functions of instruments can be pre-configured, with corresponding component objects configured in the initial templates. After obtaining the current instrument data requirement file, the initial template for the corresponding function / type of instrument can be selected and the original component objects can be adjusted according to the current instrument requirements, such as adding new component objects, deleting initial component objects, or customizing the initial component objects, thereby obtaining the current component objects.
[0067] In step S13, the corresponding control component class is configured according to the type of each component object.
[0068] For example, after determining the component objects corresponding to the custom software instrument, corresponding control component classes can be configured for each component object. A custom instrument class can be formed through multiple control component classes.
[0069] Specifically, the instrument base class can be composed of an instrument canvas class, a custom instrument class, a gradient display class, a basic property class set, and a display and control component class set.
[0070] Among them, the canvas base class implements the dial shape setting and operation of the instrument, provides the functions of setting the canvas shape, setting the zoom ratio, and setting the canvas center, and rewrites the Qt paintEvent, resizeEvent, mousePressEvent, mouseReleaseEvent, mouseMoveEvent, enterEvent, and leaveEvent events to realize graphics drawing. Drag to change the size of the instrument, drag the control to send a control change signal, and the display effect switches when the mouse enters and leaves a specific area.
[0071] The gradient display class provides dial and graphic controls with gradient, linear change, and split effect background color settings. For example, an aircraft's attitude instrument displays a background color with the ground (yellow) and sky (blue) separated by the horizon, and a temperature or pressure instrument displays a background color gradient from danger (red) to warning (yellow) to normal (green).
[0072] The base attribute class set consists of the following classes:
[0073] Font graphics class: implements the scaling settings of font graphics objects;
[0074] Text graphics class: implements color, position setting and content update of text graphics objects;
[0075] Scale parameter class: implements the setting of parameters such as position, length, and quantity of scale graphic objects;
[0076] Linear graphics class: implements the setting of parameters such as the arc, length, width, and angle of linear graphics. Path graphics class: implements the drawing and property setting of pointers, sliders, and cursors of different shapes.
[0077] refer to Figure 2 The figure shows the composition relationship of the display and control component class set, including segment class, value object class, text object class, etc. Among them, the value object class belongs to the text object class, and the text object class belongs to the basic object class and the path graphic class.
[0078] Segment classes include value segment classes and text segment classes; they can be used to configure the displayed value, text, blinking speed, and color of the object. Value object classes include slider and scale object classes; slider object classes include horizontal slider, vertical slider, and arc slider; and scale object classes include vertical scale, horizontal scale, and arc scale.
[0079] For example, refer to Figure 4 As shown, for each component object in the attitude instrument, you can assign a corresponding arc slider class to the flight pointer object; a corresponding vertical scale class to the pitch angle object; corresponding arc scale classes to the right and left roll angles; a corresponding arc slider object class to the circular dial; corresponding static object classes to the background color and instrument ring; and corresponding value object classes to the roll angle value object and pitch angle value object. Based on these control component classes, an attitude instrument class is constructed. This attitude instrument class can be upgraded to a custom instrument class.
[0080] In step S14, the parameter setting method corresponding to the control component class is called to perform object setting on the control component class to realize the target display function.
[0081] For example, after completing the configuration of the control component class, the corresponding parameter setting method can be called according to the parameters, colors, and shapes that need to be configured in the class and component objects to set the object for the class, so that the object component can realize the preset display function.
[0082] For example, for Figure 3For the attitude indicator instrument shown, 1) you can call the class's parameter-setting method to set static objects, including the instrument background shape, position, size, and brush parameters. For example, by setting the color of the static object, you can achieve a blue and yellow gradient background for the instrument. 2) You can call the class's parameter-setting method to set the arc slider object, thereby configuring the circular dial's parameters and changing the background color to the aforementioned background color. 3) You can call the class's parameter-setting method to set static object parameters related to the ring, achieving a silver-to-black gradient display effect for the outer ring of the dial. 4) You can call the class's parameter-setting method to set the left roll angle scale's parameters related to the arc scale object. 5) You can call the class's parameter-setting method to set the right roll angle scale's parameters related to the arc scale object. 6) You can call the class's parameter-setting method to set the pitch angle scale's parameters related to the longitudinal scale object. 7) You can call the class's parameter-setting method to set the aircraft pointer's parameters related to the arc slider object. 8) You can call the class's parameter-setting method to set the roll angle of the left numerical display. 9) Call the parameter setting method within the class to set the value on the right to display the pitch angle.
[0083] In step S15, a drawing function is called to draw each control component class to obtain a custom software instrument.
[0084] For example, after setting up the control component class, the drawing function can be called to draw each control component class, and after the drawing is completed, the custom software instrument can be obtained. The custom instrument can be a separate QWidget class.
[0085] Exemplarily, calling a drawing function to draw each control component class to obtain a custom software instrument includes:
[0086] Step S21, configuring the drawing order of each control component class according to the type of component object corresponding to each control component class;
[0087] Step S22: calling a drawing function to draw each control component class according to the drawing order.
[0088] Exemplarily, the component object and / or the control component class corresponding to the component object is configured with a drawing priority; the method further includes:
[0089] The drawing order of each control component class is configured in combination with the type of each component object, the drawing priority of the component object and / or the control component class corresponding to the component object.
[0090] Specifically, you can pre-configure corresponding drawing priorities for different types of component objects and control component classes with different contents. For example, you can assign a higher drawing priority to components such as instrument backgrounds and dials, while assigning a lower drawing priority to components such as pointers and rollers. Alternatively, you can assign a higher drawing priority to static objects and a lower drawing priority to dynamic objects displayed on the instrument front end.
[0091] When configuring the corresponding control component class for a component object, you can configure the drawing order of each component object and its corresponding control component class based on the component object type or the pre-configured drawing priority of each component object. After completing the control component class configuration for all component objects, you can draw each control component class in sequence according to the determined drawing order to form a custom instrument.
[0092] Exemplarily, the method further includes:
[0093] generating a custom instrument class file for the custom software instrument;
[0094] Create a QWidget interface class at the target location of the graphical user interface, add the custom instrument class file to the project and reference it;
[0095] Improve the QWidget interface class to obtain applicable custom instruments.
[0096] Specifically, when calling Qt software to generate a custom instrument, a corresponding instrument file can be generated for the custom software instrument drawn in the above steps. When the software instrument needs to be displayed and used in a specified interface, a QWidget interface class can be added to the specified location of the terminal device's graphical user interface according to actual business needs, and the instrument class can be referenced. The instrument class is then promoted to a custom instrument, which can then be displayed in the specified location.
[0097] Exemplarily, the method further includes: configuring a corresponding custom instrument name for the custom instrument.
[0098] Specifically, users can configure the corresponding instrument name for the custom instrument according to actual needs. For example, after promoting the instrument to the corresponding custom instrument, the update function can be called by calling the UI control. The calling method includes: UI->Custom Instrument Name->Update Data Function Name().
[0099] Exemplarily, the method further includes:
[0100] Step S31, obtaining current update parameters;
[0101] Step S32: calling the parameter update method to update the current display data and / or the current data display range of the custom software instrument according to the current update parameters.
[0102] Specifically, when using a custom instrument, you can obtain the current image parameters collected by sensors or other system components in real time. For example, the current image parameters can be parameters such as pitch angle and altitude. For a custom instrument, you can call the image parameter method to input the current update parameters into the custom instrument, so that the display range of the custom instrument can be updated. For example, refer to Figure 3 The attitude indicator instrument shown can call a more parameter-like method to input the roll angle and pitch angle range, thereby updating the current pitch angle range and roll angle range of the instrument.
[0103] Exemplarily, the method further includes: calling a method for updating numerical display to update the current display state of the custom software instrument according to the current update parameters.
[0104] Specifically, when using a custom gauge, once the current update parameters are obtained, you can call the Update Value Display method, input the current update parameters, and update the data status and / or data value displayed in the gauge. For example, for the currently obtained roll and pitch angles, call the Update Value Display method, input the roll and pitch angles as parameters, and update the current gauge display status.
[0105] For example, the custom instrument is a height monitoring instrument. The user can first generate instrument requirement data based on the application environment of the height monitoring instrument, the type of electronic equipment, the instrument size requirements, and the data display requirements. And create a corresponding custom instrument generation task, and execute the instrument generation task on the terminal device, and read the instrument requirement data. First, determine the component object of the instrument according to the instrument requirement data; then call the Qt framework to configure the corresponding control component class for each component; then call the parameter setting method corresponding to the control component class to set the object of the control component class. The relationship between the control component class corresponding to each component object is as follows: Figure 5As shown. Specifically, 1) call the parameter setting method within the class to set the static object - instrument background color related parameters to achieve a black-gray gradient background; 2) call the parameter setting method within the class to set the field height static object, text object, and value object related parameters to achieve a partial display effect in the field height area; 3) call the parameter setting method within the class to set the satellite height static object, text object, and value object related parameters to achieve a partial display effect in the field height area; 4) call the parameter setting method within the class to set the pressure height longitudinal scale object, the climb rate longitudinal scale object, the left pressure height indicator cursor object, the right climb rate indicator cursor object, and the altitude control slider object related parameters, and at the same time connect the altitude control slider drag and control command sending in the form of a signal slot to achieve the altimeter display and control effect. At the same time, the drawing order can be configured according to the type of component object. Then call the drawing function to draw all the above control objects in sequence to form a custom instrument. The drawn custom instrument is as follows Figure 6 shown.
[0106] In addition, during the use of the instrument, you can obtain updated altitude data in real time, trigger the call of the update value display method, input the altitude parameter to update the current instrument display status; and, based on the updated altitude data, trigger the call of the update parameter method, input the altitude parameter range to update the current instrument range display.
[0107] The method provided by the embodiment of the present invention can utilize the cross-platform characteristics of the Qt framework, and the instrument generated by this method can run seamlessly on mainstream operating systems without the need for complex porting operations. In addition, this method utilizes the efficient graphics rendering and event processing mechanism of the Qt framework, combined with the componentized instrument configuration method, and the reasonable management and allocation of resources, so that the software instrument can achieve fast and smooth animation effects. Based on the componentized development method, it can ensure that the software instrument maintains a unified user interface style and interaction method under different platforms and application scenarios. In addition, it can achieve high reusability of custom instruments. Each custom instrument is a separate QWidget class, which can be directly used in the UI interface through promotion.
[0108] It should be noted that the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention and are not intended to be limiting. It is readily understood that the processes illustrated in the above figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0109] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0110] Figure 7 A schematic diagram of an electronic device suitable for implementing an embodiment of the present invention is shown.
[0111] It should be noted that Figure 7 The electronic device 1000 shown is only an example and should not limit the functions and scope of use of the embodiments of the present invention.
[0112] like Figure 7 As shown, electronic device 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to the program stored in read-only memory (ROM) 1002 or the program loaded from storage portion 1008 into random access memory (RAM) 1003. Various programs and data required for system operation are also stored in RAM 1003. CPU 1001, ROM 1002 and RAM 1003 are connected to each other via bus 1004. Input / output (I / O) interface 1005 is also connected to bus 1004.
[0113] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, and the like; an output section 1007 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 1008 including a hard disk and the like; and a communication section 1009 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. Removable media 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 1010 as needed, so that computer programs read therefrom can be installed into the storage section 1008 as needed.
[0114] In particular, according to an embodiment of the present invention, the process described below with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product that includes a computer program carried on a storage medium, the computer program containing program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1009 and / or installed from a removable medium 1011. When the computer program is executed by the central processing unit (CPU) 1001, the various functions defined in the system of the present application are performed.
[0115] It should be noted that the storage medium shown in the embodiments of the present invention can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device or device. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any storage medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code contained on the storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0116] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0117] The units involved in the embodiments of the present invention may be implemented in software or hardware, and the units described may also be provided in a processor. In some cases, the names of these units do not limit the units themselves.
[0118] It should be noted that, as another aspect, the present application also provides a storage medium, which can be included in an electronic device; or it can exist independently without being installed in the electronic device. The above storage medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the following embodiments. For example, the electronic device can implement the following Figure 1 The individual steps of the method are shown.
[0119] In one embodiment, the present application provides a computer program product, including a computer program, which implements the steps in the above-mentioned method embodiments when executed by a processor.
[0120] Furthermore, the above-described figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention and are not intended to be limiting. It is readily understood that the processes illustrated in the above-described figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0121] Other embodiments of the present invention will readily occur to those skilled in the art after considering the specification and practicing the invention herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the invention being indicated by the claims.
[0122] It should be understood that the present invention is not limited to the exact construction described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof, which is limited only by the appended claims.
Claims
1. A method for developing a software instrument based on the Qt framework, characterized in that: The method comprises: Acquire instrument demand data; wherein the instrument demand data includes: at least one of an instrument application scenario parameter, an instrument internal data monitoring demand parameter, and an instrument internal data control demand parameter; Determining component objects of the instrument according to the instrument requirement data; wherein the component objects are used to combine and form a custom software instrument; Configure the corresponding control component class according to the type of each component object; Calling the parameter setting method corresponding to the control component class to perform object setting on the control component class to realize the target display function; Call the drawing function to draw each control component class to obtain the custom software instrument.
2. The method according to claim 1, characterized in that The drawing function is called to draw each control component class to obtain a custom software instrument, including: Configure the drawing order of each control component class according to the type of component object corresponding to each control component class; The drawing function is called to draw each control component class according to the drawing order.
3. The method according to claim 2, characterized in that The component object, and / or the control component class corresponding to the component object is configured with a drawing priority; The method further comprises: The drawing order of each control component class is configured in combination with the type of each component object, the drawing priority of the component object and / or the control component class corresponding to the component object.
4. The method according to claim 1, wherein The method further comprises: Get the current update parameters; The parameter update method is called to update the current display data and / or the current data display range of the custom software instrument according to the current update parameters.
5. The method according to claim 4, characterized in that The method further comprises: Call the update value display method to update the current display status of the custom software instrument according to the current update parameters.
6. The method according to claim 1, characterized in that The method further comprises: generating a custom instrument class file for the custom software instrument; Create a QWidget interface class at the target location of the graphical user interface, add the custom instrument class file to the project and reference it; Improve the QWidget interface class to obtain applicable custom instruments.
7. The method according to claim 6, characterized in that The method further comprises: Configure the custom instrument name corresponding to the custom instrument.
8. The method according to claim 1, characterized in that The control component class includes at least one of: an instrument canvas class, a custom instrument class, a gradient display class, a basic attribute class set, and a display and control component class set.
9. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for developing a software instrument based on the Qt framework according to any one of claims 1 to 8 is implemented.
10. An electronic device, characterized in that: include: processor; as well as a memory for storing executable instructions of the processor; The processor is configured to execute the method for developing a software instrument based on the Qt framework according to any one of claims 1 to 8 by executing the executable instructions.