Results 1 to 20 of 21

Thread: QTreeWidget->clear()?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: QTreeWidget->clear()?

    Hi Jpn

    I appreciate your suggestion of using "QDirModel" approach but I think this approach is useful for the local fileSystem , It shows all the directories & files of the local filesystem only.

    But If I have to view all the directories & files of some other media , say any Removeable Media , then I think this approach is not useful.


    Regards
    Always Believe in Urself
    Merry

  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: QTreeWidget->clear()?

    Actually QDirModel is capable of providing information about removable media and even mapped network drives on Windows.

    Alternatively, you could wrap TREEITEM structure into a QAbstractItemModel but it's a bit of work and sure requires some knowledge of Qt's model-view framework.

    However, with QTreeWidgetItems you'll just get lost into jungle. QTreeWidget is not intended to and is not really usable for something like what you're doing.
    J-P Nurmi

  3. #3
    Join Date
    Jun 2006
    Posts
    2
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: QTreeWidget->clear()?

    In Qt3 it is not allowed to delete items of the QListView while processing the signals for pressing, clicking or doubleClicking. In that case the Application crashes. Maybe this issue is also existing in the Qt4-Versions.

  4. #4
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: QTreeWidget->clear()?

    Sorry but I forget to update my profile ,

    Right now , I am working on Qt4.1.5
    Always Believe in Urself
    Merry

  5. #5
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question Re: QTreeWidget->clear()?

    Hi All,

    Thanks for yr reply.
    But I still not slove this problem.
    I cannot used QDirModel approach because i have done enough code without it and can not change my approach.

    Actually problem is that when I clear the tree it give me the error

    QTreeModel->hasChildren() on MouseDoubleClickEvent.

    So i want to ask is there any other alternative from which I can do this.

Similar Threads

  1. how to add icons to QTreeWidget?
    By wei243 in forum Qt Programming
    Replies: 4
    Last Post: 21st September 2007, 08:34
  2. Removing items properly from qtreewidget item
    By Djony in forum Qt Programming
    Replies: 6
    Last Post: 21st November 2006, 12:20
  3. resizing a QTreeWidget
    By drhex in forum Qt Programming
    Replies: 6
    Last Post: 27th October 2006, 22:32
  4. How to capture resizing of QTreeWidget columns?
    By simk in forum Qt Programming
    Replies: 2
    Last Post: 27th April 2006, 06:10
  5. few questions related to QTreeWidget
    By prakash in forum Qt Programming
    Replies: 9
    Last Post: 10th March 2006, 07:32

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.