Results 1 to 3 of 3

Thread: QTreeWidget::setModel() - Changing the model of the QTreeWidget is not allowed.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QTreeWidget::setModel() - Changing the model of the QTreeWidget is not allowed.

    Hi,

    I wrote a simple Qt program, When I run the program, it told me:

    QTreeWidget::setModel() - Changing the model of the QTreeWidget is not allowed.

    The code just like below:
    Qt Code:
    1. dir_model_ = new QDirModel(this);
    2.  
    3. // enable drag and drop
    4. dir_model_->setReadOnly(false);
    5.  
    6. tree_view_ = new QTreeWidget(this);
    7. tree_view_->setModel(dir_model_);
    To copy to clipboard, switch view to plain text mode 

    I try to search Qt document and google, but I can not find any clue. How to solve this issue ?

    Thanks.
    Last edited by jpn; 17th March 2008 at 20:34. Reason: missing [code] tags

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.