PDA

View Full Version : How to add lines using mouse move?



athulms
9th August 2011, 06:00
I am developing a word search game. I have to select the correct words through mouse click+drag. when i click on the first letter and drag the mouse to the last letter, a selection line should be drawn. The letters are placed in labels, the labels are placed inside a gridlayout. in (11 X 11) format?
Waitinf for replies.
Thanks in advance

Santosh Reddy
10th August 2011, 04:47
It may be possible, but will be complex to do with widgets, rather I suggest to using graphics scene.

If using widgets you need to draw the line over all the widgets (QLabels), i.e. draw the line on the parent widget (which contains the 11x11 layout), or can try QStackedWidget to overlay the layout (widget) and the line (widget containing the line)

athulms
10th August 2011, 07:54
sir, can you please explain more with codes pls..