Results 1 to 2 of 2

Thread: widget's cooridanates into screen coordinates.

  1. #1
    Join Date
    Sep 2008
    Posts
    32
    Thanks
    7

    Default widget's cooridanates into screen coordinates.

    Hi,

    I want to find out the screen coordinats of the widgets for automated testing.
    By usuing widget()->geometry() I am able to find out the coordinats of the widget.
    Now I need to convert these cooridanates to Screen cooridanates.

    I have tried to implement the rect() of the QAccessibleWidget like below but it's not giving the actual positions.

    QRect AccessibleClock::rect(int index ) const
    {
    QRect relrc = this->widget()->geometry();
    QPoint tl = this->widget()->mapToParent(QPoint(relrc.left(),relrc.top()));
    QPoint br = this->widget()->mapToParent(QPoint(relrc.right(), relrc.bottom()));

    QRect actrc( tl.x(), tl.y(), br.x(), br.y() );

    switch (index)
    {
    case ClockSelf:

    default:

    return actrc;

    }

    Could anyone please help me to resolve the issue?

    Thanks a lot in advance.

    Regards
    Rakesh

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: widget's cooridanates into screen coordinates.


  3. The following 2 users say thank you to aamer4yu for this useful post:

    embeddedmz (2nd September 2019), Rakesh_Kumar (20th November 2008)

Similar Threads

  1. Replies: 0
    Last Post: 16th July 2008, 13:15
  2. Replies: 1
    Last Post: 27th March 2008, 15:10

Tags for this Thread

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.