Results 1 to 20 of 21

Thread: Extend the ui_xxx.h file

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2008
    Posts
    21
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Extend the ui_xxx.h file

    Thanks jacek,

    Drag a QWidget within the Qt Designer and promoted it to the custom class that i have made.


    Now i have almost the same error:


    QLayout::addChildLayout: layout "gridLayout" already has a parent
    Segmentation fault

    Another forum said something related to that

    "If you want to create a sub-layout (i.e. you want to add it to another
    layout), then you have to create it WITHOUT a parent. Just use the
    constructor of QLayout without a parent.

    Only add a parent (namely the top widget) for a top level layout (i.e. the
    main layout of a widget).
    "

    How do i do that from within the Qt Designer?


    In my case the gridLayout is the sub layout. and i have to instantiate that without a parent.

    Regards
    Sajjad

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Extend the ui_xxx.h file

    Quote Originally Posted by dosto.walla View Post
    QLayout::addChildLayout: layout "gridLayout" already has a parent
    The problem is that you try to add a layout to a form that already has a layout. Qt doesn't like this.

    Quote Originally Posted by dosto.walla View Post
    How do i do that from within the Qt Designer?
    Either drag a layout from the toolbox just as if it was a widget or select few widgets and click the "Lay out in ..." action (you should see a red rectangle around those widgets).

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

    dosto.walla (15th September 2008)

  4. #3
    Join Date
    Sep 2008
    Posts
    21
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Extend the ui_xxx.h file

    Hello jacek,


    i am still having the same error. So i am attaching the related files.
    I hope that you can make some time out of your busy schedule.


    Regards
    Sajjad
    Attached Files Attached Files

  5. #4
    Join Date
    Sep 2008
    Posts
    21
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Extend the ui_xxx.h file

    Hello jacek,

    I have attached some screen-shots of the things you have recommended to do to avoid the error:

    The image that is attached first shows the following:

    1. All the toolbars that are arranged in a grid layout.

    2. The rectangle box beside that is a QWidget that i have dragged into the form.


    The second image shows how i promoted the custom class RenderArea.h to one of the place-holders(QWidget)

    The i compiled them ,but while running i have the runtime error as follows:

    QLayout::addChildLayout: layout "gridLayout" already has a parent
    Segmentation fault


    It says that the gridLayout already has a parent

    i followed you suggestion

    "Either drag a layout from the toolbox just as if it was a widget or select few widgets and click the "Lay out in ..." action (you should see a red rectangle around those widgets)."


    I followed the one in the bold mark. And you can see that in the attached images as well.


    Regards
    Sajjad
    Attached Images Attached Images

  6. #5
    Join Date
    Sep 2008
    Posts
    21
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Extend the ui_xxx.h file

    Hi jacek,

    Sorry that i could not attach the second image with the previous post

    Here i am sending the second image


    Regards
    Sajjad
    Attached Images Attached Images

Similar Threads

  1. Set up the Qt4.3.2 with Visual Studio 2005
    By lamoda in forum Installation and Deployment
    Replies: 6
    Last Post: 30th January 2008, 06:51
  2. file renaming on windows
    By jdd81 in forum Qt Programming
    Replies: 9
    Last Post: 2nd October 2007, 19:41
  3. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  4. Sending Binary File with QFTP
    By nbkhwjm in forum Newbie
    Replies: 2
    Last Post: 7th March 2007, 18:10
  5. QDirModel, Model/View, extend the file onfo
    By VlJE in forum Qt Programming
    Replies: 10
    Last Post: 11th December 2006, 10:56

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
  •  
Qt is a trademark of The Qt Company.