Results 1 to 4 of 4

Thread: Hiding a QToolButton in a QToolBar

  1. #1
    Join Date
    Jan 2006
    Posts
    368
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Hiding a QToolButton in a QToolBar

    Simple problem:
    I have this menu on a toolbar (a QToolButton which has a QMenu attached). Then another checkable action which shows/hides that menu. But it does not. This code does not work:

    Qt Code:
    1. toolbarMenuButton->setVisible(!hideAction->isChecked());
    To copy to clipboard, switch view to plain text mode 

    Full code attached here. Put it in a new dir, and to compile type:

    Qt Code:
    1. qmake -project
    2. qmake
    3. make
    To copy to clipboard, switch view to plain text mode 

    Can anyone give me a hint, what am I missing?
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2006
    Posts
    368
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Hiding a QToolButton in a QToolBar

    Does any one have a clue...?

  3. #3
    Join Date
    Apr 2009
    Location
    Italy
    Posts
    70
    Thanks
    23
    Thanked 15 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Hiding a QToolButton in a QToolBar

    see the docs for QToolbar::addWidget

    http://doc.trolltech.com/4.5/qtoolbar.html#addWidget

  4. #4
    Join Date
    Jan 2006
    Posts
    368
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Hiding a QToolButton in a QToolBar

    So trivial... thanks

Similar Threads

  1. Why there are always dashed-line rectangle on QToolButton?
    By FinderCheng in forum Qt Programming
    Replies: 5
    Last Post: 25th October 2009, 00:56
  2. MacOS and QToolBar?
    By Dale in forum Qt Programming
    Replies: 4
    Last Post: 26th May 2009, 07:45
  3. drag and drop QToolButton in QToolBar
    By NBilal in forum Qt Programming
    Replies: 1
    Last Post: 28th December 2008, 21:11
  4. How Do I Float a QToolBar?
    By dvmorris in forum Qt Programming
    Replies: 7
    Last Post: 29th April 2007, 20:01
  5. Insert separate QToolBar into QMainWindow
    By YuriyRusinov in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2006, 11:37

Tags for this Thread

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.