Results 1 to 2 of 2

Thread: checkable item

  1. #1
    Join Date
    Sep 2007
    Posts
    99
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Exclamation checkable item

    Hi I need to create a model...QTableModel that would have three columns...thats ok I have that...
    But the las column should be checkable ...
    Do I have to create a delegate if I want to set the item checkable ?(if yes which of its methods should I reimplement ?)
    Does that checkbox emits a signal when its state changes ?(if yes...is there any way how to find out an item index that emits that signal ?)
    I want that check box to disable the whole row when its checked and enable it when it is not checked...
    Thanks a lot folks...

    btw: is there any SIMPLE example for drag and drop between TWO IDENTICAL QTABLEVIEWS ?? Im missing that thing in docs...I what do I have to reimplement to enable that ?
    THANKS A LOT FOLKS AGAIN...

  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: checkable item

    Quote Originally Posted by gyre View Post
    But the las column should be checkable ...
    Do I have to create a delegate if I want to set the item checkable ?(if yes which of its methods should I reimplement ?)
    This has been asked dozens of times... so search the forums next time, please. In short, model's flags() must return Qt::ItemIsUserCheckable for indexes that should be checkable and data() must return a valid Qt::CheckState value for Qt::CheckStateRole.

    Does that checkbox emits a signal when its state changes ?(if yes...is there any way how to find out an item index that emits that signal ?)
    I want that check box to disable the whole row when its checked and enable it when it is not checked...


    btw: is there any SIMPLE example for drag and drop between TWO IDENTICAL QTABLEVIEWS ?? Im missing that thing in docs...I what do I have to reimplement to enable that ?
    Using Drag and Drop with Item Views
    J-P Nurmi

Similar Threads

  1. combobox and item colors
    By zorro68 in forum Qt Programming
    Replies: 16
    Last Post: 23rd September 2007, 12:54
  2. Changing selected item color in non-current window.
    By Doug Broadwell in forum Qt Programming
    Replies: 1
    Last Post: 26th August 2007, 07:09
  3. Replies: 1
    Last Post: 19th April 2007, 22:23
  4. QTableWidget item checkable and combo?
    By darpan in forum Qt Programming
    Replies: 1
    Last Post: 10th October 2006, 07:12
  5. how change the QListBox item position by pixel
    By roy_skyx in forum Qt Programming
    Replies: 2
    Last Post: 20th January 2006, 01:34

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.