Cross-platform list implementation method based on virtualized rendering and data-driven feedback
By employing a cross-platform list approach with virtualized rendering and data-driven feedback, the traditional QTableView suffers from poor performance and unfriendly user interaction under large data volumes. This approach achieves efficient data loading and clear visual feedback, thereby enhancing the user experience.
Patent Information
- Application Number
- CN202511516840.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2045-10-23
AI Technical Summary
Traditional QTableView suffers from high memory consumption and UI lag when dealing with large amounts of data. It also lacks clear indication of key data changes and has weak header customization capabilities, which negatively impacts user experience and ease of operation.
Using virtualization rendering technology to process only visible data, combined with data-driven blinking prompts and adaptive header layout algorithms, a cross-platform list is implemented through Qt's Model-View-Paint architecture, dynamically adjusting header elements and providing visual feedback when data is updated.
It enables smooth loading and scrolling of millions of data points, clearly indicates data changes, and enhances user operation convenience and interface performance.
Smart Images

Figure CN120994298B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of financial data processing, in particular to a cross-platform list implementation method and system based on virtualized rendering and data-driven feedback. BACKGROUND
[0002] In the financial field, the market list is an important component for real-time display of key information such as prices, price fluctuations, and trading volumes of various financial products. Its performance and display effect directly affect the user experience and trading decisions. Currently, the industry often uses standard QTableView to implement the market list, but this approach has many defects:
[0003] Standard QTableView does not have built-in virtualization functions. When faced with large amounts of data (such as 100,000 or more financial product data), all data is loaded and rendered at once, which not only consumes a lot of memory but also causes interface lag, severely affecting system performance. In a fast-refreshing data stream, key information such as prices and price fluctuations changes frequently, and traditional QTableView lacks effective visual cues, making it difficult for users to quickly discover these key changes and potentially missing important trading opportunities. In addition, the customization capabilities of traditional table headers are weak, making it difficult to elegantly display multiple interactive elements such as sorting icons and filtering icons in limited space, affecting user convenience in operating the market list.
[0004] Therefore, there is an urgent need in the market for a cross-platform market list implementation method based on virtualized rendering and data-driven feedback that can solve the above problems. SUMMARY
[0005] To overcome the defects in the prior art, the present application provides a cross-platform list implementation method and system based on virtualized rendering and data-driven feedback.
[0006] According to the cross-platform list implementation method based on virtualized rendering and data-driven feedback provided by the present application, the method comprises the following steps:
[0007] Step S1: Obtain an external data source;
[0008] Step S2: Preprocess the data source through a market data model PCQuoteSortModel;
[0009] Step S3: Use the preprocessed data as input to the Model layer and Paint layer of the constructed intelligent virtualized rendering engine, assemble data based on display roles, customize foreground and background color values, and rewrite drawing logic to achieve virtualization;
[0010] Step S4: Finally, the table view with frozen list is obtained by constructing an adaptive table header layout algorithm combined with the output of step S3.
[0011] Preferably, the external data source includes an HTTP source, a TCP source, and a WebSocket source.
[0012] The preprocessing includes data cleaning, assembly, and formatting processing, and converting character / number / enum / structured data into directly displayable text.
[0013] Preferably, the intelligent virtualization rendering engine is based on the Model-View-Paint architecture of Qt, and the data is assembled based on the display role in the Model layer, and the foreground color value and background custom drawing are customized by foreground color / background color roles; the core drawing logic is rewritten in the Paint layer to realize virtualization.
[0014] Preferably, the rendering process is completed by the model data of the table, and according to the row height, total number, and offset value of the table vertical scroll bar of the table view, the starting position and ending position of the table are calculated through different screen sizes, and only the visible area range is drawn and calculated, thereby decoupling the rendering overhead and the total amount of data.
[0015] Preferably, the step S4 includes assembling data by setting the Model layer display role, customizing the foreground color value and background custom drawing by foreground color / background color roles, and rewriting the paintSection method in the BaseStockHeaderView.
[0016] In the method, according to the alignment mode, text content, text style, and sorting icon elements provided by the model BaseStockHeaderModel, the corresponding sorting mode and title are obtained from the table header model, the offset value x and y axis of the icon are calculated according to the alignment mode, the width of the title in a specific font size is dynamically calculated, and finally the icon and the title are manually drawn.
[0017] Preferably, it further includes constructing a data-driven real-time flashing prompt system, and when receiving external data updates in the Model layer, an asynchronous channel processing is placed, and in addition to modifying the data itself, a flashing task is registered for one or more cells.
[0018] Preferably, the information of the flashing task includes target color and duration.
[0019] A global QTimer is set to trigger an update slot function at a high frequency, which traverses all active flashing tasks, calculates the transition color of the current frame through the easing function, and sends a dataChanged signal to notify the Painter layer to redraw and automatically refresh in the View layer, and the Painter layer receives the update background color signal triggered by the timer, and merges the visualRect area of the cells that need to flash animation through the update method of the table.
[0020] According to the application, a cross-platform list implementation system based on virtualization rendering and data-driven feedback is provided, comprising:
[0021] Module M1: obtaining an external data source;
[0022] Module M2: preprocessing the data source through a market data model PCQuoteSortModel;
[0023] Module M3: taking the preprocessed data as the input of the Model layer and the Paint layer of the constructed intelligent virtualization rendering engine, assembling data based on display roles, customizing foreground color values and background custom drawing based on foreground color / background color roles, and rewriting drawing logic to realize virtualization;
[0024] Module M4: finally obtaining a frozen list table view by constructing an adaptive table header layout algorithm combined with the output of module M3.
[0025] Preferably, the external data source includes an HTTP source, a TCP source and a WebSocket source.
[0026] The preprocessing includes data cleaning, assembling, formatting processing, and converting character / number / enumeration / structured data into directly displayable text.
[0027] Preferably, the intelligent virtualization rendering engine is based on the Model-View-Paint architecture of Qt, which assembles data based on display roles in the Model layer, customizes foreground color values and background custom drawing based on foreground color / background color roles, and rewrites the core drawing logic in the Paint layer to realize virtualization.
[0028] Compared with the prior art, the application has the following beneficial effects:
[0029] 1. The virtualization rendering of the application only processes visible data, solves the problem of memory overflow and interface lag caused by loading all data at one time in the traditional list, and can realize smooth loading and scrolling of million-level data, significantly improving the performance of the system in a large data amount scene.
[0030] 2、The flicker mechanism of the present application clearly prompts data update through visual highlighting, so that users can discover changes in key indicators such as price in a rapidly refreshed data stream in a timely manner, improving the efficiency of users in obtaining important information.
[0031] 3、The adaptive layout algorithm of the present application ensures the clarity and functionality of the table header, and can reasonably arrange text, multi-level sorting icons and other interactive elements in limited space, and can clearly and correctly display under different column widths and platforms, enhancing the operation convenience of users on the market list. BRIEF DESCRIPTION OF DRAWINGS
[0032] Other features, objects and advantages of the present application will become more apparent from the following detailed description of non-limiting embodiments with reference to the attached drawings:
[0033] Figure 1 is a system structure block of the present application;
[0034] Figure 2 is a working method flowchart of the present application. DETAILED DESCRIPTION
[0035] The present application will be described in detail below with reference to specific embodiments. The following embodiments will help those skilled in the art to further understand the present application, but do not limit the present application in any form. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of changes and improvements can be made. These all belong to the protection scope of the present application.
[0036] The present application adopts a virtualized rendering engine, which only calculates and draws data rows within the user's viewport, thereby realizing smooth loading and scrolling of millions of data; a data-driven visual feedback mechanism is realized, when the key indicators (such as price) in the data model change, the corresponding cells can trigger a short and smooth color flicker effect; an adaptive table header layout system can dynamically arrange text, multi-level sorting icons and other interactive elements, ensuring clear and correct display under different column widths and platforms.
[0037] According to the cross-platform list implementation method based on virtualized rendering and data-driven feedback provided by the present application, as shown in Figure 1 and Figure 2 , comprising:
[0038] Step S1: Obtain external data sources. The external data sources include HTTP sources, TCP sources, WebSocket sources, and even simple Json strings and simple texts.
[0039] Step S2: Preprocessing the data source by the market data model PCQuoteSortModel. The data source can come from TCP / HTTPS / WebSocket / RPC, and the content can be in Json / XML / Txt format. The PCQuoteSortModel model is an independent structure, and the injection of raw data is performed through the corresponding data adapter class (PCQuoteSortAdapter). When all the raw data is ready, the data cleaning, assembly, and formatting processing are performed in the Caculate method, and the character type / integer type / floating point type / Boolean type / enumeration / structured data are converted into a directly displayable text string type (QString). This includes enumeration type conversion into corresponding visual text, default initial value 0 converted into "--", date formatting, custom drawing area / label data layout, etc.
[0040] Step S3: Using the preprocessed data as the input of the Model layer and the Paint layer of the constructed intelligent virtualization rendering engine, assembling data based on display roles, customizing foreground color values and background custom drawing based on foreground color / background color roles, and rewriting drawing logic to achieve virtualization. Specifically, the intelligent virtualization rendering engine is based on the Model-View-Paint architecture of Qt. The data is assembled based on display roles in the Model layer (SimpleQuoteModel), and the foreground color values and background custom drawing are customized based on foreground color / background color roles. In the Paint layer (SimplePaint), the core drawing logic (paint) is rewritten to achieve virtualization. The rendering process does not traverse all the data. This calculation is done through the model data of the table. According to the row height, total number, and offset value of the table vertical scroll bar, the starting position and ending position (visibileRow) of the table are calculated through different screen sizes, and only the visible area range is drawn and calculated, thereby decoupling the rendering overhead from the total amount of data.
[0041] Step S4: Finally, a table view with a frozen list is obtained by constructing an adaptive table header layout algorithm combined with the output of step S3. Through a custom base table header view BaseStockHeaderView, the role assembly data is displayed by setting the Model layer (BaseStockHeaderModel), the foreground color / background color role customizes the foreground color value and background color value, and the paintSection method of BaseStockHeaderView is rewritten. In this method, according to the alignment mode (left / center / right), text content, text style and sorting icon elements provided by the model (BaseStockHeaderModel), the corresponding sorting mode (display sorting icon) and title are obtained through the table header model, the offset value x and y axis of the icon are calculated according to the alignment mode, the width of the title in a specific font size is dynamically calculated, and finally the icon and the title are manually drawn. The function of customizing the background color, border and other styles is also designed. This algorithm ensures that even when the column width changes frequently or there are multiple icons, the correct spacing between elements can be maintained and overlapping can be avoided.
[0042] The application also includes constructing a data-driven real-time flashing prompt system. In the Model layer (SimpleQuoteModel), when receiving external data updates, an asynchronous channel processing is placed, and in addition to modifying the data itself, a "flashing task" is also registered for one or more cells. The task contains information such as target color and duration. A global QTimer is set to trigger an update slot function at a high frequency (such as 60FPS). The function iterates through all active flashing tasks, calculates the transition color of the current frame through an easing function, and sends a dataChanged signal to notify the Painter layer to redraw and automatically refresh the View layer. In the Painter layer, the update background color signal triggered by the timer is received, and the visualRect area of the cells that need to flash animation is merged and processed through the update method of the table. The current method is to flash red for rising and green for falling, while keeping the color of each row consistent, thereby achieving a smooth flashing animation.
[0043] Further, the application is described in detail as follows in combination with the accompanying drawings. Figure 2 The cross-platform list implementation method based on virtualization rendering and data-driven feedback of the application is described in detail as follows:
[0044] First, an external data source is input, which includes various financial market data interfaces (such as stock trading systems, futures market information platforms, etc.), real-time database outputs or other business system pushed data. These data sources continuously provide raw information related to list display, such as stock prices, trading volumes, price fluctuations and other market data.
[0045] Then, the data source is preliminarily processed by a PCQuoteSortModel market data model, specifically, data is filtered according to business rules and display requirements, for example, invalid, incorrect or not in line with the current display scene data is filtered out; at the same time, according to a specific logic sorting, like ascending order by stock code, descending order by price change, etc., let the data present more orderly, facilitate subsequent reasonable display in the list. And the original data is converted and arranged into a structure form suitable for subsequent QTableView model agent processing, and the field corresponding relationship of the data is defined, such as which field corresponds to a column of the list (such as stock name column, price column, etc.), to prepare for the correct mapping of data in the table view.
[0046] Then, the data model agent conversion, SimpleQuoteModel as the model agent of QTableView, further adapts to the display requirements of the table view (QTableView related) in the Qt framework. Based on the Model-View architecture specification of Qt, the data processed by PCQuoteSortModel is assembled according to the role of Model layer (such as display role, foreground / background color role, etc.). For example, determine the specific value displayed for each cell (display role), and pre-set color-related role information that may be used for subsequent flashing prompt, style rendering, so that data can better cooperate with the view layer and the drawing layer.
[0047] Next, rendering and drawing control: SimplePaint acts as the drawing proxy for QTableView, operating according to the "intelligent virtualization rendering engine" logic described in the patent. Utilizing data obtained from SimpleQuoteModel, combined with parameters such as the table view's row height, vertical scrollbar offset, and screen size, it accurately calculates the start and end positions of the table's visible area (visibleRow). For example, through formulas or algorithms, it determines which rows of data are currently visible on the screen based on the scrollbar position, drawing and calculating only cells within this range. This decouples rendering overhead from the total data volume, preventing rendering stutters due to large amounts of data (such as tens of thousands of stock quotes), and improving list display efficiency. Handling blinking prompts: When receiving a redraw notification (dataChanged signal, etc.) related to a "blinking task" triggered by data updates from SimpleQuoteModel, SimplePaint processes the cell background color and transition color drawing according to the data-driven real-time blinking prompt system mechanism constructed in this invention. It uses the color of the current frame calculated by the easing function to draw the visualRect area of the cell that needs to blink, so as to achieve blinking effects such as rising red and falling green, and make the data changes intuitively present animated feedback on the view.
[0048] Finally, in terms of view display and interaction, FrozenTableView, as the final frozen column view, presents the content to the user based on the data and drawing instructions processed in the previous stages. Utilizing the basic functionalities of Qt table views, combined with features such as frozen columns (e.g., fixing the display of key columns like stock codes and market indicators so that important information remains visible while the user scrolls to other columns), the visible area content drawn by SimplePaint is presented in an intuitive table format, including data display and blinking animations. Simultaneously, it responds to user actions on the view, such as scrolling and clicking to sort. When user actions cause vertical scrollbar offsets or column width changes, it triggers SimpleQuoteModel, SimplePaint, and other processes to recalculate the visible area and redraw, maintaining correct view display. It also feeds back data requests generated by user interactions (such as re-sorting requests) to upstream processes like PCQuoteSortModel, forming a closed loop between data processing and view display.
[0049] This invention aims to solve the technical problems of poor performance of traditional market data lists under large data volumes, unclear indication of key data changes, and weak customization capabilities of table headers.
[0050] The application further provides a cross-platform market information list implementation system based on virtualized rendering and data-driven feedback, which can be implemented by executing the process steps of the cross-platform market information list implementation method based on virtualized rendering and data-driven feedback, i.e., the cross-platform market information list implementation method based on virtualized rendering and data-driven feedback can be understood as the preferred implementation of the cross-platform market information list implementation system.
[0051] According to the application, a cross-platform list implementation system based on virtualized rendering and data-driven feedback is provided, which comprises:
[0052] Module M1: Obtain external data sources. The external data sources include HTTP sources, TCP sources and WebSocket sources.
[0053] Module M2: Preprocess the data sources by using a market information data model PCQuoteSortModel. The preprocessing includes data cleaning, assembling and formatting processing, and converting character / number / enum / structured data into directly displayable text.
[0054] Module M3: Use the preprocessed data as the input of the Model layer and the Paint layer of the constructed intelligent virtualized rendering engine, assemble data based on display roles, customize foreground color values and background custom drawing based on foreground color / background color roles, and rewrite drawing logic to realize virtualization. The intelligent virtualized rendering engine is based on the Model-View-Paint architecture of Qt. In the Model layer, data is assembled based on display roles, and foreground color values and background custom drawing are customized based on foreground color / background color roles. In the Paint layer, the core drawing logic is rewritten to realize virtualization. The rendering process is completed by using the model data of the table. According to the row height of the table view, the total number and the offset value of the table vertical scroll bar, the starting position and the ending position of the table are calculated by using different screen sizes, and only the visible area range is drawn and calculated, so that the rendering overhead and the total amount of data are decoupled.
[0055] Module M4: through constructing adaptive table header layout algorithm, combining the output of module M3, finally obtaining the table view with frozen list. The module M4 includes through the customized base table header view BaseStockHeaderView, through setting Model layer display role assembly data, foreground color / background color role customizes foreground color value and background customizes drawing, in BaseStockHeaderView, rewriting its paintSection method. In the method, according to the alignment mode, text content, text style and the elements such as sorting icon provided by the model BaseStockHeaderModel, the corresponding sorting mode and title are obtained through the table header model, the offset value x and y axis of the icon are calculated according to the alignment mode, the width of the title in a specific font size is dynamically calculated, and finally the manual drawing of the icon and the title is carried out.
[0056] The application also includes constructing a data-driven real-time flicker prompt system, in the Model layer, when receiving external data update, placing in asynchronous channel processing, in addition to modifying the data itself, also registering one or more cells for flicker task. The information of the flicker task includes target color, duration. A global QTimer is set to trigger an update slot function at a high frequency, the function traverses all active flicker tasks, calculates the transition color of the current frame through the easing function, and sends a dataChanged signal to notify the Painter layer to redraw and automatically refresh in the View layer, in the Painter layer, receiving the update background color signal triggered by the timer, through the update method of the table, the visualRect area of the cell needing to flash animation is merged and processed.
[0057] Those skilled in the art know that, in addition to implementing the system provided by the application and each device, module and unit thereof in a pure computer readable program code manner, the system provided by the application and each device, module and unit thereof can also be realized in the form of logic gate, switch, application specific integrated circuit, programmable logic controller and embedded microcontroller by logically programming the method steps to realize the same function. Therefore, the system provided by the application and each device, module and unit thereof can be considered as a hardware component, and the devices, modules and units included therein for realizing various functions can also be considered as structures in the hardware component; the devices, modules and units for realizing various functions can also be considered as both software modules realizing the method and structures in the hardware component.
[0058] The specific embodiments of the present application are described above. It needs to be understood that the present application is not limited to the specific embodiments described above, and various changes or modifications can be made by those skilled in the art within the scope of the claims, which does not affect the essential content of the present application. The embodiments of the present application and the features in the embodiments can be combined with each other at will without conflict.
Claims
1. A cross-platform list implementation method based on virtualization rendering and data-driven feedback, characterized in that, include: Step S1: Obtain an external data source; Step S2: Preprocess the data source using the market data model PCQuoteSortModel; Step S3: Using the preprocessed data as input to the Model layer and Paint layer in the constructed intelligent virtualization rendering engine, data is assembled based on the display character, foreground / background color characters are customized foreground color values and background is customized for drawing, and the drawing logic is rewritten to achieve virtualization; Step S4: By constructing an adaptive header layout algorithm and combining it with the output of step S3, a table view with a frozen list is finally obtained; The rendering process is completed using the table's model data. Based on the table view's row height, total number, and the offset of the table's vertical scrollbar, the start and end positions of the table are calculated for different screen sizes. Drawing and calculation operations are performed only within this visible area, thereby decoupling the rendering overhead from the total amount of data. Step S4 includes displaying character assembly data by setting the Model layer through a custom base table header view BaseStockHeaderView, customizing the foreground / background color for the character's foreground color value and background color for drawing, and overriding its paintSection method in BaseStockHeadView. Within this method, based on the alignment, text content, text style, and sorting icon elements to be displayed provided by the model BaseStockHeaderModel, the corresponding sorting method and title are obtained through the header model. The offset values of the icons on the x and y axes are calculated according to the alignment method. The width of the title at a specific font size is dynamically calculated. Finally, the icons and titles are manually drawn.
2. The cross-platform list implementation method based on virtualization rendering and data-driven feedback according to claim 1, characterized in that, The external data sources include HTTP sources, TCP sources, and WebSocket sources; The preprocessing includes data cleaning, assembly, and formatting, converting character / number / enumeration / structured data into directly displayable text.
3. The cross-platform list implementation method based on virtualization rendering and data-driven feedback according to claim 1, characterized in that, The intelligent virtualization rendering engine is based on the Qt Model-View-Paint architecture. It assembles data based on the display role in the Model layer, and customizes the foreground color value and background color of the role. The core drawing logic is rewritten in the Paint layer to achieve virtualization.
4. The cross-platform list implementation method based on virtualization rendering and data-driven feedback according to claim 1, characterized in that, It also includes building a data-driven real-time flashing prompt system. In the Model layer, when external data updates are received, they are placed into an asynchronous channel for processing. In addition to modifying the data itself, flashing tasks are also registered for one or more cells.
5. The cross-platform list implementation method based on virtualization rendering and data-driven feedback according to claim 4, characterized in that, The information for the flashing task includes the target color and duration; Set up a global QTimer to trigger an update slot function at high frequency. This function iterates through all active blinking tasks, calculates the transition color of the current frame through the easing function, and sends a dataChanged signal to notify the Painter layer to redraw and automatically refresh the View layer. The Painter layer receives the background color update signal started by the timer and merges the visualRect area of the cells that need blinking animation through the table's update method.
6. A cross-platform list implementation system based on virtualization rendering and data-driven feedback, characterized in that, include: Module M1: Obtain external data source; Module M2: Preprocesses the data source using the market data model PCQuoteSortModel; Module M3: It uses the preprocessed data as input to the Model and Paint layers in the constructed intelligent virtualization rendering engine, assembles data based on the display character, customizes the foreground / background color character foreground color values and background for drawing, and rewrites the drawing logic to achieve virtualization; Module M4: By constructing an adaptive header layout algorithm, combined with the output of Module M3, a table view with a frozen list is finally obtained; The rendering process is completed using the table's model data. Based on the table view's row height, total number, and the offset of the table's vertical scrollbar, the start and end positions of the table are calculated for different screen sizes. Drawing and calculation operations are performed only within this visible area, thereby decoupling the rendering overhead from the total amount of data. The module M4 includes a custom base table header view, BaseStockHeaderView, which displays character assembly data by setting the Model layer, foreground / background color character custom foreground color values and background custom drawing, and overrides its paintSection method in BaseStockHeaderView. Within this method, based on the alignment, text content, text style, and sorting icon elements to be displayed provided by the model BaseStockHeaderModel, the corresponding sorting method and title are obtained through the header model. The offset values of the icons on the x and y axes are calculated according to the alignment method. The width of the title at a specific font size is dynamically calculated. Finally, the icons and titles are manually drawn.
7. The cross-platform list implementation system based on virtualization rendering and data-driven feedback as described in claim 6, characterized in that, The external data sources include HTTP sources, TCP sources, and WebSocket sources; The preprocessing includes data cleaning, assembly, and formatting, converting character / number / enumeration / structured data into directly displayable text.
8. The cross-platform list implementation system based on virtualization rendering and data-driven feedback according to claim 7, characterized in that, The intelligent virtualization rendering engine is based on the Qt Model-View-Paint architecture. It assembles data based on the display role in the Model layer, and customizes the foreground color value and background color of the role. The core drawing logic is rewritten in the Paint layer to achieve virtualization.
Citation Information
Patent Citations
Title display control method and device
CN106210851A
Virtual scrolling method and system for processing big data list
CN119883604A