Overall System Design
The alumni management system is a set of powerful, easy-to-operate and practical alumni information management software, which can be widely used in information exchange among alumni of various universities. The purpose of developing this alumni system is to overcome the traditional backward information exchange methods of teachers and students in colleges and universities, it is difficult to deal with emergencies such as information replacement, too many contacts, messy and other problems, according to the analysis of the existing alumni contact information record mode, it is determined The system needs to realize the following functions:
- Realize operations such as adding, deleting, querying, and modifying alumni-related information;
- Realize real-time sharing and updating of contact information among alumni;
- Realize that alumni screen qualified alumni contact information;
- Realize the export and backup functions of contact information;
System function block diagram
According to user needs, this system will mainly realize the following functions:
Among them:
reading: including reading alumni information, school information, and company information.
Query: For alumni information, perform fuzzy query based on visible fields such as code, name, phone number, and job title.
Sorting: For visible fields, the ability to sort by column.
Filtering: For the visible fields, perform multi-column filtering and display according to the content.
Add: Add a new alumni information field record at the end of the information.
Delete: delete existing alumni information, school information, and company information.
Print (incomplete): Output alumni details in picture format.
Maintenance: backup and record all data information and operations.
relationship between categories
This system mainly uses 23 types:
-
Among them, the Qt class library contains 13 types (represented by an octagonal box): main window class, floating window class, dialog window class, toolbar class, button class, menu bar class, table class, relational table model class, database class, label class, line editor class, drop-down box class, arranger class;
-
Inherited from the Qt class library 7 types (represented by a rounded rectangle box): main window class, connection window class, about window class, tabular data window class, user window class, school window class, company window class, search window class;
custom There are 2 types of categories (represented by square corner rectangle boxes): filter box category, custom table header category; -
The rest are implemented by the objects of the above main classes (represented by the hexagonal box).
class name father Subclass object Function main window QWidget Main window none Used to design the main window with menu bar, toolbar, status bar floating window QWidget Tabular Data View none Windows that can be docked to the main window dialog window QWidget as shown in the picture none Dialog displayed as a window toolbar QWidget none toolbar Provides a toolbar for adding components button class QObject none as shown in the picture Used for mouse and keyboard event response Menu Bar QWidget none Menu Bar Provides a menu bar where components can be added form class QAbstractItemView none data table for displaying tabular data relational tabular model QSqlTableModel none data model Used to manipulate information in the database database none none database for accessing the database label class QFrame none slightly Display text or pictures in the window row edit QWidget none slightly Provides an input text editor drop down box QWidget none slightly Provides an input editor with options Arranger QLayout none layout Used to automatically arrange components in the window Main window main window none Alumni The main window after adding components connect windows dialog window none slightly Windows for connecting to databases about windows dialog window none slightly Used to display software information Tabular Data View floating window none slightly main window showing data user window dialog window none slightly Window showing user details school window dialog window none slightly Window showing school details Company window dialog window none slightly Window showing company details find window dialog window none slightly for finding rows of data filter box QWidget none filter box Used to display the data filter window custom header QHeaderView none custom header Used to insert filter box components in the table The following is an illustration of the relationship between the main categories:
detailed design
The main functions of this system include: information reading, editing, sorting, screening, searching, printing, maintenance, etc.
Among them, the information reading function is realized by using the connection window class and the tabular data window class, and the editing, sorting, filtering, searching, and printing functions are realized by using the tabular data window and the detailed data window. The detailed design of connection window class, tabular data window class and detailed data window will be introduced respectively below.
link window class
-
Main function: connect to the database
-
The specific implementation process:
Main window connect button triggers popup connect window
Set and arrange database connection-related editing information elements
User enters relevant connection information and clicks Connect
Return an error message or get the database pointer and enter the table data window interface
-
Main definitions:
-
Member variables: layout, kindBox, hostLine, dataLine, userLine, portLine, passwordLine, connectLine, btn, db.
-
Member functions: link, getDB.
- The main function of the member function link is to connect to the database. The implementation method is: as a slot function, it is bound to the btn button, and when the button is clicked and triggered, it reads the contents of the member variable Box and each Line, and uses the db database class to link.
- The main function of the member function getDB is to obtain the database pointer. The implementation method is: as a shared member function, after the database connection is successful, the database information is transferred to the table data window.
-
Tabular DataWindow Class
-
Main functions: display data information, and perform operations such as sorting, filtering, and editing.
-
The specific implementation process:
The connection window expands the tabular data window after the database connection is successful
Set the right-click menu, table, data model, header information, etc.
Right-click menu to refresh data, switch data tables, add information, find information
Click the table header and filter elements to sort and filter
Double-click the data row to pop up the detailed data window interface for editing information.
-
Main definitions:
-
成员变量:db、Parent、tableview、menu、RefreshAction、AddAction、FindAction、PeopleAction、SchoolAction、CompanyAction、showFilter、model、Filter、findwidget。
-
Member functions: dataClick, Menu, refresh, add, find, showPeople, showSchool, showCompany, onDelete, onFilterClicked, onHeaderDataChanged, onFilterHide.
- The main function of the member function dataClick is to pop up the detailed data window interface. The implementation method is: as a slot function, it is bound to AddAction in the menu, triggers a function signal when the menu bar button is clicked, detects the name of the current data table of the model, and pops up the corresponding detailed data window .
- The main function of the member function refresh is to read data information. The implementation method is: as a slot function, it is bound to the RefreshAction in the menu, triggers a function signal when the menu bar button is clicked, refreshes the data information in the model, and refreshes the filter information in the showFilter .
- The main function of the member function add is to add information. The implementation method is: as a slot function, it is bound to the AddAction in the menu, triggers the function signal when the menu bar button is clicked, adds a row of blank data, and calls out the detailed data window for editing.
- The main function of the member function find is to find information. The implementation method is: as a slot function, it is bound to the FindAction in the menu, and the function signal is triggered when the menu bar button is clicked, and the findwidget window is called out to search for data.
- The main function of the member functions showPeople, showSchool, and showCompany is to switch the data table. The implementation method is: as a slot function, it is bound to the corresponding Action in the menu, and when the menu bar button is clicked, the function signal is triggered, the table data is initialized, and the data table is switched.
- The main functions of the member functions onDelete, onFilterClicked, onHeaderDataChanged, and onFilterHide are to handle filter box events. The implementation method is: as a slot function, it is bound to the signal trigger function in showFilter, and the corresponding function signal is triggered when the filter box is edited to realize the data filtering function.
-
Detailed data window class
-
Main function: display and edit the detailed information of a piece of data
-
The specific implementation process:
Double-click a piece of data or trigger addAction
Set and arrange data-related editing information elements
Information element link data table data
The user edits and modifies the information, clicks to save, cancel or delete
Submit the information and save it, and check whether the submission is successful
Return to Form Data View
-
Main definitions:
-
Member variables: layout, mapper, btn, model, Row, several Edits, several Boxes
-
Member functions: save, remove, cancel
- The main function of the member function save is to save data. The implementation method is: as a slot function, it is bound to the btn button, and when the button is clicked and triggered, it reads the contents of the member variable Box and each Line, and uses mapper data mapping to realize data saving.
- The main function of the member function remove is to delete data. The implementation method is: as a slot function, it is bound to the btn button, and when the button is clicked and triggered, the member function removeRow of the model is called to delete a row of data.
- The main function of the member function cancel is to cancel the operation. The implementation method is: as a slot function bound to the btn button, when the button is clicked and triggered, the member function close of the window class is called to close the detailed data window and return to the parent window.
-
System test
Test Methods
The general methods of software testing are: white box testing, black box testing, gray box testing
White-box testing refers to checking whether each channel can work normally by checking whether the internal actions are carried out according to the settings in the design specification with the help of the logic and related information inside the program.
Black box testing refers to: treat the program as a black box that cannot be opened, and test the program interface without considering the internal structure and characteristics of the program at all. It only checks whether the program function is normal according to the requirements specification Use, whether the program can properly accept the input data and produce the correct output information.
Gray box testing refers to: between black box testing and white box testing. Gray box testing not only pays attention to the correctness of the output relative to the access, but also its internal performance. But it cannot be as detailed and complete as white box testing. It simply judges its internal operation by some symbolic phenomena or signs, so the gray box test method can be adopted when the internal result is wrong but the output result is correct.
The system is tested by black box testing method
test case
The system uses MySQL for data storage and Navicat for data management testing. The data tables used include: people, company, school, job, major, scale, trade, work, propertiesc, properties. Among them, job, major, scale, trade, work, propertiesc, and properties are preset data, which cannot be edited through this system.
-
There are 6 groups of school test data:
i Id Name Address Properties List 1 1 school1 address_school_1 211 engineering schools 2 2 school2 address_school_2 985 engineering colleges 3 3 s other 4 4444444 address_four Provincial undergraduate colleges 45 23 Lanzhou University of Technology China-Gansu-Lanzhou-1 Campus primary school 54 32 Lanzhou University of Technology China-Gansu-Lanzhou-2 Campus 985 engineering colleges -
There are 10 groups of Company test data:
i Name Address Trade Properties Scale List 1 company1 address_one other other other 2 company2 information transmission industry Collectively owned enterprises other 3 company4 address_fourrrr…… other other Very large enterprise 4 company333…… address_five Transportation industry Foreign-funded enterprises small companies 5 Tencent Shenzhen, China Software and information technology service industry Foreign-funded enterprises Very large enterprise 6 netease Guangzhou, China Software and information technology service industry Foreign-funded enterprises Very large enterprise 7 other other other 9 1 1 other State-owned enterprises other 80 one one other other Small and medium enterprises 1000 ???? ??? Catering other other -
There are 10 groups of People test data:
i Id Name Phone Major Job Work Time Address School Company List 1 1 one 1373333 其他 其他 其他 1 oooo 1 1 2 2 two 1372222222 中医临床基础 仓储保管 其他 22 wwww 2 1 3 3 ? ??? 光学 其他 其他 0 ??? 4 1000 4 4 其他 仓储保管 其他 5 5 张三 13712345678 公共管理 体育用品制作 假肢制作装配工人 2 中国-北京 4 80 6 6 李四 0 免疫学 其他 修理工 5 中国天津 45 1000 8 44 -1 -1 其他 其他 其他 0 -1 4 7 9 23 王五 111111…… 儿科学 仓储保管 修理工 9999999 1111111…… 4 4 10 1111 同学1号 7777 其他 其他 其他 1 address 地址 1 3 9 1 1 one 1373333 其他 其他 其他 1 oooo 1 1