Results 1 to 4 of 4

Thread: ChildAt(Qpoint) - related

  1. #1
    Join Date
    Apr 2009
    Posts
    41
    Qt products
    Qt4
    Platforms
    Windows

    Red face ChildAt(Qpoint) - related

    Hi,
    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));

  2. #2
    Join Date
    Sep 2009
    Posts
    140
    Thanks
    4
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ChildAt(Qpoint) - related

    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.

  3. #3
    Join Date
    Apr 2009
    Posts
    41
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: ChildAt(Qpoint) - related

    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

  4. #4
    Join Date
    Sep 2009
    Posts
    140
    Thanks
    4
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ChildAt(Qpoint) - related

    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?

Similar Threads

  1. Related to Popup of the QComboBox
    By ashishsaryar in forum Qt Programming
    Replies: 1
    Last Post: 10th July 2009, 16:29
  2. Replies: 2
    Last Post: 12th December 2008, 15:38
  3. Pointer Question related to QLineEdit
    By ChrisReath in forum Qt Programming
    Replies: 1
    Last Post: 23rd May 2008, 15:13
  4. Related To QGraphicsItemGroup
    By ashishsaryar in forum Qt Programming
    Replies: 0
    Last Post: 29th April 2008, 14:55
  5. Qt related questions and thoughts about getting job
    By AlexKiriukha in forum General Discussion
    Replies: 4
    Last Post: 26th January 2006, 12:25

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.