Results 1 to 2 of 2

Thread: Toolbar

  1. #1
    Join Date
    Jun 2008
    Posts
    20
    Qt products
    Qt4
    Platforms
    Windows

    Default Toolbar

    sorry, because my english is not very well.

    I have a toolbar in my app. and I want to put a icon in the right side of the toolbar , near the close button (X) at the form.

    what should I do ?

    thanks !

  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: Toolbar

    Qt Code:
    1. QWidget* stretchWidget = new QWidget(toolBar);
    2. stretchWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    3.  
    4. toolBar->addAction(...); // actions before stretch
    5. toolBar->addWidget(stretchWidget); // stretch
    6. toolBar->addAction(...); // actions after stretch
    To copy to clipboard, switch view to plain text mode 
    PS. Please search the forums. This has been asked before.
    J-P Nurmi

Similar Threads

  1. Toolbar and icon size
    By MrGarbage in forum Qt Programming
    Replies: 0
    Last Post: 8th January 2008, 22:27
  2. Create a Toolbar on a Subclassed Textedit?
    By c_07 in forum Qt Programming
    Replies: 5
    Last Post: 12th October 2007, 19:17
  3. Adding a toolbar to a TableWidget
    By Walter in forum Qt Programming
    Replies: 2
    Last Post: 1st July 2007, 22:13
  4. Initialise toolbar in a different area
    By georgie in forum Qt Programming
    Replies: 4
    Last Post: 4th May 2006, 04:49
  5. animating a toolbar??!?
    By nupul in forum Qt Programming
    Replies: 4
    Last Post: 1st April 2006, 09:27

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.