Results 1 to 2 of 2

Thread: How to restrict autodelete in Qt?

  1. #1
    Join Date
    Jun 2006
    Location
    Vietnam
    Posts
    59
    Thanks
    17
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default How to restrict autodelete in Qt?

    I am developing a program have the interface same as Office 2007.
    I need use many toolbars but only one toolbar display on main window.
    When user click on menu File -> I show toolbar fileToolBar
    When user click on menu Edit -> I show toolbar editToolBar

    Qt Code:
    1. mainWin->setToolBar(fileToolBar); // user select menu File
    2. //...
    3. mainWin->setToolBar(editToolBar); // user select menu Edit -> fileToolBar will be deleted
    4. //...
    5. mainWin->setToolBar(fileToolBar); // user reselect menu File but in this case, program will cause error because fileToolBar deleted.
    To copy to clipboard, switch view to plain text mode 

    Please help me how to solve this problem.

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

    Default Re: How to restrict autodelete in Qt?

    What does autodelete have to do with what you are doing? Unless you explicitely delete the parent (or higher ancestor) of the toolbar it won't get deleted, hidden at most.

Similar Threads

  1. Restrict user from entering space in Save As File Name
    By jyoti kumar in forum Qt Programming
    Replies: 1
    Last Post: 5th September 2007, 12:47
  2. Replies: 5
    Last Post: 5th July 2007, 20:49
  3. QTableView - Restrict editable rows.
    By jimroos in forum Newbie
    Replies: 2
    Last Post: 4th June 2007, 07:31
  4. Restrict user to open the same file
    By vermarajeev in forum General Programming
    Replies: 33
    Last Post: 25th May 2007, 08:15
  5. How to restrict graphic items in view
    By aamer4yu in forum Qt Programming
    Replies: 4
    Last Post: 13th November 2006, 07:46

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.