I have found that to use qlabel a subclass to implement, and then click on the groove function how to specific implementation?? What is the signal inside the??
CodePudding user response:
Simple drawing first to understand, click the button, start drawing on qlabel, mouse click start painting, release the mouse over drawing, this should be good implementation, online about drawing a lot of examples, can refer to baidu,CodePudding user response:
Want to drawing in QLabel, does need go to inherit QLabel, then paintEvent () function to realize the corresponding drawing, the mouse to click and move should use QT event system, concrete is to use the following two events:Void mousePressEvent (QMouseEvent * event);
Void mouseMoveEvent (QMouseEvent * event);
The two events is a virtual function, in your inheritance of class to achieve what you want in the operation,
CodePudding user response:
Qt drawing must be limited in a PaintEvent function is very big, I don't know is there a way to bypass?CodePudding user response: