Results 1 to 4 of 4

Thread: Cannot connect a Table + customTablemodel with an itemdelegate.

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Cannot connect a Table + customTablemodel with an itemdelegate.

    I'm trying to use a Itemdelegate with custom models. I cant.
    Please, What have I to say to custommodel ?
    I have tried to mix the examples addresbook with the spinboxdelegate without success.

    Apparently, all the examples seems to work only with standarmodels .
    I am completely stopped, so any help will be appreciated

    Thanks

  2. #2
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Cannot connect a Table + customTablemodel with an itemdelegate.

    Nobody can answer me ?
    A link to an example ?
    Thanks

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Cannot connect a Table + customTablemodel with an itemdelegate.

    Sorry that we haven't respond after 6 hours and 24 minutes. This won't happen again. To your problem: it is perfectly possible to use custom item delegates with custom models. So what do you expect that I say? Once more: a little piece of code would be nice to see what you have done. And instead of copy things together start small, and set up a minimal custom model with a minimalistic item delegate and develop from there.

  4. #4
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Cannot connect a Table + customTablemodel with an itemdelegate.

    This is the addressbook example modified.
    At mainwindow I have 5 'addentry' commands.
    Later, I have modified tablemodel::data to retuns always a int(1) value (in order to let spinbox 'delegate' works)
    I have also a 1ABC, 2DEF ... filters (to let the 1 values to be showed)

    This is How I conect the delegates to the tableview.
    Qt Code:
    1. my_delegate = new A_delegates();
    2. tableView->setItemDelegate(my_delegate);
    To copy to clipboard, switch view to plain text mode 
    I only see '1' value when edit the cell nothing during display.
    I have test the a_delegates agains other examples that are using standar models and it works (I see the values and if I edit them the spinbox are showed). But in the case of custom models I have problems.

    I hope you can to try the example without problems.
    Thank you very much for your patience.
    Attached Files Attached Files

Similar Threads

  1. QtextDocument-ItemDelegate and Painting
    By LynneV in forum Qt Programming
    Replies: 2
    Last Post: 15th November 2010, 16:10
  2. Replies: 2
    Last Post: 14th November 2010, 08:54
  3. QTreeView and itemDelegate code
    By alexandernst in forum Newbie
    Replies: 1
    Last Post: 22nd April 2010, 17:00
  4. Replies: 1
    Last Post: 28th March 2010, 05:52
  5. Color table row with ItemDelegate
    By dexjam in forum Newbie
    Replies: 8
    Last Post: 29th June 2006, 12:56

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.