Results 1 to 3 of 3

Thread: QTreeWidget with Checkbox

  1. #1
    Join Date
    Sep 2011
    Posts
    11
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Lightbulb QTreeWidget with Checkbox

    Hi everyone,

    I am doing a massive project in Qt, so I can't show all I got, but:

    What I want:

    Ca46pture.PNG

    QTreeWidget that "knows" just like the Qt Manager Tool when to put checked or not, or put semi-checked.

    Is there a model that provides this? My goal is to do a "to-do" list.

    If there is no model that provides this, can anyone tell me how to get the source code of the Qt Manager Tool so I can see how Nokia did that (PS: I don't want to implement this myself, I could but if it isn't necessary, I won't make it myself with 10 ifs)?

    Thanks!

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QTreeWidget with Checkbox

    Is there a model that provides this?
    Any model you care to write attached to a QTreeView (not QTreeWidget). You could build on top of QStandardItemModel, override setData() and rethink check boxes after writes to Qt::CheckStateRole. Shouldn't be too difficult, but it depends on your actual data and requirement.

    I am doing a massive project in Qt,
    and
    PS: I don't want to implement this myself
    A massive project by cut and paste. Oh joy.

  3. #3
    Join Date
    Sep 2011
    Posts
    11
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: QTreeWidget with Checkbox

    Quote Originally Posted by ChrisW67 View Post
    Any model you care to write attached to a QTreeView (not QTreeWidget). You could build on top of QStandardItemModel, override setData() and rethink check boxes after writes to Qt::CheckStateRole. Shouldn't be too difficult, but it depends on your actual data and requirement.


    and

    A massive project by cut and paste. Oh joy.
    Listen buddy:

    1) I know how to implement it myself alright (I did yesterday). I was WONDERING if there's a model that exists that can do this without having to implement it

    2) It's not because it's a massive project that I have to make everything myself (Speaking about making all algorithms that may already exist). I didn't create the Qt Framework to make my program work, I use it. Maybe you prefer make classes that may already exists for your own pleasure, but not me. I prefer using what the Framework has to offer first.

    3) Massive Project != Cut & Paste. I have 27 CPP alone, without including the custom .h to make custom Checkboxes or RadioButtons. I know what Massive Projects means. It's my first project ever in Qt, I have a C# and Java past, and I never worked so hard in a project to tell you that copy paste isn't how to make a project done.

    Thanks anyway for the response,

    xboxnissan

    PS: I don't want to implement this myself => I WOULD NOT. In other words, I prefer using the Qt Framework first before even thinking about an algorithm. Why reinvent the wheel?
    Last edited by xboxnissan; 11th May 2012 at 00:32.

Similar Threads

  1. Replies: 4
    Last Post: 1st June 2011, 14:54
  2. To resize CheckBox in QTreeWidget using QStyle?
    By merry in forum Qt Programming
    Replies: 0
    Last Post: 25th May 2011, 07:26
  3. Replies: 0
    Last Post: 11th January 2011, 09:00
  4. How to add a checkBox to the headerItem of QTreeWidget
    By candela in forum Qt Programming
    Replies: 1
    Last Post: 20th August 2009, 05:31
  5. Replies: 2
    Last Post: 17th March 2008, 12:53

Tags for this Thread

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.