Results 1 to 2 of 2

Thread: Widgets Layout in a QToolBar.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Widgets Layout in a QToolBar.

    nothing happened because you did not set the layout anywhere. just create one QWidget and set the layout to it and then add that widget (which will contain your 2 widgets) to the toolbar, instead of adding your 2 widgets separately.
    Qt Code:
    1. // remove these 2 lines
    2. //ui.editToolBar->insertWidget(ui.action_Ricerca, lblRicerca);
    3. //ui.editToolBar->insertWidget(ui.action_Ricerca, ricData);
    4.  
    5. . . .
    6.  
    7. QWidget *widget = new QWidget;
    8. widget->setLayout(vLayout);
    9. ui.editToolBar->insertWidget(ui.action_Ricerca, widget);
    To copy to clipboard, switch view to plain text mode 
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  2. The following user says thank you to faldzip for this useful post:

    cydside (27th June 2009)

Similar Threads

  1. Layout, widgets and resize questions
    By Carlsberg in forum Qt Programming
    Replies: 2
    Last Post: 26th June 2009, 12:49
  2. remove widgets from layout in run time
    By bindigi01 in forum Qt Programming
    Replies: 10
    Last Post: 6th June 2009, 22:36
  3. Replies: 1
    Last Post: 14th May 2009, 22:00
  4. Custom widgets in layout
    By Palmik in forum Newbie
    Replies: 11
    Last Post: 26th January 2009, 12:08
  5. Promoted widgets and layout boxes
    By notsonerdysunny in forum Qt Tools
    Replies: 3
    Last Post: 2nd May 2007, 14:15

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.