Results 1 to 2 of 2

Thread: how to make the editor wiget always visible in QTableView

  1. #1
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Default how to make the editor wiget always visible in QTableView

    Hi
    I want to create a QTableView which has custom widgets always visible on the grid.
    I have tried setting custom delegate and reimplementing the createEditor ( QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index ) const function.But the widgets becomes invisible as soon as the grid loses the focus, how to make it visible permanently.

    Thanks in advance.

  2. #2
    Join Date
    Aug 2008
    Location
    Eastern U.S.
    Posts
    9
    Thanks
    1
    Qt products
    Qt4 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: how to make the editor wiget always visible in QTableView

    One approach I've been using lately is to just create a widget manually, and insert it into a cell with setCellWidget. This is probably the simplest way to create editors within cells, though at the expense of some flexibility. You lose the ability to take that cell into account when sorting, for example. However, widgets thus created will maintain their appearance (editing buttons and such will remain visible), which is a requirement for the work that I'm doing.

    If there is a way to do this using delegates, I would be very interested in hearing about it!

    Hope this helps.

Similar Threads

  1. How to tell if QTableView cell is visible ?
    By steviekm3 in forum Qt Programming
    Replies: 0
    Last Post: 2nd March 2009, 10:04
  2. How to tell if cell in QTableView is visible ??
    By steviekm3 in forum Qt Programming
    Replies: 3
    Last Post: 27th February 2009, 17:57
  3. make QTableView work as a multi-column list view
    By wesley in forum Qt Programming
    Replies: 1
    Last Post: 11th March 2008, 14:43
  4. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57
  5. Make the cursor visible in textEdit (Qt3.3.5)
    By vermarajeev in forum Qt Programming
    Replies: 9
    Last Post: 24th January 2007, 22:50

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.