Results 1 to 3 of 3

Thread: adding my wdget to Tab

  1. #1
    Join Date
    Feb 2006
    Posts
    87
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy adding my widget to Tab

    hello there i have tried making a modfied verson of the tooltips example in the documentation. i want to add the widget to a tab(another application) that i have implemented but im not sure about how to add it...

    ive tried using the following code but it doesnt seem to work...do i have to make any amendments to the tooltips files i.e. with sortingBox.cpp?? any tips would be really helpful, thanks. Jag

    CreatorTab::CreatorTab(const QFileInfo &fileInfo, QWidget *parent)
    : QWidget(parent)
    {

    1. sortingBox = new SortingBox;
    2. QHBoxLayout *mainLayout = new QHBoxLayout;
    3. mainLayout->addWidget(sortingBox);
    4. mainLayout->addStretch(1);
    5. setLayout(mainLayout);

    }

  2. #2
    Join Date
    Feb 2006
    Posts
    87
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Talking Re: adding my wdget to Tab

    sorry yep i figured it out - i got rid of addStretch()

  3. #3
    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: adding my widget to Tab

    Try:
    Qt Code:
    1. CreatorTab::CreatorTab(const QFileInfo &fileInfo, QWidget *parent)
    2. : QWidget(parent)
    3. {
    4. sortingBox = new SortingBox( this );
    5. QHBoxLayout *mainLayout = new QHBoxLayout( this );
    6. mainLayout->addWidget(sortingBox);
    7. mainLayout->addStretch(1);
    8. setLayout(mainLayout);
    9. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 5
    Last Post: 17th February 2009, 04:35
  2. Adding QGraphicsProxyWidget items into QGraphicsScene
    By yagabey in forum Qt Programming
    Replies: 3
    Last Post: 21st November 2008, 06:33
  3. Adding JavaScript Obj to QWebView issues
    By bpetty in forum Newbie
    Replies: 2
    Last Post: 13th May 2008, 20:44
  4. Replies: 0
    Last Post: 7th April 2008, 14:27
  5. Adding buttons on the tab part of a tabwidget
    By forrestfsu in forum Qt Programming
    Replies: 2
    Last Post: 20th December 2006, 17:52

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.