Results 1 to 3 of 3

Thread: "setIndexWidget" is a bad way ?

  1. #1
    Join Date
    May 2013
    Posts
    321
    Thanks
    9
    Thanked 8 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default "setIndexWidget" is a bad way ?

    Hi all,
    I have a QTreeView with 2 column name and editor.
    I used QItemDelegate, but the problem is the editor is not always visible, you have to click one time.
    I already know the way "reimplement paint()" but you have to enable the cell.
    I saw in documentation this function : setIndexWidget, is it safe to use it ?
    My goal is to have the widget always visible never has to enable it.
    Thanks for the help.
    --
    EDIT: Maybe I have bad understand really and using this function will give me the same result I got with paint() ?
    Last edited by Alundra; 31st May 2014 at 20:51.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: "setIndexWidget" is a bad way ?

    Are you looking for QAbstractItemView::openPersistentEditor()?


    Cheers,
    _

  3. #3
    Join Date
    May 2013
    Posts
    321
    Thanks
    9
    Thanked 8 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: "setIndexWidget" is a bad way ?

    This function to be nicely used has to be used on this way :
    1) Add Item in tree
    2) After added call this function with the index where the item is added
    Is it correct ?
    But since the QTreeView allow to have acces to model, if an item is added without this function, that will not work.
    But ... then it's an human error surely ...
    At the end it's like setIndexWidget ?
    I wait your answer to be sure.
    --
    EDIT: maybe QTreeView is not what I should use, QTableWidget is a better choice ?
    Last edited by Alundra; 1st June 2014 at 03:35.

Similar Threads

  1. Replies: 1
    Last Post: 3rd December 2013, 02:19
  2. Replies: 1
    Last Post: 7th April 2010, 21:46
  3. Replies: 3
    Last Post: 15th February 2010, 17:27
  4. Replies: 3
    Last Post: 8th July 2008, 19:37
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05

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.