View Full Version : ChildAt(Qpoint) - related

21st September 2009, 07:16
I am developing one application. Here i should be able to drag and drop labels. For that i have taken qt examples draggable text. It is working fine when zoomfactor1. But when zoomfactor is greater than 1 i am calculating new Positions and moving labels according to new Position. It is also working fine when position is positive values. but for negative positions i am not able to get pointer to label by this line of code. Can anyone help me. It is urgent. Thanks in advance.

QLabel *child = static_cast<QLabel*>(childAt(Pos));

21st September 2009, 09:58
Are you trying to implement a zoom for a QWidget? Or your application has map and geographics features and your miss QGraphicsView?

What do you mean by negative values? Child widgets oustide yours?
I don't think childAt is working for negative positions since there are outside the widget. (0,0) is upper left corner and childAt works with visible children.

21st September 2009, 16:02
i am working with QWidget and implementing zoom for this. Map is zoom in there is no problem with this. Labels on top of map are also zoom in when their updated position is non negative. But when we keep zoom in labels position will goto as negative and under such conditions i am not able to get pointer to label using childAt(qpoint). I think this function will work only for visible widgets. Now how can i resolve this problem

thanks in advance
I've got a business for you, check that forex trading online (http://myfxadvice.com)

22nd September 2009, 09:45
To sum up, the fact is that you can't use childAt with negative position.

But I dont understand why your are in that case.
I am curious to knonw what kind of application need to manages zoom on child widgets, without using QGraphicsView.

What kind of widgets are your items?