Upload Code
loading-left
loading loading loading
loading-right

Loading

Profile
No self-introduction
codes (3)
QT simple clock class
no vote
5 comprehensive programming: visual clock 5.1 demonstration case [task objective] realizes the visual clock effect as shown in the figure, and the clock pointer is updated timely. The whole dial is required to be the largest inscribed circle of the rectangle in the client area, which changes adaptively with the size of the window, and the size of the pointer can also change accordingly. Design dialog box, allow users to set the color of dial, scale and pointer, and display the preview effect of clock in the dialog box. [analysis and design] the simplest design can be adopted. After the program starts, trigger the timer message, refresh the window display in the timer event processing method, and draw the visual clock in the paintevent method. This design scheme is more complex, and the code of drawing hour hand, minute hand and second hand is more complex and redundant. The code of paintevent can only be drawn in the form. If you want to draw in other places (such as the preview effect in the dialog box), the whole processing logic is difficult to reuse. The whole clock consists of a dial and three pointers, each of which has different processing logic. The dial processing and drawing are encapsulated in the plate class. The processing logic of the three pointers is similar, abstracting arm
divexun
2017-12-29
0
1
Drawing software QT
no vote
6.1 demonstration case [task objective] realizes simple drawing function, and supports functions such as saving and opening drawing data. Through the draw menu, the user can click to select different graphics, press the left mouse button and drag the mouse to start drawing, release the mouse to save the graphics (lines, ellipses, rectangles) data, and update the screen display. The file menu defines the basic operation of the file. The new menu item is used to create a new drawing file. If the previous file has been modified but not saved, you need to prompt. Save is used to save the drawing result as a disk file to realize persistent storage. Open is used to open the saved drawing file. 6.1.1 simple drawing version
divexun
2017-12-29
0
1
STL console of commodity management system
no vote
STL implementation of commodity management system & nbsp; console. Commodity addition, deletion, second-hand commodity, management, overseas commodity. Sort. Price. The commodity management class commoditymanage implements the management of the commodity data set in the shopping basket, including the commodity pointer as the data member (pointing to the dynamically allocated commodity array), which realizes the operation of adding and removing commodities. Dynamic array dynamically allocates memory according to the initial size when it is created. When the allocated memory is full, it dynamically expands the capacity. Add goods to the shopping basket: to simplify the processing, add new goods to the end of the existing data, and add 1 to the quantity of goods. If the ID of the added goods already exists, only add up the purchase quantity. Delete product from shopping basket: according to the product ID specified by the user, find out whether the product with the specified ID exists. If it exists, delete the corresponding product information. If it does not exist, prompt information. After deleting the product successfully, the product quantity will be reduced by 1. View specified commodity: according to the commodity ID specified by the user
divexun
2017-12-29
1
1
No more~