Results 1 to 2 of 2

Thread: Adding custom widget to an existing layout

  1. #1
    Join Date
    Jun 2010
    Posts
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Adding custom widget to an existing layout

    Hi all , thanks in advance for any advise...

    I have a widget I created in designer, a few QLineEdit and QLabel aranged in a QGridLayout. I need to add this QWidget to an existing QGridLayout at a specific row,column.

    Qt Code:
    1. this->BlockCacheUI=new pqSQBlockCacheWidget;
    2. this->BlockCacheUI->setupUi(this);
    3. this->PanelLayout->addWidget((QWidget*)this->BlockCacheUI,8,0,2,2,Qt::AlignTop|Qt::AlignLeft);
    To copy to clipboard, switch view to plain text mode 

    The last line produces

    QLayout: Attempting to add QLayout "" to pqSQBOVMetaReader "pqSQBlockCacheWidget", which already has a layout
    I have tried a few variations with out luck. What exactly is the problem? I have seen nested grid layouts before... How might I insert this custom widget into the existing grid layout?

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


  3. #2
    Join Date
    Jun 2010
    Posts
    2
    Thanked 2 Times in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11

    Default Re: Adding custom widget to an existing layout

    I am also having difficulty getting a widget to appear. Any luck?

  4. The following 2 users say thank you to yers for this useful post:


Similar Threads

  1. Replies: 5
    Last Post: 18th April 2010, 23:31
  2. Embedded ARM Seg Faults Adding Widget to Layout
    By flob in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 22nd December 2009, 23:22
  3. problem/error in adding custom widget plugins
    By miroslav_karpis in forum Qt Programming
    Replies: 3
    Last Post: 13th March 2009, 07:53
  4. resizing events of a custom widget in a layout
    By Rooster in forum Qt Programming
    Replies: 7
    Last Post: 16th February 2008, 10:52
  5. Replies: 7
    Last Post: 15th June 2007, 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.