Results 1 to 3 of 3

Thread: Move child widget along with the parent widget

  1. #1
    Join Date
    Feb 2006
    Posts
    60
    Thanks
    21
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Move child widget along with the parent widget

    Hi,
    I have the foll.
    QTextEditor editor-- parent widget
    QWidget child -- chid of editor (window flag set tosetWindowFlags(Qt::ToolTip));

    If i move the scroll bars of editor(parent), i want the child to to be in place where it is created on the editor(parent). So the child should also move to the position where it was created on the parent.

    I have several child widgets created at diff. positions of the parent. So i want them to be at the same place where they are created abd move along with the parent.

    If possible please provide a sample code.

    I will be very much thankful for the sol.

    regards,
    sree

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Move child widget along with the parent widget

    Create the child widgets with the textedit's viewport as their parent.
    Qt Code:
    1. SomeWidget* child = new SomeWidget(textEdit->viewport());
    To copy to clipboard, switch view to plain text mode 

    Edit: This works only for a child widget. Qt::ToolTip flag indicates that the widget is a tooltip, which is a top level widget, a window.
    Last edited by jpn; 14th May 2006 at 20:35.
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    sreedhar (15th May 2006)

  4. #3
    Join Date
    Feb 2006
    Posts
    60
    Thanks
    21
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Move child widget along with the parent widget

    thanks a lot

Similar Threads

  1. let parent widget grow with child widget?
    By BeS in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2009, 12:17
  2. Child Widget is hogging the MouseReleaseEvent
    By Cruz in forum Qt Programming
    Replies: 1
    Last Post: 24th January 2009, 19:28
  3. move parent window to the front.
    By hvengel in forum Qt Programming
    Replies: 4
    Last Post: 2nd February 2007, 09:41
  4. minimize child widget
    By sreedhar in forum Qt Programming
    Replies: 5
    Last Post: 15th May 2006, 13:02
  5. Referencing Parent Widget from Child
    By taylor34 in forum Qt Programming
    Replies: 8
    Last Post: 11th April 2006, 16:13

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.