Results 1 to 2 of 2

Thread: QToolbar

  1. #1
    Join Date
    Mar 2010
    Posts
    5

    Default QToolbar

    I can't change the size of a button in qtoolbar ...

    Qt Code:
    1. QPushButton e1PushButton = new QPushButton(this);
    2. e1PushButton .resize(20, 20);
    3. tb.addWidget(e1PushButton );
    To copy to clipboard, switch view to plain text mode 

    And its not working ...
    The button is with the default size

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QToolbar

    Push buttons have a minimum size hint set (40x20 on my system, as far as I remember), you can't decrease their size more when they are in a layout. You can use QToolButton instead. But then the question is what is the reason of placing a push button in a toolbar when you have QAction at your disposal.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QToolBar
    By Programm3r in forum Qt Programming
    Replies: 2
    Last Post: 22nd December 2009, 07:09
  2. QToolBar
    By coderbob in forum Qt Programming
    Replies: 2
    Last Post: 18th December 2007, 04:27
  3. QToolBar
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 14th September 2007, 19:48
  4. Qtoolbar
    By Project25 in forum Qt Programming
    Replies: 3
    Last Post: 26th March 2007, 22:23
  5. QToolBar help
    By Erlendhg in forum Qt Programming
    Replies: 2
    Last Post: 6th November 2006, 15:20

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.