Results 1 to 7 of 7

Thread: auto checkox fresh in qtreeview problem.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: auto checkox fresh in qtreeview problem.

    Didnt emit dataChanged work for you ?

    Also try calling view->update();

  2. #2
    Join Date
    Oct 2008
    Posts
    10
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: auto checkox fresh in qtreeview problem.

    solved by emit dataChanged signal for every model item that change check state.

  3. #3
    Join Date
    Oct 2008
    Posts
    10
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: auto checkox fresh in qtreeview problem.

    oh,it does not solved, there must be something wrong, though i have emit every datachange signal for every change item, qtreeview doesn't refresh well.
    may be i don't have write the right code, but it seems beyond my brain now.
    i have attach a test demo.
    Attached Files Attached Files

  4. #4
    Join Date
    Oct 2008
    Posts
    10
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: auto checkox fresh in qtreeview problem.

    my compile info: qt 4.6.2 on win xp sp3 with vs2008.
    it doesn't use any windows special, it should compile everywhere that qt supported.

  5. #5
    Join Date
    Oct 2008
    Posts
    10
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: auto checkox fresh in qtreeview problem.

    when compile with qt 4.7 beta1, the same effect as 4.6.2.

  6. #6
    Join Date
    Oct 2008
    Posts
    10
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: auto checkox fresh in qtreeview problem.

    seems solved by rewrite method
    //-------------------------------------------------
    void TorgTreeModel::emitDataChanged( TorgTreeItem* item )
    {
    TorgTreeItem* parent_item = getOrgItem(item->parent_org_id);
    emit dataChanged(createIndex(item->row(),0,parent_item),createIndex(item->row(),1,parent_item));

    qDebug() << "datachange" << item->org_full_name;
    }

Similar Threads

  1. Replies: 3
    Last Post: 12th February 2010, 10:10
  2. A very fresh new Qt programmer =)
    By ZikO in forum Installation and Deployment
    Replies: 5
    Last Post: 4th December 2009, 15:24
  3. compiling hello world after fresh install fails
    By kvesi in forum Installation and Deployment
    Replies: 3
    Last Post: 19th September 2008, 13:55
  4. Program not compiling on Fresh install of Leopard
    By dvmorris in forum Qt Programming
    Replies: 1
    Last Post: 22nd November 2007, 10:22
  5. I'm a fresh,how this problem could be resolved?
    By defyer in forum Qt Programming
    Replies: 6
    Last Post: 16th July 2007, 08:04

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.